示例#1
0
文件: Gumps.cs 项目: pallop/Servuo
        public BaseCityGump(PlayerMobile pm) : base(120, 120)
        {
            User        = pm;
            Citizenship = CityLoyaltySystem.GetCitizenship(User, false);

            pm.CloseGump(typeof(BaseCityGump));
        }
示例#2
0
        public static void OnSpawnCreatureKilled(BaseCreature killed, int spawnLevel)
        {
            if (!Enabled || killed == null)
            {
                return;
            }

            List <DamageStore> rights = killed.GetLootingRights();

            rights.ForEach(store =>
            {
                CityLoyaltySystem city = CityLoyaltySystem.GetCitizenship(store.m_Mobile);

                if (city != null)
                {
                    city.AwardLove(store.m_Mobile, 1 * (spawnLevel + 1), 0.10 > Utility.RandomDouble());
                }
            });
        }
示例#3
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));
                    }
                }
            }