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

            ClearCurrentAbility( attacker );

            Timer t = (Timer) m_Table[attacker];

            if ( t != null )
                t.Stop();

            attacker.SendLocalizedMessage( 1063353 ); // You perform a masterful defense!

            m_Table[attacker] = t = Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( Expire_Callback ), attacker );

            if ( mods == null )
            {
                mods = new object[1] { new ResistanceMod( ResistanceType.Physical, 70 ) };

                m_Table[attacker] = mods;

                attacker.AddResistanceMod( (ResistanceMod) mods[0] );
            }

            att = attacker;

            attacker.FixedParticles( 0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist );
        }
		public override void Drink( Mobile from )
		{
			
			if ( from.BeginAction( typeof( BaseMaskOfDeathPotion ) ) )
			{
				
				if ( !UnderEffect( from ) )
				{
					Timer t = (Timer)m_Table[from];
	
					if ( t != null )
						t.Stop();
	
					m_Table[from] = t = Timer.DelayCall( Duration, new TimerStateCallback( Expire_Callback ), from );			
	
					//Effects.SendPacket( from, from.Map, new GraphicalEffect( EffectType.FixedFrom, from.Serial, Serial.Zero, 0x375A, from.Location, from.Location, 10, 15, true, false ) );//Default
					from.FixedParticles( 0x3779, 10, 15, 5002, EffectLayer.Head );
					from.FixedParticles( 0x376A, 9, 32, 5008, EffectLayer.Waist );
					from.FixedParticles( 0x3778, 10, 30, 5010, EffectLayer.Head );
					
					
				        from.SendLocalizedMessage( 503326 ); // You are now ignored by monsters.
	
					Delete();
				}
				Timer.DelayCall( TimeSpan.FromMinutes( Delay ),new TimerStateCallback( Release ), from );
			}
			else
			{
				from.SendMessage("You must wait 30 minutes to use this potion" );					
			}		
			
			
		}
        public override void OnDeath( Mobile m )
        {
            bool toreturn = true;

            if ( m != null && !m.Deleted)
            {

                if (m is PlayerMobile && m_Controller.NoPlayerItemDrop)
                {
                    if (m.Female)
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 403;
                        m.Hidden = true;
                    }
                    else
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 402;
                        m.Hidden = true;
                    }
                    m.Hidden = false;
                    toreturn = false;
                }
                else if ( !(m is PlayerMobile) && m_Controller.NoNPCItemDrop)
                {
                    if (m.Female)
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 403;
                        m.Hidden = true;
                    }
                    else
                    {
                        m.FixedParticles(0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist);
                        m.Body = 402;
                        m.Hidden = true;
                    }
                    m.Hidden = false;
                    toreturn = false;
                }
                else
                    toreturn = true;

                // Start a 1 second timer
                // The Timer will check if they need moving, corpse deleting etc.
                m_Timer = new MovePlayerTimer(m, m_Controller);
                m_Timer.Start();

               // return base.OnDeath(m);
            }

            base.OnDeath(m);

        }
 public static void FinalEffect( Mobile caster, Mobile target, int duration, double protection )
 {
     target.PlaySound( 0x202 );
     target.FixedParticles( 0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist );
     target.FixedParticles( 0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist );
     ( (IKhaerosMobile)target ).ShieldingMobile = caster;
     ( (IKhaerosMobile)target ).ShieldValue = protection;
     ( (IKhaerosMobile)caster ).ShieldedMobile = target;
     Timer.DelayCall( TimeSpan.FromMinutes( duration ), new TimerCallback( ( (IKhaerosMobile)target ).RemoveShieldOfSacrifice ) );
     Timer.DelayCall( TimeSpan.FromMinutes( duration ), new TimerCallback( ( (IKhaerosMobile)caster ).RemoveShieldOfSacrifice ) );
 }
Example #5
0
        public static void FinalEffect(Mobile caster, Mobile target, int hold)
        {
            target.PlaySound(0x204);
            target.FixedParticles(0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head);
            target.FixedParticles(0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head);

            target.Emote("*is rooted to the ground, unmoving*");
            target.SendMessage("You are overwhelmed by guilt over your sins.");

            if (((IKhaerosMobile)target).StunnedTimer != null)
                ((IKhaerosMobile)target).StunnedTimer.Stop();

            ((IKhaerosMobile)target).StunnedTimer = new JusticePrisonTimer(target, hold);
            ((IKhaerosMobile)target).StunnedTimer.Start();
        }
Example #6
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
Example #7
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            /* // idea... dont allow lesser heal to heal through poison (but allow it on gheal)
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 ); // You cannot heal that target/yourself in their/your current state.
            }*/
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                int toHeal = 1 + (int)( Utility.Random( 15 ) * Caster.Skills[SkillName.Magery].Value / 100.0 );
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
                m.PlaySound( 0x1F2 );
            }

            FinishSequence();
        }
