Exemplo n.º 1
0
        public bool HasMinRating(Mobile from, CityTitle title)
        {
            CityLoyaltyEntry entry = GetPlayerEntry <CityLoyaltyEntry>(from);

            if (entry == null)
            {
                return(false);
            }

            return(entry.LoyaltyRating >= GetMinimumRating(title));
        }
Exemplo n.º 2
0
        public virtual void AddTitle(Mobile from, CityTitle title)
        {
            CityLoyaltyEntry entry = GetPlayerEntry <CityLoyaltyEntry>(from);

            if (entry == null)
            {
                return;
            }

            entry.AddTitle(title);
        }
Exemplo n.º 3
0
        public virtual void AddTitle(CityTitle title)
        {
            if ((Titles & title) == 0)
            {
                int loc = CityLoyaltySystem.GetTitleLocalization(Player, title, City);
                Player.AddRewardTitle(loc);

                Titles |= title;
                Player.SendLocalizedMessage(1073625, String.Format("#{0}", loc.ToString())); // The title "~1_TITLE~" has been bestowed upon you.
            }
        }
Exemplo n.º 4
0
        public virtual bool HasTitle(Mobile from, CityTitle title)
        {
            CityLoyaltyEntry entry = GetPlayerEntry <CityLoyaltyEntry>(from);

            if (entry == null)
            {
                return(false);
            }

            return((entry.Titles & title) != 0);
        }
Exemplo n.º 5
0
        public override void OnResponse(RelayInfo info)
        {
            base.OnResponse(info);

            if (info.ButtonID > 0 && info.ButtonID < 500)
            {
                CityTitle t = (CityTitle)info.ButtonID - 1;

                if (!Citizenship.HasTitle(User, t))
                {
                    BaseGump.SendGump(new CityTitlesInfoGump(User, t));
                }
            }
        }
Exemplo n.º 6
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            AddHtmlLocalized(60, 40, 200, 16, 1152894, false, false);             // Your Titles
            int y = 60;

            foreach (int i in Enum.GetValues(typeof(CityTitle)))
            {
                CityTitle title = (CityTitle)i;

                if (title == CityTitle.None)
                {
                    continue;
                }

                if (Citizenship.HasTitle(User, title))
                {
                    AddHtmlLocalized(65, y, 300, 16, CityLoyaltySystem.GetTitleLocalization(User, title, Citizenship.City), false, false);
                    y += 20;
                }
            }

            y += 20;
            AddHtmlLocalized(60, y, 250, 16, 1152895, false, false);             //Available Titles:
            y += 20;

            foreach (int i in Enum.GetValues(typeof(CityTitle)))
            {
                CityTitle title = (CityTitle)i;

                if (title == CityTitle.None)
                {
                    continue;
                }

                if (!Citizenship.HasTitle(User, title))
                {
                    AddButton(60, y + 5, 2103, 2104, i + 1, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(75, y, 300, 16, CityLoyaltySystem.GetTitleLocalization(User, title, Citizenship.City), false, false);
                    y += 20;
                }
            }

            y += 40;
            AddHtmlLocalized(30, y, 285, 60, 1152896, false, false);
            /*Click the gem next to an available title for more information about obtaining that title.*/
        }
Exemplo n.º 7
0
        void ReleaseDesignerOutlets()
        {
            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (CityView != null)
            {
                CityView.Dispose();
                CityView = null;
            }

            if (CityTitle != null)
            {
                CityTitle.Dispose();
                CityTitle = null;
            }
        }
Exemplo n.º 8
0
        public int GetTitleCost(CityTitle title)
        {
            switch (title)
            {
            default:
            case CityTitle.Citizen: return(0);

            case CityTitle.Knight:  return(10000);

            case CityTitle.Baronet: return(100000);

            case CityTitle.Baron:   return(1000000);

            case CityTitle.Viscount: return(2000000);

            case CityTitle.Earl:    return(5000000);

            case CityTitle.Marquis: return(10000000);

            case CityTitle.Duke:    return(50000000);
            }
        }
Exemplo n.º 9
0
        public LoyaltyRating GetMinimumRating(CityTitle title)
        {
            switch (title)
            {
            default:
            case CityTitle.Citizen: return(LoyaltyRating.Disfavored);

            case CityTitle.Knight: return(LoyaltyRating.Commended);

            case CityTitle.Baronet: return(LoyaltyRating.Esteemed);

            case CityTitle.Baron: return(LoyaltyRating.Respected);

            case CityTitle.Viscount: return(LoyaltyRating.Admired);

            case CityTitle.Earl: return(LoyaltyRating.Adored);

            case CityTitle.Marquis: return(LoyaltyRating.Revered);

            case CityTitle.Duke: return(LoyaltyRating.Venerated);
            }
        }
