示例#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.HealBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.PlusHealBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.ElectronicBallBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.FireBallBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.MagicArmorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.RainbowArmorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 6)
                {
                    tempitem = new script.item.GuardianSwordBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 7)
                {
                    tempitem = new script.item.FireProtectorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 8)
                {
                    tempitem = new script.item.TeagueShieldBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 9)
                {
                    tempitem = new script.item.MagicShieldBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 10)
                {
                    tempitem = new script.item.ZigZagBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 11)
                {
                    tempitem = new script.item.MentalSwordBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 12)
                {
                    tempitem = new script.item.SidewinderBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 13)
                {
                    tempitem = new script.item.Dai().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 14)
                {
                    tempitem = new script.item.Zel().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;
            }
        }
示例#2
0
文件: Employee.cs 项目: 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.HealBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.PlusHealBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.ElectronicBallBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.FireBallBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.MagicArmorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.RainbowArmorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 6)
                {
                    tempitem = new script.item.GuardianSwordBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 7)
                {
                    tempitem = new script.item.FireProtectorBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 8)
                {
                    tempitem = new script.item.TeagueShieldBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 9)
                {
                    tempitem = new script.item.MagicShieldBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 10)
                {
                    tempitem = new script.item.ZigZagBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 11)
                {
                    tempitem = new script.item.MentalSwordBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 12)
                {
                    tempitem = new script.item.SidewinderBook().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 13)
                {
                    tempitem = new script.item.Dai().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 14)
                {
                    tempitem = new script.item.Zel().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;
            }
        }