Example #8
0
		public override void Drink( Mobile from )
		{
			if ( from.BeginAction( typeof( LightCycle ) ) )
			{
				new LightCycle.NightSightTimer( from ).Start();

				if( Server.Utilities.StartupSettings.LightingChanged )
					from.LightLevel = 15;
				else if( from.Map != Map.Trammel )
					from.LightLevel = LightCycle.DungeonLevel / 2;
				else
					from.LightLevel = 6;

				from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
				from.PlaySound( 0x1E3 );

				BasePotion.PlayDrinkEffect( from );

				this.Consume();
			}
			else
			{
				from.SendMessage( "You already have nightsight." );
			}
		}
		// Dance of Clouds
		// Activate to grant all nearby allies 20% concealment for 60 seconds.
		public static void LightAirCombo( Mobile from )
		{
			from.SendMessage( 2075, "You execute the maneuver: Dance Of The Clouds" );

			Party p = Party.Get( from );

			object[] objs =
			{
				AosAttribute.DefendChance, 25
			};

			if ( p == null )
			{
				from.SendMessage( 2075, "Monk Boost: +25% defense" );
				from.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
				new EnhancementTimer( from, 15, "monk", objs ).Start();
				return;
			}

			for ( int i = 0; i < p.Members.Count; ++i )
			{
				if ( !(p.Members[i].Mobile.InRange( from, 10 )) )
					continue;

				p.Members[i].Mobile.SendMessage( 2075, "Monk Boost: +25% defense" );
				p.Members[i].Mobile.FixedParticles( 0x374A, 10, 30, 5013, 1153, 2, EffectLayer.Waist );
				new EnhancementTimer( p.Members[i].Mobile, 60, "monk", objs ).Start();
				p.Members[i].Mobile.PlaySound( 0x28F );
			}
		}
		public override void Drink( Mobile m )
		{
			TimeSpan duration = TimeSpan.FromMinutes( 1 );
			
			if (m.Hidden == false)
			{
				m.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
				m.PlaySound( 0x3C4 );
				
				BuffInfo.RemoveBuff( m, BuffIcon.HidingAndOrStealth );
				BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Invisibility, 1075825 ) );	//Invisibility/Invisible

				BasePotion.PlayDrinkEffect( m );

				this.Consume();
				
				m.Hidden = true;
				
				RemoveTimer( m );
				
				Timer t = new InternalTimer( m, duration );

				m_Table[m] = t;

				t.Start();
				
			}
			else
			{
				m.SendMessage( "An invisibility potion is already taking effect on your person." ); //An invisibility potion is already taking effect on your person.
			}
		}
Example #11
0
		public override void OnDoubleClick(Mobile from)
		{
			if(m_Charges <= 0)
                from.SendLocalizedMessage(501259); //This magic item is out of charges.
            if (IsUnderEffects(from, m_Ward))
                from.SendLocalizedMessage(502173); //You are already under a similar effect.
            else if (from.FindItemOnLayer(Layer.MiddleTorso) == this)
            {
                Charges--;

                m_Table[from] = m_Ward;
                Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(RemoveEffects), from);

                from.FixedParticles(14154, 1, 30, 9964, 3, 3, EffectLayer.Waist);

                for (int i = -1; i <= 1; i++)
                {
                    IEntity entity = new Entity(Serial.Zero, new Point3D(from.X + i, from.Y, from.Z), from.Map);
                    IEntity to = new Entity(Serial.Zero, new Point3D(from.X + i, from.Y, from.Z + 50), from.Map);
                    Effects.SendMovingParticles(entity, to, 7956, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
                }

                from.PlaySound(0x5C1);
                from.SendLocalizedMessage(1116243); //The runes glow and a magical warding forms around your body.

                BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.Warding, 1151395, 1151396, m_Ward == WardingEffect.WeaponDamage ? 1116172 : 1116173)); 
            }
            else
            {
                from.SendLocalizedMessage(1112886); //You must be wearing this item in order to use it.
            }
		}
 public void FizzleStrangely(Mobile m)
 {
     m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "The spell fizzles strangely.", m.NetState);
     m.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
     m.FixedEffect(0x3735, 6, 30);
     m.PlaySound(0x5C);
 }
Example #13
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !IsBladeweaveAttack && ( !Validate( attacker ) || !CheckMana( attacker, true ) ) )
                return;

            ClearCurrentAbility( attacker );

            if ( m_Table.ContainsKey( attacker ) )
            {
                Timer t = m_Table[attacker].Timer;

                if ( t != null )
                    t.Stop();
            }

            Timer expireTimer = Timer.DelayCall( EffectDuration, new TimerCallback(
                delegate
                {
                    m_Table.Remove( attacker );
                } ) );

            double skill = Math.Max( attacker.Skills.Bushido.Value, attacker.Skills.Ninjitsu.Value );

            int damageModifier = (int) ( skill * 50.0 / 120.0 );

            m_Table[attacker] = new FeintContext( expireTimer, defender, damageModifier );

            attacker.SendLocalizedMessage( 1063360 ); // You baffle your target with a feint!
            defender.SendLocalizedMessage( 1063361 ); // You were deceived by an attacker's feint!

            attacker.FixedParticles( 0x3728, 1, 13, 0x7F3, 0x962, 0, EffectLayer.Waist );

            BuffInfo.AddBuff( attacker, new BuffInfo( BuffIcon.Feint, 1151308, 1151307, EffectDuration, attacker, String.Format( "{0}\t{1}", defender.Name, damageModifier ) ) );
        }
