本文整理汇总了C#中Server.Items.Item类的典型用法代码示例。如果您正苦于以下问题:C# Item类的具体用法?C# Item怎么用?C# Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Item类属于Server.Items命名空间,在下文中一共展示了Item类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:27,代码来源:Container.cs
示例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);
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:60,代码来源:Victoria.cs
示例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 );
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:Hold.cs
示例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 );
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:32,代码来源:Relnia.cs
示例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 );
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:Container.cs
示例6: OnItemRemoved
public override void OnItemRemoved(Item item)
{
if (!(item is VirtualCheck))
{
ClearChecks();
}
}
开发者ID:rokann,项目名称:JustUO,代码行数:7,代码来源:SecureTradeContainer.cs
示例7: HarvestTarget
public HarvestTarget( Item tool, HarvestSystem system ) : base( -1, true, TargetFlags.None )
{
m_Tool = tool;
m_System = system;
DisallowMultis = true;
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:HarvestTarget.cs
示例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();
}
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:28,代码来源:Dismantle.cs
示例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;
}
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:27,代码来源:KeyRing.cs
示例10: DropItem
public override void DropItem( Item dropped )
{
if( !dropped.EventItem )
base.DropItem( dropped );
else
dropped.Delete();
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:EquipmentStorage.cs
示例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.
}
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:31,代码来源:Ankhs.cs
示例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;
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:33,代码来源:Container.cs
示例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 );
}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:JailCage.cs
示例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!
}
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:27,代码来源:Ankhs.cs
示例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 );
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:26,代码来源:Zoel.cs
示例16: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped ){ Mobile m = from;PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
///////////item to be dropped
if( dropped is RadioactiveAcid ){
if (dropped.Amount<30)
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "Please return with the correct amount.", mobile.NetState );return false;
}
if (dropped.Amount>30)
mobile.AddToBackpack( new RadioactiveAcid( (dropped.Amount-30) ) );
dropped.Delete();
///////////the reward
mobile.AddToBackpack( new Gold( 5000 ) );
if (0.20>Utility.RandomDouble())
mobile.AddToBackpack( new RadioactiveGloves( ) );//replace this
///////////thanks message
PrivateOverheadMessage( MessageType.Regular, 1153, false, "Appreciate the help!!", mobile.NetState );
return true;}
if ( dropped is Whip){PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );return false;}
PrivateOverheadMessage( MessageType.Regular, 1153, false,"I have no need for this...", mobile.NetState );
}
return false;}}}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:29,代码来源:SewerQuest.cs
示例17: CheckItemUse
public override bool CheckItemUse( Mobile from, Item item )
{
if ( item != this )
return false;
return base.CheckItemUse( from, item );
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:FishBowl.cs
示例18: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( Addon != null )
return Addon.OnDragDrop( from, dropped );
return false;
}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:7,代码来源:AddonContainerComponent.cs
示例19: OnSubItemAdded
public override void OnSubItemAdded(Item item)
{
if (!(item is VirtualCheck))
{
ClearChecks();
}
}
开发者ID:rokann,项目名称:JustUO,代码行数:7,代码来源:SecureTradeContainer.cs
示例20: OnDragDropInto
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
if (Transport == null || !Transport.IsOnBoard(from) || Transport.IsMoving)
return false;
return base.OnDragDropInto(from, item, p);
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:7,代码来源:Hold.cs
注:本文中的Server.Items.Item类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论