Example #1
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

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

                double duration;

                // Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]

                duration = 7.0 + (Caster.Skills[SkillName.Magery].Value * 0.2);

                if (CheckResisted(m))
                    duration *= 0.75;

				m.Paralyze( TimeSpan.FromSeconds( duration ) );

				m.PlaySound( 0x204 );
				m.FixedEffect( 0x376A, 6, 1 );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
Example #2
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			if( IsImmune( defender ) )	//Intentionally going after Mana consumption
			{
				attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
				defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
				return;
			}

			defender.FixedEffect( 0x376A, 9, 32 );
			defender.PlaySound( 0x204 );

			attacker.SendLocalizedMessage( 1060163 ); // You deliver a paralyzing blow!
			defender.SendLocalizedMessage( 1060164 ); // The attack has temporarily paralyzed you!

			TimeSpan duration = defender.Player ? PlayerFreezeDuration : NPCFreezeDuration;

			// Treat it as paralyze not as freeze, effect must be removed when damaged.
			defender.Paralyze( duration );

			BeginImmunity( defender, duration + FreezeDelayDuration );
		}
Example #3
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m.Frozen || m.Paralyzed )
            {
                Caster.SendLocalizedMessage( 1061923 ); // The target is already frozen.
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                int secs = (int) ( ( GetDamageSkill( Caster ) / 10 ) - ( GetResistSkill( m ) / 10 ) );

                if ( !m.IsPlayer )
                    secs *= 3;

                if ( secs < 0 )
                    secs = 0;

                double duration = secs;

                m.Paralyze( TimeSpan.FromSeconds( duration ) );

                m.PlaySound( 0x204 );
                m.FixedEffect( 0x376A, 6, 1 );
            }

            FinishSequence();
        }
Example #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
            }
            else if (Core.AOS && (m.Frozen || m.Paralyzed || (m.Spell != null && m.Spell.IsCasting)))
            {
                Caster.SendAsciiMessage("The target is already frozen."); // The target is already frozen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                double duration;
                duration = (((Caster.Skills[SkillName.Magery].Value / 10) + 1) * 2) + 5;

                if (CheckResisted(m, 5))
                    duration /= 2;

                m.Paralyze(TimeSpan.FromSeconds(duration));

                if (m.Spell != null && m.Spell is Spell)
                    ((Spell)m.Spell).Disturb(DisturbType.Hurt);

                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 6, 1);
            }

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

           speak=m.Squelched;

            m.PlaySound( 0x19 ); 
       m.Paralyze( TimeSpan.FromSeconds( 20.0 ) ); 
            m.FixedParticles( 0x375A, 2, 10, 5027, 0x3D, 2, EffectLayer.Waist ); 
       m.Hidden = true; 
         	m.Squelched = true;

            { 
               Point3D loc = new Point3D( m.X, m.Y, m.Z ); 

               Item item = new InternalItem( loc, Caster.Map, Caster,m , speak ); 

            } 


         } 

         FinishSequence(); 
      } 
Example #6
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( Core.AOS && (m.Frozen || m.Paralyzed || (m.Spell != null && m.Spell.IsCasting && !(m.Spell is PaladinSpell))) )
			{
				Caster.SendLocalizedMessage( 1061923 ); // The target is already frozen.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

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

				double duration;
				
				if ( Core.AOS )
				{
					int secs = (int)((GetDamageSkill( Caster ) / 10) - (GetResistSkill( m ) / 10));
					
					if( !Core.SE )
						secs += 2;

					if ( !m.Player )
						secs *= 3;

					if ( secs < 0 )
						secs = 0;

					duration = secs;
				}
				else
				{
					// Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]

					duration = 7.0 + (Caster.Skills[SkillName.Magery].Value * 0.2);

					if ( CheckResisted( m ) )
						duration *= 0.75;
				}

				if ( m is PlagueBeastLord )
				{
					( (PlagueBeastLord) m ).OnParalyzed( Caster );
					duration = 120;
				}

				m.Paralyze( TimeSpan.FromSeconds( duration ) );

				m.PlaySound( 0x204 );
				m.FixedEffect( 0x376A, 6, 1 );

				HarmfulSpell( m );
			}

			FinishSequence();
		}
Example #7
0
 public void FreezeAttack(Mobile m)
 {
     m.Paralyze(TimeSpan.FromSeconds(10));
     m.PlaySound(541);
     m.FixedEffect(0x376A, 6, 1);
     m.HueMod = 1152;
     m.SendMessage("The white falcon's breath turns you to ice!");
     new FreezeAttackTimer(m).Start();
 }
		public override void OnDoubleClick( Mobile from )
		{
			Container pack = from.Backpack;

			if ( pack != null && pack.ConsumeTotal( typeof( Opium ), 1 ) )
			{
				Effects.SendLocationEffect( new Point3D( from.X + 1, from.Y, from.Z + 19 ), from.Map, 0x3735, 13 );
				from.Animate( 34, 5, 1, true, false, 0 );
				from.PlaySound( 0x21 );
				from.Paralyze( TimeSpan.FromSeconds( 5 ) );
				from.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Head );
			}
			else
			{
				from.SendMessage(37, "You are out of opium!");
			}
		}
Example #9
0
        // TODO: Axe Throw
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Maniacal laugh
                 * Cliloc: 1070840
                 * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(884 715, 10)" ToLocation: "(884 715, 10)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                 * Paralyzes for 4 seconds, or until hit
                 */
                defender.FixedEffect(0x37B9, 10, 5);
                defender.SendLocalizedMessage(1070840); // You are frozen as the creature laughs maniacally.

                defender.Paralyze(TimeSpan.FromSeconds(4.0));
            }
        }
Example #10
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is Navrey)
            {
                return(true);
            }

            if (AccessLevel.Player == m.AccessLevel)
            {
                m.Paralyze(duration);

                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 10, 16);
            }

            return(true);
        }
Example #11
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !defender.Mounted )
			{
				attacker.SendLocalizedMessage( 1060848 ); // This attack only works on mounted targets
				ClearCurrentAbility( attacker );
				return;
			}

			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			if( !attacker.Mounted )
			{
				Mobile mount = defender.Mount as Mobile;
				BaseMount.Dismount( defender );

				if( mount != null )	//Ethy mounts don't take damage
				{
					int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);
										
					AOS.Damage( mount, null, amount, 100, 0, 0, 0, 0 );	//The mount just takes damage, there's no flagging as if it was attacking the mount directly
					
					//TODO: Mount prevention until mount healed
				}
			}
			else
			{
				int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);
				
				AOS.Damage( defender, attacker, amount, 100, 0, 0, 0, 0 );                     			    

				if( Server.Items.ParalyzingBlow.IsImmune( defender ) )	//Does it still do damage?
				{
					attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
					defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
				}
				else
				{
				defender.Paralyze( TimeSpan.FromSeconds( 3.0 ) );
					Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
				}
			}
		}
