Beispiel #1
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            int           gold   = Citizenship.GetTitleCost(Title);
            LoyaltyRating rating = Citizenship.GetMinimumRating(Title);

            AddHtmlLocalized(60, 40, 300, 20, 1152901, false, false); // Obtain Title
            AddHtmlLocalized(75, 60, 200, 16, CityLoyaltySystem.GetTitleLocalization(User, Title, Citizenship.City), false, false);

            AddHtmlLocalized(60, 120, 200, 16, 1152899, false, false);             // Loyalty Required:
            AddHtmlLocalized(60, 140, 200, 16, 1152900, false, false);             // Donation Required:

            AddHtmlLocalized(200, 120, 150, 16, CityLoyaltySystem.RatingLocalization(Citizenship.GetMinimumRating(Title)), false, false);
            AddHtml(200, 140, 150, 16, Citizenship.GetTitleCost(Title).ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("en-US")), false, false);

            if (gold > Banker.GetBalance(User))
            {
                AddHtmlLocalized(30, 180, 280, 80, 1152902, false, false);
                // You do not have enough funds in your bank box to donate for this title.
            }
            else if (rating > Citizenship.GetLoyaltyRating(User))
            {
                AddHtmlLocalized(30, 180, 280, 80, 1152903, false, false);
                // You do not have the required minimum loyalty rating to receive this title.
            }
            else
            {
                AddHtmlLocalized(60, 345, 150, 16, 1152904, false, false); // Gain Title
                AddButton(40, 350, 2103, 2104, 1, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(60, 365, 150, 16, 1152889, false, false); // Cancel
            AddButton(40, 370, 2103, 2104, 2, GumpButtonType.Reply, 0);
        }
Beispiel #2
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.
            }
        }
Beispiel #3
0
        public void RenounceCitizenship()
        {
            foreach (int i in Enum.GetValues(typeof(CityTitle)))
            {
                Player.RemoveRewardTitle(CityLoyaltySystem.GetTitleLocalization(Player, (CityTitle)i, City), true);
            }

            Player.RemoveRewardTitle(1154017, true);

            IsCitizen = false;
            Titles    = CityTitle.None;
        }
Beispiel #4
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.*/
        }