*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()
|
||||||
@@ -301,17 +332,20 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
{
|
||||||
Creature *Maulgar = NULL;
|
Creature *Maulgar = NULL;
|
||||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
@@ -402,17 +436,20 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
{
|
||||||
Creature *Maulgar = NULL;
|
Creature *Maulgar = NULL;
|
||||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
@@ -505,17 +542,20 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
{
|
||||||
Creature *Maulgar = NULL;
|
Creature *Maulgar = NULL;
|
||||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
@@ -593,17 +633,20 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
{
|
||||||
Creature *Maulgar = NULL;
|
Creature *Maulgar = NULL;
|
||||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
uint64 BlindeyeTheSeer;
|
uint64 BlindeyeTheSeer;
|
||||||
uint64 OlmTheSummoner;
|
uint64 OlmTheSummoner;
|
||||||
uint64 KroshFirehand;
|
uint64 KroshFirehand;
|
||||||
uint64 Maulgar;
|
uint64 Maulgar;
|
||||||
|
|
||||||
uint64 MaulgarDoor;
|
uint64 MaulgarDoor;
|
||||||
uint64 GruulDoor;
|
uint64 GruulDoor;
|
||||||
|
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
@@ -54,11 +54,10 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
BlindeyeTheSeer = 0;
|
BlindeyeTheSeer = 0;
|
||||||
OlmTheSummoner = 0;
|
OlmTheSummoner = 0;
|
||||||
KroshFirehand = 0;
|
KroshFirehand = 0;
|
||||||
Maulgar = 0;
|
Maulgar = 0;
|
||||||
|
|
||||||
MaulgarDoor = 0;
|
|
||||||
GruulDoor = 0;
|
|
||||||
|
|
||||||
|
MaulgarDoor = 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;
|
||||||
@@ -77,21 +76,24 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
switch(creature_entry)
|
switch(creature_entry)
|
||||||
{
|
{
|
||||||
case 18835: KigglerTheCrazed = creature->GetGUID(); break;
|
case 18835: KigglerTheCrazed = creature->GetGUID(); break;
|
||||||
case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
|
case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
|
||||||
case 18834: OlmTheSummoner = creature->GetGUID(); break;
|
case 18834: OlmTheSummoner = creature->GetGUID(); break;
|
||||||
case 18832: KroshFirehand = creature->GetGUID(); break;
|
case 18832: KroshFirehand = creature->GetGUID(); break;
|
||||||
case 18831: Maulgar = creature->GetGUID();break;
|
case 18831: Maulgar = creature->GetGUID(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnObjectCreate(GameObject* go)
|
void OnObjectCreate(GameObject* go)
|
||||||
{
|
{
|
||||||
switch(go->GetEntry())
|
switch(go->GetEntry())
|
||||||
{
|
{
|
||||||
case 184468: MaulgarDoor = go->GetGUID();break;
|
case 184468:
|
||||||
case 184662: GruulDoor = go->GetGUID();break;
|
MaulgarDoor = go->GetGUID();
|
||||||
}
|
if(Encounters[0] == DONE) HandleGameObject(NULL, true, go);
|
||||||
}
|
break;
|
||||||
|
case 184662: GruulDoor = go->GetGUID(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SetData64(uint32 type, uint64 data)
|
void SetData64(uint32 type, uint64 data)
|
||||||
{
|
{
|
||||||
@@ -103,14 +105,14 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
{
|
{
|
||||||
switch(identifier)
|
switch(identifier)
|
||||||
{
|
{
|
||||||
case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
|
case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
|
||||||
case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
|
case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
|
||||||
case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
|
case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
|
||||||
case DATA_OLMTHESUMMONER: return OlmTheSummoner;
|
case DATA_OLMTHESUMMONER: return OlmTheSummoner;
|
||||||
case DATA_KROSHFIREHAND: return KroshFirehand;
|
case DATA_KROSHFIREHAND: return KroshFirehand;
|
||||||
case DATA_MAULGARDOOR: return MaulgarDoor;
|
case DATA_MAULGARDOOR: return MaulgarDoor;
|
||||||
case DATA_GRUULDOOR: return GruulDoor;
|
case DATA_GRUULDOOR: return GruulDoor;
|
||||||
case DATA_MAULGAR: return Maulgar;
|
case DATA_MAULGAR: return Maulgar;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -120,13 +122,16 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data == DONE)
|
if(data == DONE)
|
||||||
SaveToDB();
|
SaveToDB();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 GetData(uint32 type)
|
uint32 GetData(uint32 type)
|
||||||
@@ -134,13 +139,12 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
|||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case DATA_MAULGAREVENT: return Encounters[0];
|
case DATA_MAULGAREVENT: return Encounters[0];
|
||||||
case DATA_GRUULEVENT: return Encounters[1];
|
case DATA_GRUULEVENT: return Encounters[1];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Save()
|
||||||
const char* Save()
|
|
||||||
{
|
{
|
||||||
OUT_SAVE_INST_DATA;
|
OUT_SAVE_INST_DATA;
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
@@ -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