示例#1
0
            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
0
        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
0
        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
0
文件: Tongs.cs 项目: Godkong/RunUO
        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
0
文件: Saw.cs 项目: Godkong/RunUO
        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
0
        public static void Resurrect(Mobile from)
        {
            if (from.Alive)
            {
                return;
            }

            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return;
            }

            if (from.Criminal)
            {
                from.SendLocalizedMessage(1052007);                   // You cannot use this ability while flagged as a criminal.
            }
            else if (!VirtueHelper.IsSeeker(from, VirtueName.Sacrifice))
            {
                from.SendLocalizedMessage(1052004);                   // You cannot use this ability.
            }
            else if (pm.AvailableResurrects <= 0)
            {
                from.SendLocalizedMessage(1052005);                   // You do not have any resurrections left.
            }
            else
            {
                /*
                 * We need to wait for them to accept the gump or they can just use
                 * Sacrifice and cancel to have items in their backpack for free.
                 */
                from.CloseGump(typeof(ResurrectGump));
                from.SendMenu(new ResurrectGump(from, true));
                //from.SendGump( new ResurrectGump( from, true ) );
            }
        }
示例#7
0
        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;
                    if (DefAlchemy.CraftSystem.CraftItems.GetAt(8).GetSuccessChance(from, typeof(MandrakeRoot), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
                    {
                        if (from.Backpack.GetAmount(typeof(MandrakeRoot)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(8).ItemType).Ressources.GetAt(0).Amount)
                            from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Strength(from), "Strength", (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.");
                }
            }
            //poison
            else if (target is Nightshade)
            {
                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(10).GetSuccessChance(from, typeof(Nightshade), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
                    {
                        if (from.Backpack.GetAmount(typeof(Nightshade)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(10).ItemType).Ressources.GetAt(0).Amount)
                            from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Poison(from), "Poison", (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.");
                }
            }
            //cure
            else if (target is Garlic)
            {
                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(14).GetSuccessChance(from, typeof(Garlic), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
                    {
                        if (from.Backpack.GetAmount(typeof(Garlic)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(14).ItemType).Ressources.GetAt(0).Amount)
                            from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Cure(from), "Cure", (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.");
                }
            }
            //explosion
            else if (target is SulfurousAsh)
            {
                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(17).GetSuccessChance(from, typeof(SulfurousAsh), DefAlchemy.CraftSystem, false, ref allRequiredSkills) > 0)
                    {
                        if (from.Backpack.GetAmount(typeof(SulfurousAsh)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(17).ItemType).Ressources.GetAt(0).Amount)
                            from.SendMenu(new AlchemyMenu(from, AlchemyMenu.Explosion(from), "Explosion", (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.");
                }
            }
            else
                from.SendAsciiMessage("That's not something you can grind with a mortar and pestle!");
        }
示例#8
0
        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
0
        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
0
        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
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( !BaseCommand.IsAccessible( from, targeted ) )
                {
                    from.SendMessage( "That is not accessible." );
                    return;
                }

                if ( targeted is Mobile )
                    from.SendMenu( new EquipMenu( from, (Mobile)targeted, GetEquip( (Mobile)targeted ) ) );
            }
示例#12
0
 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 ) ) );
 }
示例#13
0
文件: Ankhs.cs 项目: Godkong/Origins
        public static void Resurrect( Mobile m, Item item )
        {
            if ( m.Alive )
                return;

            if (m.CantWalk)
                return;

            if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
            {
                m.SendAsciiMessage("That is too far away.");
               // m.SendLocalizedMessage(500446); // That is too far away.
            }
            else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
            {
                m.CantWalk = true;
                m.CloseGump(typeof(ResurrectGump));

                if (m is PlayerMobile && !((PlayerMobile)m).HasMenu)
                {
                    ((PlayerMobile)m).HasMenu = true;
                    m.SendMenu(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
                }
                //m.SendGump( new ResurrectGump( m, ResurrectMessage.VirtueShrine ) );
            }
            else
                m.SendAsciiMessage("Thou can not be resurrected there!");
                //m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
        }
        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 ) );
                }
            }
        }
示例#15
0
        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);
        }
示例#16
0
 public override void OnDoubleClick(Mobile from)
 {
     BaseTool m_Tool = this;
     string IsFrom = "Main";
     from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), IsFrom, m_Tool));
 }
