*Fix a bug that shade of Akama causes crash.
--HG-- branch : trunk
This commit is contained in:
@@ -188,9 +188,12 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
|||||||
|
|
||||||
bool IsBanished;
|
bool IsBanished;
|
||||||
bool HasKilledAkama;
|
bool HasKilledAkama;
|
||||||
|
bool reseting;
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
|
reseting = true;
|
||||||
|
|
||||||
m_creature->setActive(true); // TODO: setActive(true, time);
|
m_creature->setActive(true); // TODO: setActive(true, time);
|
||||||
FindChannelers();
|
FindChannelers();
|
||||||
|
|
||||||
@@ -221,15 +224,17 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
|||||||
if(!Sorcerers.empty())
|
if(!Sorcerers.empty())
|
||||||
{
|
{
|
||||||
for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
|
for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
|
||||||
|
{
|
||||||
if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
||||||
if(Sorcerer->isAlive())
|
if(Sorcerer->isAlive())
|
||||||
{
|
{
|
||||||
Sorcerer->SetVisibility(VISIBILITY_OFF);
|
Sorcerer->SetVisibility(VISIBILITY_OFF);
|
||||||
Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
Sorcerer->Kill(Sorcerer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Sorcerers.clear();
|
Sorcerers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
|
if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
|
||||||
Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||||
|
|
||||||
@@ -253,6 +258,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
|||||||
|
|
||||||
if(pInstance && m_creature->isAlive())
|
if(pInstance && m_creature->isAlive())
|
||||||
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
|
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
|
||||||
|
|
||||||
|
reseting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who) { }
|
void Aggro(Unit* who) { }
|
||||||
@@ -274,6 +281,9 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
|||||||
|
|
||||||
void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
|
void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
|
||||||
{
|
{
|
||||||
|
if(reseting)
|
||||||
|
return;
|
||||||
|
|
||||||
debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
|
debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
|
||||||
++DeathCount;
|
++DeathCount;
|
||||||
m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
|
m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user