public virtual void DoHarmful( Mobile target, bool indirect ) { if ( target == null ) return; bool isCriminal = IsHarmfulCriminal( target ); OnHarmfulAction( target, isCriminal ); target.AggressiveAction( this, isCriminal ); Region.OnDidHarmful( this, target ); target.Region.OnGotHarmful( this, target ); if ( !indirect ) Combatant = target; if ( m_ExpireCombatant == null ) m_ExpireCombatant = new ExpireCombatantTimer( this ); else m_ExpireCombatant.Stop(); m_ExpireCombatant.Start(); }
public virtual void DoHarmful( Mobile target, bool indirect ) { if ( target == null ) return; bool isCriminal = IsHarmfulCriminal( target ); OnHarmfulAction( target, isCriminal ); target.AggressiveAction( this, isCriminal ); Region.OnDidHarmful( this, target ); target.Region.OnGotHarmful( this, target ); if ( !indirect ) Combatant = target; #region Combat if ( m_CombatContext == null ) m_CombatContext = new CombatContext( this ); m_CombatContext.RefreshExpireCombatant(); #endregion HarmfulActionEventArgs args = HarmfulActionEventArgs.Create( this, target, isCriminal ); EventSink.Instance.InvokeHarmfulAction( args ); args.Free(); }