private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            IPooledEnumerable eable = this.GetMobilesInRange(6);

            foreach (Mobile m in eable)
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m, RelationshipFilter.None))
                {
                    list.Add(m);
                }
            }
            eable.Free();

            if (list.Count == 0)
            {
                this.Say(true, "Thou art but leaping back from the inevitable, mortal!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);
                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                this.Say(true, "If I cannot cleanse thy soul, I will destroy it!");
            }
        }
Beispiel #2
0
        private void DoAreaLeech_Finish()
        {
            ArrayList         list  = new ArrayList();
            IPooledEnumerable eable = GetMobilesInRange(6);

            foreach (Mobile m in eable)
            {
                if (CanBeHarmful(m) && IsEnemy(m))
                {
                    list.Add(m);
                }
            }
            eable.Free();

            if (list.Count == 0)
            {
                Say(true, "Bah! You have escaped my grasp this time, mortal!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    DoHarmful(m);
                    Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                Say(true, "If I cannot cleanse thy soul, I will destroy it!");
            }
        }
        private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m))
                {
                    list.Add(m);
                }
            }

            if (list.Count == 0)
            {
                this.Say(true, "From dark grounds i will rise again!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);
                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                this.Say(true, "The true path to Order is through Chaos!");
            }
        }
Beispiel #4
0
        private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(6))
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m))
                {
                    list.Add(m);
                }
            }

            if (list.Count == 0)
            {
                this.Say(true, "So you flee from my power do you?");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.50;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.20;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);
                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                this.Say(true, "Yes, I devour your essence, muhahahaha!");
            }
        }
        private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(6))
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m))
                {
                    list.Add(m);
                }
            }

            if (list.Count == 0)
            {
                this.Say(true, "Come back here and give me your life force!  You do not need it!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.50;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.40;
                }
                else
                {
                    scalar = 0.20;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);
                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                this.Say(true, "Ah the joys of feasting on such life!");
            }
        }
Beispiel #6
0
        private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(6))
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m))
                {
                    list.Add(m);
                }
            }

            if (list.Count == 0)
            {
                this.Say(true, "I will Summon the white mages");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);
                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }

                this.Say(true, "the power of Ice will vanquish thee!");
            }
        }
Beispiel #7
0
        private void DoAreaLeech_Finish()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(6))
            {
                if (this.CanBeHarmful(m) && this.IsEnemy(m))
                {
                    list.Add(m);
                }
            }

            if (list.Count == 0)
            {
                this.Say(true, "Ah the chase is on. Your blood will be mine soon!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = (Mobile)list[i];

                    int damage = (int)(m.Hits * scalar);

                    damage += Utility.RandomMinMax(-5, 5);

                    if (damage < 1)
                    {
                        damage = 1;
                    }

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 1150, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 1150, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    this.DoHarmful(m);

                    this.Hits += AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
                }
                this.Say(true, "If I cannot have thine blood then I shall destroy thee!");
            }
        }
Beispiel #8
0
        private void DoFocusedLeech_Stage2(Mobile combatant)
        {
            if (CanBeHarmful(combatant))
            {
                combatant.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                combatant.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                PlaySound(0x209);
                DoHarmful(combatant);
                Hits += AOS.Damage(combatant, this, Utility.RandomMinMax(30, 40) - (Core.AOS ? 0 : 10), 100, 0, 0, 0, 0);
            }
        }
Beispiel #9
0
        private void DoFocusedLeech_Stage2(object state)
        {
            Mobile combatant = (Mobile)state;

            if (this.CanBeHarmful(combatant))
            {
                combatant.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                combatant.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                this.PlaySound(0x209);
                this.DoHarmful(combatant);
                this.Hits += AOS.Damage(combatant, this, Utility.RandomMinMax(30, 40), 100, 0, 0, 0, 0);
            }
        }
Beispiel #10
0
        private void DoFocusedLeech_Stage2(Mobile combatant)
        {
            if (CanBeHarmful(combatant))
            {
                combatant.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                combatant.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                PlaySound(0x209);
                DoHarmful(combatant);
                int damageDone = Utility.RandomMinMax(20, 30);
                combatant.Damage(damageDone, this);
                Hits += damageDone;
            }
        }
        public override void OnThink()
        {
            if (m_Victim != null && m_Victim.InRange(this, 8) && CanBeHarmful(m_Victim))
            {
                this.Freeze(TimeSpan.FromSeconds(2.0));
                m_Victim.Freeze(TimeSpan.FromSeconds(2.0));
                m_Victim.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                m_Victim.Hits -= 2;
                this.Hits     += 2;

                if (m_Victim.Hits == 0)
                {
                    m_Victim.Kill();
                    m_Victim = null;
                }
            }
            else
            {
                m_Victim = null;
            }

            if (m_Victim == null && DateTime.Now >= m_NextPlayer)
            {
                Mobile combatant = this.Combatant;

                if (combatant != null && combatant.Player && combatant.Map == this.Map && combatant.InRange(this, 20))
                {
                    m_NextPlayer = DateTime.Now + TimeSpan.FromSeconds(20.0);

                    m_Victim = combatant;
                }
            }
            base.OnThink();
        }
Beispiel #12
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage = GetNewAosDamage(40, 1, 5, m);

                // Do the effects
                source.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                source.PlaySound(0x20A);

                // Deal the damage
                SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
