public static void InvokeBeforeDamage(BeforeDamageEventArgs e) { if (BeforeDamage != null) { BeforeDamage(e); } }
private static void EventSink_BeforeDamage( BeforeDamageEventArgs e ) { int amount = e.Amount; AlterDamage( e.From, e.Mobile, ref amount ); e.Amount = amount; }
private static void EventSink_BeforeDamage( BeforeDamageEventArgs e ) { if ( CheckEffect( e.Mobile ) ) { bool isFromPlayer = ( e.From != null && e.From.IsPlayer ); e.Amount = (int) ( e.Amount * ( isFromPlayer ? 1.1 : 1.25 ) ); } }
private static void EventSink_BeforeDamage( BeforeDamageEventArgs e ) { Perseverance spellsong = Spellsong.GetEffectSpellsong<Perseverance>( e.Mobile ); if ( spellsong != null ) e.Amount = (int) ( e.Amount * ( 100 - spellsong.DamageTaken ) / 100 ); }
public virtual void Damage( int amount, Mobile from, bool informMount ) { if ( !CanBeDamaged() ) return; if ( !Region.OnDamage( this, ref amount ) ) return; BeforeDamageEventArgs args = new BeforeDamageEventArgs( this, from, amount ); EventSink.Instance.InvokeBeforeDamage( args ); amount = args.Amount; if ( amount > 0 ) { int oldHits = Hits; int newHits = oldHits - amount; if ( newHits < 0 ) amount = oldHits; if ( m_Spell != null ) m_Spell.OnCasterHurt(); if ( from != null ) RegisterDamage( amount, from ); DisruptiveAction(); if ( ( m_Skills[SkillName.Hiding].Value * 0.75 / 100.0 ) < Utility.RandomDouble() ) Hidden = false; Paralyzed = false; InvokeDamaged( new DamagedEventArgs( amount, from ) ); OnDamage( amount, from, newHits < 0 ); IMount m = this.Mount; if ( m != null && informMount ) m.OnRiderDamaged( amount, from, newHits < 0 ); if ( newHits < 0 ) { m_LastKiller = from; Hits = 0; if ( oldHits >= 0 ) Kill(); } else { Hits = newHits; } } }
public void InvokeBeforeDamage( BeforeDamageEventArgs e ) { if ( BeforeDamage != null ) BeforeDamage( e ); }
private static void EventSink_BeforeDamage( BeforeDamageEventArgs e ) { if ( e.From == null ) return; Inspire spellsong = Spellsong.GetEffectSpellsong<Inspire>( e.From ); if ( spellsong != null ) e.Amount = (int) ( e.Amount * ( 100 + spellsong.DamageModifier ) / 100 ); }