Exemple #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.Suit().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.Surplice().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.Cape().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.Robe().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.BambooKnife().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.WoodenSword().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 6)
                {
                    tempitem = new script.item.ShortSword().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 7)
                {
                    tempitem = new script.item.Saw().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 8)
                {
                    tempitem = new script.item.SpikedClub().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 9)
                {
                    tempitem = new script.item.MorningStar().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 10)
                {
                    tempitem = new script.item.SmallShield().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 11)
                {
                    tempitem = new script.item.Hood().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                //
                if (buyslot == 12)
                {
                    tempitem = new script.item.Crown().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 13)
                {
                    tempitem = new script.item.Mask().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 14)
                {
                    tempitem = new script.item.FullDress().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                                                 tempitem).Compile());
                }
                if (buyslot == 15)
                {
                    tempitem = new script.item.Mace().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;
            }
        }
Exemple #2
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.Suit().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 1)
                {
                    tempitem = new script.item.Surplice().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 2)
                {
                    tempitem = new script.item.Cape().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 3)
                {
                    tempitem = new script.item.Robe().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 4)
                {
                    tempitem = new script.item.BambooKnife().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 5)
                {
                    tempitem = new script.item.WoodenSword().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 6)
                {
                    tempitem = new script.item.ShortSword().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 7)
                {
                    tempitem = new script.item.Saw().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 8)
                {
                    tempitem = new script.item.SpikedClub().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 9)
                {
                    tempitem = new script.item.MorningStar().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 10)
                {
                    tempitem = new script.item.SmallShield().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 11)
                {
                    tempitem = new script.item.Hood().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                //
                if (buyslot == 12)
                {
                    tempitem = new script.item.Crown().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                        tempitem).Compile());
                }
                if (buyslot == 13)
                {
                    tempitem = new script.item.Mask().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 14)
                {
                    tempitem = new script.item.FullDress().Inventory(player);
                    player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
                       tempitem).Compile());
                }
                if (buyslot == 15)
                {
                    tempitem = new script.item.Mace().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;
            }
        }