Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                var entity = targeted as IEntity;

                if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) &&
                    UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, m_Bandage))
                {
                    return;
                }

                if (targeted is BaseCreature &&
                    (((BaseCreature)targeted).Pseu_CanBeHealed == false || ((BaseCreature)targeted).ChampSpawn != null))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500951);                     // You cannot heal that.
                }
                else if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), GetRange(from.Expansion)))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            var region1 = from.Region as CustomRegion;

                            if (!DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                            {
                                IUOFBattle battle = null;

                                if (from is PlayerMobile)
                                {
                                    battle = AutoPvP.FindBattleI <IUOFBattle>((PlayerMobile)from);
                                }

                                if (battle == null || !battle.NoConsume)
                                {
                                    m_Bandage.Consume();
                                }
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                         // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                     // Bandages can not be used on that.
                }
            }
Exemple #2
0
        /*private static bool CheckHarmfulStatus( GuildStatus from, GuildStatus target )
         * {
         *      if ( from == GuildStatus.Waring && target == GuildStatus.Waring )
         *              return true;
         *
         *      return false;
         * }*/

        public static bool Mobile_AllowBeneficial(Mobile from, Mobile target)
        {
            if (from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player)
            {
                return(true);
            }

            #region Dueling
            PlayerMobile pmFrom = from as PlayerMobile;
            PlayerMobile pmTarg = target as PlayerMobile;

            if (pmFrom == null && from is BaseCreature)
            {
                BaseCreature bcFrom = (BaseCreature)from;

                if (bcFrom.Summoned)
                {
                    pmFrom = bcFrom.SummonMaster as PlayerMobile;
                }
            }

            if (pmTarg == null && target is BaseCreature)
            {
                BaseCreature bcTarg = (BaseCreature)target;

                if (bcTarg.Summoned)
                {
                    pmTarg = bcTarg.SummonMaster as PlayerMobile;
                }
            }

            if (pmFrom != null && pmTarg != null)
            {
                if (pmFrom.DuelContext != pmTarg.DuelContext && ((pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg.DuelContext != null && pmTarg.DuelContext.Started)))
                {
                    return(false);
                }

                if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && ((pmFrom.DuelContext.StartedReadyCountdown && !pmFrom.DuelContext.Started) || pmFrom.DuelContext.Tied || pmFrom.DuelPlayer.Eliminated || pmTarg.DuelPlayer.Eliminated))
                {
                    return(false);
                }

                if (pmFrom.DuelPlayer != null && !pmFrom.DuelPlayer.Eliminated && pmFrom.DuelContext != null && pmFrom.DuelContext.IsSuddenDeath)
                {
                    return(false);
                }

                if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.m_Tournament != null && pmFrom.DuelContext.m_Tournament.IsNotoRestricted && pmFrom.DuelPlayer != null && pmTarg.DuelPlayer != null && pmFrom.DuelPlayer.Participant != pmTarg.DuelPlayer.Participant)
                {
                    return(false);
                }

                if (pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.Started)
                {
                    return(true);
                }
            }

            if ((pmFrom != null && pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg != null && pmTarg.DuelContext != null && pmTarg.DuelContext.Started))
            {
                return(false);
            }

            Engines.ConPVP.SafeZone sz = from.Region.GetRegion(typeof(Engines.ConPVP.SafeZone)) as Engines.ConPVP.SafeZone;

            if (sz != null /*&& sz.IsDisabled()*/)
            {
                return(false);
            }

            sz = target.Region.GetRegion(typeof(Engines.ConPVP.SafeZone)) as Engines.ConPVP.SafeZone;

            if (sz != null /*&& sz.IsDisabled()*/)
            {
                return(false);
            }
            #endregion

            Map map = from.Map;

            // Alan mod: custom teams
            if (from.CustomTeam && target.CustomTeam)
            {
                List <XmlTeam> targetTeams = XmlAttach.GetTeams(target);
                List <XmlTeam> fromTeams   = XmlAttach.GetTeams(from);

                if (!XmlTeam.SameTeam(fromTeams, targetTeams))
                {
                    return(XmlTeam.AllowHealEnemy(fromTeams, targetTeams));
                }
                // they are on the same team, allow beneficial
                return(true);
            }
            // end Alan mod

            #region Factions
            Faction targetFaction = Faction.Find(target, true);

            if ((!target.EraML || Faction.IsFactionFacet(map)) && targetFaction != null)
            {
                if (Faction.Find(from, true) != targetFaction && pmFrom != null && pmTarg != null && !AutoPvP.IsParticipant(pmTarg))
                {
                    return(false);
                }
            }
            #endregion

            if (map != null && (map.Rules & MapRules.BeneficialRestrictions) == 0)
            {
                return(true);                // In felucca, anything goes
            }
            if (!from.Player)
            {
                return(true);                // NPCs have no restrictions
            }
            if (target is BaseCreature && !((BaseCreature)target).Controlled)
            {
                return(false);                // Players cannot heal uncontrolled mobiles
            }
            if (from is PlayerMobile && ((PlayerMobile)from).Young && (!(target is PlayerMobile) || !((PlayerMobile)target).Young))
            {
                return(false);                // Young players cannot perform beneficial actions towards older players
            }
            Guild fromGuild   = from.Guild as Guild;
            Guild targetGuild = target.Guild as Guild;

            if (fromGuild != null && targetGuild != null && (targetGuild == fromGuild || fromGuild.IsAlly(targetGuild)))
            {
                return(true);                // Guild members can be beneficial
            }
            return(CheckBeneficialStatus(GetGuildStatus(from), GetGuildStatus(target)));
        }
        protected override int GetProgress(ConquestState state, PlayerConquestContainer args)
        {
            if (state.User == null)
            {
                return(0);
            }

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account || !(args.Mobile is PlayerMobile) || !(args.Killer is PlayerMobile))
            {
                return(0);
            }

            var killer = args.Killer as PlayerMobile;
            var victim = args.Killer as PlayerMobile;

            Faction killerFaction = Faction.Find(killer, true);
            Faction victimFaction = Faction.Find(victim, true);

            if (killerFaction == null || victimFaction == null || killerFaction == victimFaction || AutoPvP.IsParticipant(victim))
            {
                return(0);
            }

            Player ethickiller = Player.Find(killer);
            Player ethicvictim = Player.Find(victim);

            if (IsEthic && (ethickiller == null || ethicvictim == null || ethickiller.Ethic == ethicvictim.Ethic))
            {
                return(0);
            }

            return(base.GetProgress(state, args));
        }
