本文整理汇总了C#中Server.Items.Item.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Delete方法的具体用法?C# Item.Delete怎么用?C# Item.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.Item
的用法示例。
在下文中一共展示了Item.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DestroyFurniture
private void DestroyFurniture( Mobile from, Item item )
{
if ( !from.InRange( item.GetWorldLocation(), 3 ) )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
return;
}
else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
{
from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
return;
}
from.SendLocalizedMessage( 500461 ); // You destroy the item.
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();
}
}
示例2: 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;}}}
示例3: 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 );
}
示例4: 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();
}
}
示例5: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( !base.OnDragDrop( from, dropped ) )
return false;
PublicOverheadMessage( MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
dropped.Delete();
return true;
}
示例6: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !base.OnDragDropInto( from, item, p ) )
return false;
PublicOverheadMessage( MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
item.Delete();
return true;
}
示例7: OnItemAdded
public override void OnItemAdded(Item item)
{
if (!(item is BountyMessage))
{
var bm = item as BulletinMessage;
if (bm != null && bm.Poster != null)
bm.Poster.SendMessage("This board is for bounty messages only.");
item.Delete();
}
}
示例8: 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 SheetMusic ){
if (dropped.Amount<8)
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "Please return with the correct amount.", mobile.NetState );return false;
}
if (dropped.Amount>8)
mobile.AddToBackpack( new SheetMusic( (dropped.Amount-8) ) );
dropped.Delete();
///////////the reward
mobile.AddToBackpack( new Gold( 1000 ) );
mobile.AddToBackpack(new DawnsMusicBox());
mobile.AddToBackpack(new DawnsMusicGear());
mobile.AddToBackpack(new DawnsMusicGear());
mobile.AddToBackpack(new DawnsMusicGear());
//if( Utility.Random( 100 ) < 100 )
// switch ( Utility.Random( 4 ) )
// {
// case 0: mobile.AddToBackpack( new DawnsMusicGear RandomCommon); break;
// case 1: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common)); break;
// case 2: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Rare)); break;
// case 3: mobile.AddToBackpack(new DawnsMusicBox.RandomTrack(DawnsMusicRarity.Common)); break;
// }
PrivateOverheadMessage( MessageType.Regular, 1153, false, "Thank you very much!", mobile.NetState );
mobile.SendGump( new LudwigFinishGump( mobile ) );
return true;
}
else if( dropped is SheetMusic )
{
this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );
return false;
}
else
{
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for that!", mobile.NetState );
}
}
return false;
}
示例9: OnDragDrop
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (dropped is LargeBOD || dropped is SmallBOD)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1062385); // You must have the book in your backpack to add deeds to it.
return false;
}
else if (!from.Backpack.CheckHold(from, dropped, true, true))
return false;
else if (m_Entries.Count < 500)
{
if (dropped is LargeBOD)
m_Entries.Add(new BOBLargeEntry((LargeBOD)dropped));
else if (dropped is SmallBOD) // Sanity
m_Entries.Add(new BOBSmallEntry((SmallBOD)dropped));
InvalidateProperties();
if (m_Entries.Count / 5 > m_ItemCount)
{
m_ItemCount++;
InvalidateItems();
}
from.SendSound(0x42, GetWorldLocation());
from.SendLocalizedMessage(1062386); // Deed added to book.
if (from is PlayerMobile)
from.SendGump(new BOBGump((PlayerMobile)from, this));
dropped.Delete();
return true;
}
else
{
from.SendLocalizedMessage(1062387); // The book is full of deeds.
return false;
}
}
from.SendLocalizedMessage(1062388); // That is not a bulk order deed.
return false;
}
示例10: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is LetterToOrthal )
{
dropped.Delete();
mobile.SendGump( new OrthalStartGump( mobile ));
return true;
}
if( dropped is HeadOfBritainLettuce )
{
dropped.Delete();
mobile.AddToBackpack( new EnchantedRope() );
mobile.AddToBackpack( new LetterToKyvon() );
mobile.SendGump( new OrthalFinishGump( mobile ));
return true;
}
else
{
mobile.SendMessage("I have no need for this item.");
}
}
else
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState );
}
return false;
}
示例11: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is LetterToBarthus )
{
dropped.Delete();
mobile.SendGump( new BarthusStartGump( mobile ));
return true;
}
if( dropped is KegOfBritishAle )
{
dropped.Delete();
mobile.AddToBackpack( new SturdyAxle() );
mobile.AddToBackpack( new LetterToCaztor() );
mobile.SendGump( new BarthusFinishGump( mobile ));
return true;
}
else
{
mobile.SendMessage("I have no need for this item.");
}
}
else
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState );
}
return false;
}
示例12: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is LetterToSnyden )
{
dropped.Delete();
mobile.SendGump( new SnydenStartGump( mobile ));
return true;
}
if( dropped is DecayingHead )
{
dropped.Delete();
mobile.AddToBackpack( new ReinforcedHinge() );
mobile.AddToBackpack( new LetterToBarthus() );
mobile.SendGump( new SnydenFinishGump( mobile ));
return true;
}
else
{
mobile.SendMessage("I have no need for this item.");
}
}
else
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState );
}
return false;
}
示例13: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is LetterToSevargas )
{
dropped.Delete();
mobile.SendGump( new SevargasStartGump( mobile ));
return true;
}
if( dropped is HumongousFish )
{
dropped.Delete();
mobile.AddToBackpack( new GlowingShipModel() );
mobile.AddToBackpack( new LetterToFlint() );
mobile.SendGump( new SevargasFinishGump( mobile ));
return true;
}
else
{
mobile.SendMessage("I have no need for this item.");
}
}
else
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState );
}
return false;
}
示例14: OnDragDrop
public override bool OnDragDrop(Mobile from, Item dropped)
{
var player = from as PlayerMobile;
if (player != null)
{
var qs = player.Quest;
if (qs is UzeraanTurmoilQuest)
{
if (dropped is UzeraanTurmoilHorn)
{
if (player.Young)
{
var horn = (UzeraanTurmoilHorn) dropped;
if (horn.Charges < 10)
{
SayTo(from, 1049384); // I have recharged the item for you.
horn.Charges = 10;
}
else
{
SayTo(from, 1049385); // That doesn't need recharging yet.
}
}
else
{
player.SendLocalizedMessage(1114333); //You must be young to have this item recharged.
}
return false;
}
if (dropped is SchmendrickScrollOfPower)
{
var obj = qs.FindObjective(typeof (ReturnScrollOfPowerObjective));
if (obj != null && !obj.Completed)
{
var cont = GetNewContainer();
cont.DropItem(new TreasureMap(player.Young ? 0 : 1, Map.Trammel));
cont.DropItem(new Shovel());
cont.DropItem(new UzeraanTurmoilHorn());
if (!player.PlaceInBackpack(cont))
{
cont.Delete();
player.SendLocalizedMessage(1046260);
// You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
return false;
}
dropped.Delete();
obj.Complete();
return true;
}
}
else if (dropped is QuestFertileDirt)
{
var obj = qs.FindObjective(typeof (ReturnFertileDirtObjective));
if (obj != null && !obj.Completed)
{
var cont = GetNewContainer();
if (player.Profession == 2) // magician
{
cont.DropItem(new BlackPearl(20));
cont.DropItem(new Bloodmoss(20));
cont.DropItem(new Garlic(20));
cont.DropItem(new Ginseng(20));
cont.DropItem(new MandrakeRoot(20));
cont.DropItem(new Nightshade(20));
cont.DropItem(new SulfurousAsh(20));
cont.DropItem(new SpidersSilk(20));
for (var i = 0; i < 3; i++)
cont.DropItem(Loot.RandomScroll(0, 23, SpellbookType.Regular));
}
else
{
cont.DropItem(new Gold(300));
cont.DropItem(new Bandage(25));
for (var i = 0; i < 5; i++)
cont.DropItem(new LesserHealPotion());
}
if (!player.PlaceInBackpack(cont))
{
cont.Delete();
player.SendLocalizedMessage(1046260);
// You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
return false;
}
dropped.Delete();
obj.Complete();
return true;
}
//.........这里部分代码省略.........
示例15: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
if( dropped is LetterToCaztor )
{
dropped.Delete();
mobile.SendGump( new CaztorStartGump( mobile ));
return true;
}
if( dropped is DeepSeaScale )
{
dropped.Delete();
mobile.AddToBackpack( new SteelGears() );
mobile.AddToBackpack( new LetterToArathan() );
mobile.SendGump( new CaztorFinishGump( mobile ));
return true;
}
else
{
mobile.SendMessage("I have no need for this item.");
}
}
else
{
PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no need for this item.", mobile.NetState );
}
return false;
}