示例#1
0
        public static void RegisterKill(Mobile attacker, BaseCreature killed, int count)
        {
            int points = Math.Min(60, Math.Max(1, (killed.Fame / 5000) * 10)) / count;

            if (attacker != null && HuntTable.ContainsKey(attacker))
            {
                bool gainedPath = false;

                if (VirtueHelper.Award(attacker, VirtueName.Humility, points, ref gainedPath))
                {
                    if (gainedPath)
                    {
                        attacker.SendLocalizedMessage(1155811); // You have gained a path in Humility!
                    }
                    else
                    {
                        attacker.SendLocalizedMessage(1155809); // You have gained in Humility!
                    }
                }
                else
                {
                    attacker.SendLocalizedMessage(1155808); // You cannot gain more Humility.
                }
            }
        }
示例#2
0
        public static void HumilityHunt(Mobile from)
        {
            if (!from.Alive)
            {
                return;
            }

            if (HuntTable.ContainsKey(from))
            {
                if (!HuntTable[from].Expiring)
                {
                    HuntTable[from].Expiring = true;
                    from.SendLocalizedMessage(1155800); // You have ended your journey on the Path of Humility.
                }
                else
                {
                    from.SendLocalizedMessage(1155796); // You have already ended your journey on the Path of Humility.  You must wait before you restart your path.
                }
            }
            else
            {
                PlayerMobile pm = from as PlayerMobile;

                if (pm != null)
                {
                    HuntTable[pm] = new HumilityHuntContext(pm, new List <Mobile>(pm.AllFollowers));

                    pm.SendLocalizedMessage(1155802, "70"); // You have begun your journey on the Path of Humility.  Your resists have been debuffed by ~1_DEBUFF~.
                    pm.SendLocalizedMessage(1155858);       // You are now on a Humility Hunt. For each kill while you forgo the protection of resists," you shall continue on your path to Humility.  You may end your Hunt by speaking ""Lum Lum Lum"" at any time.

                    BuffInfo.AddBuff(pm, new BuffInfo(BuffIcon.HumilityDebuff, 1025327, 1155806, "70"));
                }
            }
        }
示例#3
0
 public static void TryAddPetToHunt(Mobile owner, Mobile pet)
 {
     if (HuntTable.ContainsKey(owner) && pet is BaseCreature creature && creature.GetMaster() == owner)
     {
         HuntTable[owner].AddPet(creature);
     }
 }
示例#4
0
 public static void OnHuntExpired(Mobile m)
 {
     Timer.DelayCall(TimeSpan.FromSeconds(60), () =>
     {
         if (HuntTable.ContainsKey(m))
         {
             HuntTable.Remove(m);
         }
     });
 }
示例#5
0
 public static bool IsInHunt(PlayerMobile pm)
 {
     return(HuntTable.ContainsKey(pm));
 }
示例#6
0
 public static bool IsInHunt(Mobile m)
 {
     return(HuntTable != null && HuntTable.ContainsKey(m));
 }