Beispiel #13
0
        // note that this method will be called when attached to either a mobile or a weapon
        // when attached to a weapon, only that weapon will do additional damage
        // when attached to a mobile, any weapon the mobile wields will do additional damage
        public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
        {
            // if it is still refractory then return
            if (DateTime.UtcNow < this.m_EndTime)
            {
                return;
            }

            int damage = 0;

            if (this.m_Damage > 0)
            {
                damage = Utility.Random(this.m_Damage);
            }

            if (defender != null && attacker != null && damage > 0)
            {
                attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                attacker.PlaySound(0x15E);

                SpellHelper.Damage(TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0);

                this.m_EndTime = DateTime.UtcNow + this.Refractory;
            }
        }
Beispiel #14
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect(CirclePower, ref source, ref m);

                double damage = DamagingSkill(Caster) / 3;
                if (damage > 80)
                {
                    damage = 80.0;
                }
                if (damage < 2)
                {
                    damage = 2.0;
                }

                source.MovingParticles(m, 0x36E4, 7, 0, false, true, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xBB3), 0, 9502, 4019, 0x160, 0);
                source.PlaySound(0x650);

                SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
                Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, false);
            }

            FinishSequence();
        }
Beispiel #15
0
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                Mobile source = this.Caster;

                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage;

                damage = Utility.Random(10, 7);

                if (this.CheckResisted(m))
                {
                    damage *= 0.75;

                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                }

                damage *= this.GetDamageScalar(m);

                source.MovingParticles(m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                source.PlaySound(Core.AOS ? 0x15E : 0x44B);

                SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0);
            }

            this.FinishSequence();
        }
Beispiel #16
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage = Utility.Random(4, 4);

                if (CheckResisted(m))
                {
                    damage *= 0.75;

                    m.SendLocalizedMessage(501783);                       // You feel yourself resisting magical energy.
                }

                damage *= GetDamageScalar(m);

                source.MovingParticles(m, 0x36E4, 5, 0, false, false, 3006, 0, 0);
                source.PlaySound(0x1E5);

                SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0);
            }

            FinishSequence();
        }
Beispiel #17
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.CheckReflect((int)Circle, ref source, ref m);

                double damage;

                if (Scroll != null)
                {
                    damage = 8 + ((int)(GetDamageSkill(Caster) - GetResistSkill(m)) / 15);
                }
                else
                {
                    damage = 1 + ((int)(GetDamageSkill(Caster) - GetResistSkill(m)) / 15);
                }

                source.MovingParticles(m, 0x36E4, 5, 0, false, false, 3006, 3006, 0, 0);
                source.PlaySound(Sound);

                SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
            }
            FinishSequence();
        }
Beispiel #18
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

                SpellHelper.CheckReflect((int)this.Circle, ref source, ref m);

                double damage;
                damage = (((1 * Utility.Random(1, 3)) + 3) * (50 + Caster.Skills[SkillName.Magery].Value)) / 100;

                if (CheckResisted(m, damage))
                {
                    damage = (damage + 1) / 2;
                    m.SendAsciiMessage("You feel yourself resisting magical energy."); // You feel yourself resisting magical energy.
                }

                damage *= GetDamageScalar(m);

                source.MovingParticles(m, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
                source.PlaySound(0x1E5);

                SpellHelper.Damage(this, m, damage, 0, 100, 0, 0, 0);
            }

            FinishSequence();
        }
Beispiel #19
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null)
            {
                return;
            }

            // if it is still refractory then return
            if (DateTime.Now < m_EndTime)
            {
                return;
            }

            int damage = 0;

            if (m_Damage > 0)
            {
                damage = Utility.Random(m_Damage);
            }

            if (damage > 0)
            {
                m.MovingParticles(m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                m.PlaySound(0x15E);
            }

            m_EndTime = DateTime.Now + Refractory;
        }
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(Caster, m);

                double damage = (Utility.Random(28, 23) + Utility.Random(5, 1));

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783);                       // You feel yourself resisting magical energy.
                    damage *= .4;
                }

                //sound damage, all resistances
                SpellHelper.Damage(this, m, damage, 20, 20, 20, 20, 20);

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Head);
                source.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                m.PlaySound(0x1EA);
            }

            FinishSequence();
        }
Beispiel #21
0
		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			// if it is still refractory then return
			if (DateTime.UtcNow < m_EndTime)
			{
				return;
			}

			int damage = 0;

			if (m_Damage > 0)
			{
				damage = Utility.Random(m_Damage);
			}

			if (defender != null && attacker != null && damage > 0)
			{
				attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
				attacker.PlaySound(0x15E);

				//SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 100, 0, 0, 0 );
				SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage);

				m_EndTime = DateTime.UtcNow + Refractory;
			}
		}
Beispiel #22
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null)
            {
                return;
            }

            // if it is still refractory then return
            if (DateTime.UtcNow < this.m_EndTime)
            {
                return;
            }

            int damage = 0;

            if (this.m_Damage > 0)
            {
                damage = Utility.Random(this.m_Damage);
            }

            if (damage > 0)
            {
                m.MovingParticles(m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                m.PlaySound(0x15E);
                SpellHelper.Damage(TimeSpan.Zero, m, damage, 0, 100, 0, 0, 0);
            }

            this.m_EndTime = DateTime.UtcNow + this.Refractory;
        }
