本文整理汇总了C#中Item.Internalize方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Internalize方法的具体用法?C# Item.Internalize怎么用?C# Item.Internalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.Internalize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if (dropped.LootType == LootType.Blessed || dropped.LootType == LootType.Newbied || dropped is Gold || dropped is TrTokens || dropped is BoardingVoucher || dropped is ChaosCoin || dropped is OrderCoin || dropped is GauntletToken || dropped is StarWarToken || dropped is BankCheck || dropped is ImagineNickel || dropped is ShrinkItem || dropped is Key || dropped is Container && TotalItems >= 1)
{
from.SendMessage( 38,"You can not trash that for a reward!");
return false;
}
int prize = GetSellPriceFor( dropped );
int totalPrize = prize;
while (prize > 65000)
{
from.AddToBackpack(new TrTokens(65000));
prize -= 65000;
}
from.AddToBackpack( new TrTokens( prize ) );
from.SendMessage( 53, "You got {0} silver coins for your trash!", totalPrize);
dropped.Internalize();
if (m_TrashedItem != null)
m_TrashedItem.Delete();
m_TrashedItem = dropped;
trashedReward = totalPrize;
return true;
}
示例2: SetCommodity
public bool SetCommodity( Item item )
{
InvalidateProperties();
if ( m_Commodity == null && item is ICommodity && ((ICommodity)item).IsDeedable )
{
m_Commodity = item;
m_Commodity.Internalize();
InvalidateProperties();
return true;
}
else
{
return false;
}
}
示例3: Lift
//.........这里部分代码省略.........
item.Spawner.Remove(item);
item.Spawner = null;
}
if (amount == 0)
amount = 1;
if (amount > item.Amount)
amount = item.Amount;
int oldAmount = item.Amount;
//item.Amount = amount; //Set in LiftItemDupe
if (amount < oldAmount)
LiftItemDupe(item, amount);
//item.Dupe( oldAmount - amount );
Map map = from.Map;
if (DragEffects && map != null && (root == null || root is Item))
{
IPooledEnumerable eable = map.GetClientsInRange(from.Location);
Packet p = null;
foreach (NetState ns in eable)
{
if (ns.Mobile != from && ns.Mobile.CanSee(from) && (!ns.Mobile.HasFilter || InLOS(ns.Mobile)))
{
if (p == null)
{
IEntity src;
if (root == null)
src = new Entity(Serial.Zero, item.Location, map);
else
src = new Entity(((Item) root).Serial, ((Item) root).Location, map);
p = Packet.Acquire(new DragEffect(src, from, item.ItemID, item.Hue, amount));
}
ns.Send(p);
}
}
Packet.Release(p);
eable.Free();
}
Point3D fixLoc = item.Location;
Map fixMap = item.Map;
bool shouldFix = (item.Parent == null);
item.RecordBounce();
item.OnItemLifted(from, item);
item.Internalize();
from.Holding = item;
from.NextActionTime = DateTime.Now + TimeSpan.FromSeconds(0.4);
if (fixMap != null && shouldFix)
fixMap.FixColumn(fixLoc.X, fixLoc.Y);
reject = LRReason.Inspecific;
rejected = false;
}
}
}
else
{
reject = LRReason.Inspecific;
}
}
else
{
SendActionMessage();
reject = LRReason.Inspecific;
}
if (rejected && state != null)
{
state.Send(new LiftRej(reject));
if (item.Parent is Item)
{
if (state.ContainerGridLines)
state.Send(new ContainerContentUpdate6017(item));
else
state.Send(new ContainerContentUpdate(item));
}
else if (item.Parent is Mobile)
state.Send(new EquipUpdate(item));
else
item.SendInfoTo(state);
if (ObjectPropertyList.Enabled && item.Parent != null)
state.Send(item.OPLPacket);
}
}
示例4: AddItem
public void AddItem(Item item)
{
item.Internalize();
Items.Add(item);
}