コード例 #1
0
ファイル: GuardCaptain.cs プロジェクト: ygtkms/ServUO
            public InternalEntry(PlayerMobile from, GuardCaptain guard)
                : base(1152366, 3) // City Banner
            {
                Player = from;
                Guard  = guard;

                Enabled = CityLoyaltySystem.HasCitizenship(from, Guard.City);
            }
コード例 #2
0
ファイル: Banners.cs プロジェクト: ygtkms/ServUO
        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.
                }
            }
        }
コード例 #3
0
ファイル: GuardCaptain.cs プロジェクト: ygtkms/ServUO
            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));
                    }
                }
            }