Exemplo n.º 10
0
        private static int TitleIndex(CityTitle title, bool female)
        {
            switch (title)
            {
            default:
            case CityTitle.Citizen: return(!female ? 0 : 1);

            case CityTitle.Knight:  return(!female ? 2 : 3);

            case CityTitle.Baronet: return(!female ? 4 : 5);

            case CityTitle.Baron:   return(!female ? 6 : 7);

            case CityTitle.Viscount: return(!female ? 8 : 9);

            case CityTitle.Earl:    return(!female ? 10 : 11);

            case CityTitle.Marquis: return(!female ? 12 : 13);

            case CityTitle.Duke:    return(!female ? 14 : 15);
            }
        }
Exemplo n.º 11
0
		public virtual bool HasTitle(Mobile from, CityTitle title)
		{
			CityLoyaltyEntry entry = GetPlayerEntry<CityLoyaltyEntry>(from);
			
			if(entry == null)
				return false;
			
			return (entry.Titles & title) != 0;
		}
Exemplo n.º 12
0
 public CityTitlesInfoGump(PlayerMobile pm, CityTitle title) : base(pm)
 {
     Title = title;
 }
Exemplo n.º 13
0
		public int GetTitleCost(CityTitle title)
		{
			switch(title)
			{
				default:
				case CityTitle.Citizen: return 0;
				case CityTitle.Knight:	return 10000;
				case CityTitle.Baronet:	return 100000;
				case CityTitle.Baron:	return 1000000;
				case CityTitle.Viscount:return 2000000;
				case CityTitle.Earl:	return 5000000;
				case CityTitle.Marquis:	return 10000000;
				case CityTitle.Duke:	return 50000000;
			}
		}
Exemplo n.º 14
0
		public bool HasMinRating(Mobile from, CityTitle title)
		{
            CityLoyaltyEntry entry = GetPlayerEntry<CityLoyaltyEntry>(from);
			
			if(entry == null)
				return false;
				
			return entry.LoyaltyRating >= GetMinimumRating(title);
		}
Exemplo n.º 15
0
		public LoyaltyRating GetMinimumRating(CityTitle title)
		{
			switch(title)
			{
                default:
				case CityTitle.Citizen: return LoyaltyRating.Disfavored;
				case CityTitle.Knight: return LoyaltyRating.Commended;
				case CityTitle.Baronet: return LoyaltyRating.Esteemed;
				case CityTitle.Baron: return LoyaltyRating.Respected;
				case CityTitle.Viscount: return LoyaltyRating.Admired;
				case CityTitle.Earl: return LoyaltyRating.Adored;
				case CityTitle.Marquis: return LoyaltyRating.Revered;
				case CityTitle.Duke: return LoyaltyRating.Venerated;
			}
		}
Exemplo n.º 16
0
 public CityTitlesInfoGump(PlayerMobile pm, CityTitle title) : base(pm)
 {
     Title = title;
     AddGumpLayout();
 }
Exemplo n.º 17
0
 public static int GetTitleLocalization(Mobile from, CityTitle title, City city)
 {
     return((1152739 + (int)city * 16) + TitleIndex(title, from.Female));
 }
Exemplo n.º 18
0
		public static int GetTitleLocalization(Mobile from, CityTitle title, City city)
		{
            return (1152739 + (int)city * 16) + TitleIndex(title, from.Female);
		}
Exemplo n.º 19
0
		public virtual void AddTitle(Mobile from, CityTitle title)
		{
            CityLoyaltyEntry entry = GetPlayerEntry<CityLoyaltyEntry>(from);
			
			if(entry == null)
				return;

            entry.AddTitle(title);
		}
Exemplo n.º 20
0
        private static int TitleIndex(CityTitle title, bool female)
        {
            switch(title)
			{
                default:
                case CityTitle.Citizen: return !female ? 0 : 1;
				case CityTitle.Knight:	return !female ? 2 : 3;
                case CityTitle.Baronet: return !female ? 4 : 5;
				case CityTitle.Baron:	return !female ? 6 : 7;
				case CityTitle.Viscount:return !female ? 8 : 9;
				case CityTitle.Earl:	return !female ? 10 : 11;
                case CityTitle.Marquis: return !female ? 11 : 12;
				case CityTitle.Duke:	return !female ? 13 : 14;
			}
        }
Exemplo n.º 21
0
		public virtual void AddTitle(CityTitle title)
		{
            if ((Titles & title) == 0)
            {
                int loc = CityLoyaltySystem.GetTitleLocalization(Player, title, City);
                Player.AddCollectionTitle(loc);

                Titles |= title;
                Player.SendLocalizedMessage(1073625, String.Format("#{0}", loc.ToString())); // The title "~1_TITLE~" has been bestowed upon you.
            }
		}