*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
@@ -323,6 +323,8 @@ struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI
m_creature->setActive(true); m_creature->setActive(true);
Searched = false; Searched = false;
FindOrbs(); FindOrbs();
ScriptedAI::InitializeAI();
} }
void Reset(){} 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_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->addUnitState(UNIT_STAT_STUNNED); m_creature->addUnitState(UNIT_STAT_STUNNED);
ScriptedAI::InitializeAI();
} }
void Reset(){ void Reset(){
@@ -914,6 +918,8 @@ struct TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI
SpawnFiendTimer = 5000; SpawnFiendTimer = 5000;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
ScriptedAI::InitializeAI();
} }
// TODO: Timers // TODO: Timers
@@ -1066,6 +1072,8 @@ struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI
my = ShieldOrbLocations[0][1]; my = ShieldOrbLocations[0][1];
if (rand()%2 == 0)Clockwise = true; if (rand()%2 == 0)Clockwise = true;
else Clockwise = false; else Clockwise = false;
ScriptedAI::InitializeAI();
} }
void Reset(){} void Reset(){}
@@ -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); 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 JustReachedHome() { Prepare(); _JustReachedHome(); }
void KilledUnit(Unit* victim) void KilledUnit(Unit* victim)
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
Reset(); ScriptedAI::InitializeAI();
} }
void Reset() void Reset()
+2
View File
@@ -48,6 +48,8 @@ void SpellAI::InitializeAI()
for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
if(me->m_spells[i] && GetSpellStore()->LookupEntry(me->m_spells[i])) if(me->m_spells[i] && GetSpellStore()->LookupEntry(me->m_spells[i]))
spells.push_back(me->m_spells[i]); spells.push_back(me->m_spells[i]);
CreatureAI::InitializeAI();
} }
void SpellAI::Reset() void SpellAI::Reset()