*Fix the bug that Reset is not called for some scripts. This should fix the bug of quest "death's challenge". Thanks to Kudlaty

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-17 20:00:28 -05:00
parent 14022b619f
commit c84d37c2c2
4 changed files with 12 additions and 2 deletions

View File

@@ -323,6 +323,8 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI
m_creature->setActive(true);
Searched = false;
FindOrbs();
ScriptedAI::InitializeAI();
}
void Reset(){}
@@ -753,6 +755,8 @@ struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementA
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->addUnitState(UNIT_STAT_STUNNED);
ScriptedAI::InitializeAI();
}
void Reset(){
@@ -914,6 +918,8 @@ struct TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI
SpawnFiendTimer = 5000;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
ScriptedAI::InitializeAI();
}
// TODO: Timers
@@ -1066,6 +1072,8 @@ struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI
my = ShieldOrbLocations[0][1];
if (rand()%2 == 0)Clockwise = true;
else Clockwise = false;
ScriptedAI::InitializeAI();
}
void Reset(){}

View File

@@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI
DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
}
void InitializeAI() { Prepare(); }
void InitializeAI() { Prepare(); BossAI::InitializeAI(); }
void JustReachedHome() { Prepare(); _JustReachedHome(); }
void KilledUnit(Unit* victim)

View File

@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
Reset();
ScriptedAI::InitializeAI();
}
void Reset()

View File

@@ -48,6 +48,8 @@ void SpellAI::InitializeAI()
for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
if(me->m_spells[i] && GetSpellStore()->LookupEntry(me->m_spells[i]))
spells.push_back(me->m_spells[i]);
CreatureAI::InitializeAI();
}
void SpellAI::Reset()