本文整理汇总了C#中Server.Mobiles.PlayerMobile.EquipItem方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.EquipItem方法的具体用法?C# PlayerMobile.EquipItem怎么用?C# PlayerMobile.EquipItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.PlayerMobile
的用法示例。
在下文中一共展示了PlayerMobile.EquipItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestoreState
//.........这里部分代码省略.........
if (parent != null)
{
if (item == pack || item == bank)
{
m.AddItem(item);
}
else if (parent == pack || parent == oldPack)
{
p = item.Location;
pack.DropItem(item);
item.Location = p;
}
else if (parent == bank || parent == oldBank)
{
p = item.Location;
bank.DropItem(item);
item.Location = p;
}
else if (parent is Container)
{
if (parent.Deleted)
{
bank.DropItem(item);
}
else
{
p = item.Location;
((Container)parent).DropItem(item);
item.Location = p;
}
}
else if (parent is Mobile)
{
if (!m.EquipItem(item))
{
pack.DropItem(item);
}
}
else
{
bank.DropItem(item);
}
item.SetLastMoved();
item.UpdateTotals();
item.Delta(ItemDelta.Update);
}
else if (Cleanup.IsBuggable(item))
{
--idxCreated;
++idxDeleted;
item.Delete();
}
else
{
item.Internalize();
}
}
if (oldPack != null && oldPack != pack && !restored.ContainsKey(oldPack))
{
oldPack.Delete();
}
if (oldBank != null && oldBank != bank && !restored.ContainsKey(oldBank))
示例2: LoadPlayer
public void LoadPlayer(PlayerMobile pm)
{
Backpack pack = (Backpack)pm.Backpack;
//pm.SendMessage(String.Format("SettingBackpack"));
TeleportAllPets( pm, (Point3D)PlayerLocations[pm.Serial], (Map)PlayerMaps[pm.Serial] );
pm.Location = (Point3D)PlayerLocations[pm.Serial];
PlayerLocations.Remove(pm.Serial);
//pm.SendMessage(String.Format("SettingLocation"));
pm.Map = (Map)PlayerMaps[pm.Serial];
PlayerMaps.Remove(pm.Serial);
//pm.SendMessage(String.Format("SettingMap"));
ArrayList items = (ArrayList)PlayerItems[pm.Serial];
PlayerItems.Remove(pm.Serial);
//pm.SendMessage(String.Format("Setting Arraylist of Items"));
for (int i = 0; i < items.Count; ++i)
{
//pm.SendMessage(String.Format("LoadPlayer() {0} / {1}.", i , items.Count));
Item item = (Item)items[i];
if (item.Layer == Layer.Invalid)
{
//pm.SendMessage(String.Format("Layer Invalid!"));
item.Location = (Point3D)ItemLocations[item.Serial];
ItemLocations.Remove(item.Serial);
pack.AddItem(item);
}
else
{
Item test = (Item)pm.FindItemOnLayer(item.Layer);
if (test == null || test == item)
{
ItemLocations.Remove(item.Serial);
pm.EquipItem(item);
test = (Item)pm.FindItemOnLayer(item.Layer);
if ( test == null )
pack.AddItem(item);
}
else
{
item.Location = (Point3D)ItemLocations[item.Serial];
ItemLocations.Remove(item.Serial);
if (item != pm.Backpack && item != pm.BankBox)
pack.AddItem(item);
}
}
}
}