*Little changes in instance Gruul's Lair.
--HG-- branch : trunk
This commit is contained in:
@@ -77,14 +77,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
|
|||||||
Reverberation_Timer= 60000+45000;
|
Reverberation_Timer= 60000+45000;
|
||||||
|
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
|
||||||
pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
|
pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
|
||||||
|
|
||||||
GameObject* Door = NULL;
|
|
||||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR));
|
|
||||||
if(Door)
|
|
||||||
Door->SetGoState(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
@@ -92,14 +85,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
|
|||||||
DoScriptText(SAY_DEATH, m_creature);
|
DoScriptText(SAY_DEATH, m_creature);
|
||||||
|
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
|
||||||
pInstance->SetData(DATA_GRUULEVENT, DONE);
|
pInstance->SetData(DATA_GRUULEVENT, DONE);
|
||||||
|
|
||||||
GameObject* Door = NULL;
|
|
||||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR));
|
|
||||||
if(Door)
|
|
||||||
Door->SetGoState(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit *who)
|
void Aggro(Unit *who)
|
||||||
@@ -108,14 +94,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
|
|||||||
DoZoneInCombat();
|
DoZoneInCombat();
|
||||||
|
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
|
||||||
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
|
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
|
||||||
|
|
||||||
GameObject* Door = NULL;
|
|
||||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR));
|
|
||||||
if(Door)
|
|
||||||
Door->SetGoState(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KilledUnit()
|
void KilledUnit()
|
||||||
|
|||||||
@@ -65,6 +65,44 @@ EndScriptData */
|
|||||||
#define SPELL_SPELLSHIELD 33054
|
#define SPELL_SPELLSHIELD 33054
|
||||||
#define SPELL_BLAST_WAVE 33061
|
#define SPELL_BLAST_WAVE 33061
|
||||||
|
|
||||||
|
bool AllBossDied(ScriptedInstance* pInstance, Creature* m_creature)
|
||||||
|
{
|
||||||
|
if(!pInstance || !m_creature)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
uint64 MaulgarGUID = 0;
|
||||||
|
uint64 KigglerGUID = 0;
|
||||||
|
uint64 BlindeyeGUID = 0;
|
||||||
|
uint64 OlmGUID = 0;
|
||||||
|
uint64 KroshGUID = 0;
|
||||||
|
|
||||||
|
Creature* Maulgar = NULL;
|
||||||
|
Creature* Kiggler = NULL;
|
||||||
|
Creature* Blindeye = NULL;
|
||||||
|
Creature* Olm = NULL;
|
||||||
|
Creature* Krosh = NULL;
|
||||||
|
|
||||||
|
MaulgarGUID = pInstance->GetData64(DATA_MAULGAR);
|
||||||
|
KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
|
||||||
|
BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER);
|
||||||
|
OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER);
|
||||||
|
KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND);
|
||||||
|
|
||||||
|
Maulgar = ((Creature*)Unit::GetUnit((*m_creature), MaulgarGUID));
|
||||||
|
Kiggler = ((Creature*)Unit::GetUnit((*m_creature), KigglerGUID));
|
||||||
|
Blindeye = ((Creature*)Unit::GetUnit((*m_creature), BlindeyeGUID));
|
||||||
|
Olm = ((Creature*)Unit::GetUnit((*m_creature), OlmGUID));
|
||||||
|
Krosh = ((Creature*)Unit::GetUnit((*m_creature), KroshGUID));
|
||||||
|
|
||||||
|
if(!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//High King Maulgar AI
|
//High King Maulgar AI
|
||||||
struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
|
struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
|
||||||
{
|
{
|
||||||
@@ -132,15 +170,8 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
DoScriptText(SAY_DEATH, m_creature);
|
DoScriptText(SAY_DEATH, m_creature);
|
||||||
|
|
||||||
if (pInstance)
|
if(CheckAllBossDied(pInstance, m_creature))
|
||||||
{
|
|
||||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||||
|
|
||||||
GameObject* Door = NULL;
|
|
||||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_MAULGARDOOR));
|
|
||||||
if(Door)
|
|
||||||
Door->SetGoState(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDeath()
|
void AddDeath()
|
||||||
@@ -310,6 +341,9 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
|
|||||||
|
|
||||||
if(Maulgar)
|
if(Maulgar)
|
||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
|
|
||||||
|
if(CheckAllBossDied(pInstance, m_creature))
|
||||||
|
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,6 +445,9 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
|
|||||||
|
|
||||||
if(Maulgar)
|
if(Maulgar)
|
||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
|
|
||||||
|
if(CheckAllBossDied(pInstance, m_creature))
|
||||||
|
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,6 +551,9 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
|
|||||||
|
|
||||||
if(Maulgar)
|
if(Maulgar)
|
||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
|
|
||||||
|
if(CheckAllBossDied(pInstance, m_creature))
|
||||||
|
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,6 +642,9 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
|||||||
|
|
||||||
if(Maulgar)
|
if(Maulgar)
|
||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
|
|
||||||
|
if(CheckAllBossDied(pInstance, m_creature))
|
||||||
|
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
MaulgarDoor = 0;
|
MaulgarDoor = 0;
|
||||||
GruulDoor = 0;
|
GruulDoor = 0;
|
||||||
|
|
||||||
|
|
||||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||||
Encounters[i] = NOT_STARTED;
|
Encounters[i] = NOT_STARTED;
|
||||||
}
|
}
|
||||||
@@ -88,7 +87,10 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
{
|
{
|
||||||
switch(go->GetEntry())
|
switch(go->GetEntry())
|
||||||
{
|
{
|
||||||
case 184468: MaulgarDoor = go->GetGUID();break;
|
case 184468:
|
||||||
|
MaulgarDoor = go->GetGUID();
|
||||||
|
if(Encounters[0] == DONE) HandleGameObject(NULL, true, go);
|
||||||
|
break;
|
||||||
case 184662: GruulDoor = go->GetGUID(); break;
|
case 184662: GruulDoor = go->GetGUID(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,8 +122,11 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case DATA_MAULGAREVENT:
|
case DATA_MAULGAREVENT:
|
||||||
|
if(data == DONE) HandleGameObject(MaulgarDoor, true);
|
||||||
Encounters[0] = data; break;
|
Encounters[0] = data; break;
|
||||||
case DATA_GRUULEVENT:
|
case DATA_GRUULEVENT:
|
||||||
|
if(data == IN_PROGRESS) HandleGameObject(GruulDoor, true);
|
||||||
|
else HandleGameObject(GruulDoor, false);
|
||||||
Encounters[1] = data; break;
|
Encounters[1] = data; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +144,6 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char* Save()
|
const char* Save()
|
||||||
{
|
{
|
||||||
OUT_SAVE_INST_DATA;
|
OUT_SAVE_INST_DATA;
|
||||||
@@ -173,6 +177,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
OUT_LOAD_INST_DATA_COMPLETE;
|
OUT_LOAD_INST_DATA_COMPLETE;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
InstanceData* GetInstanceData_instance_gruuls_lair(Map* map)
|
InstanceData* GetInstanceData_instance_gruuls_lair(Map* map)
|
||||||
{
|
{
|
||||||
return new instance_gruuls_lair(map);
|
return new instance_gruuls_lair(map);
|
||||||
|
|||||||
Reference in New Issue
Block a user