Exemple #4
0
        protected virtual int GetProgress(ConquestState state, PlayerConquestContainer args)
        {
            if (state.User == null)
            {
                return(0);
            }

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account)
            {
                return(0);
            }

            if (IsDuel && args.Mobile is PlayerMobile && args.Killer is PlayerMobile && ((PlayerMobile)args.Killer).DuelContext == null)
            {
                return(0);
            }

            if (IsDungeon && !args.Mobile.InRegion <DungeonRegion>())
            {
                return(0);
            }

            PvPBattle battle = AutoPvP.FindBattle(args.Killer as PlayerMobile);

            if (Battle.IsNotNull && !battle.TypeEquals(Battle, BattleChildren))
            {
                if (ChangeBattleReset)
                {
                    return(-state.Progress);
                }

                return(0);
            }

            if (AccessPlayer > args.Mobile.AccessLevel)
            {
                return(0);
            }

            if (AccessKiller > args.Killer.AccessLevel)
            {
                return(0);
            }

            if (NotoCompare != NotorietyType.None && NotoCompare != args.Killer.ComputeNotoriety(args.Mobile))
            {
                return(0);
            }

            if (NotoPlayer != NotorietyType.None && NotoPlayer != args.Mobile.ComputeNotoriety())
            {
                return(0);
            }

            if (NotoKiller != NotorietyType.None && NotoKiller != args.Killer.ComputeNotoriety())
            {
                return(0);
            }

            if (Map != null && Map != Map.Internal && (args.Mobile.Map == null || args.Mobile.Map != Map))
            {
                return(0);
            }

            if (!String.IsNullOrWhiteSpace(RegionName) && (args.Mobile.Region == null || !args.Mobile.Region.IsPartOf(RegionName)))
            {
                return(0);
            }

            return(1);
        }
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background",
                () =>
            {
                AddImageTiled(40, 80, 44, 458, 202);
                AddImage(40, 39, 206);
                AddImageTiled(80, 38, 422, 45, 201);
                AddImage(40, 538, 204);
                AddImageTiled(495, 71, 44, 469, 203);
                AddImage(496, 39, 207);
                AddImageTiled(84, 539, 417, 43, 233);
                AddImageTiled(75, 82, 446, 459, 200);
                AddImage(171, 16, 1419);
                AddImage(248, -1, 1417);
                AddImage(257, 8, 5545);
                AddImage(496, 538, 205);
            });

            layout.Add("SideButtons",
                       () =>
            {
                if (GumpType == CentralGumpType.News)
                {
                    AddButton(0, 87, 223, 223, b =>
                    {
                        GumpType = CentralGumpType.News;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(0, 87, 224, 223, b =>
                    {
                        GumpType = CentralGumpType.News;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Links)
                {
                    AddButton(0, 154, 221, 221, b =>
                    {
                        GumpType = CentralGumpType.Links;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(0, 154, 222, 221, b =>
                    {
                        GumpType = CentralGumpType.Links;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Information)
                {
                    AddButton(0, 286, 219, 219, b =>
                    {
                        GumpType = CentralGumpType.Information;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(0, 286, 220, 219, b =>
                    {
                        GumpType = CentralGumpType.Information;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Commands)
                {
                    AddButton(0, 352, 217, 217, b =>
                    {
                        GumpType = CentralGumpType.Commands;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(0, 352, 218, 217, b =>
                    {
                        GumpType = CentralGumpType.Commands;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Profile)
                {
                    AddButton(525, 87, 229, 229, b =>
                    {
                        GumpType = CentralGumpType.Profile;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(525, 87, 230, 229, b =>
                    {
                        GumpType = CentralGumpType.Profile;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Options)
                {
                    AddButton(525, 154, 231, 231, b =>
                    {
                        GumpType = CentralGumpType.Options;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(525, 154, 232, 231, b =>
                    {
                        GumpType = CentralGumpType.Options;
                        Refresh(true);
                    });
                }

                if (GumpType == CentralGumpType.Events)
                {
                    AddButton(525, 286, 227, 227, b =>
                    {
                        GumpType = CentralGumpType.Events;
                        Refresh(true);
                    });
                }
                else
                {
                    AddButton(525, 286, 228, 227, b =>
                    {
                        GumpType = CentralGumpType.Events;
                        Refresh(true);
                    });
                }

                AddButton(525, 352, 235, 234, b =>
                {
                    new CentralGumpUIList(User, Profile, X, Y).Send();
                });
            });

            switch (GumpType)
            {
            case CentralGumpType.News:
                layout.Add("News",
                           () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);
                    AddHtml(126, 74, 325, 17,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever News & Patch Notes")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 104, 404, 413, 2624);
                    AddHtml(86, 103, 414, 413, News, false, true);

                    AddImageTiled(81, 518, 420, 12, 50);

                    AddImage(97, 530, 9004);
                    AddHtml(180, 541, 129, 18,
                            String.Format("<BIG>{0}</BIG>", "Receive on login?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite),
                            false, false);
                    AddCheck(147, 536, 2152, 2153, Profile.LoginGump, (b, t) => { Profile.LoginGump = t; });


                    if (User.AccessLevel >= AccessLevel.GameMaster)
                    {
                        AddHtml(385, 541, 113, 18,
                                String.Format("<BIG>{0}</BIG>", "Modify News?")
                                .WrapUOHtmlColor(KnownColor.GhostWhite),
                                false, false);
                        AddButton(351, 541, 4005, 4006, b => { Send(new NewsMessageListGump(User, Hide())); });
                    }
                });
                break;

            case CentralGumpType.Links:
                layout.Add("Links",
                           () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);
                    AddHtml(134, 74, 313, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - Important Links")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(135, 115, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Homepage")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 115, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://www.uoforever.com");
                        Refresh();
                    });

                    AddHtml(135, 160, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Donation Page")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 160, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://uoforever.com/donate.php");
                        Refresh();
                    });

                    AddHtml(135, 205, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Forums")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 205, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://www.uoforum.com/");
                        Refresh();
                    });

                    AddHtml(135, 250, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Chatroom [IRC]")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 250, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://uoforever.com/chat/");
                        Refresh();
                    });

                    AddHtml(135, 295, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Wiki")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(99, 295, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://www.uofwiki.com");
                        Refresh();
                    });

                    AddHtml(135, 340, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Frequently Asked Questions")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 340, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://www.uoforum.com/faq/");
                        Refresh();
                    });

                    AddHtml(135, 385, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever: Legends")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 385, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://legends.uoforever.com");
                        Refresh();
                    });

                    AddHtml(135, 430, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Facebook Page")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(99, 430, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("https://www.facebook.com/UltimaOnlineForever");
                        Refresh();
                    });

                    AddHtml(135, 475, 400, 107,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online Forever Action Camera")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    AddButton(99, 475, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://live.uoforever.com");
                        Refresh();
                    });

                    AddImageTiled(81, 518, 420, 12, 50);
                });
                break;

            case CentralGumpType.Information:
                layout.Add("Information",
                           () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);


                    AddHtml(124, 74, 513, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - Information and Options")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddLabel(85, 109, 2049, "Young Program");


                    AddLabel(120, 130, 2049, "General Information");
                    AddButton(85, 130, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungBenefitsString())
                        .Send();
                    });

                    AddLabel(120, 155, 2049, "Leaving the Program");
                    AddButton(85, 155, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungLeaveString()).Send
                            ();
                    });

                    AddLabel(120, 180, 2049, "The Defiled Crypt");
                    AddButton(85, 180, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(120, 205, 2049, "Companion Program");
                    AddButton(85, 205, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });


                    AddLabel(85, 228, 2049, "Shopkeeper/NPC Information");


                    AddLabel(120, 250, 2049, "Banks");
                    AddButton(85, 250, 4005, 4007,
                              b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructBankString()).Send();
                    });

                    AddLabel(120, 275, 2049, "Bardic Guild");
                    AddButton(85, 275, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructBardicGuildString())
                        .Send();
                    });


                    AddLabel(120, 300, 2049, "The Blacksmith");
                    AddButton(85, 300, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructBlacksmithGuildString())
                        .Send();
                    });


                    AddLabel(120, 325, 2049, "Carpenter's Guild");
                    AddButton(85, 325, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructLumberjackGuildString())
                        .Send();
                    });

                    AddLabel(120, 350, 2049, "The Docks");
                    AddButton(85, 350, 4005, 4007,
                              b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructDocksString()).Send();
                    });


                    AddLabel(120, 375, 2049, "Healers");
                    AddButton(85, 375, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructHealersGuildString())
                        .Send();
                    });


                    AddLabel(120, 400, 2049, "Inns");
                    AddButton(85, 400, 4005, 4007,
                              b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructInnGuildString())
                        .Send();
                    });


                    AddLabel(120, 425, 2049, "Mage's Guild");
                    AddButton(85, 425, 4005, 4007,
                              b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructMageGuildString())
                        .Send();
                    });


                    AddLabel(120, 450, 2049, "Miner's Guild");
                    AddButton(85, 450, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructMinersGuildString())
                        .Send();
                    });


                    AddLabel(120, 475, 2049, "Stables");
                    AddButton(85, 475, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructStablesGuildString())
                        .Send();
                    });


                    AddLabel(120, 500, 2049, "Tailor Shop");
                    AddButton(85, 500, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructTailorGuildString())
                        .Send();
                    });

                    AddLabel(315, 109, 2049, "General Systems Information");

                    AddLabel(350, 130, 2049, "Battles System");
                    AddButton(315, 130, 4005, 4007,
                              b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructBattlesString())
                        .Send();
                    });

                    AddLabel(350, 155, 2049, "Conquest System");
                    AddButton(315, 155, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 180, 2049, "Event Scoring System");
                    AddButton(315, 180, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 205, 2049, "Invasion System");
                    AddButton(315, 205, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 230, 2049, "Player Scoring System");
                    AddButton(315, 230, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 255, 2049, "Portals System");
                    AddButton(315, 255, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(315, 280, 2049, "Housing Information");

                    AddLabel(350, 300, 2049, "Classic Houses");
                    AddButton(315, 300, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 325, 2049, "Custom Houses");
                    AddButton(315, 325, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 350, 2049, "House Ownership");
                    AddButton(315, 350, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 375, 2049, "Player Run Vendors");
                    AddButton(315, 375, 4005, 4007, b =>
                    {
                        new CentralGumpInformationUI(User, Hide(), CentralGump.ConstructYoungDungeonString())
                        .Send();
                    });

                    AddLabel(350, 475, User.GuildMessageHue, "Guild Chat Color");
                    AddButton(315, 475, 4005, 4007,
                              b => { new CentralGump.GuildChatColorPicker(User, Profile).SendTo(User.NetState); });

                    AddLabel(350, 500, User.AllianceMessageHue, "Alliance Chat Color");
                    AddButton(315, 500, 4005, 4007,
                              b => { new CentralGump.AllianceChatColorPicker(User, Profile).SendTo(User.NetState); });


                    AddImageTiled(81, 523, 420, 12, 50);
                });
                break;

            case CentralGumpType.Commands:
                layout.Add("Commands",
                           () =>
                {
                    AddHtml(81, 74, 513, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - PvP Commands and Notifications")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 92, 420, 12, 50);

                    AddCheck(60, 120, 2152, 2153, Profile.BuyHead,
                             (b, t) => { Profile.BuyHead = t; });
                    AddHtml(95, 125, 221, 18,
                            String.Format("<BIG>{0}</BIG>", "Buy head for 30k?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 120, 2152, 2153, Profile.FactionPoint,
                             (b, t) => { Profile.FactionPoint = t; });
                    AddHtml(318, 125, 204, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Faction Notifications?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 518, 420, 12, 50);
                });
                break;

            case CentralGumpType.Profile:
                layout.Add("Profile",
                           () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);
                    AddHtml(140, 74, 313, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - Player Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(79, 110, 186, 18,
                            String.Format("<BIG>{0}</BIG>", "Total Account Play Time")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    TimeSpan totaltime = TimeSpan.Zero;
                    var account        = User.Account as Account;

                    if (account != null)
                    {
                        totaltime =
                            account.Mobiles.Cast <PlayerMobile>()
                            .Where(player => player != null)
                            .Aggregate(totaltime, (current, player) => current + player.GameTime);
                    }

                    AddHtml(79, 135, 186, 18,
                            String.Format("<BIG>{0} Days</BIG>", (int)Math.Ceiling(totaltime.TotalDays))
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(345, 110, 175, 18,
                            String.Format("<BIG>{0}</BIG>", "Character Play Time")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(345, 135, 130, 18,
                            String.Format("<BIG>{0} Days</BIG>", (int)Math.Ceiling(User.GameTime.TotalDays))
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(79, 180, 105, 107,
                            String.Format("<BIG>{0}</BIG>", "Current Title")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    Title t;
                    TitleHue h;
                    CustomTitles.CustomTitles.GetTitle(User, out t);
                    CustomTitles.CustomTitles.GetTitleHue(User, out h);

                    if (t != null)
                    {
                        /*AddHtml(79, 205, 105, 107,
                         *  String.Format("<BIG>{0}</BIG>", User.Female ? t.FemaleTitle : t.MaleTitle)
                         *      .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);*/
                        AddLabel(79, 205, h != null ? h.Hue - 1 : 0, User.Female ? t.FemaleTitle : t.MaleTitle);
                    }
                    else
                    {
                        AddHtml(79, 205, 105, 107,
                                String.Format("<BIG>{0}</BIG>", "No title to display.")
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }

                    AddHtml(345, 180, 138, 17,
                            String.Format("<BIG>{0}</BIG>", "Current Title Hue")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    if (t != null && h != null)
                    {
                        /*AddHtml(345, 205, 105, 107,
                         *  String.Format("<BIG>{0}</BIG>", h.Hue)
                         *      .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);*/
                        AddLabel(345, 205, h.Hue - 1, h.Hue.ToString());
                    }
                    else
                    {
                        AddHtml(345, 205, 105, 107,
                                String.Format("<BIG>{0}</BIG>", "No title hue to display.")
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }

                    AddHtml(79, 250, 121, 18,
                            String.Format("<BIG>{0}</BIG>", "Conquest Points")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    ConquestProfile conquestprofile = Conquests.Conquests.EnsureProfile(User);
                    long points = conquestprofile.GetPointsTotal();

                    if (points == 0)
                    {
                        AddHtml(79, 275, 171, 107,
                                String.Format("<BIG>{0}</BIG>", "You have not completed any conquests.")
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }
                    else
                    {
                        AddHtml(79, 275, 121, 18,
                                String.Format("<BIG>{0}</BIG>", points)
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }

                    AddHtml(345, 250, 171, 107,
                            String.Format("<BIG>{0}</BIG>", "Invasion Points")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddHtml(79, 320, 171, 107,
                            String.Format("<BIG>{0}</BIG>", "Event Points")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    PlayerEventScoreProfile eventprofile = EventScores.EventScores.EnsureProfile(User);
                    points = eventprofile.OverallScore;

                    if (points == 0)
                    {
                        AddHtml(79, 345, 171, 107,
                                String.Format("<BIG>{0}</BIG>", "You have not competed in any events.")
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }
                    else
                    {
                        AddHtml(79, 345, 121, 18,
                                String.Format("<BIG>{0}</BIG>", points)
                                .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                    }

                    AddHtml(345, 320, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Portals Points")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 393, 420, 12, 50);

                    AddButton(79, 415, 4005, 4006,
                              b => { Send(new PvPProfileOverviewGump(User, AutoPvP.EnsureProfile(User), Hide())); });

                    AddHtml(117, 415, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Battles Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(79, 460, 4005, 4006,
                              b => { Send(new ConquestStatesGump(User, Hide(), conquestprofile)); });

                    AddHtml(117, 460, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Conquests Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(79, 505, 4005, 4006, b => { Send(new BattlesTUI(User, Hide(), eventprofile)); });

                    AddHtml(117, 505, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Events Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(345, 415, 4005, 4006, b => { Refresh(); });

                    AddHtml(383, 415, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Invasions Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(345, 460, 4005, 4006, b =>
                    {
                        User.LaunchBrowser("http://uoforever.com/legends/?action=player&s=" + User.Serial.Value);
                        Refresh();
                    });

                    AddHtml(383, 460, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Legends Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddButton(345, 505, 4005, 4006, b => { Refresh(); });

                    AddHtml(383, 505, 111, 17,
                            String.Format("<BIG>{0}</BIG>", "Portals Profile")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);
                });
                break;

            case CentralGumpType.Options:
                layout.Add("Options",
                           () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);


                    AddHtml(119, 74, 513, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - Player Profile Options")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);


                    AddCheck(60, 120, 2152, 2153, Profile.IgnoreBattles,
                             (b, t) => { Profile.IgnoreBattles = t; });
                    AddHtml(95, 125, 221, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Battles Prompts?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 120, 2152, 2153, Profile.IgnoreNotifies,
                             (b, t) => { Profile.IgnoreNotifies = t; });
                    AddHtml(318, 125, 204, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Staff Notifications?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(60, 190, 2152, 2153, Profile.IgnoreTournament,
                             (b, t) => { Profile.IgnoreTournament = t; });
                    AddHtml(95, 195, 256, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Tourny Prompts?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 190, 2152, 2153, Profile.IgnoreConquests,
                             (b, t) => { Profile.IgnoreConquests = t; });
                    AddHtml(318, 195, 232, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Conquest Notification?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(60, 260, 2152, 2153, Profile.IgnoreMoongates,
                             (b, t) => { Profile.IgnoreMoongates = t; });
                    AddHtml(95, 265, 202, 18,
                            String.Format("<BIG>{0}</BIG>", "Ignore Moongate Prompt?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 260, 2152, 2153, Profile.PublicLegends,
                             (b, t) => { Profile.PublicLegends = t; });
                    AddHtml(318, 265, 202, 18,
                            String.Format("<BIG>{0}</BIG>", "Show UOF Legends?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    /*AddCheck(283, 260, 2152, 2153, Profile.IgnoreMoongates,
                    *   (b, t) => { Profile.IgnoreMoongates = t; });
                    *  AddHtml(318, 265, 250, 18,
                    *   String.Format("<BIG>{0}</BIG>", "Auto Buy Head for 30k?")
                    *       .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);*/

                    AddCheck(60, 330, 2152, 2153, Profile.FameTitle, (b, t) => { Profile.FameTitle = t; });
                    AddHtml(95, 335, 155, 18,
                            String.Format("<BIG>{0}</BIG>", "Display Fame Title?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 330, 2152, 2153, User.KarmaLocked, (b, t) => { User.KarmaLocked = t; });
                    AddHtml(318, 335, 147, 20,
                            String.Format("<BIG>{0}</BIG>", "Lock Your Karma?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(60, 400, 2152, 2153, User.DisplayChampionTitle,
                             (b, t) => { User.DisplayChampionTitle = t; });
                    AddHtml(95, 405, 186, 18,
                            String.Format("<BIG>{0}</BIG>", "Display Champion Title?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 400, 2152, 2153, Profile.MiniGump, (b, t) => { Profile.MiniGump = t; });
                    AddHtml(318, 405, 186, 18,
                            String.Format("<BIG>{0}</BIG>", "Display Mini Score Gump")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(60, 470, 2152, 2153, Profile.DisablePvPTemplate,
                             (b, t) => { Profile.DisablePvPTemplate = t; });
                    AddHtml(95, 475, 183, 18,
                            String.Format("<BIG>{0}</BIG>", "Disable PvP Templates?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddCheck(283, 470, 2152, 2153, Profile.DisableTemplateEquipment,
                             (b, t) => { Profile.DisableTemplateEquipment = t; });
                    AddHtml(318, 475, 255, 18,
                            String.Format("<BIG>{0}</BIG>", "Disable Template Equipment?")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);


                    AddImageTiled(81, 518, 420, 12, 50);
                });
                break;

            case CentralGumpType.Events:
                layout.Add("Events",
                           () =>
                {
                    AddHtml(154, 74, 513, 18,
                            String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever - Events Page")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 92, 420, 12, 50);
                    AddHtml(85, 109, 325, 17,
                            String.Format("<BIG>{0}</BIG>", "There are currently no events at this time.")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 518, 420, 12, 50);
                });
                break;
            }
        }