Example #1
0
    public virtual void DoGetItem()
    {
        if (null == itemObj)
        {
            return;
        }

        if (!GameConfig.IsMultiMode)
        {
            if (Pathea.PlayerPackageCmpt.LockStackCount &&
                !ItemMgr.IsCreationItem(itemObj.protoId))
            {
                ItemMgr.Instance.DestroyItem(itemObj.instanceId);
            }
            else if (null != pkg)
            {
                if (ItemPackage.InvalidIndex == pkg.AddItem(itemObj))
                {
                    PeTipMsg.Register(PELocalization.GetString(9500312), PeTipMsg.EMsgLevel.Warning);
                    return;
                }
                if (MissionManager.Instance != null && Pathea.PeCreature.Instance != null && Pathea.PeCreature.Instance.mainPlayer != null)
                {
                    MissionManager.Instance.ProcessUseItemMissionByID(itemObj.protoId, Pathea.PeCreature.Instance.mainPlayer.position, -1);
                }
            }

            DragItemAgent agent = DragItemAgent.GetById(id);
            if (agent != null)
            {
                DragItemAgent.Destory(agent);
            }

            GameUI.Instance.mItemPackageCtrl.ResetItem();
        }
        else
        {
            if (null != PlayerNetwork.mainPlayer)
            {
                PlayerNetwork.mainPlayer.RequestGetItemBack(itemObjectId);
            }
        }

        HideItemOpGui();
    }