Example #14
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            if (0.20 > Utility.RandomDouble() && (defender.Mounted || defender.Flying))
            {
                if (defender is PlayerMobile)
                {
                    if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(defender))
                    {
                        defender.SendLocalizedMessage(1114066, this.Name); // ~1_NAME~ knocked you out of animal form!
                    }
                    else if (defender.Mounted)
                    {
                        defender.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
                    }

                    ((PlayerMobile)defender).SetMountBlock(BlockMountType.Dazed, TimeSpan.FromSeconds(10), true);
                }
                else if (defender.Mount != null)
                    defender.Mount.Rider = null;

                defender.PlaySound(0x140);
                defender.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist);
            }

            base.OnGaveMeleeAttack(defender);
        }
      public override void OnDoubleClick( Mobile from )
      {

	PlayerMobile pm = from as PlayerMobile;

			//if ( !IsChildOf( from.Backpack ) )
			{
				//from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			//else if( from.InRange( this.GetWorldLocation(), 1 ) ) 
		        {
           		from.FixedParticles( 0x373A, 10, 15, 5036, EffectLayer.Head ); 
                from.PlaySound( 521 );
        		RidablePolar RidablePolar = new RidablePolar();
        		RidablePolar.Controlled = true;
        		RidablePolar.ControlMaster = from;
        		RidablePolar.IsBonded = true;
        		RidablePolar.Location = from.Location;
        		RidablePolar.Map = from.Map;
        		World.AddMobile( RidablePolar );

               		from.SendMessage( "You click the deed, and a polar bear appears! It is now your loyal pet." );
      			this.Delete();
		        } 
		        //else 
		        { 
		            from.SendLocalizedMessage( 500446 ); // That is too far away. 
		        }
      }
Example #16
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4) + Utility.Random( 10 ) + 1;
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
Example #17
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                // The item must be in your backpack to use it.
                from.SendLocalizedMessage(1060640);
            } 
            else if (from.NextSkillTime > DateTime.Now)
            {
                // You must wait a few seconds before you can use that item.
                from.SendLocalizedMessage(1070772);
            }

            else
            {
                SkillHandlers.Hiding.CombatOverride = true;

                if (from.UseSkill(SkillName.Hiding))
                {

                    from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
                    from.PlaySound(0x22F);

                    Consume();
                }

                SkillHandlers.Hiding.CombatOverride = false;
            }
        }
Example #18
0
		public override bool Use( Mobile from ) {
			if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.PlaySound( 0x2D6 );

				if ( from.Body.IsHuman ) {
					from.Animate( 34, 5, 1, true, false, 0 );
				}

				from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
				from.PlaySound( 0x1EB );

				StatMod mod = from.GetStatMod( "Concussion" );

				if ( mod != null ) {
					from.RemoveStatMod( "Concussion" );
					from.Mana -= mod.Offset;
				}

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );

				Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
					from.EndAction( typeof( ClarityPotion ) );
				} );

				return true;
			}

			return false;
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.Blessed != true )
			{
				if ( IsChildOf( from.Backpack ) )
				{
					new InvulTimer(from).Start();
	
					from.FixedParticles( 0x376A, 9, 32, 5007, EffectLayer.Waist );
					from.PlaySound( 0x1E3 );
	
					BasePotion.PlayDrinkEffect( from );
	
					this.Consume();
				}
				else
				{
					from.SendMessage("The Potion must be in your backpack.");
				}
			}
			else
			{
				from.SendMessage( "You are already invulnerable." );
			}
		}
Example #20
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );


			attacker.SendMessage( "You attack by psychic energy" ); 
			defender.SendMessage( "You attacking by psychic energy" );

			//defender.Mana -= Utility.Random( (int)attacker.Skills[SkillName.Anatomy].Value/10, (int)attacker.Skills[SkillName.Anatomy].Value/5 );
							
					int toDrain = defender.Mana;

					if ( toDrain < 0 )
						toDrain = 0;
					else if ( toDrain > defender.Mana )
						toDrain = defender.Mana;

					if ( m_Table.Contains( defender ) )
						toDrain = 0;

					defender.FixedParticles( 0x3789, 10, 25, 5032, EffectLayer.Head );
					defender.PlaySound( 0x1F8 );

					if ( toDrain > 0 )
					{
						defender.Mana -= toDrain;

						m_Table[defender] = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( AosDelay_Callback ), new object[]{ defender, toDrain } );
					}
		}
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			attacker.SendLocalizedMessage( 1063353 ); // You perform a masterful defense!

			attacker.FixedParticles( 0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist );

			int modifier = (int)(30.0 * ((Math.Max( attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value ) - 50.0) / 70.0));

			DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;

			if( info != null )
				EndDefense( (object)info );

			ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, 50 + modifier );
			attacker.AddResistanceMod( mod );

			info = new DefenseMasteryInfo( attacker, 80 - modifier, mod );
			info.m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( EndDefense ), info );

			m_Table[attacker] = info;

			attacker.Delta( MobileDelta.WeaponDamage );
		}
        public override void Drink(Mobile from)
        {
            Item am = from.Backpack.FindItemByType(typeof(RecluseStingMarker));
            if (am != null)
            {
                from.BodyMod = 0;
                from.Hue = -1;
                from.YellowHealthbar = false;

                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    BasePotion.PlayDrinkEffect(from);

                    this.Consume();
                    from.SendGump(new RecluseAntidoteGump());
                    //am.Delete();
                }
                else if (am == null )
                {
                    from.SendGump(new RecluseCuredGump());
                    
                }
            }
Example #23
0
      public override void OnDoubleClick( Mobile from )
      {

	PlayerMobile pm = from as PlayerMobile;

			//if ( !IsChildOf( from.Backpack ) )
			{
				//from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			//else if( from.InRange( this.GetWorldLocation(), 1 ) ) 
		        {
           		from.FixedParticles( 0x373A, 10, 15, 5036, EffectLayer.Head ); 
               		from.PlaySound( 521 );
        		FireDrake FireDrake = new FireDrake();
        		FireDrake.Controlled = true;
        		FireDrake.ControlMaster = from;
        		FireDrake.IsBonded = true;
        		FireDrake.Location = from.Location;
        		FireDrake.Map = from.Map;
        		World.AddMobile( FireDrake );

               		from.SendMessage( "You raised a Fire Drake with loving care." );
      			this.Delete();
		        } 
		        //else 
		        { 
		            from.SendLocalizedMessage( 500446 ); // That is too far away. 
		        }
      }
Example #24
0
		public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return false;

			ClearCurrentAbility( attacker );

			attacker.SendMessage( "You become one with you weapon, allowing it to guide you hand. The effects of this attack are unpredictable, but effective." );
			defender.SendMessage( "You enemie become one with their weapon and the effects of his attack are unpredictable" );

				attacker.PlaySound( 0x20C );
				attacker.PlaySound( 0x56 );
				attacker.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );

				IEntity from = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z ), attacker.Map );
				IEntity to = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z + 50 ), attacker.Map );
				Effects.SendMovingParticles( from, to, 0xF5F, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

			int damage = 10; 

			damage += Math.Min( 5, (int)(Math.Abs( attacker.Skills[SkillName.Anatomy].Value + attacker.Skills[SkillName.ArmsLore].Value ) / 8));

			defender.Damage( damage, attacker );

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

            ClearCurrentAbility( attacker );

            Timer t = (Timer) m_Table[attacker];

            if ( t != null )
                t.Stop();

            Skill ninjitsu = attacker.Skills[SkillName.Ninjitsu];

            int delay = (int) ( ninjitsu.Value / 12.0 );

            attacker.SendLocalizedMessage( 1063345 ); // You block an attack!
            defender.SendLocalizedMessage( 1063346 ); // Your attack was blocked!

            attacker.FixedParticles( 0x37C4, 1, 16, 0x251D, 0x39D, 0x3, EffectLayer.RightHand );

            m_Table[attacker] = t = Timer.DelayCall( TimeSpan.FromSeconds( delay ), new TimerStateCallback( Expire_Callback ), attacker );
        }
