本文整理汇总了C#中model.GetFreeSlot方法的典型用法代码示例。如果您正苦于以下问题:C# model.GetFreeSlot方法的具体用法?C# model.GetFreeSlot怎么用?C# model.GetFreeSlot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model.GetFreeSlot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Buy
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.LifeDrug().Inventory(player);
player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
tempitem).Compile());
}
if (buyslot == 1)
{
tempitem = new script.item.MagicDrug().Inventory(player);
player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
tempitem).Compile());
}
if (buyslot == 2)
{
tempitem = new script.item.FullLifeDrug().Inventory(player);
player.client.SendPacket(new LKCamelot.model.AddItemToInventory2(
tempitem).Compile());
}
if (buyslot == 3)
{
tempitem = new script.item.FullMagicDrug().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: Buy
public override void Buy(model.Player player, int buyslot)
{
if (player.GetFreeSlot() != -1 && player.Gold >= templ[buyslot].BuyPrice)
{
LKCamelot.script.item.Item tempitem = null;
tempitem = createWithIndex(buyslot, 0).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;
}
}
示例3: Buy
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)
{
//.........这里部分代码省略.........
示例4: Buy
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;
//.........这里部分代码省略.........
示例5: Buy
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;
}
}