Example #12
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            bool immune    = Server.Items.ParalyzingBlow.IsImmune(defender);
            bool doEffects = false;

            AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0); //0-25

            if (!immune && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
            {
                defender.Paralyze(TimeSpan.FromSeconds(2.0));
                doEffects = true;
            }

            if (attacker is BaseCreature)
            {
                PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Bushido);
            }

            if (!immune)
            {
                attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
                defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
            }
            else
            {
                attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
                defender.SendLocalizedMessage(1070813); // You resist paralysis.
            }

            if (doEffects)
            {
                attacker.PlaySound(0x204);
                defender.FixedEffect(0x376A, 9, 32);
                defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);
            }

            Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
        }
Example #13
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    double duration;

                    if (Core.AOS)
                    {
                        duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

                        if (!m.Player)
                        {
                            duration *= 3.0;
                        }

                        if (duration < 0.0)
                        {
                            duration = 0.0;
                        }
                    }
                    else
                    {
                        duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
                    }

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);

                    if (m is BaseCreature)
                    {
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                    }
                }

                return(true);
            }
Example #14
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                double duration;

                // Algorithm: ((20% of AnimalTamin) + 7) seconds [- 50% if resisted] seems to work??
                duration = 7.0 + (Caster.Skills[DamageSkill].Value * 0.2);

                // Resist if Str + Dex / 2 is greater than CastSkill eg. AnimalLore seems to work??
                if ((Caster.Skills[CastSkill].Value) < ((m.Str + m.Dex) * 0.5))
                {
                    duration *= 0.5;
                }

                // no less than 0 seconds no more than 9 seconds
                if (duration < 0.0)
                {
                    duration = 0.0;
                }
                if (duration > 9.0)
                {
                    duration = 9.0;
                }

                m.PlaySound(0x2A1);

                m.Paralyze(TimeSpan.FromSeconds(duration));
                m.FixedParticles(0x375A, 2, 10, 5027, 0x3D, 2, EffectLayer.Waist);

                {
                    Point3D loc = new Point3D(m.X, m.Y, m.Z);

                    Item item = new InternalItem(loc, Caster.Map, Caster);
                }
            }

            FinishSequence();
        }
 DoMountAbility(int damage, Mobile attacker)
 {
     if (Rider == null || attacker == null)
     {
         return
             (false);
     }
     if (Rider.Map == attacker.Map && Rider.InRange(attacker, 1) && .7 > Utility.RandomDouble()
         )
     {
         attacker.Paralyze(TimeSpan.FromSeconds(6)); { if (attacker.Body.IsHuman && !attacker.Mounted)
                                                       {
                                                           attacker.Animate(22, 7, 1, true, true, 2); return(true);
                                                       }
         }
     }
     return(false);
 }
Example #16
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    m_Caster.DoHarmful(m);

                    double duration = 5.0 + (m_Caster.Skills[SkillName.ArtMagique].Value * 0.2);

                    duration = SpellHelper.AdjustValue(m_Caster, duration);

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    Effects.SendTargetEffect(m, 0x376A, 10, 16);
                }

                return(true);
            }
Example #17
0
        public override void OnTarget(Object o)
        {
            Mobile target = o as Mobile;

            if (target == null)
            {
                return;
            }
            else if (this.CheckHSequence(target))
            {
                //duration = 7.0 + (Caster.Skills[SkillName.Mysticism].Value * 0.2);
                target.Paralyze(TimeSpan.FromSeconds(12));
                target.Sleep(TimeSpan.FromSeconds(12));
                target.Say("ZZZzzzzz");///////
            }

            this.FinishSequence();
        }
Example #18
0
        public override void OnTarget(Object o)
        {
            Mobile target = o as Mobile;

            if (target == null)
            {
                return;
            }
            else if (CheckHSequence(target))
            {
                Map map = Caster.Map;

                if (map != null)
                {
                    List <Mobile> targets = new List <Mobile>();

                    foreach (Mobile m in target.GetMobilesInRange(3))
                    {
                        if (Caster != m && target.InLOS(m) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    //Effects.PlaySound( target.Location, map, 0x655 );
                    //Effects.PlaySound( target.Location, map, 0x655 );
                    //Effects.SendLocationParticles( EffectItem.Create( target.Location, map, EffectItem.DefaultDuration ), 0x37CC, 1, 40, 97, 3, 9917, 0 );

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

                        Caster.DoHarmful(m);

                        target.Paralyze(TimeSpan.FromSeconds(12));
                        target.DoSleep(TimeSpan.FromSeconds(12));
                        target.Say("ZZZzzzzz");///////
                    }
                }
            }

            FinishSequence();
        }
Example #19
0
 public override void OnHit(Mobile attacker, Mobile defender, int damage)
 {
     if (!attacker.Mounted)
     {
         attacker.SendMessage("You must be mounted to use this ability!");
         ClearCurrentAbility(attacker);
         return;
     }
     if (!Validate(attacker) || !CheckMana(attacker, true))
     {
         return;
     }
     ClearCurrentAbility(attacker);
     if (defender.Mounted)
     {
         Mobile mount = defender.Mount as Mobile;
         BaseMount.Dismount(defender);
         int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Chivalry].Value) / 70.0 + 5);
         if (mount != null)
         {
             AOS.Damage(mount, null, amount, 100, 0, 0, 0, 0);
         }
         else
         {
             AOS.Damage(defender, null, amount, 100, 0, 0, 0, 0);
         }
     }
     else
     {
         int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Chivalry].Value) / 70.0 + 5);
         AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0);
         if (Server.Items.ParalyzingBlow.IsImmune(defender))
         {
             attacker.SendLocalizedMessage(1070804);
             defender.SendLocalizedMessage(1070813);
         }
         else
         {
             defender.Paralyze(TimeSpan.FromSeconds(4.0));
             Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
         }
     }
 }
Example #20
0
		public override void SpellEffect( Mobile m )
		{
			m.Paralyze( TimeSpan.FromSeconds( ScaleBySkill( Caster, DamageSkill ) ) );

			NetState ns = m.NetState;

			if ( ns != null )
			{
				if ( m.Race == Race.Elf )
					ns.Send( new PersonalLightLevel( m, -66 ) );
				else
					ns.Send( new PersonalLightLevel( m, -56 ) );
			}

			Timer timer = new InternalTimer( m, (int)ScaleBySkill( Caster, DamageSkill ) );
			timer.Start();

			BlueMageControl.CheckKnown( m, this, CanTeach( m ) );
		}