Example #26
0
		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			if( Server.Items.ParalyzingBlow.IsImmune( defender ) )	//After mana consumption intentional
			{
				attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
				defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
				return;
			}

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

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

			defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );
			Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
		}
Example #27
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( m.IsDeadBondedPet )
            {
                Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
            }
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4);
                toHeal += Utility.Random( 1, 10 );

                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
        public override void OnDoubleClick(Mobile from)
        {
            MerlinsStaff Staff = from.FindItemOnLayer(Layer.TwoHanded) as MerlinsStaff;

            if (Parent != from)
            {
                from.SendMessage("You remember that you must equip the staff to summon a portal to Merlin");
            }
            else
            {
                Item marker1 = from.Backpack.FindItemByType(typeof(Marker1));
                if (marker1 != null)
                {
                    marker1.Delete();

                    from.AddToBackpack(new Marker2());
                    from.AddToBackpack(new Tablet());
                    from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
                    from.SendGump(new MerlinsQuestGump6(from));
                    from.SendMessage("Muahahahaha!!!! You fool!");
                    Talon2 tl = new Talon2();
                    tl.Map = from.Map;
                    tl.Location = from.Location;
                    Delete();
                }
                else
                {
                    from.SendMessage("You have no right to have this staff!!!!");
                }
            }
        }
		public void SandAttack( Mobile m )
		{
			DoHarmful( m );

			m.FixedParticles( 0x36B0, 10, 25, 9540, 2413, 0, EffectLayer.Waist );

			new InternalTimer( m, this ).Start();
		}
Example #30
0
		public override void OnHit(Mobile attacker, Mobile defender, int damage)
		{
			if (!Validate(attacker) || !CheckMana(attacker, true))
				return;

			ClearCurrentAbility(attacker);


			attacker.SendMessage("You poisoned your target.");
			defender.SendMessage("You've been poisoned.");

			int level;

			if (Core.AOS)
			{
				if (attacker.InRange(defender, 2))
				{
					int total = (attacker.Skills.Poisoning.Fixed) / 2;

					if (total >= 1000)
						level = 3;
					else if (total > 850)
						level = 2;
					else if (total > 650)
						level = 1;
					else
						level = 0;
				}
				else
				{
					level = 0;
				}
			}
			else
			{
				double total = attacker.Skills[SkillName.Poisoning].Value;

				double dist = attacker.GetDistanceToSqrt(defender);

				if (dist >= 3.0)
					total -= (dist - 3.0) * 10.0;

				if (total >= 200.0 && 1 > Utility.Random(10))
					level = 3;
				else if (total > (Core.AOS ? 170.1 : 170.0))
					level = 2;
				else if (total > (Core.AOS ? 130.1 : 130.0))
					level = 1;
				else
					level = 0;
			}

			defender.ApplyPoison(attacker, Poison.GetPoison(level));

			defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
			defender.PlaySound(0x474);
		}
