Exemplo n.º 1
0
        //一次购买多个物品
        public int BulkBuyItem(int nIndex, int nNumber)
        {
            CObject_Item pBoothItem = CDataPool.Instance.Booth_GetItem(nIndex);

            if (pBoothItem != null)
            {
                nNumber = (nNumber <1 || nNumber> pBoothItem.GetMaxOverLay())?1:nNumber;

                if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Money() >=
                    (int)(CDataPool.Instance.Booth_GetItemPrice(nIndex) * nNumber))
                {
                    CGShopBuy msg = new CGShopBuy();

                    msg.UniqueID  = CDataPool.Instance.Booth_GetShopUniqueId();
                    msg.Index     = (byte)pBoothItem.GetPosIndex();
                    msg.SerialNum = (byte)CDataPool.Instance.Booth_GetSerialNum();
                    msg.BuyNum    = (uint)nNumber;

                    NetManager.GetNetManager().SendPacket(msg);
                    return(0);
                }
            }

            CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_INTERCOURSE, "#{LowMoney}");

            return(0);
        }
Exemplo n.º 2
0
        //获得商店物品叠加数量
        public int EnumItemMaxOverlay(int nIndex)
        {
            CObject_Item pBoothItem = CDataPool.Instance.Booth_GetItem(nIndex);

            if (pBoothItem != null)
            {
                return(pBoothItem.GetMaxOverLay());
            }
            else
            {
                return(-1);
            }
        }