Example #21
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender);

            if (cantpara)
            {
                attacker.SendLocalizedMessage(1070804);                 // Your target resists paralysis.
                defender.SendLocalizedMessage(1070813);                 // You resist paralysis.
            }
            else
            {
                attacker.SendLocalizedMessage(1063356);                 // You cripple your target with a nerve strike!
                defender.SendLocalizedMessage(1063357);                 // Your attacker dealt a crippling nerve strike!
            }

            attacker.PlaySound(0x204);
            defender.FixedEffect(0x376A, 9, 32);
            defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);

            if (Core.ML)
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0);                             //0-25

                if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
                {
                    defender.Paralyze(TimeSpan.FromSeconds(2.0));
                    Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
                }
            }
            else if (!cantpara)
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0);                   //10-25
                defender.Freeze(TimeSpan.FromSeconds(2.0));
                Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
            }
        }
Example #22
0
        public override void Detonate(Mobile m)
        {
            int dam = Utility.RandomMinMax(MinDamage, MaxDamage);

            if (DeploymentType == DeploymentType.Tripwire)
            {
                dam *= 2;
            }

            AOS.Damage(m, Owner, dam, 0, 0, 100, 0, 0);
            m.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);

            m.Paralyze(TimeSpan.FromSeconds(5));

            Effects.SendLocationParticles(m, 0x374A, 1, 30, 97, 3, 9502, 0);
            Effects.PlaySound(GetWorldLocation(), Map, 0x1FB);

            base.Detonate(m);
        }
      public void Target( Mobile m )
      {
         if ( !Caster.CanSee( m ) )
         {
            Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
         }
         else if ( CheckHSequence( m ) )
         {
            SpellHelper.Turn( Caster, m );

            double duration;

            // Algorithm: ((20% of AnimalTamin) + 7) seconds [- 50% if resisted] seems to work??
            duration = 7.0 + (Caster.Skills[DamageSkill].Value * 0.2);

            // Resist if Str + Dex / 2 is greater than CastSkill eg. AnimalLore seems to work??
            if ( ( Caster.Skills[CastSkill].Value ) < ( ( m.Str + m.Dex ) * 0.5 ) )
               duration *= 0.5;

            // no less than 0 seconds no more than 9 seconds
            if ( duration < 0.0 )
               duration = 0.0;
            if ( duration > 9.0 )
               duration = 9.0;

            m.PlaySound( 0x2A1 );

            m.Paralyze( TimeSpan.FromSeconds( duration ) );
            m.FixedParticles( 0x375A, 2, 10, 5027, 0x3D, 2, EffectLayer.Waist );

            {
               Point3D loc = new Point3D( m.X, m.Y, m.Z );

               Item item = new InternalItem( loc, Caster.Map, Caster );

            }


         }

         FinishSequence();
      }
Example #24
0
        public static void OnHit(Mobile from, Mobile target)
        {
            if (m_Table.ContainsKey(from))
            {
                ForceOfNatureTimer t = m_Table[from];

                t.Hits++;
                t.LastHit = DateTime.Now;

                if (t.Hits % 12 == 0)
                {
                    int duration = target.Skills[SkillName.MagicResist].Value >= 90.0 ? 1 : 2;
                    target.Paralyze(TimeSpan.FromSeconds(duration));
                    t.Hits = 0;

                    from.SendLocalizedMessage(1004013);   // You successfully stun your opponent!
                    target.SendLocalizedMessage(1004014); // You have been stunned!
                }
            }
        }
        public override void TrapEffect(Mobile from)
        {
            from.PlaySound(0x4A);  // click sound

            from.PlaySound(0x204);
            from.FixedEffect(0x376A, 6, 1);

            int duration = Utility.RandomMinMax(3, 6);

            from.Paralyze(TimeSpan.FromSeconds(duration));

            bool m_TrapsLimit = Trapcrafting.Config.TrapsLimit;

            if ((m_TrapsLimit) && (((PlayerMobile)this.Owner).TrapsActive > 0))
            {
                ((PlayerMobile)this.Owner).TrapsActive -= 1;
            }

            this.Delete();
        }
Example #26
0
        public void DoSpecialAbility(Mobile target)
        {
            try
            {
                Mobile m = VerifyValidMobile(target, 8);

                if (m != null)
                {
                    Effects.SendMovingEffect(this, m, 0x36D4, 5, 0, false, false, 1151, 0);
                    m.PlaySound(0x204);
                    m.Paralyze(TimeSpan.FromSeconds(6.0));
                    DoHarmful(m);
                }
            }
            catch (Exception e)
            {
                LogHelper.LogException(e);
                Console.WriteLine("Exception (non-fatal) caught in Azothu.OnDoSpecialAbility: " + e.Message);
            }
        }
Example #27
0
        private void CheckParalyze(Mobile defender, TimeSpan duration)
        {
            if (ParalyzingBlow.IsImmune(defender))
            {
                Caster.SendLocalizedMessage(1070804);   // Your target resists paralysis.
                defender.SendLocalizedMessage(1070813); // You resist paralysis.
                return;
            }

            defender.FixedEffect(0x376A, 9, 32);
            defender.PlaySound(0x204);

            Caster.SendLocalizedMessage(1060163);   // You deliver a paralyzing blow!
            defender.SendLocalizedMessage(1060164); // The attack has temporarily paralyzed you!

            // Treat it as paralyze not as freeze, effect must be removed when damaged.
            defender.Paralyze(duration);

            ParalyzingBlow.BeginImmunity(defender, duration);
        }
Example #28
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);
                Caster.DoHarmful(m);

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

                double duration;

                // Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]

                duration = 4.0 + (Caster.Skills[SkillName.Magery].Value * 0.2);

                if (CheckResisted(m))
                {
                    duration *= 0.50;
                }


                if (m is PlagueBeastLord)
                {
                    ((PlagueBeastLord)m).OnParalyzed(Caster);
                    duration = 120;
                }

                m.Paralyze(TimeSpan.FromSeconds(duration));

                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 6, 1);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Example #29
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender);

			if ( cantpara )
			{
				attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
				defender.SendLocalizedMessage(1070813); // You resist paralysis.
			}
			else
			{
				attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
				defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
			}

			attacker.PlaySound(0x204);
			defender.FixedEffect(0x376A, 9, 32);
			defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);

			if ( Core.ML )
			{
				AOS.Damage( defender, attacker, (int)( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.Random( 10 ) ), true, 100, 0, 0, 0, 0 );	//0-25

				if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
				{
					defender.Paralyze( TimeSpan.FromSeconds( 2.0 ) );
					Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );				
				}
			}
			else if( !cantpara )
			{
				AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0 ); //10-25
				defender.Freeze(TimeSpan.FromSeconds(2.0));
				Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
			}
		}