Beispiel #23
0
        // Apply damage as Fireball damage, not physical sticky-pokey-arrow damage
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            attacker.MovingParticles(defender, EffectID, 7, 1, false, true, 9502, 4019, 0x160);
            attacker.PlaySound(Core.AOS ? 0x15E : 0x44B);

            SpellHelper.CheckReflect((int)SpellCircle.Third, ref attacker, ref defender);

            double damage;

            Server.Spells.Third.FireballSpell tempFireball = new Server.Spells.Third.FireballSpell(attacker, null);

            if (Core.AOS)
            {
                damage = tempFireball.GetNewAosDamage(19, 1, 5, defender);
            }
            else
            {
                damage = Utility.Random(10, 7);

                if (tempFireball.CheckResisted(defender))
                {
                    damage *= 0.75;

                    defender.SendLocalizedMessage(501783);   // You feel yourself resisting magical energy.
                }

                // TODO: Scale the damage somehow, because stock Fireball is bleh.
                // Use Magery & EvalInt, like the Fireball Spell? Use Archery & Tactics? Combination? I don't know.
                // Pretend it's a standard fireball spell for now. Naturally mages would get more damage out of a magical artifact?
                damage *= (tempFireball.GetDamageScalar(defender) * 2);
            }

            SpellHelper.Damage(tempFireball, defender, damage, 0, 100, 0, 0, 0);
        }
Beispiel #24
0
        public virtual void WrathOfFray_OnTarget(Mobile from, object target)
        {
            if (!from.CanSee(target))
            {
                from.SendLocalizedMessage(500237);                   //Target cannot be seen.
            }
            else if (target is Mobile)
            {
                Mobile t = (Mobile)target;

                from.MovingParticles(t, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                from.PlaySound(0x307);
                t.PlaySound(0x307);

                AOS.Damage(t, from, Utility.RandomMinMax(25, 45), 20, 20, 20, 20, 20, false);

                this.Delete();
            }
            else
            {
                from.SendMessage("This spell will not work on that.");
            }

            from.Frozen = false;
        }
Beispiel #25
0
        public void Target(IDamageable m)
        {
            Mobile mob = m as Mobile;

            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                Mobile source = this.Caster;
                SpellHelper.Turn(this.Caster, m);

                if (mob != null)
                {
                    if (SpellHelper.CheckReflect((int)this.Circle, ref source, ref mob))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
                        {
                            source.MovingParticles(mob, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                            source.PlaySound(0x20A);
                        });
                    }
                }

                double damage = 0;

                if (Core.AOS)
                {
                    damage = GetNewAosDamage(40, 1, 5, m);
                }
                else if (mob != null)
                {
                    damage = Utility.Random(24, 18);

                    if (this.CheckResisted(mob))
                    {
                        damage *= 0.75;

                        mob.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                    }

                    // Scale damage based on evalint and resist
                    damage *= this.GetDamageScalar(mob);
                }

                // Do the effects
                this.Caster.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                this.Caster.PlaySound(0x20A);

                if (damage > 0)
                {
                    // Deal the damage
                    SpellHelper.Damage(this, mob != null ? mob : m, damage, 0, 0, 0, 0, 100);
                }
            }

            this.FinishSequence();
        }
        public static void ThrowBomb(Mobile m, Mobile bomber)
        {
            m.DoHarmful(m);

            bomber.MovingParticles(m, 0x1AD7, 1, 0, false, true, 0, 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0);

            new BomberTimer(m, bomber).Start();
        }
Beispiel #27
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m.InRange(this.GetWorldLocation(), 2))
            {
                if (0.1 > Utility.RandomDouble())
                {
                    m.BAC = Math.Min(60, m.BAC + 10);
                    m.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    BaseBeverage.CheckHeaveTimer(m);

                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156270, m.NetState);                     // *You ready the bottle to throw but it's enchanting label persuades you to drink it instead!*

                    Delete();
                }
                else
                {
                    m.SendLocalizedMessage(1010086);                     // What do you want to use this on?
                    m.BeginTarget(10, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                    {
                        if (0.25 > Utility.RandomDouble() && m.BAC > 0)
                        {
                            AOS.Damage(m, Utility.RandomMinMax(25, 50), 100, 0, 0, 0, 0);
                            m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1156271, m.NetState);                             // *You wind up to throw but in your inebriated state you manage to hit yourself!*
                            m.FixedParticles(0x3728, 20, 10, 5044, EffectLayer.Head);

                            Delete();
                        }
                        else if (targeted is ShadowguardPirate)
                        {
                            ShadowguardPirate pirate = targeted as ShadowguardPirate;

                            m.DoHarmful(pirate);
                            m.MovingParticles(pirate, 0x99B, 10, 0, false, true, 0, 0, 9502, 6014, 0x11D, EffectLayer.Waist, 0);

                            Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
                            {
                                if (pirate.Alive)
                                {
                                    // this is gay, but can't figure out a better way to do!
                                    pirate.BlockReflect = true;
                                    AOS.Damage(pirate, m, 300, 0, 0, 0, 0, 0, 0, 100);
                                    pirate.BlockReflect = false;
                                    pirate.FixedParticles(0x3728, 20, 10, 5044, EffectLayer.Head);

                                    pirate.PlaySound(Utility.Random(0x3E, 3));
                                }
                            });

                            Delete();
                        }
                        else
                        {
                            m.SendLocalizedMessage(1156211);                             // You cannot throw this there!
                        }
                    });
                }
            }
        }
        public override void OnDamagedBySpell(Mobile caster)
        {
            if (caster.InRange(this, 8))
            {
                caster.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                caster.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);
                this.PlaySound(0x209);

                caster.Mana -= caster.Mana;
                caster.Hits -= caster.Hits;
                caster.Stam -= caster.Stam;
                this.Mana   += caster.Mana;
                this.Hits   += caster.Hits;
                this.Stam   += caster.Stam;
            }

            base.OnDamagedBySpell(caster);
        }
