*Fix a bug that shade of Akama causes crash.
--HG-- branch : trunk
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -188,9 +188,12 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
|
||||
bool IsBanished;
|
||||
bool HasKilledAkama;
|
||||
bool reseting;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
reseting = true;
|
||||
|
||||
m_creature->setActive(true); // TODO: setActive(true, time);
|
||||
FindChannelers();
|
||||
|
||||
@@ -221,15 +224,17 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
if(!Sorcerers.empty())
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
|
||||
{
|
||||
if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
||||
if(Sorcerer->isAlive())
|
||||
{
|
||||
Sorcerer->SetVisibility(VISIBILITY_OFF);
|
||||
Sorcerer->DealDamage(Sorcerer, Sorcerer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
Sorcerer->Kill(Sorcerer);
|
||||
}
|
||||
}
|
||||
|
||||
Sorcerers.clear();
|
||||
}
|
||||
|
||||
if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
|
||||
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())
|
||||
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
|
||||
|
||||
reseting = false;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if(reseting)
|
||||
return;
|
||||
|
||||
debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
|
||||
++DeathCount;
|
||||
m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
|
||||
|
||||
Reference in New Issue
Block a user