Example #30
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is Mobiles.Navrey)
            {
                return(true);
            }

            if (AccessLevel.Player == AccessLevel.Player && m.Alive)
            {
                m.Paralyze(m_Duration);

                m_StuckMobs.Add(m);

                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 10, 16);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Webbing, 1153789, 1153825));
            }

            return(true);
        }
Example #31
0
        private void DoDamage_Callback(object o)
        {
            Mobile m   = o as Mobile;
            Map    map = Map;

            if (m != null && map != null)
            {
                DoHarmful(m);
                AOS.Damage(m, this, Utility.RandomMinMax(100, 150), 50, 50, 0, 0, 0);

                Direction d     = Utility.GetDirection(this, m);
                int       range = 0;
                int       x     = m.X;
                int       y     = m.Y;
                int       orx   = x;
                int       ory   = y;

                while (range < 12)
                {
                    range++;
                    int lastx = x;
                    int lasty = y;

                    Movement.Movement.Offset(d, ref x, ref y);

                    if (!map.CanSpawnMobile(x, y, map.GetAverageZ(x, y)))
                    {
                        m.MoveToWorld(new Point3D(lastx, lasty, map.GetAverageZ(lastx, lasty)), Map);
                        break;
                    }

                    if (range >= 12 && (orx != x || ory != y))
                    {
                        m.MoveToWorld(new Point3D(x, y, map.GetAverageZ(x, y)), Map);
                    }
                }

                m.Paralyze(TimeSpan.FromSeconds(3));
            }
        }
Example #32
0
        public static void OnHit(Mobile from, Mobile target)
        {
            if (_table.TryGetValue(from, out var t))
            {
                t.Hits++;
                t.LastHit = Core.Now;

                if (t.Hits % 12 == 0)
                {
                    int duration = target.Skills[SkillName.MagicResist].Value >= 90.0 ? 1 : 2;
                    target.Paralyze(TimeSpan.FromSeconds(duration));

                    target.FixedEffect(0x376A, 9, 32);
                    target.PlaySound(0x204);

                    t.Hits = 0;

                    from.SendLocalizedMessage(1004013);   // You successfully stun your opponent!
                    target.SendLocalizedMessage(1004014); // You have been stunned!
                }
            }
        }
Example #33
0
        public override void OnEnter(Mobile m)
        {
            if (m.Backpack == null)
            {
                return;
            }

            if (m.NetState != null)
            {
                m.Paralyze(TimeSpan.FromSeconds(2));
                m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 33, 1113580, m.NetState);    // You are filled with a sense of dread and impending doom!
                m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1113581, m.NetState); // I might need something to help me navigate through this.

                if (m.Backpack.FindItemByType(typeof(GoldenCompass)) != null)
                {
                    m.CloseGump(typeof(CompassDirectionGump));
                    m.SendGump(new CompassDirectionGump(m));
                }
            }

            base.OnEnter(m);
        }
Example #34
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                double duration = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                m.Paralyze(TimeSpan.FromSeconds(duration));

                m.PlaySound(0x204);
                Effects.SendTargetEffect(m, 0x376A, 6, 1);
            }

            FinishSequence();
        }
Example #35
0
        public override void DoEffects(BaseCreature creature, Mobile defender, ref int damage)
        {
            if (Utility.RandomBool())
            {
                defender.SendLocalizedMessage(1112554);                 // You're stunned as the creature's tail knocks the wind out of you.

                defender.PlaySound(0x204);
                defender.FixedEffect(0x376A, 6, 1);

                defender.Paralyze(TimeSpan.FromSeconds(3));
            }
            else
            {
                defender.SendLocalizedMessage(1112555);                 // You're left confused as the creature's tail catches you right in the face!

                defender.PlaySound(0x204);
                defender.FixedEffect(0x376A, 6, 1);

                defender.AddStatMod(new StatMod(StatType.Dex, "[TailSwipe] Dex", -20, TimeSpan.FromSeconds(5)));
                defender.AddStatMod(new StatMod(StatType.Int, "[TailSwipe] Int", -20, TimeSpan.FromSeconds(5)));
            }
        }
Example #36
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!defender.Mounted)
            {
                attacker.SendLocalizedMessage(1060848);                   // This attack only works on mounted targets
                ClearCurrentAbility(attacker);
                return;
            }

            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (!attacker.Mounted)
            {
                Mobile mount = defender.Mount as Mobile;
                BaseMount.Dismount(defender);

                if (mount != null)                      //Ethy mounts don't take damage
                {
                    int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);

                    AOS.Damage(mount, null, amount, 100, 0, 0, 0, 0);                           //The mount just takes damage, there's no flagging as if it was attacking the mount directly

                    //TODO: Mount prevention until mount healed
                }
            }
            else
            {
                int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);

                AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0);

                defender.Paralyze(TimeSpan.FromSeconds(3.0));
            }
        }
Example #37
0
        public static void WebAttack(Mobile from, Mobile to)
        {
            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            int x = from.X + Utility.RandomMinMax(-1, 1);
            int y = from.Y + Utility.RandomMinMax(-1, 1);
            int z = from.Z;

            SelfDeletingItem web = new SelfDeletingItem(3812, "a web", 5);

            to.MovingEffect(from, 0xee6, 7, 1, false, false, 0x481, 0);
            to.Paralyze(TimeSpan.FromSeconds(6));
            to.SendMessage("You are are caught in a web");
            to.MoveToWorld(new Point3D(x, y, z), map);
            web.MoveToWorld(new Point3D(x, y, z), map);
            to.ApplyPoison(from, Poison.Lethal);
        }
Example #38
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    m_Caster.DoHarmful(m);

                    double duration = (m_Caster.Skills[SkillName.Magery].Value / 10 + 1) * 2 + 5;

                    if (!m.CheckSkill(SkillName.MagicResist, 10.0, 50.0))                         // CheckResistedEasy
                    {
                        m.Paralyze(TimeSpan.FromSeconds(duration));
                    }
                    else
                    {
                        m.SendLocalizedMessage(501783);                           // You feel yourself resisting magical energy.
                    }
                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);
                }

                return(true);
            }