示例#17
0
        public virtual void OfferResurrection( Mobile m )
        {
            Direction = GetDirectionTo( m );
            Say( true, "Thou hast strayed from the path of virtue, but thou still deservest a second chance." ); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.

            m.PlaySound( 0x214 );
            m.FixedEffect( 0x376A, 10, 16 );

            m.CantWalk = true;
            m.CloseGump( typeof( ResurrectGump ) );
            if (m is PlayerMobile && !((PlayerMobile)m).HasMenu)
            {
                ((PlayerMobile)m).HasMenu = true;
                m.SendMenu(new ResurrectGump(m, ResurrectMessage.Healer));
            }
            //m.SendGump( new ResurrectGump( m, ResurrectMessage.Healer ) );
        }
示例#18
0
        public override void OnDoubleClick( Mobile m )
        {
            if ( m_Owner == null )
                return;

            if ( m.AccessLevel < AccessLevel.GameMaster && m_Owner.Owner == null && m_Owner.DecayLevel != DecayLevel.DemolitionPending )
            {
                bool canClaim = false;

                if ( m_Owner.CoOwners == null || m_Owner.CoOwners.Count == 0 )
                    canClaim = m_Owner.IsFriend( m );
                else
                    canClaim = m_Owner.IsCoOwner( m );

                if ( canClaim && !BaseHouse.HasAccountHouse( m ) )
                {
                    /* You do not currently own any house on any shard with this account,
                     * and this house currently does not have an owner.  If you wish, you
                     * may choose to claim this house and become its rightful owner.  If
                     * you do this, it will become your Primary house and automatically
                     * refresh.  If you claim this house, you will be unable to place
                     * another house or have another house transferred to you for the
                     * next 7 days.  Do you wish to claim this house?
                     */
                    m.SendMenu(new WarningGump(501036, 32512, 1049719, 32512, 420, 280, new WarningGumpCallback(ClaimGump_Callback), null));
                }
            }

            ShowSign( m );
        }
示例#19
0
        public bool OnPlacement( Mobile from, Point3D p )
        {
            if ( !from.CheckAlive() || from.Backpack == null || from.Backpack.FindItemByType( typeof( HousePlacementTool ) ) == null  )
                return false;

            ArrayList toMove;
            Point3D center = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
            HousePlacementResult res = HousePlacement.Check( from, m_MultiID, center, out toMove );

            switch ( res )
            {
                case HousePlacementResult.Valid:
                {
                    if ( from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse( from ) )
                    {
                        from.SendLocalizedMessage( 501271 ); // You already own a house, you may not place another!
                    }
                    else
                    {
                        from.SendLocalizedMessage( 1011576 ); // This is a valid location.

                        PreviewHouse prev = new PreviewHouse( m_MultiID );

                        MultiComponentList mcl = prev.Components;

                        Point3D banLoc = new Point3D( center.X + mcl.Min.X, center.Y + mcl.Max.Y + 1, center.Z );

                        for ( int i = 0; i < mcl.List.Length; ++i )
                        {
                            MultiTileEntry entry = mcl.List[i];

                            int itemID = entry.m_ItemID & 0x3FFF;

                            if ( itemID >= 0xBA3 && itemID <= 0xC0E )
                            {
                                banLoc = new Point3D( center.X + entry.m_OffsetX, center.Y + entry.m_OffsetY, center.Z );
                                break;
                            }
                        }

                        for ( int i = 0; i < toMove.Count; ++i )
                        {
                            object o = toMove[i];

                            if ( o is Mobile )
                                ((Mobile)o).Location = banLoc;
                            else if ( o is Item )
                                ((Item)o).Location = banLoc;
                        }

                        prev.MoveToWorld( center, from.Map );

                        /* You are about to place a new house.
                         * Placing this house will condemn any and all of your other houses that you may have.
                         * All of your houses on all shards will be affected.
                         *
                         * In addition, you will not be able to place another house or have one transferred to you for one (1) real-life week.
                         *
                         * Once you accept these terms, these effects cannot be reversed.
                         * Re-deeding or transferring your new house will not uncondemn your other house(s) nor will the one week timer be removed.
                         *
                         * If you are absolutely certain you wish to proceed, click the button next to OKAY below.
                         * If you do not wish to trade for this house, click CANCEL.
                         */
                        from.SendMenu(new WarningGump(1060635, 30720, 1049583, 32512, 420, 280, new WarningGumpCallback(PlacementWarning_Callback), prev));

                        return true;
                    }

                    break;
                }
                case HousePlacementResult.BadItem:
                case HousePlacementResult.BadLand:
                case HousePlacementResult.BadStatic:
                case HousePlacementResult.BadRegionHidden:
                case HousePlacementResult.NoSurface:
                {
                    from.SendLocalizedMessage( 1043287 ); // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
                    break;
                }
                case HousePlacementResult.BadRegion:
                {
                    from.SendLocalizedMessage( 501265 ); // Housing cannot be created in this area.
                    break;
                }
            }

            return false;
        }
