Exemplo n.º 1
0
        public override void Buy(model.Player player, int buyslot)
        {
            if (player.GetFreeSlot() != -1 && player.Gold >= templ[buyslot].BuyPrice)
            {
                LKCamelot.script.item.Item tempitem = null;
                if (buyslot == 0)
                {
                    tempitem = new script.item.Rod().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.ShortStaff().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.Crook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.BambooSpear().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.ShortSpear().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.Skewer().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }

                LKCamelot.model.World.NewItems.TryAdd(tempitem.m_Serial, tempitem);
                player.Gold -= (uint)templ[buyslot].BuyPrice;
            }
        }
Exemplo n.º 2
0
Arquivo: Boy.cs Projeto: sepharoph/LK2
        public override void Buy(model.Player player, int buyslot)
        {
            if (player.GetFreeSlot() != -1 && player.Gold >= templ[buyslot].BuyPrice)
            {
                LKCamelot.script.item.Item tempitem = null;
                if (buyslot == 0)
                {
                    tempitem = new script.item.Rod().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.ShortStaff().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.Crook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.BambooSpear().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.ShortSpear().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.Skewer().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }

                LKCamelot.model.World.NewItems.TryAdd(tempitem.m_Serial, tempitem);
                player.Gold -= (uint)templ[buyslot].BuyPrice;
            }
        }