当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.SendMenu方法代码示例

本文整理汇总了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."));*/
                }
            }
开发者ID:Godkong,项目名称:RunUO,代码行数:25,代码来源:Cartography.cs

示例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 );
        }
开发者ID:Godkong,项目名称:Origins,代码行数:9,代码来源:HordeMinion.cs

示例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.");
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:36,代码来源:TinkerTools.cs

示例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.");
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:19,代码来源:Tongs.cs

示例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.");
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:22,代码来源:Saw.cs

示例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.
        }
开发者ID:Ravenwolfe,项目名称:Origins,代码行数:12,代码来源:Cannon.cs

示例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;
//.........这里部分代码省略.........
开发者ID:Godkong,项目名称:RunUO,代码行数:101,代码来源:MortarPestle.cs

示例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 ) );
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:11,代码来源:PricedHealer.cs

示例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 );
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:18,代码来源:ClientVerification.cs

示例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!
        }
开发者ID:Ravenwolfe,项目名称:Origins,代码行数:27,代码来源:AnimalTrainer.cs

示例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 ) ) );
 }
开发者ID:Godkong,项目名称:Origins,代码行数:4,代码来源:Statics.cs

示例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 ) );
                }
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:23,代码来源:EvilWanderingHealer.cs

示例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 ) );
                }
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:23,代码来源:Uzeraan.cs

示例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);
        }
开发者ID:Godkong,项目名称:Origins,代码行数:61,代码来源:HarvestTarget.cs

示例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));
 }
开发者ID:Godkong,项目名称:RunUO,代码行数:6,代码来源:FletcherTools.cs


注:本文中的Server.Mobile.SendMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。