Beispiel #29
0
        public void Target(IDamageable d)
        {
            Mobile m = d as Mobile;

            if (!this.Caster.CanSee(d))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(d))
            {
                Mobile source = this.Caster;

                SpellHelper.Turn(source, d);

                if (m != null)
                {
                    if (SpellHelper.CheckReflect((int)this.Circle, ref source, ref m))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
                        {
                            source.MovingParticles(m, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                            source.PlaySound(0x20A);
                        });
                    }
                }

                double damage = 0;

                if (Core.AOS)
                {
                    damage = this.GetNewAosDamage(10, 1, 4, d);
                }
                else if (m != null)
                {
                    damage = Utility.Random(4, 4);

                    if (this.CheckResisted(m))
                    {
                        damage *= 0.75;

                        m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                    }

                    damage *= this.GetDamageScalar(m);
                }

                if (damage > 0)
                {
                    this.Caster.MovingParticles(d, 0x36E4, 5, 0, false, false, 3006, 0, 0);
                    this.Caster.PlaySound(0x1E5);

                    SpellHelper.Damage(this, m != null ? m : d, damage, 0, 100, 0, 0, 0);
                }
            }

            this.FinishSequence();
        }
Beispiel #30
0
        private void DoAreaLeech_Finish()
        {
            IPooledEnumerable <Mobile> eable = GetMobilesInRange(6);
            List <Mobile> list = eable.Where(m => CanBeHarmful(m) && IsEnemy(m)).ToList();

            eable.Free();

            if (list.Count == 0)
            {
                Say(true, "Bah! You have escaped my grasp this time, mortal!");
            }
            else
            {
                double scalar;

                if (list.Count == 1)
                {
                    scalar = 0.75;
                }
                else if (list.Count == 2)
                {
                    scalar = 0.50;
                }
                else
                {
                    scalar = 0.25;
                }

                for (int i = 0; i < list.Count; ++i)
                {
                    Mobile m = list[i];

                    int damage = (int)(m.Hits * scalar) + Utility.RandomMinMax(-5, 5);

                    m.MovingParticles(this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1, 0, (EffectLayer)255, 0x100);
                    m.MovingParticles(this, 0x0001, 1, 0, false, true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0);

                    DoHarmful(m);
                    Hits += AOS.Damage(m, this, Math.Max(damage, 1), 100, 0, 0, 0, 0);
                }

                Say(true, "If I cannot cleanse thy soul, I will destroy it!");
            }
        }
        public void Target(IDamageable m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                Mobile source = this.Caster;
                Mobile target = m as Mobile;

                SpellHelper.Turn(source, m);

                if (target != null)
                {
                    if (SpellHelper.CheckReflect((int)this.Circle, ref source, ref target))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(.5), () =>
                        {
                            source.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                            source.PlaySound(Core.AOS ? 0x15E : 0x44B);
                        });
                    }
                }

                double damage = 0;

                if (Core.AOS)
                {
                    damage = this.GetNewAosDamage(19, 1, 5, m);
                }
                else if (target != null)
                {
                    damage = Utility.Random(10, 7);

                    if (this.CheckResisted(target))
                    {
                        damage *= 0.75;

                        target.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                    }

                    damage *= this.GetDamageScalar(target);
                }

                if (damage > 0)
                {
                    this.Caster.MovingParticles(m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    this.Caster.PlaySound(Core.AOS ? 0x15E : 0x44B);

                    SpellHelper.Damage(this, target != null ? target : m, damage, 0, 100, 0, 0, 0);
                }
            }

            this.FinishSequence();
        }