Example #39
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m.Frozen || m.Paralyzed)
            {
                Caster.SendLocalizedMessage(1061923);                   // The target is already frozen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

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

                int secs = (int)((GetDamageSkill(Caster) / 10) - (GetResistSkill(m) / 10));

                if (!m.IsPlayer)
                {
                    secs *= 3;
                }

                if (secs < 0)
                {
                    secs = 0;
                }

                double duration = secs;

                m.Paralyze(TimeSpan.FromSeconds(duration));

                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 6, 1);
            }

            FinishSequence();
        }
Example #40
0
            public override bool OnMoveOver(Mobile m)
            {
                if (Visible && m_Caster != null && m != m_Caster && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false))
                {
                    m_Caster.DoHarmful(m);

                    double duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

                    if (!m.Player)
                    {
                        duration *= 3.0;
                    }

                    Utility.FixMin(ref duration, 0.0);

                    m.Paralyze(TimeSpan.FromSeconds(duration));

                    m.PlaySound(0x204);
                    m.FixedEffect(0x376A, 10, 16);
                }

                return(true);
            }
Example #41
0
        public override void OnHit(Mobile attacker, Mobile defender)
        {
            SpearOfGruumshHit = false;

            if (!defender.Paralyzed)
            {
                base.OnHit(attacker, defender);
            }

            if (Utility.RandomDouble() < .5 && !defender.Paralyzed)
            {
                attacker.SendMessage("You have paralyzed " + defender.Name);
                defender.Paralyze(TimeSpan.FromSeconds(10.0));
                defender.SendMessage("The Spear of Gruumsh has paralyzed you!");
                defender.FixedEffect(0x376A, 5, 10);
                SpearOfGruumshHit = true;
            }

            if (defender.Paralyzed && !SpearOfGruumshHit)
            {
                base.OnHit(attacker, defender);
            }
        }
Example #42
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if( !defender.Mounted )
            {
                attacker.SendLocalizedMessage( 1060848 ); // This attack only works on mounted targets
                ClearCurrentAbility( attacker );
                return;
            }

            if( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            if( !attacker.Mounted )
            {
                Mobile mount = defender.Mount as Mobile;
                BaseMount.Dismount( defender );

                if( mount != null )	//Ethy mounts don't take damage
                {
                    int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Leadership].Value - 50.0) / 70.0 + 5);

                    AOS.Damage( mount, null, amount, 100, 0, 0, 0, 0, 0, 0, 0 );	//The mount just takes damage, there's no flagging as if it was attacking the mount directly

                    //TODO: Mount prevention until mount healed
                }
            }
            else
            {
                int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Leadership].Value - 50.0) / 70.0 + 5);

                AOS.Damage( defender, attacker, amount, 100, 0, 0, 0, 0, 0, 0, 0 );

                defender.Paralyze( TimeSpan.FromSeconds( 3.0 ) );
            }
        }
            public override bool OnMoveOver(Mobile m)
            {
                bool CanAffect = true;

                if (m is BaseCreature)
                {
                    SlayerEntry undead = SlayerGroup.GetEntryByName(SlayerName.Silver);
                    SlayerEntry elly   = SlayerGroup.GetEntryByName(SlayerName.ElementalBan);
                    SlayerEntry golem  = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction);
                    if (undead.Slays(m) || elly.Slays(m) || golem.Slays(m))
                    {
                        CanAffect = false;
                    }
                }

                if (Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget(m_Caster, m) && m_Caster.CanBeHarmful(m, false) && CanAffect)
                {
                    if (SpellHelper.CanRevealCaster(m))
                    {
                        m_Caster.RevealingAction();
                    }

                    m_Caster.DoHarmful(m);

                    TimeSpan duration = TimeSpan.FromSeconds((DamagingSkill(m_Caster) / 4));

                    m.Paralyze(duration);

                    m.PlaySound(0x657);

                    m.FixedParticles(0x3039, 9, 32, 5008, Server.Items.CharacterDatabase.GetMySpellHue(m_Caster, 0xB72), 0, EffectLayer.Waist);

                    new SleepyTimer(m, duration).Start();
                }

                return(true);
            }
Example #44
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is Navrey)
                return true;

            if (AccessLevel.Player == m.AccessLevel)
            {
                m.Paralyze(duration);
    
                m.PlaySound(0x204);
                m.FixedEffect(0x376A, 10, 16);
            }

            return true;
        }
Example #45
0
            public override bool OnMoveOver( Mobile m )
            {
                if ( Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
                {
                    m_Caster.DoHarmful( m );

                    double duration;

                    if ( Core.AOS )
                    {
                        duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

                        if ( !m.Player )
                            duration *= 3.0;

                        if ( duration < 0.0 )
                            duration = 0.0;
                    }
                    else
                    {
                        duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.1);

                        bool guarded = (m.Region is Regions.GuardedRegion && !((Regions.GuardedRegion)m.Region).IsDisabled());

                        //if ( !m.CheckSkill( SkillName.MagicResist, 10.0, 50.0 ) ) // CheckResistedEasy
                        //if ( !guarded && !m.CheckSkill( SkillName.MagicResist, 45.0, 105.0 ) ) // CheckResisted
                        if (!guarded && MagerySpell.CheckResistedStatic(m, m_Caster, (int)SpellCircle.Fifth)) // Para Field is 6th circle, but para itself is 5th
                        {
                            m.Paralyze(TimeSpan.FromSeconds(duration));
                        }
                        else
                        {
                            duration *= 0.25;
                            m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                        }
                    }

                    if ( duration > 0 )
                        m.Paralyze( TimeSpan.FromSeconds( duration ) );

                    m.PlaySound( 0x204 );
                    m.FixedEffect( 0x376A, 10, 16 );
                }

                return true;
            }