示例#20
0
        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.
        }
示例#21
0
        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 ) );
                }
            }
        }
示例#22
0
        public void BeginConfirmTransfer( Mobile from, Mobile to )
        {
            if ( Deleted || !from.CheckAlive() || !IsOwner( from ) )
                return;

            if ( NewVendorSystem && HasPersonalVendors )
            {
                from.SendLocalizedMessage( 1062467 ); // You cannot trade this house while you still have personal vendors inside.
            }
            else if ( DecayLevel == DecayLevel.DemolitionPending )
            {
                from.SendLocalizedMessage( 1005321 ); // This house has been marked for demolition, and it cannot be transferred.
            }
            else if ( from == to )
            {
                from.SendLocalizedMessage( 1005330 ); // You cannot transfer a house to yourself, silly.
            }
            else if ( to.Player )
            {
                if ( BaseHouse.HasAccountHouse( to ) )
                {
                    from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
                }
                else if ( CheckTransferPosition( from, to ) )
                {
                    from.SendLocalizedMessage( 1005326 ); // Please wait while the other player verifies the transfer.

                    if ( HasRentedVendors )
                    {
                        /* You are about to be traded a home that has active vendor contracts.
                         * While there are active vendor contracts in this house, you
                         * <strong>cannot</strong> demolish <strong>OR</strong> customize the home.
                         * When you accept this house, you also accept landlordship for every
                         * contract vendor in the house.
                         */
                        to.SendMenu(new WarningGump(1060635, 30720, 1062487, 32512, 420, 280, new WarningGumpCallback(ConfirmTransfer_Callback), from));
                    }
                    else
                    {
                        to.CloseGump( typeof( Gumps.HouseTransferGump ) );
                        to.SendGump( new Gumps.HouseTransferGump( from, to, this ) );
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage( 501384 ); // Only a player can own a house!
            }
        }
示例#23
0
        public static void Resurrect( Mobile m, Item item, bool reds )
        {
            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 ) && ( reds || m.Karma > (int)Noto.Dark ) )
                m.SendMenu( new ResurrectMenu( m, reds ? ResurrectMessage.ChaosShrine : ResurrectMessage.VirtueShrine ) );
            else
                m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
        }
示例#24
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Tool.Deleted || m_Tool.RootParent != from)
                return;

            if (target is Cloth)
            {
                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(Cloth)) >= 2)
                        from.SendMenu(new TailoringMenu(from, TailoringMenu.Main(from), "Main", (BaseTool)m_Tool));
                    else
                        from.SendAsciiMessage("You don't have the resources required to make anything from that.");
                }
            }
            else if (target is Leather || target is Hides)
            {
                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(Leather)) >= 2 || from.Backpack.GetAmount(typeof(Hides)) >= 2)
                        from.SendMenu(new TailoringMenu(from, TailoringMenu.LeatherMain(from), "LeatherMain", (BaseTool)m_Tool));
                    else
                        from.SendAsciiMessage("You don't have the resources required to make anything from that.");
                }
            }
        }