Example #31
0
        public static int Damage(Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, int chaos, int direct, bool keepAlive, int damageIncrease)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                Mobiles.MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return(damage);
            }

            #region Mondain's Legacy
            BaseTalisman talisman = m.Talisman as BaseTalisman;

            if (talisman != null && talisman.Protection != null)
            {
                damage = talisman.Protection.ScaleDamage(from, damage);
            }
            #endregion

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            #region Mondain's Legacy
            Fix(ref chaos);
            Fix(ref direct);

            if (chaos > 0)
            {
                switch (Utility.Random(5))
                {
                case 0: phys += chaos; break;

                case 1: fire += chaos; break;

                case 2: cold += chaos; break;

                case 3: pois += chaos; break;

                case 4: nrgy += chaos; break;
                }
            }

            damage += (int)(damage * direct / (double)100);
            #endregion

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                int resPhys = m.PhysicalResistance;
                int resFire = m.FireResistance;
                int resCold = m.ColdResistance;
                int resPois = m.PoisonResistance;
                int resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                totalDamage = Math.Min(damage, 35);                     //Direct Damage cap of 35
            }
            else
            {
                totalDamage = damage;
            }

            #region Mondain's Legacy
            totalDamage += (int)(totalDamage * damageIncrease / (double)100);
            #endregion

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent  = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;

                    // Mondain's Legacy mod
                    if (!(pet is ParoxysmusSwampDragon))
                    {
                        pet.BardingHP -= absorbed;
                    }

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null && !from.Deleted && from.Alive)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance))) / 10000, reflectPhys), m);
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Example #32
0
        public static int Damage(
            Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois,
            int nrgy, int chaos = 0, int direct = 0, bool keepAlive = false, bool archer = false, bool deathStrike = false
            )
        {
            if (m?.Deleted != false || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return(damage);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chaos);
            Fix(ref direct);

            if (Core.ML && chaos > 0)
            {
                switch (Utility.Random(5))
                {
                case 0:
                    phys += chaos;
                    break;

                case 1:
                    fire += chaos;
                    break;

                case 2:
                    cold += chaos;
                    break;

                case 3:
                    pois += chaos;
                    break;

                case 4:
                    nrgy += chaos;
                    break;
                }
            }

            BaseQuiver quiver = null;

            if (archer && from != null)
            {
                quiver = from.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
            }

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                var resPhys = m.PhysicalResistance;
                var resFire = m.FireResistance;
                var resCold = m.ColdResistance;
                var resPois = m.PoisonResistance;
                var resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (Core.ML)
                {
                    totalDamage += damage * direct / 100;

                    if (quiver != null)
                    {
                        totalDamage += totalDamage * quiver.DamageIncrease / 100;
                    }
                }

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                if (quiver != null)
                {
                    damage += damage * quiver.DamageIncrease / 100;
                }

                if (!deathStrike)
                {
                    totalDamage = Math.Min(damage, 35); // Direct Damage cap of 35
                }
                else
                {
                    totalDamage = Math.Min(damage, 70); // Direct Damage cap of 70
                }
            }
            else
            {
                totalDamage = damage;

                if (Core.ML && quiver != null)
                {
                    totalDamage += totalDamage * quiver.DamageIncrease / 100;
                }
            }

            if (from?.Player != true && m.Player && m.Mount is SwampDragon pet)
            {
                if (pet.HasBarding)
                {
                    var percent  = pet.BardingExceptional ? 20 : 10;
                    var absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from?.Deleted == false && from.Alive)
            {
                var reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if ((from as ExodusMinion)?.FieldActive == true ||
                        (from as ExodusOverseer)?.FieldActive == true)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(
                            Scale(damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance)) / 10000, reflectPhys),
                            m
                            );
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Example #33
0
        public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                Mobiles.MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return(damage);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (m_ArmorIgnore)
            {
                resPhys = 0;
            }

            int totalDamage;

            totalDamage  = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

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

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent  = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - resPhys)) / 10000, reflectPhys), m);
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Example #34
0
            protected override void OnTick()
            {
                if (m_ForebiddenLoreStatue == null)
                {
                    Stop();
                    return;
                }

                if (m_ForebiddenLoreStatue.Deleted)
                {
                    Stop();
                    return;
                }

                if (m_ForebiddenLoreStatue.EffectCount >= m_ForebiddenLoreStatue.EffectMaxCount)
                {
                    m_ForebiddenLoreStatue.Delete();
                    Stop();

                    return;
                }

                m_ForebiddenLoreStatue.EffectCount++;

                Point3D location = m_ForebiddenLoreStatue.Location;
                Map     map      = m_ForebiddenLoreStatue.Map;

                int effectHue = m_ForebiddenLoreStatue.Hue - 1;

                int minDamage = m_ForebiddenLoreStatue.MinDamage;
                int maxDamage = m_ForebiddenLoreStatue.MaxDamage;

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

                IPooledEnumerable mobileInRange = m_ForebiddenLoreStatue.Map.GetMobilesInRange(location, m_ForebiddenLoreStatue.Range);

                foreach (Mobile mobile in mobileInRange)
                {
                    if (UOACZRegion.ContainsItem(m_ForebiddenLoreStatue))
                    {
                        if (!UOACZSystem.IsUOACZValidMobile(mobile))
                        {
                            continue;
                        }
                        if (!map.InLOS(location, mobile.Location))
                        {
                            continue;
                        }
                        if (mobile.Hidden)
                        {
                            continue;
                        }
                        if (mobile is UOACZBaseUndead)
                        {
                            continue;
                        }
                        if (mobile is PlayerMobile)
                        {
                            PlayerMobile player = mobile as PlayerMobile;

                            if (player.IsUOACZUndead)
                            {
                                continue;
                            }
                        }

                        m_ValidMobiles.Add(mobile);
                    }

                    else
                    {
                        if (!SpecialAbilities.MonsterCanDamage(null, mobile))
                        {
                            continue;
                        }
                    }
                }

                mobileInRange.Free();

                if (m_ValidMobiles.Count == 0)
                {
                    return;
                }

                Mobile  target         = m_ValidMobiles[Utility.RandomMinMax(0, m_ValidMobiles.Count - 1)];
                Point3D targetLocation = target.Location;

                IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 14), map);
                IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), map);

                int particleSpeed = 5;

                Effects.PlaySound(location, map, 0x227);
                Effects.SendMovingParticles(startLocation, endLocation, 0x36D4, particleSpeed, 0, false, false, effectHue, 0, 9501, 0, 0, 0x100);

                Point3D newLocation = new Point3D(location.X, location.Y, location.Z + 14);

                TimedStatic timedStatic = new TimedStatic(0x3779, .5);

                timedStatic.Hue  = effectHue;
                timedStatic.Name = "dissipated energy";
                timedStatic.MoveToWorld(newLocation, map);

                double distance         = Utility.GetDistanceToSqrt(location, targetLocation);
                double destinationDelay = (double)distance * .08;

                Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                {
                    if (m_ForebiddenLoreStatue.Deleted)
                    {
                        return;
                    }
                    if (target == null)
                    {
                        return;
                    }
                    if (target.Deleted || !target.Alive)
                    {
                        return;
                    }
                    if (Utility.GetDistanceToSqrt(m_ForebiddenLoreStatue.Location, targetLocation) >= 30)
                    {
                        return;
                    }

                    int damage = Utility.RandomMinMax(minDamage, maxDamage);

                    if (target is BaseCreature)
                    {
                        damage *= 2;
                    }

                    Effects.PlaySound(location, map, 0x208);

                    target.FixedParticles(0x36BD, 20, 20, 5044, effectHue, 0, EffectLayer.Head);
                    //Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 20, effectHue, 0, 5029, 0);

                    new Blood().MoveToWorld(targetLocation, map);
                    AOS.Damage(target, damage, 0, 100, 0, 0, 0);
                });
            }