Example #46
0
            public override bool OnMoveOver( Mobile m )
            {
                if ( Visible && m_Caster != null && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
                {
                    m_Caster.DoHarmful( m );

                    double duration = (m_Caster.Skills[SkillName.Magery].Value / 10 + 1) * 2 + 5;

                    if ( !m.CheckSkill( SkillName.MagicResist, 10.0, 50.0 ) ) // CheckResistedEasy
                        m.Paralyze( TimeSpan.FromSeconds( duration ) );
                    else
                        m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.

                    m.PlaySound( 0x204 );
                    m.FixedEffect( 0x376A, 10, 16 );
                }

                return true;
            }
Example #47
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if (!CheckLineOfSight(m))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                double duration;

                if ( Core.AOS )
                {
                    int secs = (int)((GetDamageSkill( Caster ) / 10) - (GetResistSkill( m ) / 10));

                    if( !Core.SE )
                        secs += 2;

                    if ( !m.Player )
                        secs *= 3;

                    if ( secs < 0 )
                        secs = 0;

                    duration = secs;
                }
                else
                {
                    // Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]

                    duration = 7.0 + (Caster.Skills[SkillName.Magery].Value * 0.2);

                    if ( CheckResisted( m ) )
                        duration *= 0.75;
                }

                if ( m is PlagueBeastLord )
                {
                    ( (PlagueBeastLord) m ).OnParalyzed( Caster );
                    duration = 120;
                }

                m.Paralyze( TimeSpan.FromSeconds( duration ) );

                m.PlaySound( 0x204 );
                m.FixedEffect( 0x376A, 6, 1 );
            }

            FinishSequence();
        }
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			defender.Paralyze( new TimeSpan(0, 0, 0, 15, 0 ) );
			base.OnGaveMeleeAttack( defender );
		}
            public override bool OnMoveOver( Mobile m )
            {
                if ( Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
                {
                    m_Caster.DoHarmful( m );

                    double duration;

                    if ( Core.AOS )
                    {
                        duration = (m_Caster.Skills[SkillName.EvalInt].Value - m.Skills[SkillName.MagicResist].Value) * 0.3;

                        if ( duration < 0.0 )
                            duration = 0.0;
                    }
                    else
                    {
                        duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
                    }

                    m.Paralyze( TimeSpan.FromSeconds( duration ) );

                    m.PlaySound( 0x204 );
                    m.FixedEffect( 0x376A, 10, 16 );
                }

                return true;
            }
Example #50
0
        // TODO: Axe Throw
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (0.1 > Utility.RandomDouble())
            {
                /* Maniacal laugh
                * Cliloc: 1070840
                * Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(884 715, 10)" ToLocation: "(884 715, 10)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
                * Paralyzes for 4 seconds, or until hit
                */
                defender.FixedEffect(0x37B9, 10, 5);
                defender.SendLocalizedMessage(1070840); // You are frozen as the creature laughs maniacally.

                defender.Paralyze(TimeSpan.FromSeconds(4.0));
            }
        }
Example #51
0
        public static void WebAttack(Mobile from, Mobile to)
        {
            Map map = from.Map;

            if (map == null)
                return;

            int x = from.X + Utility.RandomMinMax(-1, 1);
            int y = from.Y + Utility.RandomMinMax(-1, 1);
            int z = from.Z;

            SelfDeletingItem web = new SelfDeletingItem(3812, "a web", 5);

            to.MovingEffect(from, 0xee6, 7, 1, false, false, 0x481, 0);
            to.Paralyze(TimeSpan.FromSeconds(6));
            to.SendMessage("You are are caught in a web");
            to.MoveToWorld(new Point3D(x, y, z), map);
            web.MoveToWorld(new Point3D(x, y, z), map);
            to.ApplyPoison(from, Poison.Lethal);
        }
Example #52
0
			public override bool OnMoveOver( Mobile m )
			{
				if ( Visible && m_Caster != null && (!Core.AOS || m != m_Caster) && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
				{
					if ( SpellHelper.CanRevealCaster( m ) )
						m_Caster.RevealingAction();

					m_Caster.DoHarmful( m );

					double duration;

					if ( Core.AOS )
					{
						duration = 2.0 + ((int)(m_Caster.Skills[SkillName.EvalInt].Value / 10) - (int)(m.Skills[SkillName.MagicResist].Value / 10));

						if ( !m.Player )
							duration *= 3.0;

						if ( duration < 0.0 )
							duration = 0.0;
					}
					else
					{
						duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);
					}

					m.Paralyze( TimeSpan.FromSeconds( duration ) );

					m.PlaySound( 0x204 );
					m.FixedEffect( 0x376A, 10, 16 );
                    
                    if (m is BaseCreature)
                        ((BaseCreature)m).OnHarmfulSpell(m_Caster);
                }

				return true;
			}
Example #53
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen. " );
            }
            else if ( Caster.HarmfulCheck( m ) && CheckSequence() )
            {
                Mobile source = Caster;
                SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
                double duration = 7.0;

                m.Paralyze( TimeSpan.FromSeconds( duration ) );
                Caster.Mana = 0;

                if ( Caster != m )
                {
                    Caster.Direction = Caster.GetDirectionTo( m );
                }

                m.PlaySound( 0x204 );
                Effects.SendTargetEffect( m, 0x376A, 16 );
                Caster.SendAsciiMessage( "*The staff quickly freezes and thaws!*" );
            }

            FinishSequence();
        }
		public virtual int AbsorbDamageAOS(Mobile attacker, Mobile defender, int damage)
		{
			int originalDamage = damage;

			bool blocked = false;

			if (defender.Player || defender.Body.IsHuman)
			{
				blocked = CheckParry(defender);
                BaseWeapon weapon = defender.Weapon as BaseWeapon;

				if (blocked)
				{
					defender.FixedEffect(0x37B9, 10, 16);
					damage = 0;

					// Successful block removes the Honorable Execution penalty.
					HonorableExecution.RemovePenalty(defender);

					if (CounterAttack.IsCountering(defender))
					{
						if (weapon != null)
						{
							defender.FixedParticles(0x3779, 1, 15, 0x158B, 0x0, 0x3, EffectLayer.Waist);
							weapon.OnSwing(defender, attacker);
						}

						CounterAttack.StopCountering(defender);
					}

					if (Confidence.IsConfident(defender))
					{
						defender.SendLocalizedMessage(1063117);
							// Your confidence reassures you as you successfully block your opponent's blow.

						double bushido = defender.Skills.Bushido.Value;

						defender.Hits += Utility.RandomMinMax(1, (int)(bushido / 12));
						defender.Stam += Utility.RandomMinMax(1, (int)(bushido / 5));
					}

					BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield;

					if (shield != null)
					{
						shield.OnHit(this, damage);

                        #region Stygian Abyss
                        if (shield.ArmorAttributes.ReactiveParalyze > 0 && 30 > Utility.Random(100))
                        {
                            int secs = (int)Math.Max(1, Math.Max(8, defender.Skills[SkillName.EvalInt].Value / 10) - attacker.Skills[SkillName.MagicResist].Value / 10);

                            attacker.Paralyze(TimeSpan.FromSeconds(secs));
                            attacker.PlaySound(0x204);
                            attacker.FixedEffect(0x376A, 6, 1);
                        }
                        #endregion
                        XmlAttach.OnArmorHit(attacker, defender, shield, this, originalDamage);
                    }
                    #region Stygian Abyss
                    else if (weapon != null && weapon.Layer == Layer.TwoHanded && weapon.WeaponAttributes.ReactiveParalyze > 0 && 30 > Utility.Random(100))
                    {
                        int secs = (int)Math.Max(1, Math.Max(8, defender.Skills[SkillName.EvalInt].Value / 10) - attacker.Skills[SkillName.MagicResist].Value / 10);

                        attacker.Paralyze(TimeSpan.FromSeconds(secs));
                        attacker.PlaySound(0x204);
                        attacker.FixedEffect(0x376A, 6, 1);
                    }
                    #endregion
                }
			}

			if (!blocked)
			{
				double positionChance = Utility.RandomDouble();

				Item armorItem;

                if (positionChance < 0.035)
                    armorItem = defender.Ring;
                else if (positionChance < 0.07)
                    armorItem = defender.Bracelet;
                else if (positionChance < 0.14)
                    armorItem = defender.NeckArmor;
                else if (positionChance < 0.28)
                    armorItem = defender.HandArmor;
                else if (positionChance < 0.43)
                    armorItem = defender.ArmsArmor;
                else if (positionChance < 0.65)
                    armorItem = defender.HeadArmor;
                else if (positionChance < 0.85)
                    armorItem = defender.LegsArmor;
                else
                    armorItem = defender.ChestArmor;

				IWearableDurability armor = armorItem as IWearableDurability;

				if (armor != null)
				{
					armor.OnHit(this, damage); // call OnHit to lose durability
					damage -= XmlAttach.OnArmorHit(attacker, defender, armorItem, this, originalDamage);
				}
			}

			return damage;
		}
