Ejemplo n.º 1
0
        public static int GetLuckChance(Mobile killer, Mobile victim)
        {
            if (!Core.AOS)
            {
                return(0);
            }

            int luck = killer.Luck;

            luck += FountainOfFortune.GetLuckBonus(killer);

            PlayerMobile pmKiller = killer as PlayerMobile;

            if (pmKiller != null && pmKiller.SentHonorContext != null && pmKiller.SentHonorContext.Target == victim)
            {
                luck += pmKiller.SentHonorContext.PerfectionLuckBonus;
            }

            if (luck < 0)
            {
                return(0);
            }

            if (!Core.SE && luck > 1200)
            {
                luck = 1200;
            }

            return(GetLuckChance(luck));
        }
Ejemplo n.º 2
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m.Alive && !m.IsDeadBondedPet && m.AccessLevel == AccessLevel.Player && !m.Hidden && !TransformationSpellHelper.UnderTransformation(m, typeof(EtherealVoyageSpell)))
            {
                if (0.2 > Utility.RandomDouble() && !m_TangleCooldown.Contains(m) && InRange(m, 6) && !FountainOfFortune.UnderProtection(m))
                {
                    m.Frozen = true;
                    m.MoveToWorld(Location, Map);

                    m.PlaySound(0x1FE);
                    m.SendLocalizedMessage(1111641); // You become entangled in the acid drenched roots.

                    m_TangleCooldown.Add(m);

                    Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(3, 6)), Untangle, m);
                    Timer.DelayCall(TimeSpan.FromSeconds(15.0), RemoveCooldown, m);
                }

                if (m.InRange(this, 1) && !m_DamageTable.ContainsKey(m))
                {
                    // Should start the timer
                    m_DamageTable[m] = Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), DoDamage, m);
                }
            }
        }
Ejemplo n.º 3
0
        private void TryInfect(Mobile attacker)
        {
            if (!m_BloodDiseaseTable.ContainsKey(attacker) && this.InRange(attacker, 1) && 0.25 > Utility.RandomDouble() && !FountainOfFortune.UnderProtection(attacker))
            {
                // The rotworm has infected you with blood disease!!
                attacker.SendLocalizedMessage(1111672, "", 0x25);

                attacker.PlaySound(0x213);
                Effects.SendTargetParticles(attacker, 0x373A, 1, 15, 0x26B9, EffectLayer.Head);

                BloodDiseaseTimer timer = new BloodDiseaseTimer(attacker);
                timer.Start();

                // TODO: 2nd cliloc
                BuffInfo.AddBuff(attacker, new BuffInfo(BuffIcon.RotwormBloodDisease, 1153798, 1153798));

                m_BloodDiseaseTable.Add(attacker, timer);
            }
        }
Ejemplo n.º 4
0
        private void TryInfect(Mobile attacker)
        {
            if (!m_AnemiaTable.ContainsKey(attacker) && this.InRange(attacker, 1) && 0.25 > Utility.RandomDouble() && !FountainOfFortune.UnderProtection(attacker))
            {
                // The creature's attack weakens you. You have become anemic.
                attacker.SendLocalizedMessage(1111669, "", 0x25);

                attacker.PlaySound(0x213);
                Effects.SendTargetParticles(attacker, 0x373A, 1, 15, 0x26B9, EffectLayer.Head);

                AnemiaTimer timer = new AnemiaTimer(attacker);
                timer.Start();

                int str = attacker.RawStr / 3;
                int dex = attacker.RawDex / 3;
                int Int = attacker.RawInt / 3;

                attacker.AddStatMod(new StatMod(StatType.Str, "BloodWorm_Str", str, TimeSpan.FromSeconds(60)));
                attacker.AddStatMod(new StatMod(StatType.Dex, "BloodWorm_Dex", dex, TimeSpan.FromSeconds(60)));
                attacker.AddStatMod(new StatMod(StatType.Int, "BloodWorm_Int", Int, TimeSpan.FromSeconds(60)));

                // -~1_STR~ strength.<br>-~2_INT~ intelligence.<br>-~3_DEX~ dexterity.<br> Drains all stamina.
                BuffInfo.AddBuff(attacker, new BuffInfo(BuffIcon.BloodwormAnemia, 1153797, 1153824, String.Format("{0}\t{1}\t{2}", str, dex, Int)));

                m_AnemiaTable.Add(attacker, timer);
            }
        }