Example #35
0
        public static int Damage(Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, int chaos, int direct, bool keepAlive, bool archer)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                //Taran: This caused a huge bug where you could keep using skills and stack them when this was called
                //if (from is PlayerMobile)
                //    ((PlayerMobile)from).EndPlayerAction();

                if (m.Body.IsHuman)
                {
                    if (m.Mounted)
                    {
                        m.Animate(29, 5, 1, true, false, 2);
                    }
                    else
                    {
                        m.Animate(20, 5, 1, true, false, 2);
                    }
                }

                m.PlaySound(m.GetHurtSound());

                m.Damage(damage, from);
                return(damage);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chaos);
            Fix(ref direct);

            if (Core.ML && chaos > 0)
            {
                switch (Utility.Random(5))
                {
                case 0: phys += chaos; break;

                case 1: fire += chaos; break;

                case 2: cold += chaos; break;

                case 3: pois += chaos; break;

                case 4: nrgy += chaos; break;
                }
            }

            BaseQuiver quiver = null;

            if (archer && from != null)
            {
                quiver = from.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
            }

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                int resPhys = m.PhysicalResistance;
                int resFire = m.FireResistance;
                int resCold = m.ColdResistance;
                int resPois = m.PoisonResistance;
                int resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (Core.ML)
                {
                    totalDamage += damage * direct / 100;

                    if (quiver != null)
                    {
                        totalDamage += totalDamage * quiver.DamageIncrease / 100;
                    }
                }

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                if (quiver != null)
                {
                    damage += damage * quiver.DamageIncrease / 100;
                }

                totalDamage = Math.Min(damage, 35);                     //Direct Damage cap of 35
            }
            else
            {
                totalDamage = damage;

                if (Core.ML && quiver != null)
                {
                    totalDamage += totalDamage * quiver.DamageIncrease / 100;
                }
            }

            #region Dragon Barding
            if ((from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent  = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null && !from.Deleted && from.Alive)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance))) / 10000, reflectPhys), m);
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Example #36
0
        public static void DoMoves(BaseCreature from, Mobile target)
        {
            switch (Utility.Random(3))
            {
            case 0:

                if (Utility.Random(500) <= from.RoarAttack)
                {
                    int power;
                    int mindam;
                    int maxdam;

                    if (from.RoarAttack > 3)
                    {
                        mindam = from.RoarAttack / 3;
                        maxdam = from.RoarAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    if (from.RoarAttack > 10)
                    {
                        power = from.RoarAttack / 10;
                    }
                    else
                    {
                        power = 1;
                    }

                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in from.GetMobilesInRange(power))
                    {
                        if (m != from)
                        {
                            targets.Add(m);
                        }
                    }

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

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = (BaseCreature)m;

                            bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20);
                        }
                    }
                }

                break;

            case 1:

                if (Utility.Random(500) <= from.PetPoisonAttack)
                {
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    Effects.PlaySound(target.Location, target.Map, 0x229);

                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    int level = from.PetPoisonAttack / 20;

                    if (level > 5)
                    {
                        level = 5;
                    }

                    target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
                }

                break;

            case 2:

                if (Utility.Random(500) <= from.FireBreathAttack)
                {
                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    from.PlaySound(Core.AOS ? 0x15E : 0x44B);
                    target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    target.PlaySound(0x208);

                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);

                    Timer t = new FireBreathDOT(target, from, from.FireBreathAttack);
                    t.Start();
                }

                break;
            }
        }
Example #37
0
        public static int Damage(Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, int chaos, int direct, bool keepAlive, bool archer, bool deathStrike)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys > 0)
            {
                damage = m.AbsorbDamage(from, m, damage, true, false);
            }

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

            m.Damage(damage, from);

            return(damage);

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chaos);
            Fix(ref direct);

            BaseQuiver quiver = null;

            if (archer && from != null)
            {
                quiver = from.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
            }

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                int resPhys = m.PhysicalResistance;
                int resFire = m.FireResistance;
                int resCold = m.ColdResistance;
                int resPois = m.PoisonResistance;
                int resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (Core.ML)
                {
                    totalDamage += damage * direct / 100;

                    if (quiver != null)
                    {
                        totalDamage += totalDamage * quiver.DamageIncrease / 100;
                    }
                }

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                if (quiver != null)
                {
                    damage += damage * quiver.DamageIncrease / 100;
                }

                if (!deathStrike)
                {
                    totalDamage = Math.Min(damage, 35);                 //Direct Damage cap of 35
                }
                else
                {
                    totalDamage = Math.Min(damage, 70);                         // Direct Damage cap of 70
                }
            }
            else
            {
                totalDamage = damage;

                if (Core.ML && quiver != null)
                {
                    totalDamage += totalDamage * quiver.DamageIncrease / 100;
                }
            }

            #region Dragon Barding
            if ((from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent  = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null && !from.Deleted && from.Alive)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance))) / 10000, reflectPhys), m);
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
Example #38
0
        // Main Aura Method
        public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text, bool scales, bool allownull, bool effects, int itemid, int hue)
        {
            if (from == null && !allownull)
            {
                return;
            }

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

            foreach (Mobile m in Map.AllMaps[map.MapID].GetMobilesInRange(location, range))
            {
                if (CanTarget(from, m, true, false, allownull))
                {
                    targets.Add(m);
                }
            }

            if (effects && from != null)
            {
                from.Animate(12, 5, 1, true, false, 0);
            }

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

                if (text != "")
                {
                    m.SendMessage(text);
                }

                int auradamage = Utility.RandomMinMax(min, max);

                if (scales)
                {
                    auradamage = (int)((auradamage / GetDist(location, m.Location)) * range);
                }

                if (poison != null)
                {
                    m.ApplyPoison((from == null) ? m : from, poison);
                }

                if (effects)
                {
                    m.FixedParticles(itemid, 10, 15, 5030 /*what the hell does this number do?*/, hue, 0, EffectLayer.Waist);
                }

                switch (type)
                {
                case ResistanceType.Physical:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 100, 0, 0, 0, 0);
                    break;

                case ResistanceType.Fire:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 100, 0, 0, 0);
                    break;

                case ResistanceType.Cold:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 100, 0, 0);
                    break;

                case ResistanceType.Poison:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 100, 0);
                    break;

                case ResistanceType.Energy:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 0, 100);
                    break;
                }
            }

            targets.Clear();
        }
