Fix crash in Mal'Ganis script + cleanup.
Fixes issue #1347. Thanks Johnholiver. --HG-- branch : trunk
This commit is contained in:
@@ -86,7 +86,6 @@ struct boss_mal_ganisAI : public ScriptedAI
|
|||||||
bool bYelled;
|
bool bYelled;
|
||||||
bool bYelled2;
|
bool bYelled2;
|
||||||
|
|
||||||
Creature *pArthas;
|
|
||||||
CombatPhases Phase;
|
CombatPhases Phase;
|
||||||
|
|
||||||
ScriptedInstance* pInstance;
|
ScriptedInstance* pInstance;
|
||||||
@@ -95,7 +94,6 @@ struct boss_mal_ganisAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
bYelled = false;
|
bYelled = false;
|
||||||
bYelled2 = false;
|
bYelled2 = false;
|
||||||
pArthas = NULL;
|
|
||||||
Phase = COMBAT;
|
Phase = COMBAT;
|
||||||
uiCarrionSwarmTimer = 6000;
|
uiCarrionSwarmTimer = 6000;
|
||||||
uiMindBlastTimer = 11000;
|
uiMindBlastTimer = 11000;
|
||||||
@@ -110,9 +108,6 @@ struct boss_mal_ganisAI : public ScriptedAI
|
|||||||
void EnterCombat(Unit* who)
|
void EnterCombat(Unit* who)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_AGGRO, m_creature);
|
DoScriptText(SAY_AGGRO, m_creature);
|
||||||
|
|
||||||
pArthas = GetClosestCreatureWithEntry(m_creature, NPC_ARTHAS, 150.0f);
|
|
||||||
|
|
||||||
if (pInstance)
|
if (pInstance)
|
||||||
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
|
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
|
||||||
}
|
}
|
||||||
@@ -153,13 +148,14 @@ struct boss_mal_ganisAI : public ScriptedAI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pArthas && pArthas->isDead())
|
if (Creature* pArthas = m_creature->GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
|
||||||
{
|
if (pArthas->isDead())
|
||||||
EnterEvadeMode();
|
{
|
||||||
m_creature->DisappearAndDie();
|
EnterEvadeMode();
|
||||||
if (pInstance)
|
m_creature->DisappearAndDie();
|
||||||
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
|
if (pInstance)
|
||||||
}
|
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
if (uiCarrionSwarmTimer < diff)
|
if (uiCarrionSwarmTimer < diff)
|
||||||
{
|
{
|
||||||
@@ -202,7 +198,7 @@ struct boss_mal_ganisAI : public ScriptedAI
|
|||||||
uiOutroTimer = 8000;
|
uiOutroTimer = 8000;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pArthas->GetGUID());
|
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
|
||||||
m_creature->HandleEmoteCommand(29);
|
m_creature->HandleEmoteCommand(29);
|
||||||
DoScriptText(SAY_ESCAPE_SPEECH_2, m_creature);
|
DoScriptText(SAY_ESCAPE_SPEECH_2, m_creature);
|
||||||
++uiOutroStep;
|
++uiOutroStep;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ enum Data
|
|||||||
|
|
||||||
enum Data64
|
enum Data64
|
||||||
{
|
{
|
||||||
|
DATA_ARTHAS,
|
||||||
DATA_MEATHOOK,
|
DATA_MEATHOOK,
|
||||||
DATA_SALRAMM,
|
DATA_SALRAMM,
|
||||||
DATA_EPOCH,
|
DATA_EPOCH,
|
||||||
|
|||||||
+5
@@ -33,6 +33,7 @@ struct instance_culling_of_stratholme : public ScriptedInstance
|
|||||||
{
|
{
|
||||||
instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||||
|
|
||||||
|
uint64 uiArthas;
|
||||||
uint64 uiMeathook;
|
uint64 uiMeathook;
|
||||||
uint64 uiSalramm;
|
uint64 uiSalramm;
|
||||||
uint64 uiEpoch;
|
uint64 uiEpoch;
|
||||||
@@ -60,6 +61,9 @@ struct instance_culling_of_stratholme : public ScriptedInstance
|
|||||||
{
|
{
|
||||||
switch(pCreature->GetEntry())
|
switch(pCreature->GetEntry())
|
||||||
{
|
{
|
||||||
|
case NPC_ARTHAS:
|
||||||
|
uiArthas = pCreature->GetGUID();
|
||||||
|
break;
|
||||||
case NPC_MEATHOOK:
|
case NPC_MEATHOOK:
|
||||||
uiMeathook = pCreature->GetGUID();
|
uiMeathook = pCreature->GetGUID();
|
||||||
break;
|
break;
|
||||||
@@ -162,6 +166,7 @@ struct instance_culling_of_stratholme : public ScriptedInstance
|
|||||||
{
|
{
|
||||||
switch(identifier)
|
switch(identifier)
|
||||||
{
|
{
|
||||||
|
case DATA_ARTHAS: return uiArthas;
|
||||||
case DATA_MEATHOOK: return uiMeathook;
|
case DATA_MEATHOOK: return uiMeathook;
|
||||||
case DATA_SALRAMM: return uiSalramm;
|
case DATA_SALRAMM: return uiSalramm;
|
||||||
case DATA_EPOCH: return uiEpoch;
|
case DATA_EPOCH: return uiEpoch;
|
||||||
|
|||||||
Reference in New Issue
Block a user