Example #55
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);

            #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;
                }
            }

			#region SA
			percentageBonus += BattleLust.GetBonus( attacker, defender );

			if ( this is BaseThrown )
			{
				int max = ((BaseThrown)this).MaxThrowRange;

				if ( attacker.InRange( defender, max ) )
					percentageBonus += -47;
			}
			#endregion

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

            #region Mondain's Legacy
            if (Core.ML)
            {
                BaseTalisman talisman = attacker.Talisman as BaseTalisman;

                if (talisman != null && talisman.Killer != null)
                    percentageBonus += talisman.Killer.DamageBonus(defender);

                if (this is ButchersWarCleaver)
                {
                    if (defender is Bull || defender is Cow || defender is Gaman)
                        percentageBonus += 100;
                }
            }
            #endregion

            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!
                }
                #region SA
				if ( AosArmorAttributes.GetValue( defender, AosArmorAttribute.ReactiveParalyze ) > Utility.RandomMinMax( 1, 100 ) )
					attacker.Paralyze( TimeSpan.FromSeconds( 3 ) );
				#endregion
            }

            #region Mondain's Legacy
            if (m_Immolating)
            {
                int d = ImmolatingWeaponSpell.GetDamage(this);
                d = AOS.Damage(defender, attacker, d, 0, 100, 0, 0, 0);

                AttuneWeaponSpell.TryAbsorb(defender, ref d);

                if (d > 0)
                    defender.Damage(d);
            }
            #endregion

            AddBlood(attacker, defender, damage);

            int phys, fire, cold, pois, nrgy, chaos, direct;

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

            if (Core.ML && this is BaseRanged)
            {
                BaseQuiver quiver = attacker.FindItemOnLayer(Layer.Cloak) as BaseQuiver;

                if (quiver != null)
                    quiver.AlterBowDamage(ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct);
            }

            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 = chaos = direct = 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, chaos, direct, false, this is BaseRanged);

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

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

                // Mondain's Legacy Mod
                if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLeechHits) * propertyBonus) > Utility.Random(100))
                    lifeLeech += 30; // HitLeechHits% chance to leech 30% of damage as hit points

                // Mondain's Legacy Mod
                if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLeechStam) * propertyBonus) > Utility.Random(100))
                    stamLeech += 100; // HitLeechStam% chance to leech 100% of damage as stamina

                // Mondain's Legacy Mod
                if ((int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.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!*

                // Mondain's Legacy Sets
                if (Core.AOS && m_AosWeaponAttributes.SelfRepair + (IsSetItem && m_SetEquipped ? m_SetSelfRepair : 0) > 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)
            {
                // Mondain's Legacy Mod
                int physChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitPhysicalArea) * propertyBonus);
                int fireChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitFireArea) * propertyBonus);
                int coldChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitColdArea) * propertyBonus);
                int poisChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitPoisonArea) * propertyBonus);
                int nrgyChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.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);

                // Mondain's Legacy Mod
                int maChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitMagicArrow) * propertyBonus);
                int harmChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitHarm) * propertyBonus);
                int fireballChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitFireball) * propertyBonus);
                int lightningChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLightning) * propertyBonus);
                int dispelChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitDispel) * propertyBonus);
                #region SA
                int curseChance = (int)(m_AosWeaponAttributes.HitCurse * propertyBonus);
                int fatigueChance = (int)(m_AosWeaponAttributes.HitFatigue * propertyBonus);
                int manadrainChance = (int)(m_AosWeaponAttributes.HitManaDrain * propertyBonus);
                #endregion

                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);

				#region SA
                if (curseChance != 0 && curseChance > Utility.Random(100))
                    DoCurse(attacker, defender);

                if (fatigueChance != 0 && fatigueChance > Utility.Random(100))
                    DoFatigue(attacker, defender, damageGiven);

                if (manadrainChance != 0 && manadrainChance > Utility.Random(100))
                    DoManaDrain(attacker, defender, damageGiven);
				#endregion

                // Mondain's Legacy Mod
                int laChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.HitLowerAttack) * propertyBonus);
                int ldChance = (int)(AosWeaponAttributes.GetValue(attacker, AosWeaponAttribute.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 (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);
            }
        }