Example #39
0
        public static int Damage(bool directDamage, Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, int chao, bool keepAlive)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                Mobiles.MeerMage.StopEffect(m, true);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chao);

            switch (Utility.RandomMinMax(1, 5))
            {
            case 1: phys += chao; break;

            case 2: fire += chao; break;

            case 3: cold += chao; break;

            case 4: pois += chao; break;

            case 5: nrgy += chao; break;
            }

            chao = 0;

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (m_ArmorIgnore)
            {
                resPhys = fire = cold = pois = nrgy = 0;
                phys    = 100;
            }

            if (m_ArmorPierce)
            {
                double delta = 0.6;                 // is this correct?

                resPhys -= (int)(delta * resPhys);
            }

            int totalDamage;

            totalDamage  = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

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

            int absorbed;

            #region Damage Eater
            int dmgEater = Math.Min((int)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.DamageEater), 18);

            int physEater = dmgEater;
            int fireEater = dmgEater;
            int coldEater = dmgEater;
            int poisEater = dmgEater;
            int nrgyEater = dmgEater;

            if (!m_ArmorIgnore)
            {
                physEater = Math.Min(Math.Max(AbsorptionAttributes.GetValue(m, AbsorptionAttribute.KineticEater), dmgEater), 30);
                fireEater = Math.Min(Math.Max(AbsorptionAttributes.GetValue(m, AbsorptionAttribute.FireEater), dmgEater), 30);
                coldEater = Math.Min(Math.Max(AbsorptionAttributes.GetValue(m, AbsorptionAttribute.ColdEater), dmgEater), 30);
                poisEater = Math.Min(Math.Max(AbsorptionAttributes.GetValue(m, AbsorptionAttribute.PoisonEater), dmgEater), 30);
                nrgyEater = Math.Min(Math.Max(AbsorptionAttributes.GetValue(m, AbsorptionAttribute.EnergyEater), dmgEater), 30);
            }

            absorbed  = damage * phys * (100 - resPhys) * physEater;
            absorbed += damage * fire * (100 - resFire) * fireEater;
            absorbed += damage * cold * (100 - resCold) * coldEater;
            absorbed += damage * pois * (100 - resPois) * poisEater;
            absorbed += damage * nrgy * (100 - resNrgy) * nrgyEater;

            absorbed /= 1000000;

            if (m is PlayerMobile)
            {
                ((PlayerMobile)m).EatDamage(absorbed);
            }
            #endregion

            if (!m_ArmorIgnore)
            {
                #region Resonance
                if (m.Spell is Spell && m.Spell.IsCasting)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        double chance = 0.0;

                        switch (i)
                        {
                        case 0: chance = (double)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.KineticResonance) / phys; break;

                        case 1: chance = (double)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.FireResonance) / fire; break;

                        case 2: chance = (double)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.ColdResonance) / cold; break;

                        case 3: chance = (double)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.PoisonResonance) / pois; break;

                        case 4: chance = (double)AbsorptionAttributes.GetValue(m, AbsorptionAttribute.EnergyResonance) / nrgy; break;
                        }

                        if (chance > Utility.RandomDouble())
                        {
                            ((Spell)m.Spell).Resonates = true;
                            break;
                        }
                    }
                }
                #endregion
            }

            #region Dragon Barding
            if ((from == null || !from.IsPlayer) && m.IsPlayer && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent = (pet.BardingExceptional ? 20 : 10);
                    absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;
                    if (!(pet is ParoxysmusSwampDragon))
                    {
                        pet.BardingHP -= absorbed;
                    }

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null)
            {
                int reflectPhys = m.GetMagicalAttribute(MagicalAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        int rpd_damage = Scale((damage * phys * (100 - from.PhysicalResistance)) / 10000, reflectPhys);
                        if (m is PlayerMobile && from is PlayerMobile && directDamage)
                        {
                            rpd_damage = Math.Min(rpd_damage, 35);
                        }
                        from.Damage(rpd_damage, m);
                    }
                }
            }

            if (from is BaseCreature)
            {
                Mobile master = ((BaseCreature)from).ControlMaster;

                if (master != null)
                {
                    master.RevealingAction();
                }

                #region Talismans
                BaseTalisman talis = BaseTalisman.GetTalisman(m);

                if (talis != null && talis.ProtectionTalis != NPC_Name.None && talis.ProtectionValue > 0)
                {
                    if (ProtectionKillerEntry.IsProtectionKiller(talis.ProtectionTalis, from))
                    {
                        totalDamage = totalDamage - ((totalDamage * talis.ProtectionValue) / 100);
                    }
                }
                #endregion
            }

            if (from != null)
            {
                Item cloak     = from.FindItemOnLayer(Layer.Cloak);
                Item twohanded = from.FindItemOnLayer(Layer.TwoHanded);

                if (directDamage && cloak is BaseQuiver && twohanded is BaseRanged)
                {
                    BaseQuiver quiver = cloak as BaseQuiver;
                    totalDamage += (int)(totalDamage * quiver.DamageModifier * 0.01);
                }
            }

            if (m is PlayerMobile && from is PlayerMobile && directDamage)
            {
                totalDamage = Math.Min(totalDamage, 35);
            }

            /* TODO: El efecto del Attunement debería ir despues de aplicar el Blood Oath.
             * Según parece, en OSI los Necro-Arcanists lo usan mucho en PvP, de manera que
             * el daño recibido se refleja al atacante por Blood Oath, pero luego es
             * absorbido por el Attunement en el defensor.
             */
            if (directDamage)
            {
                Spells.Spellweaving.AttunementSpell.TryAbsorb(m, ref totalDamage);
            }

            if (from != null)
            {
                SpellHelper.DoLeech(totalDamage, from, m);
            }

            m.Damage(totalDamage, from);

            return(totalDamage);
        }
