mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripting: Some cleanup for Hyjal Script.
This commit is contained in:
@@ -21,32 +21,73 @@
|
||||
|
||||
#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy."
|
||||
|
||||
enum Types
|
||||
{
|
||||
WORLD_STATE_WAVES = 2842,
|
||||
WORLD_STATE_ENEMY = 2453,
|
||||
WORLD_STATE_ENEMYCOUNT = 2454,
|
||||
uint32 const EncounterCount = 5;
|
||||
|
||||
DATA_ANETHERON = 1,
|
||||
DATA_ANETHERONEVENT = 2,
|
||||
DATA_ARCHIMONDE = 3,
|
||||
DATA_ARCHIMONDEEVENT = 4,
|
||||
DATA_AZGALOR = 5,
|
||||
DATA_AZGALOREVENT = 6,
|
||||
DATA_JAINAPROUDMOORE = 7,
|
||||
DATA_KAZROGAL = 8,
|
||||
DATA_KAZROGALEVENT = 9,
|
||||
DATA_RAGEWINTERCHILL = 10,
|
||||
DATA_RAGEWINTERCHILLEVENT = 11,
|
||||
DATA_THRALL = 12,
|
||||
DATA_TYRANDEWHISPERWIND = 13,
|
||||
DATA_TRASH = 14,
|
||||
DATA_RESET_TRASH_COUNT = 15,
|
||||
DATA_ALLIANCE_RETREAT = 16,
|
||||
DATA_HORDE_RETREAT = 17,
|
||||
DATA_RAIDDAMAGE = 18,
|
||||
DATA_RESET_RAIDDAMAGE = 19,
|
||||
TYPE_RETREAT = 20
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_ANETHERON = 1,
|
||||
DATA_ANETHERONEVENT = 2,
|
||||
DATA_ARCHIMONDE = 3,
|
||||
DATA_ARCHIMONDEEVENT = 4,
|
||||
DATA_AZGALOR = 5,
|
||||
DATA_AZGALOREVENT = 6,
|
||||
DATA_JAINAPROUDMOORE = 7,
|
||||
DATA_KAZROGAL = 8,
|
||||
DATA_KAZROGALEVENT = 9,
|
||||
DATA_RAGEWINTERCHILL = 10,
|
||||
DATA_RAGEWINTERCHILLEVENT = 11,
|
||||
DATA_THRALL = 12,
|
||||
DATA_TYRANDEWHISPERWIND = 13,
|
||||
DATA_TRASH = 14,
|
||||
DATA_RESET_TRASH_COUNT = 15,
|
||||
DATA_ALLIANCE_RETREAT = 16,
|
||||
DATA_HORDE_RETREAT = 17,
|
||||
DATA_RAIDDAMAGE = 18,
|
||||
DATA_RESET_RAIDDAMAGE = 19,
|
||||
TYPE_RETREAT = 20
|
||||
};
|
||||
|
||||
enum WorldStateIds
|
||||
{
|
||||
WORLD_STATE_WAVES = 2842,
|
||||
WORLD_STATE_ENEMY = 2453,
|
||||
WORLD_STATE_ENEMYCOUNT = 2454
|
||||
};
|
||||
|
||||
enum CreaturesIds
|
||||
{
|
||||
// Trash Mobs summoned in waves
|
||||
NECROMANCER = 17899,
|
||||
ABOMINATION = 17898,
|
||||
GHOUL = 17895,
|
||||
BANSHEE = 17905,
|
||||
CRYPT_FIEND = 17897,
|
||||
GARGOYLE = 17906,
|
||||
FROST_WYRM = 17907,
|
||||
GIANT_INFERNAL = 17908,
|
||||
FEL_STALKER = 17916,
|
||||
|
||||
JAINA = 17772,
|
||||
THRALL = 17852,
|
||||
TYRANDE = 17948,
|
||||
|
||||
// Bosses summoned after every 8 waves
|
||||
RAGE_WINTERCHILL = 17767,
|
||||
ANETHERON = 17808,
|
||||
KAZROGAL = 17888,
|
||||
AZGALOR = 17842,
|
||||
ARCHIMONDE = 17968,
|
||||
NPC_WORLD_TRIGGER_TINY = 21987
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_HORDE_ENCAMPMENT_PORTAL = 182060,
|
||||
GO_NIGHT_ELF_VILLAGE_PORTAL = 182061,
|
||||
GO_ANCIENT_GEM = 185557,
|
||||
GO_ANCIENT_VEIN = 185557,
|
||||
GO_ROARING_FLAME = 182592
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ void hyjalAI::SpawnVeins()
|
||||
return;
|
||||
for (uint8 i = 0; i<7; ++i)
|
||||
{
|
||||
GameObject* gem = me->SummonGameObject(ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
if (gem)
|
||||
VeinGUID[i]=gem->GetGUID();
|
||||
}
|
||||
@@ -671,7 +671,7 @@ void hyjalAI::SpawnVeins()
|
||||
return;
|
||||
for (uint8 i = 7; i<14; ++i)
|
||||
{
|
||||
GameObject* gem = me->SummonGameObject(ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
|
||||
if (gem)
|
||||
VeinGUID[i]=gem->GetGUID();
|
||||
}
|
||||
@@ -731,7 +731,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
HideNearPos(me->GetPositionX(), me->GetPositionY());
|
||||
HideNearPos(5037.76f, -1889.71f);
|
||||
for (uint8 i = 0; i < 92; ++i)//summon fires
|
||||
me->SummonGameObject(FLAMEOBJECT, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
|
||||
me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
|
||||
|
||||
}
|
||||
else me->SetVisible(true);
|
||||
@@ -744,7 +744,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
HideNearPos(5563, -2763.19f);
|
||||
HideNearPos(5542.2f, -2629.36f);
|
||||
for (uint8 i = 0; i < 65; ++i)//summon fires
|
||||
me->SummonGameObject(FLAMEOBJECT, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
|
||||
me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
|
||||
|
||||
}
|
||||
else me->SetVisible(true);
|
||||
@@ -1051,7 +1051,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
{
|
||||
case 0://alliance
|
||||
for (uint8 i = 0; i < 92; ++i)//summon fires
|
||||
me->SummonGameObject(FLAMEOBJECT, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
|
||||
me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
|
||||
|
||||
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
|
||||
{
|
||||
@@ -1092,7 +1092,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
||||
break;
|
||||
case 1://horde
|
||||
for (uint8 i = 0; i < 65; ++i)//summon fires
|
||||
me->SummonGameObject(FLAMEOBJECT, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
|
||||
me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
|
||||
|
||||
for (uint8 i = 0; i < 26; ++i)//summon infernals
|
||||
{
|
||||
|
||||
@@ -24,34 +24,6 @@
|
||||
|
||||
#define HYJAL_AI_MAX_SPELLS 3
|
||||
|
||||
enum CreaturesIds
|
||||
{
|
||||
// Trash Mobs summoned in waves
|
||||
NECROMANCER = 17899,
|
||||
ABOMINATION = 17898,
|
||||
GHOUL = 17895,
|
||||
BANSHEE = 17905,
|
||||
CRYPT_FIEND = 17897,
|
||||
GARGOYLE = 17906,
|
||||
FROST_WYRM = 17907,
|
||||
GIANT_INFERNAL = 17908,
|
||||
FEL_STALKER = 17916,
|
||||
|
||||
JAINA = 17772,
|
||||
THRALL = 17852,
|
||||
TYRANDE = 17948,
|
||||
|
||||
ANCIENT_VEIN = 185557,
|
||||
FLAMEOBJECT = 182592,
|
||||
|
||||
// Bosses summoned after every 8 waves
|
||||
RAGE_WINTERCHILL = 17767,
|
||||
ANETHERON = 17808,
|
||||
KAZROGAL = 17888,
|
||||
AZGALOR = 17842,
|
||||
ARCHIMONDE = 17968,
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_TELEPORT_VISUAL = 41232,
|
||||
@@ -65,7 +37,7 @@ enum SpellIds
|
||||
|
||||
//Thrall spells
|
||||
SPELL_CHAIN_LIGHTNING = 31330,
|
||||
SPELL_SUMMON_DIRE_WOLF = 31331,
|
||||
SPELL_SUMMON_DIRE_WOLF = 31331
|
||||
};
|
||||
|
||||
struct Wave
|
||||
|
||||
@@ -31,12 +31,6 @@ EndScriptData */
|
||||
#include "WorldPacket.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ENCOUNTER = 5,
|
||||
|
||||
GO_ANCIENT_GEM = 185557,
|
||||
};
|
||||
/* Battle of Mount Hyjal encounters:
|
||||
0 - Rage Winterchill event
|
||||
1 - Anetheron event
|
||||
@@ -45,6 +39,9 @@ enum Misc
|
||||
4 - Archimonde event
|
||||
*/
|
||||
|
||||
#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more."
|
||||
#define YELL_EFFORTS_NAME "Archimonde"
|
||||
|
||||
class instance_hyjal : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
@@ -59,61 +56,33 @@ public:
|
||||
{
|
||||
instance_mount_hyjal_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
std::list<uint64> m_uiAncientGemGUID;
|
||||
|
||||
uint64 RageWinterchill;
|
||||
uint64 Anetheron;
|
||||
uint64 Kazrogal;
|
||||
uint64 Azgalor;
|
||||
uint64 Archimonde;
|
||||
uint64 JainaProudmoore;
|
||||
uint64 Thrall;
|
||||
uint64 TyrandeWhisperwind;
|
||||
uint64 HordeGate;
|
||||
uint64 ElfGate;
|
||||
|
||||
uint32 Trash;
|
||||
|
||||
uint32 hordeRetreat;
|
||||
uint32 allianceRetreat;
|
||||
bool ArchiYell;
|
||||
|
||||
uint32 RaidDamage;
|
||||
|
||||
#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more."
|
||||
#define YELL_EFFORTS_NAME "Archimonde"
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
m_uiAncientGemGUID.clear();
|
||||
|
||||
RageWinterchill = 0;
|
||||
Anetheron = 0;
|
||||
Kazrogal = 0;
|
||||
Azgalor = 0;
|
||||
Archimonde = 0;
|
||||
JainaProudmoore = 0;
|
||||
Thrall = 0;
|
||||
RageWinterchill = 0;
|
||||
Anetheron = 0;
|
||||
Kazrogal = 0;
|
||||
Azgalor = 0;
|
||||
Archimonde = 0;
|
||||
JainaProudmoore = 0;
|
||||
Thrall = 0;
|
||||
TyrandeWhisperwind = 0;
|
||||
HordeGate = 0;
|
||||
ElfGate = 0;
|
||||
ArchiYell = false;
|
||||
RaidDamage = 0;
|
||||
HordeGate = 0;
|
||||
ElfGate = 0;
|
||||
RaidDamage = 0;
|
||||
Trash = 0;
|
||||
hordeRetreat = 0;
|
||||
allianceRetreat = 0;
|
||||
|
||||
Trash = 0;
|
||||
|
||||
hordeRetreat = 0;
|
||||
allianceRetreat = 0;
|
||||
ArchiYell = false;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
for (uint8 i = 0; i < EncounterCount; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
@@ -124,14 +93,14 @@ public:
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case 182060:
|
||||
case GO_HORDE_ENCAMPMENT_PORTAL:
|
||||
HordeGate = go->GetGUID();
|
||||
if (allianceRetreat)
|
||||
HandleGameObject(0, true, go);
|
||||
else
|
||||
HandleGameObject(0, false, go);
|
||||
break;
|
||||
case 182061:
|
||||
case GO_NIGHT_ELF_VILLAGE_PORTAL:
|
||||
ElfGate = go->GetGUID();
|
||||
if (hordeRetreat)
|
||||
HandleGameObject(0, true, go);
|
||||
@@ -148,14 +117,14 @@ public:
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case 17767: RageWinterchill = creature->GetGUID(); break;
|
||||
case 17808: Anetheron = creature->GetGUID(); break;
|
||||
case 17888: Kazrogal = creature->GetGUID(); break;
|
||||
case 17842: Azgalor = creature->GetGUID(); break;
|
||||
case 17968: Archimonde = creature->GetGUID(); break;
|
||||
case 17772: JainaProudmoore = creature->GetGUID(); break;
|
||||
case 17852: Thrall = creature->GetGUID(); break;
|
||||
case 17948: TyrandeWhisperwind = creature->GetGUID(); break;
|
||||
case RAGE_WINTERCHILL: RageWinterchill = creature->GetGUID(); break;
|
||||
case ANETHERON: Anetheron = creature->GetGUID(); break;
|
||||
case KAZROGAL: Kazrogal = creature->GetGUID(); break;
|
||||
case AZGALOR: Azgalor = creature->GetGUID(); break;
|
||||
case ARCHIMONDE: Archimonde = creature->GetGUID(); break;
|
||||
case JAINA: JainaProudmoore = creature->GetGUID(); break;
|
||||
case THRALL: Thrall = creature->GetGUID(); break;
|
||||
case TYRANDE: TyrandeWhisperwind = creature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,13 +132,13 @@ public:
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_RAGEWINTERCHILL: return RageWinterchill;
|
||||
case DATA_ANETHERON: return Anetheron;
|
||||
case DATA_KAZROGAL: return Kazrogal;
|
||||
case DATA_AZGALOR: return Azgalor;
|
||||
case DATA_ARCHIMONDE: return Archimonde;
|
||||
case DATA_JAINAPROUDMOORE: return JainaProudmoore;
|
||||
case DATA_THRALL: return Thrall;
|
||||
case DATA_RAGEWINTERCHILL: return RageWinterchill;
|
||||
case DATA_ANETHERON: return Anetheron;
|
||||
case DATA_KAZROGAL: return Kazrogal;
|
||||
case DATA_AZGALOR: return Azgalor;
|
||||
case DATA_ARCHIMONDE: return Archimonde;
|
||||
case DATA_JAINAPROUDMOORE: return JainaProudmoore;
|
||||
case DATA_THRALL: return Thrall;
|
||||
case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
|
||||
}
|
||||
|
||||
@@ -202,7 +171,7 @@ public:
|
||||
Creature* creature = instance->GetCreature(Azgalor);
|
||||
if (creature)
|
||||
{
|
||||
Creature* unit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
Creature* unit = creature->SummonCreature(NPC_WORLD_TRIGGER_TINY, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
|
||||
Map* map = creature->GetMap();
|
||||
if (map->IsDungeon() && unit)
|
||||
@@ -301,14 +270,14 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0];
|
||||
case DATA_ANETHERONEVENT: return m_auiEncounter[1];
|
||||
case DATA_KAZROGALEVENT: return m_auiEncounter[2];
|
||||
case DATA_AZGALOREVENT: return m_auiEncounter[3];
|
||||
case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
|
||||
case DATA_TRASH: return Trash;
|
||||
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
|
||||
case DATA_HORDE_RETREAT: return hordeRetreat;
|
||||
case DATA_RAIDDAMAGE: return RaidDamage;
|
||||
case DATA_ANETHERONEVENT: return m_auiEncounter[1];
|
||||
case DATA_KAZROGALEVENT: return m_auiEncounter[2];
|
||||
case DATA_AZGALOREVENT: return m_auiEncounter[3];
|
||||
case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
|
||||
case DATA_TRASH: return Trash;
|
||||
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
|
||||
case DATA_HORDE_RETREAT: return hordeRetreat;
|
||||
case DATA_RAIDDAMAGE: return RaidDamage;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -329,13 +298,32 @@ public:
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage;
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
for (uint8 i = 0; i < EncounterCount; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
protected:
|
||||
uint32 m_auiEncounter[EncounterCount];
|
||||
std::string str_data;
|
||||
std::list<uint64> m_uiAncientGemGUID;
|
||||
uint64 RageWinterchill;
|
||||
uint64 Anetheron;
|
||||
uint64 Kazrogal;
|
||||
uint64 Azgalor;
|
||||
uint64 Archimonde;
|
||||
uint64 JainaProudmoore;
|
||||
uint64 Thrall;
|
||||
uint64 TyrandeWhisperwind;
|
||||
uint64 HordeGate;
|
||||
uint64 ElfGate;
|
||||
uint32 Trash;
|
||||
uint32 hordeRetreat;
|
||||
uint32 allianceRetreat;
|
||||
uint32 RaidDamage;
|
||||
bool ArchiYell;
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_mount_hyjal()
|
||||
|
||||
Reference in New Issue
Block a user