Exemple #1
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     if (City != null)
     {
         list.Add(1153887, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(City.City)));
     }
 }
Exemple #2
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            if (City == null)
            {
                return;
            }

            AddHtmlLocalized(30, 40, 285, 200, 1152891, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(City.City).ToString()), 1, false, true);

            /*If you choose to declare citizenship with ~1_CITY~, you will be granted the "Citizen" title.
             * If your loyalty rating to ~1_CITY~ is high enough, you will be able to receive titles with
             * that city.<br><br>You may only have citizenship in one city at a time. You may renounce
             * citizenship at any time. After renouncing citizenship, you must wait one week before declaring
             * citizenship again.<br><br>Note that gaining city titles requires positive loyalty with your city,
             * and you will be required to donate funds to the city's coffers.<br><br>Are you sure you wish to
             * declare citizenship with ~1_CITY~?*/

            AddHtmlLocalized(115, 280, 150, 16, 1152892, false, false); // Declare Citizenship
            AddButton(100, 285, 2103, 2104, 1, GumpButtonType.Reply, 0);

            AddHtmlLocalized(115, 300, 150, 16, 1152889, false, false); // Cancel
            AddButton(100, 305, 2103, 2104, 2, GumpButtonType.Reply, 0);
        }
Exemple #3
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     if (City != null)
     {
         list.Add(1153887, $"#{CityLoyaltySystem.GetCityLocalization(City.City)}");
     }
 }
Exemple #4
0
        public bool TryTurnIn(Mobile from, TradeOrderCrate order, Mobile turninMobile)
        {
            if (order == null || from == null || turninMobile == null || order.Entry == null)
            {
                return(false);
            }

            TradeEntry entry = order.Entry;

            if (from.AccessLevel == AccessLevel.Player && turninMobile is TradeMinister minister && minister.City != entry.Destination)
            {
                turninMobile.SayTo(from, 1151738, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(entry.Destination))); // Begging thy pardon, but those goods are destined for the City of ~1_city~
            }
Exemple #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                CityLoyaltySystem sys = CityLoyaltySystem.GetCityInstance(City);

                if (CityLoyaltySystem.HasCitizenship(from, City) && sys.GetLoyaltyRating(from) >= LoyaltyRating.Commended)
                {
                    base.OnDoubleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(1152361, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(City))); // You are not sufficiently loyal to ~1_CITY~ to use this.
                }
            }
        }
Exemple #6
0
        public bool TryTurnIn(Mobile from, TradeOrderCrate order, Mobile turninMobile)
        {
            if (order == null || from == null || turninMobile == null || order.Entry == null)
            {
                return(false);
            }

            TradeEntry    entry    = order.Entry;
            TradeMinister minister = turninMobile as TradeMinister;

            if (from.AccessLevel == AccessLevel.Player && minister != null && minister.City != entry.Destination)
            {
                turninMobile.SayTo(from, 1151738, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(entry.Destination))); // Begging thy pardon, but those goods are destined for the City of ~1_city~
            }
            else if (!order.Fulfilled)
            {
                turninMobile.SayTo(from, 1151732); // This trade order has not been fulfilled.  Fill the trade order with all necessary items and try again.
            }
            else
            {
                CityLoyaltySystem.OnTradeComplete(from, order.Entry);
                CityTradeEntry pentry = GetPlayerEntry <CityTradeEntry>(from as PlayerMobile);

                if (pentry != null)
                {
                    pentry.Points++;
                    pentry.DistanceTraveled += entry.Distance;
                    pentry.Completed++;
                    CheckTitle(pentry);
                }

                order.Delete();
                return(true);
            }

            return(false);
        }
Exemple #7
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            if (Citizenship == null)
            {
                return;
            }

            AddHtmlLocalized(45, 40, 250, 16, 1152883, false, false); // Citizenship:
            AddHtmlLocalized(200, 40, 100, 16, CityLoyaltySystem.CityLocalization(Citizenship.City), false, false);

            AddHtmlLocalized(30, 70, 280, 200, 1152887, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(Citizenship.City).ToString()), 1, false, true);

            /*If you renounce your citizenship, you will be stripped of all titles gained with your current
             * city, and you must wait 7 days before declaring citizenship again.<br><br>Are you sure you wish
             * to renounce your citizenship with ~1_CITY~?*/

            AddHtmlLocalized(115, 280, 150, 16, 1152888, false, false); // Renounce Citizenship
            AddButton(100, 285, 2103, 2104, 1, GumpButtonType.Reply, 0);

            AddHtmlLocalized(115, 300, 150, 16, 1152889, false, false); // Cancel
            AddButton(100, 305, 2103, 2104, 2, GumpButtonType.Reply, 0);
        }
Exemple #8
0
            public override void OnClick()
            {
                CityLoyaltySystem thisSystem  = CityLoyaltySystem.GetCityInstance(Guard.City);
                CityLoyaltySystem theirSystem = CityLoyaltySystem.GetCitizenship(Player);

                Guard.CheckBannerCooldown();

                if (theirSystem != null && thisSystem != null && CityLoyaltySystem.HasCitizenship(Player, Guard.City))
                {
                    if (Guard.IsInBannerCooldown(Player))
                    {
                        Guard.SayTo(Player, 1152364, String.Format("#{0}", CityLoyaltySystem.BannerLocalization(thisSystem.City))); // I have quite a backlog of orders and I cannot satisfy your request for a ~1_ITEM~ right now.
                    }
                    if (theirSystem.GetLoyaltyRating(Player) < LoyaltyRating.Adored)
                    {
                        Guard.SayTo(Player, 1152363, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(thisSystem.City))); // I apologize, but you are not well-enough renowned in the city of ~1_CITY~ to make this purchase.
                    }
                    else
                    {
                        string args = String.Format("#{0}\t{1}", CityLoyaltySystem.BannerLocalization(thisSystem.City), CityLoyaltySystem.BannerCost.ToString("N0", CultureInfo.GetCultureInfo("en-US")));
                        Player.SendGump(new ConfirmCallbackGump(Player, 1049004, 1152365, Player, args, Guard.OnConfirm));
                    }
                }
            }