Example #40
0
        public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive, int armorIgnore)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
                return 0;


            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
                Mobiles.MeerMage.StopEffect(m, true);

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return damage;
            }
            bool Stalker = false;
            TeiravonMobile TavMobile;
            double var = 1;
            if (from != null && from is TeiravonMobile)
            {
                TavMobile = from as TeiravonMobile;
                var = .9 - (TavMobile.PlayerLevel * .01);
                if (TavMobile.HasFeat(TeiravonMobile.Feats.StalkingPrey))
                    Stalker = true;
            }

            if (from != null && Spells.Third.BlessSpell.narindun.Contains(from))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(from, m, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, from, m.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            if (from !=null && Spells.Third.BlessSpell.narindun.Contains(m))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(m, from, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, m, from.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (Spells.Third.BlessSpell.saerin.Contains(m))
                resPhys = 95;

            if (armorIgnore > 0 )
            {
                double f = (100 - armorIgnore) / 100.0;
                resPhys =(int)(resPhys * f);
                resFire = (int)(resFire * f);
                resCold = (int)(resCold * f);
                resPois = (int)(resPois * f);
                resNrgy = (int)(resNrgy * f);
            }
            if (from != null && IsTracking(from, m) && Stalker)
            {
                resPhys = (int)(resPhys * var);
                resFire = (int)(resFire * var);
                resCold = (int)(resCold * var);
                resPois = (int)(resPois * var);
                resNrgy = (int)(resNrgy * var);
            }

            if (m_ArmorIgnore)
                resPhys = resFire = resCold = resPois = resNrgy = 0;

            if (Spells.Third.BlessSpell.saerin.Contains(m) && resPhys < 50)
                resPhys = 50;

            int totalDamage;



            totalDamage = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

            if (totalDamage < 1)
                totalDamage = 1;

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
                totalDamage = m.Hits;

            if (from != null)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - resPhys)) / 10000, reflectPhys), m);
                    }
                }
            }

            if (from != null && Spells.Third.BlessSpell.valar.Contains(m))
            {
                ArrayList TargList = new ArrayList();

                foreach (Mobile x in m.GetMobilesInRange(2))
                {
                    if (x != m && x.AccessLevel <= m.AccessLevel && !x.Blessed)
                        TargList.Add(x);

                }

                if (TargList.Count > 0)
                {
                    m.FixedParticles(0x376A, 9, 32, 5005, 2634, 2, EffectLayer.Waist);
                    totalDamage = totalDamage / TargList.Count;
                    for (int i = 0; i < TargList.Count; ++i)
                    {
                        Mobile dude = TargList[i] as Mobile;
                        dude.Damage(totalDamage, from);
                    }
                }
            }

            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;
                if (((tav.IsOrc() && tav.HasFeat(TeiravonMobile.Feats.Tuffness) || tav.HasFeat(TeiravonMobile.Feats.PhysicalResistance)) && from != null && from != tav))
                {
                    double reduce = (((double)(100 - Utility.RandomMinMax(0, 5)) - (double)(tav.PlayerLevel / 1.75)) / (double)100);

                    int temp = totalDamage;

                    totalDamage = (int)((double)totalDamage * (double)reduce);

                    if (temp - totalDamage < 1)
                        totalDamage -= 1;

                    if (totalDamage < 0)
                        totalDamage = 0;

                    if (Utility.RandomMinMax(1, 20) > 19)
                    {
                        totalDamage = 0;
                        tav.SendMessage("Your tough skin deflects the attack!");
                        from.SendMessage("{0} deflects the attack!", tav.Name);
                    }

                }
            }

            if (Spells.Third.BlessSpell.kamalini.Contains(m) && (((DateTime)Spells.Third.BlessSpell.kamalini[m] + TimeSpan.FromSeconds(3)).CompareTo(DateTime.Now)) < 0)
            {
                IPooledEnumerable eable = m.GetMobilesInRange(2);
                ArrayList targets = new ArrayList();
                int total = 0;
                foreach (Mobile t in eable)
                {
                    if (t.AccessLevel > m.AccessLevel || t.Blessed || t == m)
                        continue;
                    targets.Add(t);
                }
                eable.Free();

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile x = (Mobile)targets[i];
                    total += (int)(x.Hits * .03);
                }
                if (total > 2)
                {
                    m.Heal(Utility.RandomMinMax((int)(total * .75), total));
                    m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                    Spells.Third.BlessSpell.kamalini[m] = DateTime.Now;
                }
            }
            m.Damage(totalDamage, from);
            return totalDamage;
        }