本文整理汇总了C#中Item.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Delete方法的具体用法?C# Item.Delete怎么用?C# Item.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Item item )
{
Type t = item.GetType();
if ( !Caster.CanSee( item ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
{
Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
}
else if ( item is Moongate && !((Moongate)item).Dispellable )
{
Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
}
else if ( CheckSequence() )
{
// Scriptiz : Si pas joueur, on ne perd pas de karma
if (!(Caster is PlayerMobile)) Caster.Mana += 14;
SpellHelper.Turn( Caster, item );
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );
item.Delete();
}
FinishSequence();
}
示例2: Target
public void Target( Item item )
{
Type t = item.GetType();
if ( !Caster.CanSee( item ) )
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
else if ( item is Moongate && !((Moongate)item).Dispellable )
Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, item );
if ( item is ILinkDispel )
{
Item second = ((ILinkDispel)item).Link;
Effects.SendLocationParticles( EffectItem.Create( second.Location, second.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
Effects.PlaySound( second.GetWorldLocation(), second.Map, 0x201 );
second.Delete();
}
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );
item.Delete();
}
FinishSequence();
}
示例3: OnDragDrop
public override bool OnDragDrop( Mobile from, Item item )
{
if ( item.LootType == LootType.Newbied || item.LootType == LootType.Blessed )
{
from.LocalOverheadMessage(MessageType.Regular, 906, true, "You cannot trash blessed or newbied items");
return false;
}
if (!base.OnDragDrop(from, item))
return false;
if (TotalItems >= 50)
{
Empty(501478); // The trash is full! Emptying!
}
else
{
/*
from.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("The item will be deleted in 20 seconds"));
if (m_Timer != null)
m_Timer.Stop();
else
m_Timer = new EmptyTimer(this);
m_Timer.Start();
*/
from.LocalOverheadMessage(MessageType.Regular, 906, true, "You trash the item");
item.Delete();
}
return true;
}
示例4: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is PowerScroll )
{
PowerScroll deed = (PowerScroll)dropped;
i_PSReward = 0; //default value
if ( deed.Value == 120.0 )
i_PSReward = 1000;
else if ( deed.Value == 115.0 )
i_PSReward = 500;
else if ( deed.Value == 110.0 )
i_PSReward = 50;
else if ( deed.Value == 105.0 )
i_PSReward = 10;
}
else i_PSReward = 0;
dropped.Delete();
if ( i_PSReward > 0 )
{
from.AddToBackpack( new PSCredits(i_PSReward) );
from.SendMessage( 1173, "You were rewarded {0} Powerscroll Credits for this scroll.", i_PSReward );
}
else if (i_PSReward == 0 ) from.SendMessage( 1173, "This was not a Powerscroll, but it was deleted anyways." );
return true;
}
示例5: Target
public void Target( Item item )
{
Type t = item.GetType();
if ( !Caster.CanSee( item ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
{
Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
}
else if ( item is Moongate && !((Moongate)item).Dispellable )
{
Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
}
else if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if ( CheckSequence() )
{
//Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
Effects.PlaySound( item.GetWorldLocation(), item.Map, Sound );
item.Delete();
}
FinishSequence();
}
示例6: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is blueapple )
{
if(dropped.Amount!=1)
{
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "ahhh my apple!", mobile.NetState );
return false;
}
dropped.Delete();
mobile.AddToBackpack( new ArrianasClips() );
mobile.SendMessage( "The Piece is now yours, now join them and bring it back to arriana!" );
return true;
}
else if ( dropped is blueapple )
{
this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );
return false;
}
else
{
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Why on earth would I want to have that?", mobile.NetState );
}
}
return false;
}
示例7: Target
public void Target( Item item )
{
Type t = item.GetType();
if ( !Caster.CanSee( item ) )
{
Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
}
else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
{
Caster.SendAsciiMessage("That cannot be dispelled."); // That cannot be dispelled.
}
/*else if ( item is Moongate && !((Moongate)item).Dispellable )
{
Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
}*/
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, item );
Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );
item.Delete();
}
FinishSequence();
}
示例8: OnDragDrop
public override bool OnDragDrop(Mobile from, Item dropped)
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if (mobile != null)
{
if (dropped is GibberHead)
{
dropped.Delete();
// mobile.AddToBackpack(new GibberToken());
mobile.AddToBackpack(new RAD());
mobile.AddToBackpack(new BankCheck(5000));
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank you. As I said here is a reward.", mobile.NetState);
}
else
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState); return true;
}
}
return false;
}
示例9: DropItem
public override void DropItem( Item dropped )
{
if (AcceptsItem(dropped))
base.DropItem(dropped);
else
dropped.Delete();
}
示例10: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is Key )
{
if ( m_Keys.Count < 16 )
{
Key key = (Key)dropped;
if ( key.KeyValue != 0 )
{
m_Keys.Add( new KeyringEntry( key.KeyValue, key.Link, key.MaxRange, key.ItemID, key.LootType, key.Description ) );
dropped.Delete();
//from.Send( new PlaySound( 0x42, GetWorldLocation() ) );
this.Weight = this.Weight + 1;
switch( m_Keys.Count )
{
case 0:
{
this.ItemID = 0x1011;
break;
}
case 1:
{
this.ItemID = 0x1769;
break;
}
case 3:
{
this.ItemID = 0x176A;
break;
}
case 5:
{
this.ItemID = 0x176B;
break;
}
}
return true;
}
else
{
from.SendAsciiMessage( "This key is blank." );
return false;
}
}
else
{
from.SendAsciiMessage( "This key ring is full" );
return false;
}
}
return false;
}
示例11: NewPackItem
public void NewPackItem(Item item)
{
Container pack = m.Backpack;
if (pack != null)
pack.DropItem(item);
else
item.Delete();
}
示例12: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( !base.OnDragDrop( from, dropped ) )
return false;
PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
dropped.Delete();
return true;
}
示例13: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !base.OnDragDropInto( from, item, p ) )
return false;
PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
item.Delete();
return true;
}
示例14: OnItemRemoved
public override void OnItemRemoved( Item item )
{
if (m_LastTrash <= DateTime.Now)
{
item.Delete();
Empty();
}
else
base.OnItemRemoved( item );
//TotalWeight = 0;
}
示例15: 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 HellKey2 ){if(dropped.Amount!=1)
{this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "There's not the right amount here!", mobile.NetState );return false;}
dropped.Delete();
///////////////the reward
mobile.AddToBackpack( new Gold( 1200 ) );
mobile.AddToBackpack( new HellSword( ) );
////////////////////////////////////////////////////////// thanksmessage
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Excelent Dude! Now Hurry and Save Ted!", mobile.NetState );
return true;}else if ( dropped is Whip){this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );return false;}else{this.PrivateOverheadMessage( MessageType.Regular, 1153, false,"I have no need for this...", mobile.NetState );}}return false;}}}