Example #1
0
        private void IncreaseStage(int newStage)
        {
            if (newStage > 0)
            {
                RemoveCurrentTCMessage();
            }

            if (newStage < Stages)
            {
                var cityInstance = CityLoyaltySystem.GetCityInstance(CityOrder[newStage]);

                if (cityInstance != null && cityInstance.Treasury >= (long)_DefaultCityGold)
                {
                    Stage++;
                    AddCurrentTCMessage();
                }
                else
                {
                    IncreaseStage(++newStage);
                }
            }
            else
            {
                Deactivate();
            }
        }
Example #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCreature bc)
                {
                    Type t = bc.GetType();

                    if (bc.Controlled && !bc.Summoned && bc.GetMaster() == from)
                    {
                        if (Item.Table.ContainsKey(t))
                        {
                            CityLoyaltySystem sys = CityLoyaltySystem.GetCityInstance(Item.City);

                            if (sys != null)
                            {
                                bc.Delete();
                                sys.AwardLove(from, Item.Table[t]);

                                Item.SendMessageTo(from, 1152926); // The City thanks you for your generosity!
                            }
                        }
                        else
                        {
                            Item.SendMessageTo(from, 1152929); // That does not look like an animal the City is in need of.
                        }
                    }
                    else
                    {
                        Item.SendMessageTo(from, 1152930); // Erm. Uhh. I don't think that'd enjoy the stables much...
                    }
                }
                else
                {
                    Item.SendMessageTo(from, 1152930); // Erm. Uhh. I don't think that'd enjoy the stables much...
                }
            }
Example #3
0
            public override void OnClick()
            {
                if (Player.Prompt != null)
                {
                    Player.SendLocalizedMessage(1079166); // You already have a text entry request pending.
                }
                else
                {
                    Player.SendLocalizedMessage(1155865); // Enter amount to deposit:
                    Player.BeginPrompt(
                        (from, text) =>
                    {
                        int amount = Utility.ToInt32(text);

                        if (amount > 0)
                        {
                            if (Banker.Withdraw(from, amount, true))
                            {
                                CityLoyaltySystem.GetCityInstance(Herald.City).AddToTreasury(from, amount, true);

                                Herald.SayTo(from, 1152926);     // The City thanks you for your generosity!
                            }
                            else
                            {
                                from.SendLocalizedMessage(1155867);     // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1155867);     // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction.
                        }
                    },
                        (from, text) =>
                    {
                        from.SendLocalizedMessage(1155867);     // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction.
                    });
                }
            }
Example #4
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));
                    }
                }
            }