示例#25
0
        protected override void OnTarget( Mobile from, object targeted )
        {
            if ( m_Item.Deleted )
                return;

            if ( targeted is ICarvable )
            {
                from.Animate(32, 5, 1, true, false, 0);
                ((ICarvable)targeted).Carve( from, m_Item );
            }
            else if (targeted is Log)
            {
                BaseTool tools = new FletcherTools();
                from.SendMenu(new BowFletchingMenu(from, BowFletchingMenu.Main(from), "Main", tools));
                if (tools != null)
                    tools.Delete();
            }
            else if ( targeted is SwampDragon && ((SwampDragon)targeted).HasBarding )
            {
                SwampDragon pet = (SwampDragon)targeted;

                if ( !pet.Controlled || pet.ControlMaster != from )
                    from.SendLocalizedMessage( 1053022 ); // You cannot remove barding from a swamp dragon you do not own.
                else
                    pet.HasBarding = false;
            }
            else
            {
                if ( targeted is StaticTarget )
                {
                    int itemID = ((StaticTarget)targeted).ItemID;

                    if ( itemID == 0xD15 || itemID == 0xD16 ) // red mushroom
                    {
                        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.RedMushrooms )
                                {
                                    player.SendLocalizedMessage( 1055036 ); // You slice a red cap mushroom from its stem.
                                    obj.Complete();
                                    return;
                                }
                            }
                        }
                    }
                }

                HarvestSystem system = Lumberjacking.System;
                HarvestDefinition def = Lumberjacking.System.Definition;

                int tileID;
                Map map;
                Point3D loc;

                if ( !system.GetHarvestDetails( from, m_Item, targeted, out tileID, out map, out loc ) )
                {
                    from.SendAsciiMessage( "You can't use a bladed item on that!" ); // You can't use a bladed item on that!
                }
                else if ( !def.Validate( tileID ) )
                {
                    from.SendAsciiMessage( "You can't use a bladed item on that!" ); // You can't use a bladed item on that!
                }
                else
                {
                    HarvestBank bank = def.GetBank( map, loc.X, loc.Y );

                    if ( bank == null )
                        return;

                    if ( bank.Current < 5 )
                    {
                        from.SendAsciiMessage( "There's not enough wood here to harvest." ); // There's not enough wood here to harvest.
                    }
                    else
                    {
                        bank.Consume( 5, from );

                        Item item = new Kindling();

                        if ( from.PlaceInBackpack( item ) )
                        {
                            from.SendAsciiMessage( "You put some kindling into your backpack." ); // You put some kindling into your backpack.
                            from.SendAsciiMessage( "An axe would probably get you more wood." ); // An axe would probably get you more wood.
                        }
                        else
                        {
                            from.SendAsciiMessage( "You can't place any kindling into your backpack!" ); // You can't place any kindling into your backpack!

                            item.Delete();
                        }
                    }
                }
            }
        }
示例#26
0
        public void AddSecure( Mobile m, Item item )
        {
            if ( m_Secures == null || !IsOwner( m ) || !IsActive )
                return;

            if ( !IsInside( item ) )
            {
                m.SendAsciiMessage( "That is not in your house" ); // That is not in your house
            }
            else if ( IsLockedDown( item ) )
            {
                m.SendAsciiMessage( "This is already locked down and cannot be secured." ); // This is already locked down and cannot be secured.
            }
            else if ( !(item is Container) )
            {
                LockDown( m, item );
            }
            else
            {
                SecureInfo info = null;

                for ( int i = 0; info == null && i < m_Secures.Count; ++i )
                    if ( ((SecureInfo)m_Secures[i]).Item == item )
                        info = (SecureInfo)m_Secures[i];

                if ( info != null )
                {
                    m.SendMenu( new SetSecureLevelMenu( m_Owner, info, this ) );
                }
                else if ( item.Parent != null )
                {
                    m.SendAsciiMessage( "You cannot secure this, place it on the ground first." ); // You cannot secure this, place it on the ground first.
                }
                else if ( !item.Movable )
                {
                    m.SendAsciiMessage( "You cannot secure this." ); // You cannot secure this.
                }
                else if ( !IsAosRules && SecureCount >= MaxSecures )
                {
                    // The maximum number of secure items has been reached :
                    m.SendAsciiMessage( "The maximum number of secure items has been reached : " + MaxSecures.ToString() );
                }
                else if ( IsAosRules ? !CheckAosLockdowns( 1 ) : ((LockDownCount + 125) >= MaxLockDowns) )
                {
                    m.SendAsciiMessage( "That would exceed the maximum lock down limit for this house" ); // That would exceed the maximum lock down limit for this house
                }
                else if ( IsAosRules && !CheckAosStorage( item.TotalItems ) )
                {
                    m.SendAsciiMessage( "This action would exceed the secure storage limit of the house." ); // This action would exceed the secure storage limit of the house.
                }
                else
                {
                    //enable protection
                    if ( this.SecureCount == 0 && this.LockDownCount == 0)
                    {
                        PlayerMobile pm = m as PlayerMobile;
                        Guild guild = pm.Guild as Guild;

                        if ( pm.ProtectedHouse != null )
                        {
                            pm.SendAsciiMessage( "You already have a protected house." );
                            return;
                        }

                        pm.SendAsciiMessage( "This house is now under the protection of " + pm.Guild.Name + "." );
                        pm.ProtectedHouse = this;
                        this.ChangeSignType( guild.GuildHouseSignItemID );

                        if ( m_Sign != null )
                            m_Sign.InvalidateProperties();
                    }

                    info = new SecureInfo( (Container)item, SecureLevel.Owner );

                    item.IsLockedDown = false;
                    item.IsSecure = true;

                    m_Secures.Add( info );
                    m_LockDowns.Remove( item );
                    item.Movable = false;

                    m.SendMenu( new SetSecureLevelMenu( m_Owner, info, this ) );
                }
            }
        }
