Ejemplo n.º 1
0
        public static void OnBODTurnIn(Mobile from, int gold)
        {
            if (!Enabled)
            {
                return;
            }

            CityLoyaltySystem city = Cities.FirstOrDefault(c => c.Definition.Region != null && c.Definition.Region.IsPartOf(from.Region));

            if (city != null)
            {
                city.AwardLove(from, Math.Max(10, gold / 100));
            }
        }
Ejemplo n.º 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());
                }
            });
        }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCreature)
                {
                    BaseCreature bc = targeted as BaseCreature;
                    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...
                }
            }