本文整理汇总了C#中Server.Items.Item类的典型用法代码示例。如果您正苦于以下问题:C# Item类的具体用法?C# Item怎么用?C# Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Item类属于Server.Items命名空间,在下文中一共展示了Item类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryDropItem
public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
{
if ( !CheckHold( from, dropped, sendFullMessage, true ) )
return false;
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null && house.IsLockedDown( this ) )
{
if ( !house.LockDown( from, dropped, false ) )
return false;
}
List<Item> list = this.Items;
for ( int i = 0; i < list.Count; ++i )
{
Item item = list[i];
if ( !(item is Container) && item.StackWith( from, dropped, false ) )
return true;
}
DropItem( dropped );
return true;
}
示例2: OnDragDrop
public override bool OnDragDrop(Mobile from, Item dropped)
{
// trigger returns true if returnoverride
if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) &&
UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped))
{
return true;
}
var player = from as PlayerMobile;
if (player != null)
{
QuestSystem qs = player.Quest;
if (qs is TheSummoningQuest)
{
if (dropped is DaemonBone)
{
var bones = (DaemonBone)dropped;
QuestObjective obj = qs.FindObjective(typeof(CollectBonesObjective));
if (obj != null && !obj.Completed)
{
int need = obj.MaxProgress - obj.CurProgress;
if (bones.Amount < need)
{
obj.CurProgress += bones.Amount;
bones.Delete();
qs.ShowQuestLogUpdated();
}
else
{
obj.Complete();
bones.Consume(need);
if (!bones.Deleted)
{
// TODO: Accurate?
SayTo(from, 1050038);
// You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
}
}
else
{
// TODO: Accurate?
SayTo(from, 1050038);
// You have already given me all the Daemon bones necessary to weave the spell. Keep these for a later time.
}
return false;
}
}
}
return base.OnDragDrop(from, dropped);
}
示例3: CheckItemUse
public override bool CheckItemUse( Mobile from, Item item )
{
if ( item != this && (m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving) )
return false;
return base.CheckItemUse( from, item );
}
示例4: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
PlayerMobile player = from as PlayerMobile;
if ( player != null )
{
QuestSystem qs = player.Quest;
if ( qs is HaochisTrialsQuest )
{
QuestObjective obj = qs.FindObjective( typeof( FourthTrialCatsObjective ) );
if ( obj != null && !obj.Completed )
{
Gold gold = dropped as Gold;
if ( gold != null )
{
obj.Complete();
qs.AddObjective( new FourthTrialReturnObjective( false ) );
SayTo( from, 1063241 ); // I thank thee. This gold will be a great help to me and mine!
gold.Consume(); // Intentional difference from OSI: don't take all the gold of poor newbies!
return gold.Deleted;
}
}
}
}
return base.OnDragDrop( from, dropped );
}
示例5: CheckHold
public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
{
if ( IsSecure && !BaseHouse.CheckHold( m, this, item, message, checkItems, plusItems, plusWeight ) )
return false;
return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight );
}
示例6: OnItemRemoved
public override void OnItemRemoved(Item item)
{
if (!(item is VirtualCheck))
{
ClearChecks();
}
}
示例7: HarvestTarget
public HarvestTarget( Item tool, HarvestSystem system ) : base( -1, true, TargetFlags.None )
{
m_Tool = tool;
m_System = system;
DisallowMultis = true;
}
示例8: DismantleItem
private void DismantleItem(Mobile from, Item item)
{
if (!from.InRange(item.GetWorldLocation(), 2))
{
from.SendMessage("You need to be closer to it.");
return;
}
else if (!item.IsChildOf(from.Backpack) && !item.Movable)
{
from.SendMessage("It can't be dismantled.");
return;
}
from.SendMessage("You dismantle the object.");
Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3);
if (item is Container)
{
if (item is TrapableContainer)
(item as TrapableContainer).ExecuteTrap(from);
((Container)item).Destroy();
}
else
{
item.Delete();
}
}
示例9: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( !this.IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
return false;
}
Key key = dropped as Key;
if ( key == null || key.KeyValue == 0 )
{
from.SendLocalizedMessage( 501689 ); // Only non-blank keys can be put on a keyring.
return false;
}
else if ( this.Keys.Count >= MaxKeys )
{
from.SendLocalizedMessage( 1008138 ); // This keyring is full.
return false;
}
else
{
Add( key );
from.SendLocalizedMessage( 501691 ); // You put the key on the keyring.
return true;
}
}
示例10: DropItem
public override void DropItem( Item dropped )
{
if( !dropped.EventItem )
base.DropItem( dropped );
else
dropped.Delete();
}
示例11: Resurrect
public static void Resurrect( Mobile m, Item item )
{
if ( m.InRange(item, 2) && m.InLOS(item))
{
if (!m.Alive)
{
if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
{
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
}
else if (m.Region is HouseRegion)
{
m.SendAsciiMessage("You can't get resurrected in house regions.");
}
else
{
m.PlaySound(0x214);
m.FixedEffect(0x376A, 10, 16);
m.Resurrect();
//m.CloseGump(typeof(ResurrectGump));
//m.SendGump(new ResurrectGump(m, item, ResurrectMessage.VirtueShrine));
}
}
}
else
{
m.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
}
}
示例12: TryDropItem
public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
{
if ( !CheckHold( from, dropped, sendFullMessage, true ) )
return false;
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null && house.IsLockedDown( this ) )
{
if ( dropped is VendorRentalContract || ( dropped is Container && ((Container)dropped).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
{
from.SendLocalizedMessage( 1062492 ); // You cannot place a rental contract in a locked down container.
return false;
}
if ( !house.LockDown( from, dropped, false ) )
return false;
}
List<Item> list = this.Items;
for ( int i = 0; i < list.Count; ++i )
{
Item item = list[i];
if ( !(item is Container) && item.StackWith( from, dropped, false ) )
return true;
}
DropItem( dropped );
return true;
}
示例13: AddItem
private void AddItem( Mobile from, int x, int y, int z, Item item, bool vis )
{
item.Visible = vis;
item.MoveToWorld( new Point3D( from.Location.X + x, from.Location.Y + y, from.Location.Z + z ), from.Map );
m_Components.Add( item );
}
示例14: Resurrect
public static void Resurrect(Mobile m, Item item)
{
if (m.Alive)
{
return;
}
if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
{
m.SendLocalizedMessage(500446); // That is too far away.
}
else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
{
m.CloseGump(typeof(ResurrectGump));
/*PlayerMobile pres = m as PlayerMobile;
if (pres.MurderBounty > 0)
m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
else*/
m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
}
else
{
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
}
}
示例15: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
PlayerMobile player = from as PlayerMobile;
if ( player != null )
{
QuestSystem qs = player.Quest;
if ( qs is EminosUndertakingQuest )
{
if ( dropped is NoteForZoel )
{
QuestObjective obj = qs.FindObjective( typeof( GiveZoelNoteObjective ) );
if ( obj != null && !obj.Completed )
{
dropped.Delete();
obj.Complete();
return true;
}
}
}
}
return base.OnDragDrop( from, dropped );
}