Example #56
0
        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus )
        {
            PlayHurtAnimation( defender );

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

            int damage = ComputeDamage( attacker, defender );

            if (Effect != WeaponEffect.None && Charges > 0)
            {
                #region Magic Weapon Effects
                if (Effect == WeaponEffect.Clumsy)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Dex);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < -10)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                    defender.PlaySound(0x1DF);
                }
                else if (Effect == WeaponEffect.Feeblemind)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Int, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                    defender.PlaySound(0x1E4);
                }
                else if (Effect == WeaponEffect.MagicArrow)
                {
                    DoMagicArrow(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
                    attacker.PlaySound(0x1E5);*/
                }
                else if (Effect == WeaponEffect.Weakness)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Str);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Str, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                    defender.PlaySound(0x1E6);
                }
                else if (Effect == WeaponEffect.Harm)
                {
                    DoHarm(attacker, defender);
                    Charges--;
                    /*defender.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
                    defender.PlaySound(0x1F1);*/
                }
                else if (Effect == WeaponEffect.Paralyze)
                {
                    defender.Paralyze(TimeSpan.FromSeconds(7));
                    Charges--;
                    defender.PlaySound(0x204);
                    defender.FixedEffect(0x376A, 6, 1);
                }
                else if (Effect == WeaponEffect.Fireball)
                {
                    DoFireball(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    attacker.PlaySound(0x15E);*/
                }
                else if (Effect == WeaponEffect.Curse)
                {
                    string nameS = String.Format("[Magic] {0} Offset", StatType.Str);
                    string nameD = String.Format("[Magic] {0} Offset", StatType.Dex);
                    string nameI = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod strmod = defender.GetStatMod(nameS);
                    StatMod dexmod = defender.GetStatMod(nameD);
                    StatMod intmod = defender.GetStatMod(nameI);

                    if (strmod != null && strmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, strmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (strmod == null || strmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, -10, TimeSpan.FromSeconds(60.0)));

                    if (dexmod != null && dexmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, dexmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (dexmod == null || dexmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, -10, TimeSpan.FromSeconds(60.0)));

                    if (intmod != null && intmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Int, nameI, intmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (intmod == null || intmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Int, nameI, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    defender.PlaySound(0x1EA);
                }
                else if (Effect == WeaponEffect.ManaDrain)
                {
                    defender.Mana -= 10;
                    Charges--;
                    defender.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);
                    defender.PlaySound(0x1F8);
                }
                else if (Effect == WeaponEffect.Lightning)
                {
                    DoLightning(attacker, defender);
                    Charges--;
                    /*defender.BoltEffect(0);*/
                }
                #endregion
            }

            CheckSlayerResult cs = CheckSlayers( attacker, defender );

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

                damage *= 2;
            }

            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 );

            // Halve the computed damage and return
            damage /= 2;

            if (damage < 1)
                damage = 1;

            if (attacker is PlayerMobile)
                damage += 2;

            AddBlood( attacker, defender, damage );
            defender.Damage(damage, attacker);

            if (defender is Slime)
            {
                if ((damage > (defender.Hits / 4)) && (defender.Hits > 5))
                {
                    defender.Say(true, "*The slime splits when struck!*");
                    BaseCreature slime = new Slime();
                    slime.Hits = (defender.Hits / 2);
                    defender.Hits /= 2;
                    slime.MoveToWorld(new Point3D(defender.X, defender.Y, defender.Z), defender.Map);
                }
            }

            Item hammer = attacker.FindItemOnLayer(Layer.OneHanded);

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

                    if (( m_Hits > 0 ) || (hammer != null && hammer is SmithHammer && ((SmithHammer)hammer).HitPoints > 0))
                    {
                        --HitPoints;
                    }
                    else if (( m_MaxHits > 1 ) || (hammer != null && hammer is SmithHammer && ((SmithHammer)hammer).MaxHitPoints > 1))
                    {
                        --MaxHitPoints;

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

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

            if ( defender is BaseCreature )
                ((BaseCreature)defender).OnGotMeleeAttack( attacker );
        }
Example #57
0
            public override bool OnMoveOver( Mobile m )
            {
                if ( Visible && m_Caster != null && m != m_Caster && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
                {
                    m_Caster.DoHarmful( m );

                    double duration = 2.0 + ( (int) ( m_Caster.Skills[SkillName.EvalInt].Value / 10 ) - (int) ( m.Skills[SkillName.MagicResist].Value / 10 ) );

                    if ( !m.IsPlayer )
                        duration *= 3.0;

                    Utility.FixMin( ref duration, 0.0 );

                    m.Paralyze( TimeSpan.FromSeconds( duration ) );

                    m.PlaySound( 0x204 );
                    m.FixedEffect( 0x376A, 10, 16 );
                }

                return true;
            }
Example #58
0
			public override bool OnMoveOver( Mobile m )
			{
				if ( Visible && m_Caster != null && SpellHelper.ValidIndirectTarget( m_Caster, m ) && m_Caster.CanBeHarmful( m, false ) )
				{
					if ( SpellHelper.CanRevealCaster( m ) )
						m_Caster.RevealingAction();

					m_Caster.DoHarmful( m );

					double duration = 7.0 + (m_Caster.Skills[SkillName.Magery].Value * 0.2);

					m.Paralyze( TimeSpan.FromSeconds( duration ) );

					m.PlaySound( 0x204 );
					m.FixedEffect( 0x376A, 10, 16 );
					
					if ( m is BaseCreature )
						((BaseCreature) m).OnHarmfulSpell( m_Caster );
				}

				return true;
			}
Example #59
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendAsciiMessage( "Target can not be seen." );
            }
            else if ( Core.AOS && (m.Frozen || m.Paralyzed || (m.Spell != null && m.Spell.IsCasting)) )
            {
                Caster.SendAsciiMessage( "The target is already frozen." );
            }
            else if ( CheckHSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

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

                double duration;
                double damage;

                if ( Core.AOS )
                {
                    int baseDamage = 1 + (int)(GetDamageSkill( Caster ) / 5);
                    damage = Utility.RandomMinMax( baseDamage, baseDamage + 3 );
                    damage += (int)(damage * GetInscribeSkill( Caster ) * 0.001);
                    int secs = 2 + (GetDamageFixed( Caster ) / 100) - (GetResistFixed( m ) / 100);

                    if ( !m.Player )
                        secs *= 3;

                    if ( secs < 0 )
                        secs = 0;
                damage = Utility.Random( 1, 1 );

                damage *= GetDamageScalar( m );

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

                // Scale damage based on evalint and resist
                damage *= GetDamageScalar( m );

                    duration = secs;
                }
                else
                {
                    // Algorithm: ((20% of magery) + 7) seconds [- 50% if resisted]

                    duration = 7.0 + (Caster.Skills[SkillName.Magery].Value * 0.2);

                    damage = Utility.Random( 1, 3 );

                    if ( CheckResisted( m ) )
                        duration *= 0.75;
                        damage *= 1.25;

                }
                damage *= GetDamageScalar( m );

                // Deal the damage
                SpellHelper.Damage( this, m, damage, 0, 0, 0, 0, 100 );
                damage = Utility.Random( 1, 1 );
                m.Paralyze( TimeSpan.FromSeconds( duration ) );

                m.PlaySound( 0x204 );
                m.FixedEffect( 0x376A, 6, 1 );
            }

            FinishSequence();
        }
Example #60
0
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			if ( 0.10 > Utility.RandomDouble() )
				defender.Paralyze( new TimeSpan(0, 0, 0, 15, 0 ) );
			base.OnGaveMeleeAttack( defender );
		}