Beispiel #32
0
        public static void DrawFirework(Mobile from)
        {
            int[] intEffectID = { 14138, 14154, 14201 };

            Point3D EffectLocation = new Point3D((from.X + Utility.Random(-4, 8)), (from.Y + Utility.Random(-4, 8)), from.Z + 20);
            //	Effects.SendMovingParticles( from, EffectLocation, 0x36E4, 5, 0, false, false, 3006, 4006, 9501, 1, 0, EffectLayer.RightHand, 0x100 );
            IEntity to = new Entity(Serial.Zero, EffectLocation, from.Map);
            from.MovingParticles(to, 0x36E4, 5, 0, false, false, 3006, 4006, 0);
            Timer t = new InternalTimer(from, EffectLocation, intEffectID);

            m_Table[from] = t;

            t.Start();
        }
		public virtual void DoFireball(Mobile attacker, Mobile defender)
		{
			if (!attacker.CanBeHarmful(defender, false))
			{
				return;
			}

			attacker.DoHarmful(defender);

			double damage = GetAosDamage(attacker, 19, 1, 5);

			attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
			attacker.PlaySound(0x15E);

			SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage, 0, 100, 0, 0, 0);
		}
		public virtual void DoMagicArrow(Mobile attacker, Mobile defender)
		{
			if (!attacker.CanBeHarmful(defender, false))
			{
				return;
			}

			attacker.DoHarmful(defender);

			double damage = GetAosDamage(attacker, 10, 1, 4);

			attacker.MovingParticles(defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
			attacker.PlaySound(0x1E5);

			SpellHelper.Damage(TimeSpan.FromSeconds(1.0), defender, attacker, damage, 0, 100, 0, 0, 0);
		}
Beispiel #35
0
        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus )
        {
            if ( MirrorImage.HasClone( defender ) && (defender.Skills.Ninjitsu.Value / 150.0) > Utility.RandomDouble() )
            {
                Clone bc;

                foreach ( Mobile m in defender.GetMobilesInRange( 4 ) )
                {
                    bc = m as Clone;

                    if ( bc != null && bc.Summoned && bc.SummonMaster == defender )
                    {
                        attacker.SendLocalizedMessage( 1063141 ); // Your attack has been diverted to a nearby mirror image of your target!
                        defender.SendLocalizedMessage( 1063140 ); // You manage to divert the attack onto one of your nearby mirror images.

                        /*
                         * TODO: What happens if the Clone parries a blow?
                         * And what about if the attacker is using Honorable Execution
                         * and kills it?
                         */

                        defender = m;
                        break;
                    }
                }
            }

            PlaySwingAnimation( attacker );
            PlayHurtAnimation( defender );

            attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
            defender.PlaySound( GetHitDefendSound( attacker, defender ) );

            int damage = ComputeDamage( attacker, defender );

            if (attacker is PlayerMobile && defender is BaseCreature) //Attacks do double damage to creeps.
                damage *= 2;

            #region Damage Multipliers
            /*
             * The following damage bonuses multiply damage by a factor.
             * Capped at x3 (300%).
             */
            //double factor = 1.0;
            int percentageBonus = 0;

            WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
            SpecialMove move = SpecialMove.GetCurrentMove( attacker );

            if( a != null )
            {
                //factor *= a.DamageScalar;
                percentageBonus += (int)(a.DamageScalar * 100) - 100;
            }

            if( move != null )
            {
                //factor *= move.GetDamageScalar( attacker, defender );
                percentageBonus += (int)(move.GetDamageScalar( attacker, defender ) * 100) - 100;
            }

            //factor *= damageBonus;
            percentageBonus += (int)(damageBonus * 100) - 100;

            CheckSlayerResult cs = CheckSlayers( attacker, defender );

            if ( cs != CheckSlayerResult.None )
            {
                if ( cs == CheckSlayerResult.Slayer )
                    defender.FixedEffect( 0x37B9, 10, 5 );

                //factor *= 2.0;
                percentageBonus += 100;
            }

            if ( !attacker.Player )
            {
                if ( defender is PlayerMobile )
                {
                    PlayerMobile pm = (PlayerMobile)defender;

                    if( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
                    {
                        //factor *= 2.0;
                        percentageBonus += 100;
                    }
                }
            }
            else if ( !defender.Player )
            {
                if ( attacker is PlayerMobile )
                {
                    PlayerMobile pm = (PlayerMobile)attacker;

                    if ( pm.WaitingForEnemy )
                    {
                        pm.EnemyOfOneType = defender.GetType();
                        pm.WaitingForEnemy = false;
                    }

                    if ( pm.EnemyOfOneType == defender.GetType() )
                    {
                        defender.FixedEffect( 0x37B9, 10, 5, 1160, 0 );
                        //factor *= 1.5;
                        percentageBonus += 50;
                    }
                }
            }

            int packInstinctBonus = GetPackInstinctBonus( attacker, defender );

            if( packInstinctBonus != 0 )
            {
                //factor *= 1.0 + (double)packInstinctBonus / 100.0;
                percentageBonus += packInstinctBonus;
            }

            if( m_InDoubleStrike )
            {
                //factor *= 0.9; // 10% loss when attacking with double-strike
                percentageBonus -= 10;
            }

            TransformContext context = TransformationSpellHelper.GetContext( defender );

            if( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Spell is NecromancerSpell && context.Type != typeof( HorrificBeastSpell ) )
            {
                //factor *= 1.25; // Every necromancer transformation other than horrific beast takes an additional 25% damage
                percentageBonus += 25;
            }

            if ( attacker is PlayerMobile && !(Core.ML && defender is PlayerMobile ))
            {
                PlayerMobile pmAttacker = (PlayerMobile) attacker;

                if( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
                {
                    //factor *= 1.25;
                    percentageBonus += 25;
                }

                if( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
                {
                    //pmAttacker.SentHonorContext.ApplyPerfectionDamageBonus( ref factor );
                    percentageBonus += pmAttacker.SentHonorContext.PerfectionDamageBonus;
                }
            }

            //if ( factor > 3.0 )
            //	factor = 3.0;

            percentageBonus = Math.Min( percentageBonus, 300 );

            //damage = (int)(damage * factor);
            damage = AOS.Scale( damage, 100 + percentageBonus );
            #endregion

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );

            damage = AbsorbDamage( attacker, defender, damage );

            if ( !Core.AOS && damage < 1 )
                damage = 1;
            else if ( Core.AOS && damage == 0 ) // parried
            {
                if ( a != null && a.Validate( attacker ) /*&& a.CheckMana( attacker, true )*/ ) // Parried special moves have no mana cost
                {
                    a = null;
                    WeaponAbility.ClearCurrentAbility( attacker );

                    attacker.SendLocalizedMessage( 1061140 ); // Your attack was parried!
                }
            }

            AddBlood( attacker, defender, damage );

            int phys, fire, cold, pois, nrgy;

            GetDamageTypes( attacker, out phys, out fire, out cold, out pois, out nrgy );

            if ( m_Consecrated )
            {
                phys = defender.PhysicalResistance;
                fire = defender.FireResistance;
                cold = defender.ColdResistance;
                pois = defender.PoisonResistance;
                nrgy = defender.EnergyResistance;

                int low = phys, type = 0;

                if ( fire < low ){ low = fire; type = 1; }
                if ( cold < low ){ low = cold; type = 2; }
                if ( pois < low ){ low = pois; type = 3; }
                if ( nrgy < low ){ low = nrgy; type = 4; }

                phys = fire = cold = pois = nrgy = 0;

                if ( type == 0 ) phys = 100;
                else if ( type == 1 ) fire = 100;
                else if ( type == 2 ) cold = 100;
                else if ( type == 3 ) pois = 100;
                else if ( type == 4 ) nrgy = 100;
            }

            int damageGiven = damage;

            if ( a != null && !a.OnBeforeDamage( attacker, defender ) )
            {
                WeaponAbility.ClearCurrentAbility( attacker );
                a = null;
            }

            if ( move != null && !move.OnBeforeDamage( attacker, defender ) )
            {
                SpecialMove.ClearCurrentMove( attacker );
                move = null;
            }

            bool ignoreArmor = ( a is ArmorIgnore || (move != null && move.IgnoreArmor( attacker )) );

            damageGiven = AOS.Damage( defender, attacker, damage, ignoreArmor, phys, fire, cold, pois, nrgy );

            double propertyBonus = ( move == null ) ? 1.0 : move.GetPropertyBonus( attacker );

            if ( Core.AOS )
            {
                int lifeLeech = 0;
                int stamLeech = 0;
                int manaLeech = 0;
                int wraithLeech = 0;

                if ( (int)(m_AosWeaponAttributes.HitLeechHits * propertyBonus) > Utility.Random( 100 ) )
                    lifeLeech += 30; // HitLeechHits% chance to leech 30% of damage as hit points

                if ( (int)(m_AosWeaponAttributes.HitLeechStam * propertyBonus) > Utility.Random( 100 ) )
                    stamLeech += 100; // HitLeechStam% chance to leech 100% of damage as stamina

                if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > Utility.Random( 100 ) )
                    manaLeech += 40; // HitLeechMana% chance to leech 40% of damage as mana

                if ( m_Cursed )
                    lifeLeech += 50; // Additional 50% life leech for cursed weapons (necro spell)

                context = TransformationSpellHelper.GetContext( attacker );

                if ( context != null && context.Type == typeof( VampiricEmbraceSpell ) )
                    lifeLeech += 20; // Vampiric embrace gives an additional 20% life leech

                if ( context != null && context.Type == typeof( WraithFormSpell ) )
                {
                    wraithLeech = (5 + (int)((15 * attacker.Skills.SpiritSpeak.Value) / 100)); // Wraith form gives an additional 5-20% mana leech

                    // Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
                    defender.Mana -= AOS.Scale( damageGiven, wraithLeech );

                    manaLeech += wraithLeech;
                }

                if ( lifeLeech != 0 )
                    attacker.Hits += AOS.Scale( damageGiven, lifeLeech );

                if ( stamLeech != 0 )
                    attacker.Stam += AOS.Scale( damageGiven, stamLeech );

                if ( manaLeech != 0 )
                    attacker.Mana += AOS.Scale( damageGiven, manaLeech );

                if ( lifeLeech != 0 || stamLeech != 0 || manaLeech != 0 )
                    attacker.PlaySound( 0x44D );
            }

            if ( m_MaxHits > 0 && ((MaxRange <= 1 && (defender is Slime || defender is ToxicElemental)) || Utility.Random( 25 ) == 0) ) // Stratics says 50% chance, seems more like 4%..
            {
                if ( MaxRange <= 1 && (defender is Slime || defender is ToxicElemental) )
                    attacker.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500263 ); // *Acid blood scars your weapon!*

                if ( Core.AOS && m_AosWeaponAttributes.SelfRepair > Utility.Random( 10 ) )
                {
                    HitPoints += 2;
                }
                else
                {
                    if ( m_Hits > 0 )
                    {
                        --HitPoints;
                    }
                    else if ( m_MaxHits > 1 )
                    {
                        --MaxHitPoints;

                        if ( Parent is Mobile )
                            ((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
                    }
                    else
                    {
                        Delete();
                    }
                }
            }

            if ( attacker is VampireBatFamiliar )
            {
                BaseCreature bc = (BaseCreature)attacker;
                Mobile caster = bc.ControlMaster;

                if ( caster == null )
                    caster = bc.SummonMaster;

                if ( caster != null && caster.Map == bc.Map && caster.InRange( bc, 2 ) )
                    caster.Hits += damage;
                else
                    bc.Hits += damage;
            }

            if ( Core.AOS )
            {
                int physChance = (int)(m_AosWeaponAttributes.HitPhysicalArea * propertyBonus);
                int fireChance = (int)(m_AosWeaponAttributes.HitFireArea * propertyBonus);
                int coldChance = (int)(m_AosWeaponAttributes.HitColdArea * propertyBonus);
                int poisChance = (int)(m_AosWeaponAttributes.HitPoisonArea * propertyBonus);
                int nrgyChance = (int)(m_AosWeaponAttributes.HitEnergyArea * propertyBonus);

                if ( physChance != 0 && physChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x10E,   50, 100, 0, 0, 0, 0 );

                if ( fireChance != 0 && fireChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x11D, 1160, 0, 100, 0, 0, 0 );

                if ( coldChance != 0 && coldChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x0FC, 2100, 0, 0, 100, 0, 0 );

                if ( poisChance != 0 && poisChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x205, 1166, 0, 0, 0, 100, 0 );

                if ( nrgyChance != 0 && nrgyChance > Utility.Random( 100 ) )
                    DoAreaAttack( attacker, defender, 0x1F1,  120, 0, 0, 0, 0, 100 );

                int maChance = (int)(m_AosWeaponAttributes.HitMagicArrow * propertyBonus);
                int harmChance = (int)(m_AosWeaponAttributes.HitHarm * propertyBonus);
                int fireballChance = (int)(m_AosWeaponAttributes.HitFireball * propertyBonus);
                int lightningChance = (int)(m_AosWeaponAttributes.HitLightning * propertyBonus);
                int dispelChance = (int)(m_AosWeaponAttributes.HitDispel * propertyBonus);

                if ( maChance != 0 && maChance > Utility.Random( 100 ) )
                    DoMagicArrow( attacker, defender );

                if ( harmChance != 0 && harmChance > Utility.Random( 100 ) )
                    DoHarm( attacker, defender );

                if ( fireballChance != 0 && fireballChance > Utility.Random( 100 ) )
                    DoFireball( attacker, defender );

                if ( lightningChance != 0 && lightningChance > Utility.Random( 100 ) )
                    DoLightning( attacker, defender );

                if ( dispelChance != 0 && dispelChance > Utility.Random( 100 ) )
                    DoDispel( attacker, defender );

                int laChance = (int)(m_AosWeaponAttributes.HitLowerAttack * propertyBonus);
                int ldChance = (int)(m_AosWeaponAttributes.HitLowerDefend * propertyBonus);

                if ( laChance != 0 && laChance > Utility.Random( 100 ) )
                    DoLowerAttack( attacker, defender );

                if ( ldChance != 0 && ldChance > Utility.Random( 100 ) )
                    DoLowerDefense( attacker, defender );
            }

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).OnGaveMeleeAttack( defender );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).OnGotMeleeAttack( attacker );

            if (m_PreUORMagEff != null && m_PreUORMagEff != PreUORMagEff.None && MagEffCharges != 0)
            {
                Mobile from = defender;
                switch(m_PreUORMagEff)
                {
                    case PreUORMagEff.Clumsiness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Dex );
                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Dex, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < -10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Dex, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5002, EffectLayer.Head );
                        from.PlaySound( 0x1DF );
                        }
                        break;
                    case PreUORMagEff.Feeblemindedness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Int );

                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Int, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < 10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Int, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5004, EffectLayer.Head );
                        from.PlaySound( 0x1E4 );
                        }
                        break;
                    case PreUORMagEff.Weakness:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            string name = String.Format( "[Magic] {0} Offset", StatType.Str );

                            StatMod mod = from.GetStatMod( name );

                            if ( mod != null && mod.Offset < 0 )
                            {
                                from.AddStatMod( new StatMod( StatType.Str, name, mod.Offset + -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            else if ( mod == null || mod.Offset < 10 )
                            {
                                from.AddStatMod( new StatMod( StatType.Str, name, -10, TimeSpan.FromSeconds( 60.0 ) ) );
                            }
                            MagEffCharges--;
                        from.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                        from.PlaySound( 0x1E6 );
                        }
                        break;
                    case PreUORMagEff.Burning:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoMagicArrow( attacker, defender );
                            MagEffCharges--;
                            attacker.MovingParticles( defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0 );
                            attacker.PlaySound( 0x1E5 );
                        }
                        break;
                    case PreUORMagEff.Wounding:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoHarm( attacker, defender );
                            MagEffCharges--;
                            defender.FixedParticles( 0x374A, 10, 15, 5013, EffectLayer.Waist );
                            defender.PlaySound( 0x1F1 );
                        }
                        break;
                    case PreUORMagEff.DaemonBreath:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoFireball( attacker, defender );
                            MagEffCharges--;
                            attacker.MovingParticles( defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
                            attacker.PlaySound( 0x15E );
                        }
                        break;
                    case PreUORMagEff.Thunder:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            DoLightning( attacker, defender );
                            MagEffCharges--;
                            defender.BoltEffect( 0 );
                        }
                        break;
                    case PreUORMagEff.MagesBane:
                        if( Utility.RandomDouble() <= 0.25 ) //25% chance for this to hit defender successfully
                        {
                            defender.Mana -= 10;
                            MagEffCharges--;
                            defender.FixedParticles( 0x374A, 10, 15, 5032, EffectLayer.Head );
                            defender.PlaySound( 0x1F8 );
                        }
                        break;
                    case PreUORMagEff.GhoulTouch:
                        if( Utility.RandomDouble() <= 0.25 ) //25% chance for this to hit defender successfully
                        {
                            defender.Paralyze( TimeSpan.FromSeconds( 7 ) );
                            MagEffCharges--;
                            defender.PlaySound( 0x204 );
                            defender.FixedEffect( 0x376A, 6, 1 );
                        }
                        break;
                    case PreUORMagEff.Evil:
                        if( Utility.RandomDouble() <= 0.35 ) //35% chance for this to hit defender successfully
                        {
                            TimeSpan duration = TimeSpan.FromSeconds( 60.0 );
                            int amount = 10;
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Str, amount, duration);
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Dex, amount, duration);
                            SpellHelper.AddStatCurse(attacker, defender, StatType.Int, amount, duration);

                            MagEffCharges--;
                            from.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist );
                            from.PlaySound( 0x1EA );
                        }
                        break;
                }
            }
            if ( a != null )
                a.OnHit( attacker, defender, damage );

            if ( move != null )
                move.OnHit( attacker, defender, damage );

            if ( defender is IHonorTarget && ((IHonorTarget)defender).ReceivedHonorContext != null )
                ((IHonorTarget)defender).ReceivedHonorContext.OnTargetHit( attacker );

            if ( !(this is BaseRanged) )
            {
                if ( AnimalForm.UnderTransformation( attacker, typeof( GiantSerpent ) ) )
                    defender.ApplyPoison( attacker, Poison.Lesser );

                if ( AnimalForm.UnderTransformation( defender, typeof( BullFrog ) ) )
                    attacker.ApplyPoison( defender, Poison.Regular );
                // hook for attachment OnWeaponHit method
                Server.Engines.XmlSpawner2.XmlAttach.OnWeaponHit(this, attacker, defender, damageGiven);
            }
        }
		public override void OnHit( Mobile caster, Mobile target )
		{
			double damage;

			damage = Utility.Random( 7, 5 );

			if ( CheckResisted( target ) )
			{
				damage *= 0.75;

				target.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
			}

			damage *= GetDamageScalar( target );

			caster.MovingParticles( target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
			caster.PlaySound( Core.AOS ? 0x15E : 0x44B );

			SpellHelper.Damage( this, target, damage, 0, 100, 0, 0, 0 );
		}
        public override void OnUsage(Mobile m)
        {
            if (CrateRace.FirstPlace != null)
            {
                if (CrateRace.PartList.Count > 0)
                {
                    RaceData rd = CrateRace.PartList[0];

                    m.MovingParticles(rd.Part, 0x379F, 7, 0, false, true, 3043, 4043, 0x211);
                    m.PlaySound(0x20A);
                    rd.Part.SendMessage("You have been hit by an enormous energy blast!");
                    CrateRace.HandleDamage(rd, .50);
                }
                m.SendMessage("The first in place has been hit by an enormous energy blast!");
            }

            CrateRace.OpenCrates--;
        }
        public override void OnHit(Mobile caster, Mobile target)
        {
            double damage;

            damage = 3;

            if (CheckResisted(target))
            {
                damage *= 0.75;

                target.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
            }

            damage *= GetDamageScalar(target);

            caster.MovingParticles(target, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
            caster.PlaySound(0x1E5);

            SpellHelper.Damage(TimeSpan.FromSeconds(0.50), target, caster, damage, 0, 100, 0, 0, 0);
        }
Beispiel #39
0
		public void DoMeteorSwarm( Mobile attacker, Mobile defender )
		{
			if ( !attacker.CanBeHarmful( defender, false ) )
				return;

			IPoint3D p = defender.Location;

			if ( !attacker.CanSee( p ) )
			{
				attacker.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( SpellHelper.CheckTown( p, attacker ) )
			{
				SpellHelper.Turn( attacker, p );

				if ( p is Item )
					p = ((Item)p).GetWorldLocation();

				List<Mobile> targets = new List<Mobile>();

				Map map = attacker.Map;

				bool playerVsPlayer = false;

				if ( map != null )
				{
					IPooledEnumerable eable = map.GetMobilesInRange( new Point3D( p ), 2 );

					foreach ( Mobile m in eable )
					{
						if ( attacker != m && SpellHelper.ValidIndirectTarget( attacker, m ) && attacker.CanBeHarmful( m, false ) )
						{
							if ( Core.AOS && !attacker.InLOS( m ) )
								continue;

							targets.Add( m );

							if ( m.Player )
								playerVsPlayer = true;
						}
					}

					eable.Free();
				}

				double damage;

				damage = Utility.Random( 37, 33 );

				if ( targets.Count > 0 )
				{
					Effects.PlaySound( p, attacker.Map, 0x160 );

					if ( targets.Count > 2 )
						damage = (damage * 2) / targets.Count;

					for ( int i = 0; i < targets.Count; ++i )
					{
						Mobile m = targets[i];

						double toDeal = damage;

						attacker.DoHarmful( m );
						SpellHelper.Damage( TimeSpan.FromSeconds( 1.0 ), m, attacker, toDeal, 0, 100, 0, 0, 0 );

						attacker.MovingParticles( m, 0x36D4, 7, 0, false, true, 9501, 1, 0, 0x100 );
					}
				}
				SpellHelper.Damage( TimeSpan.FromSeconds( 1.0 ), defender, attacker, 1, 0, 100, 0, 0, 0 );
			}
		}
Beispiel #40
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if(m == null ) return;

			// if it is still refractory then return
			if(DateTime.Now < m_EndTime) return;

			int damage = 0;

			if(m_Damage > 0)
				damage = Utility.Random(m_Damage);

			if(damage > 0)
			{
				m.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
				m.PlaySound( 0x15E );
				SpellHelper.Damage( TimeSpan.Zero, m, m, damage, 0, 100, 0, 0, 0 );
			}

			m_EndTime = DateTime.Now + Refractory;

		}    
		public override void OnDamagedBySpell( Mobile caster )
		{
			if ( caster.InRange( this, 8 ) )
			{
				caster.MovingParticles( this, 0x36F4, 1, 0, false, false, 32, 0, 9535, 1,    0, (EffectLayer)255, 0x100 );
				caster.MovingParticles( this, 0x0001, 1, 0, false,  true, 32, 0, 9535, 9536, 0, (EffectLayer)255, 0 );
				this.PlaySound( 0x209 );

				caster.Mana -= caster.Mana;
				caster.Hits -= caster.Hits;
				caster.Stam -= caster.Stam;
				this.Mana += caster.Mana;
				this.Hits += caster.Hits;
				this.Stam += caster.Stam;
			}

			base.OnDamagedBySpell( caster );
		}