本文整理汇总了C#中Server.Mobile.SendMenu方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.SendMenu方法的具体用法?C# Mobile.SendMenu怎么用?C# Mobile.SendMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.SendMenu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTarget
protected override void OnTarget(Mobile from, object target)
{
if (target is BlankMap)
{
Item item = (Item)target;
BaseTool tool = new MapmakersPen();
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
from.SendMenu(new CartographyMenu(from, CartographyMenu.Main(from), "Main", tool));
if (tool != null)
tool.Delete();
}
else if (target is WorldMap || target is LocalMap || target is CityMap || target is SeaChart)
//from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "You cannot overwrite this carefully hand-drawn map!"));
from.SendAsciiMessage("You cannot overwrite this carefully hand-drawn map!");
else
{
from.SendAsciiMessage("This is not a map.");
/*if (target is Item)
from.Send(new AsciiMessage(((Item)target).Serial, ((Item)target).ItemID, MessageType.Regular, 0, 3, "", "This is not a map."));*/
}
}
示例2: BeginRelease
public override void BeginRelease( Mobile from )
{
Container pack = this.Backpack;
if ( pack != null && pack.Items.Count > 0 )
from.SendMenu(new WarningGump(1060635, 30720, 1061672, 32512, 420, 280, new WarningGumpCallback(ConfirmRelease_Callback), null));
else
EndRelease( from );
}
示例3: OnTarget
protected override void OnTarget(Mobile from, object target)
{
if (m_Tool.Deleted || m_Tool.RootParent != from)
return;
if (target is Log)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
if (from.Backpack.GetAmount(typeof(Log)) >= 2)
from.SendMenu(new TinkeringMenu(from, TinkeringMenu.Wood(from), "Wood", (BaseTool)m_Tool));
else
from.SendAsciiMessage("You don't have the resources required to make anything from that.");
}
}
else if (target is IronIngot)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
if (from.Backpack.GetAmount(typeof(IronIngot)) >= 2)
from.SendMenu(new TinkeringMenu(from, TinkeringMenu.Metal(from), "Metal", (BaseTool)m_Tool));
else
from.SendAsciiMessage("You don't have the resources required to make anything from that.");
}
}
else
from.SendAsciiMessage("That is not proper material for tinkering items.");
}
示例4: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack) || Parent == from)
{
bool anvil, forge;
DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);
if (anvil && forge)
{
BaseTool m_Tool = this;
string IsFrom = "Main";
from.SendMenu(new BlacksmithMenu(from, BlacksmithMenu.Main(from), IsFrom, m_Tool));
}
else
from.SendAsciiMessage("You must be near an anvil and a forge to smith items.");
}
else
from.SendAsciiMessage("That must be in your pack for you to use it.");
}
示例5: OnTarget
protected override void OnTarget(Mobile from, object target)
{
if (m_Tool.Deleted || m_Tool.RootParent != from)
return;
if (target is Board || target is Log)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("You cannot use your tool on that.");
else
{
if (from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board)) >= 6)
from.SendMenu(new CarpentryMenu(from, CarpentryMenu.Main(from), "Main", (BaseTool)m_Tool));
else
from.SendAsciiMessage("You don't have the resources required to make anything from that.");
}
}
else
from.SendAsciiMessage("You cannot use your tool on that.");
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
return;
if ( IsChildOf( from.Backpack ) )
{
from.SendMenu( new RewardOptionMenu( this ) );
}
else
from.SendLocalizedMessage( "You must have the object in your backpack to use it." ); // You must have the object in your backpack to use it.
}
示例7: OnTarget
protected override void OnTarget(Mobile from, object target)
{
if (m_Pestle.Deleted || m_Pestle.RootParent != from)
return;
//refresh
if (target is BlackPearl)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
bool allRequiredSkills = true;
if (DefAlchemy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(BlackPearl), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
{
if (from.Backpack.GetAmount(typeof(BlackPearl)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount)
from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Refresh(from), "Refresh", (BaseTool)m_Pestle));
else
from.SendAsciiMessage("You don't have the resources required to make that item.");
}
else
from.SendAsciiMessage("You are not skilled enough to make anything out of that.");
}
}
//agility
else if (target is Bloodmoss)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
bool allRequiredSkills = true;
if (DefAlchemy.CraftSystem.CraftItems.GetAt(2).GetSuccessChance(from, typeof(Bloodmoss), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
{
if (from.Backpack.GetAmount(typeof(Bloodmoss)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(2).ItemType).Ressources.GetAt(0).Amount)
from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Agility(from), "Agility", (BaseTool)m_Pestle));
else
from.SendAsciiMessage("You don't have the resources required to make that item.");
}
else
from.SendAsciiMessage("You are not skilled enough to make anything out of that.");
}
}
//Nightsight
else if (target is SpidersSilk)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
bool allRequiredSkills = true;
if (DefAlchemy.CraftSystem.CraftItems.GetAt(4).GetSuccessChance(from, typeof(SpidersSilk), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
{
if (from.Backpack.GetAmount(typeof(SpidersSilk)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(4).ItemType).Ressources.GetAt(0).Amount)
from.SendMenu(new AlchemyMenu(from, AlchemyMenu.NightSight(from), "NightSight", (BaseTool)m_Pestle));
else
from.SendAsciiMessage("You don't have the resources required to make that item.");
}
else
from.SendAsciiMessage("You are not skilled enough to make anything out of that.");
}
}
//heal
else if (target is Ginseng)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
bool allRequiredSkills = true;
if (DefAlchemy.CraftSystem.CraftItems.GetAt(5).GetSuccessChance(from, typeof(Ginseng), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
{
if (from.Backpack.GetAmount(typeof(Ginseng)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(5).ItemType).Ressources.GetAt(0).Amount)
from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Heal(from), "Heal", (BaseTool)m_Pestle));
else
from.SendAsciiMessage("You don't have the resources required to make that item.");
}
else
from.SendAsciiMessage("You are not skilled enough to make anything out of that.");
}
}
//strength
else if (target is MandrakeRoot)
{
Item item = (Item)target;
if (item.RootParent != from)
from.SendAsciiMessage("That must be in your pack for you to use it.");
else
{
bool allRequiredSkills = true;
//.........这里部分代码省略.........
示例8: OfferResurrection
public override void OfferResurrection( Mobile m )
{
Direction = GetDirectionTo( m );
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
m.CloseGump( typeof( ResurrectGump ) );
m.SendMenu(new ResurrectGump(m, this));
//m.SendGump( new ResurrectGump( m, this, m_Price ) );
}
示例9: SendAnnoyGump
private static void SendAnnoyGump( Mobile m )
{
if( m.NetState != null && m.NetState.Version < Required )
{
QuestionMenu g = new WarningGump(1060637, 30720, String.Format("Your client is out of date. Please update your client. This server recommends that your client version be at least {0}. You are currently using version {1}. To patch, run UOPatch.exe inside your Ultima Online folder.", Required, m.NetState.Version), 0xFFC000, 480, 360,
delegate( Mobile mob, bool selection, object o )
{
m.SendMessage( "You will be reminded of this again." );
if ( m_OldClientResponse == OldClientResponse.LenientKick )
m.SendMessage( "Old clients will be kicked after {0} days of character age and {1} hours of play time", m_AgeLeniency, m_GameTimeLeniency );
Timer.DelayCall( TimeSpan.FromMinutes( Utility.Random( 5, 15 ) ), delegate { SendAnnoyGump( m ); } );
}, null, false );
m.SendMenu( g );
}
}
示例10: BeginClaimList
public void BeginClaimList( Mobile from )
{
if ( Deleted || !from.CheckAlive() )
return;
List<BaseCreature> list = new List<BaseCreature>();
for ( int i = 0; i < from.Stabled.Count; ++i )
{
BaseCreature pet = from.Stabled[i] as BaseCreature;
if ( pet == null || pet.Deleted )
{
pet.IsStabled = false;
from.Stabled.RemoveAt( i );
--i;
continue;
}
list.Add( pet );
}
if ( list.Count > 0 )
from.SendMenu( new ClaimListMenu( this, from, list ) );
else
SayTo( from, true, "But I have no animals stabled with me at the moment!" ); // But I have no animals stabled with me at the moment!
}
示例11: SendWarning
public static void SendWarning( Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback )
{
m.SendMenu( new WarningGump( 1060635, 30720, String.Format( baseWarning, String.Format( header, map ) ), 0xFFC000, 420, 400, callback, new StateInfo( map, start, end ) ) );
}
示例12: OnMovement
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( !m.Frozen && !m.Alive && DateTime.Now >= m_NextResurrect && InRange( m, 4 ) && !InRange( oldLocation, 4 ) && InLOS( m ) )
{
m_NextResurrect = DateTime.Now + Healer.ResurrectDelay;
if ( m.Region is Regions.HouseRegion || m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
{
m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
}
else
{
Direction = GetDirectionTo( m );
Say( 501224 ); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
//m.CloseGump( typeof( ResurrectGump ) );
m.SendMenu( new ResurrectMenu( m, ResurrectMessage.Healer ) );
}
}
}
示例13: OnMovement
public override void OnMovement( Mobile m, Point3D oldLocation )
{
base.OnMovement( m, oldLocation );
if ( m is PlayerMobile && !m.Frozen && !m.Alive && InRange( m, 4 ) && !InRange( oldLocation, 4 ) && InLOS( m ) )
{
if ( m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
{
m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
}
else
{
Direction = GetDirectionTo( m );
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
m.CloseGump( typeof( ResurrectGump ) );
m.SendMenu(new ResurrectGump(m, ResurrectMessage.Healer));
//m.SendGump( new ResurrectGump( m, ResurrectMessage.Healer ) );
}
}
}
示例14: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( m_System is Mining && targeted is StaticTarget )
{
int itemID = ((StaticTarget)targeted).ItemID;
// grave
if ( itemID == 0xED3 || itemID == 0xEDF || itemID == 0xEE0 || itemID == 0xEE1 || itemID == 0xEE2 || itemID == 0xEE8 )
{
PlayerMobile player = from as PlayerMobile;
if ( player != null )
{
QuestSystem qs = player.Quest;
if ( qs is WitchApprenticeQuest )
{
FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;
if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.Bones )
{
player.SendLocalizedMessage( 1055037 ); // You finish your grim work, finding some of the specific bones listed in the Hag's recipe.
obj.Complete();
return;
}
}
}
}
}
if (m_System is Lumberjacking && targeted is IChopable)
{
if (m_Tool.Parent != from)
{
from.SendAsciiMessage("The axe must be equipped for any serious wood chopping.");
//from.SendLocalizedMessage( 500487 ); // The axe must be equipped for any serious wood chopping.
return;
}
else
((IChopable)targeted).OnChop(from);
}
else if (m_System is Lumberjacking && targeted is ICarvable )
{
from.Animate(32, 5, 1, true, false, 0);
((ICarvable)targeted).Carve( from, m_Tool );
}
else if (m_System is Lumberjacking && targeted is Log)
{
BaseTool tools = new FletcherTools();
from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), "Main", tools));
if (tools != null)
tools.Delete();
}
else if (m_System is Lumberjacking && FurnitureAttribute.Check(targeted as Item))
DestroyFurniture(from, (Item)targeted);
else if (m_System is Mining && targeted is TreasureMap)
((TreasureMap)targeted).OnBeginDig(from);
else
m_System.StartHarvesting(from, m_Tool, targeted);
}
示例15: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
BaseTool m_Tool = this;
string IsFrom = "Main";
from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), IsFrom, m_Tool));
}