示例#27
0
        public static void Resurrect( Mobile from )
        {
            if ( from.Alive )
                return;

            PlayerMobile pm = from as PlayerMobile;

            if ( pm == null )
                return;

            if ( from.Criminal )
            {
                from.SendLocalizedMessage( 1052007 ); // You cannot use this ability while flagged as a criminal.
            }
            else if ( !VirtueHelper.IsSeeker( from, VirtueName.Sacrifice ) )
            {
                from.SendLocalizedMessage( 1052004 ); // You cannot use this ability.
            }
            else if ( pm.AvailableResurrects <= 0 )
            {
                from.SendLocalizedMessage( 1052005 ); // You do not have any resurrections left.
            }
            else
            {
                /*
                 * We need to wait for them to accept the gump or they can just use
                 * Sacrifice and cancel to have items in their backpack for free.
                 */
                from.CloseGump( typeof( ResurrectGump ) );
                from.SendMenu(new ResurrectGump(from, true));
                //from.SendGump( new ResurrectGump( from, true ) );
            }
        }
示例#28
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                BaseBook book = targeted as BaseBook;
                Container pack = from.Backpack;

                if (targeted is BlankScroll)
                {
                    Item item = (Item)targeted;

                    if (item.RootParent != from)
                        from.SendAsciiMessage("That must be in your pack for you to use it.");
                    else
                    {
                        if (pack != null)
                        {
                            if (pack.FindItemByType(typeof(Spellbook)) == null)
                                from.SendAsciiMessage("You don't have a spellbook.");
                            else if (((Spellbook)pack.FindItemByType(typeof(Spellbook))).SpellCount == 0)
                                from.SendAsciiMessage("You can't inscribe any spells.");
                            else
                            {
                                BaseTool m_Pen = new ScribesPen();
                                from.SendMenu(new InscriptionMenu(from, InscriptionMenu.Main(from), "Main", m_Pen));
                                if (m_Pen != null)
                                    m_Pen.Delete();
                            }
                        }
                    }
                }
                else
                {
                    if (book == null)
                        from.SendAsciiMessage("Can't inscribe that item.");
                    else if (Inscribe.IsEmpty(book))
                        from.SendAsciiMessage("Can't copy an empty book."); // Can't copy an empty book.
                    else if (Inscribe.GetUser(book) != null)
                        from.SendAsciiMessage("Someone else is inscribing that item."); // Someone else is inscribing that item.
                    else
                    {
                        Target target = new InternalTargetDst(book);
                        from.Target = target;
                        from.SendAsciiMessage("Select a book to copy this to."); // Select a book to copy this to.
                        target.BeginTimeout(from, TimeSpan.FromMinutes(1.0));
                        Inscribe.SetUser(book, from);
                    }
                }
            }
示例#29
0
 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)));
 }
示例#30
0
        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( 1062334 ); // This item must be in your backpack to be used.
        }
示例#31
0
 public override void OnDoubleClick( Mobile from )
 {
     from.SendMenu(new HolidayTreeChoiceMenu(from, this));
 }