void MoonScriptCreatureAI::OnDied(Unit *pKiller) { RandomEmote(mOnDiedEmotes); CancelAllSpells(); CancelAllTimers(); RemoveAllAuras(); if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER); }
void ArcScriptCreatureAI::OnCombatStop(Unit* pTarget) { CancelAllSpells(); CancelAllTimers(); RemoveAllAuras(); SetBehavior(Behavior_Default); _unit->GetAIInterface()->SetAIState(STATE_IDLE); RemoveAIUpdateEvent(); if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER); }
void MoonScriptCreatureAI::OnCombatStop(Unit *pTarget) { CancelAllSpells(); CancelAllTimers(); RemoveAllAuras(); SetCanMove(true); SetBehavior(Behavior_Default); if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER); }
void MoonScriptCreatureAI::OnCombatStop(Unit* pTarget) { CancelAllSpells(); CancelAllTimers(); RemoveAllAuras(); SetCanMove(true); SetBehavior(Behavior_Default); //_unit->GetAIInterface()->SetAIState(STATE_IDLE); // Fix for stucking mobs that don't regen RemoveAIUpdateEvent(); if( mDespawnWhenInactive ) Despawn(DEFAULT_DESPAWN_TIMER); }
void MoonScriptBossAI::SetPhase(int32 pPhase, SpellDesc* pPhaseChangeSpell) { if(mPhaseIndex != pPhase) { //Cancel all spells CancelAllSpells(); //Enable spells related to that phase for(PhaseSpellArray::iterator SpellIter = mPhaseSpells.begin(); SpellIter != mPhaseSpells.end(); ++SpellIter) SpellIter->second->mEnabled = SpellIter->first == pPhase ? true : false; //Remember phase index mPhaseIndex = pPhase; //Cast phase change spell now if available if(pPhaseChangeSpell) CastSpellNowNoScheduling(pPhaseChangeSpell); } };