aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoschiwald <joschiwald@online.de>2013-08-20 18:11:41 +0200
committerjoschiwald <joschiwald@online.de>2013-08-20 18:11:41 +0200
commit7e3a52bb42a6f1a7882440fce575f82b9d0fe6ec (patch)
tree71759285b1f8885dae940bbe7851769f96d2b60b /src
parentd74b8f0a1a4c72506d5a287334b6e7ae663da8ac (diff)
Scripts/HallsOfLightning: reworked InstanceScript
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp8
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp7
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h48
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp338
8 files changed, 185 insertions, 234 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 94454e8440d..ebf7121eb54 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3374,10 +3374,6 @@ void SpellMgr::LoadSpellInfoCorrections()
case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc
spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1);
break;
- case 59414: // Pulsing Shockwave Aura (Loken)
- // this flag breaks movement, remove it
- spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1;
- break;
case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with
spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
break;
diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
index 240e27ad026..d9e34ee2af3 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
@@ -36,7 +36,7 @@ class instance_drak_tharon_keep : public InstanceMapScript
KingDredGUID = 0;
TharonJaGUID = 0;
- memset(TrollgoreInvaderSummonerGuids, 0, 4 * sizeof(uint64));
+ memset(TrollgoreInvaderSummonerGuids, 0, 3 * sizeof(uint64));
memset(NovosCrystalGUIDs, 0, 4 * sizeof(uint64));
memset(NovosSummonerGUIDs, 0, 4 * sizeof(uint64));
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
index 2077049641f..944eacda34e 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
@@ -181,7 +181,7 @@ public:
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE);
if (instance)
- instance->SetData(TYPE_BJARNGRIM, NOT_STARTED);
+ instance->SetBossState(DATA_BJARNGRIM, NOT_STARTED);
}
void EnterEvadeMode() OVERRIDE
@@ -202,7 +202,7 @@ public:
me->CallForHelp(30.0f);
if (instance)
- instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS);
+ instance->SetBossState(DATA_BJARNGRIM, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -215,7 +215,7 @@ public:
Talk(SAY_DEATH);
if (instance)
- instance->SetData(TYPE_BJARNGRIM, DONE);
+ instance->SetBossState(DATA_BJARNGRIM, DONE);
}
/// @todo remove when removal is done by the core
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index dfb21edf9af..af6beca608d 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -116,7 +116,7 @@ public:
me->SetVisible(true);
if (instance)
- instance->SetData(TYPE_IONAR, NOT_STARTED);
+ instance->SetBossState(DATA_IONAR, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -124,7 +124,7 @@ public:
Talk(SAY_AGGRO);
if (instance)
- instance->SetData(TYPE_IONAR, IN_PROGRESS);
+ instance->SetBossState(DATA_IONAR, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -134,7 +134,7 @@ public:
lSparkList.DespawnAll();
if (instance)
- instance->SetData(TYPE_IONAR, DONE);
+ instance->SetBossState(DATA_IONAR, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -338,7 +338,7 @@ public:
void UpdateAI(uint32 uiDiff) OVERRIDE
{
// Despawn if the encounter is not running
- if (instance && instance->GetData(TYPE_IONAR) != IN_PROGRESS)
+ if (instance && instance->GetBossState(DATA_IONAR) != IN_PROGRESS)
{
me->DespawnOrUnsummon();
return;
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index d8ab71870a8..61687de1b58 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -97,7 +97,7 @@ public:
if (instance)
{
- instance->SetData(TYPE_LOKEN, NOT_STARTED);
+ instance->SetBossState(DATA_LOKEN, NOT_STARTED);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
}
}
@@ -108,7 +108,7 @@ public:
if (instance)
{
- instance->SetData(TYPE_LOKEN, IN_PROGRESS);
+ instance->SetBossState(DATA_LOKEN, IN_PROGRESS);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
}
}
@@ -119,7 +119,7 @@ public:
if (instance)
{
- instance->SetData(TYPE_LOKEN, DONE);
+ instance->SetBossState(DATA_LOKEN, DONE);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
}
}
@@ -140,6 +140,7 @@ public:
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
{
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
+ me->ClearUnitState(UNIT_STATE_CASTING); // this flag breaks movement
DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true);
m_uiResumePulsingShockwave_Timer = 0;
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index 725293a7e60..b6790a088ad 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -121,7 +121,7 @@ public:
m_lGolemGUIDList.clear();
if (instance)
- instance->SetData(TYPE_VOLKHAN, NOT_STARTED);
+ instance->SetBossState(DATA_VOLKHAN, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -129,7 +129,7 @@ public:
Talk(SAY_AGGRO);
if (instance)
- instance->SetData(TYPE_VOLKHAN, IN_PROGRESS);
+ instance->SetBossState(DATA_VOLKHAN, IN_PROGRESS);
}
void AttackStart(Unit* who) OVERRIDE
@@ -151,7 +151,7 @@ public:
DespawnGolem();
if (instance)
- instance->SetData(TYPE_VOLKHAN, DONE);
+ instance->SetBossState(DATA_VOLKHAN, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
index c45feab1e8a..3659f53752c 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 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
@@ -16,22 +15,23 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DEF_HALLS_OF_LIGHTNING_H
-#define DEF_HALLS_OF_LIGHTNING_H
+#ifndef HALLS_OF_LIGHTNING_H_
+#define HALLS_OF_LIGHTNING_H_
-enum Types
-{
- MAX_ENCOUNTER = 4,
+#include "Map.h"
+#include "Creature.h"
- DATA_BJARNGRIM = 1,
- DATA_IONAR = 2,
- DATA_LOKEN = 3,
- DATA_VOLKHAN = 4,
+#define HoLScriptName "instance_halls_of_lightning"
- TYPE_BJARNGRIM = 10,
- TYPE_IONAR = 11,
- TYPE_LOKEN = 12,
- TYPE_VOLKHAN = 13,
+uint32 const EncounterCount = 4;
+
+enum DataTypes
+{
+ // Encounter States/Boss GUIDs
+ DATA_BJARNGRIM = 0,
+ DATA_VOLKHAN = 1,
+ DATA_IONAR = 2,
+ DATA_LOKEN = 3
};
enum CreaturesIds
@@ -44,11 +44,21 @@ enum CreaturesIds
enum GameObjectIds
{
- GO_BJARNGRIM_DOOR = 191416, //_doors10
- GO_VOLKHAN_DOOR = 191325, //_doors07
- GO_IONAR_DOOR = 191326, //_doors05
- GO_LOKEN_DOOR = 191324, //_doors02
+ GO_BJARNGRIM_DOOR = 191416,
+ GO_VOLKHAN_DOOR = 191325,
+ GO_IONAR_DOOR = 191326,
+ GO_LOKEN_DOOR = 191324,
GO_LOKEN_THRONE = 192654
};
-#endif
+template<class AI>
+AI* GetHallsOfLightningAI(Creature* creature)
+{
+ if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
+ if (instance->GetInstanceScript())
+ if (instance->GetScriptId() == sObjectMgr->GetScriptId(HoLScriptName))
+ return new AI(creature);
+ return NULL;
+}
+
+#endif // HALLS_OF_LIGHTNING_H_
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
index e6d2ededd73..95967f3a7bc 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 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
@@ -16,240 +15,185 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Instance_Halls_of_Lightning
-SD%Complete: 90%
-SDComment: All ready.
-SDCategory: Halls of Lightning
-EndScriptData */
-
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "halls_of_lightning.h"
-/* Halls of Lightning encounters:
-0 - General Bjarngrim
-1 - Volkhan
-2 - Ionar
-3 - Loken
-*/
+DoorData const doorData[] =
+{
+ { GO_BJARNGRIM_DOOR, DATA_BJARNGRIM, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_VOLKHAN_DOOR, DATA_VOLKHAN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_IONAR_DOOR, DATA_IONAR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_LOKEN_DOOR, DATA_LOKEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+};
class instance_halls_of_lightning : public InstanceMapScript
{
-public:
- instance_halls_of_lightning() : InstanceMapScript("instance_halls_of_lightning", 602) { }
-
- InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
- {
- return new instance_halls_of_lightning_InstanceMapScript(map);
- }
-
- struct instance_halls_of_lightning_InstanceMapScript : public InstanceScript
- {
- instance_halls_of_lightning_InstanceMapScript(Map* map) : InstanceScript(map) {}
+ public:
+ instance_halls_of_lightning() : InstanceMapScript(HoLScriptName, 602) { }
- uint32 m_auiEncounter[MAX_ENCOUNTER];
-
- uint64 m_uiGeneralBjarngrimGUID;
- uint64 m_uiIonarGUID;
- uint64 m_uiLokenGUID;
- uint64 m_uiVolkhanGUID;
-
- uint64 m_uiBjarngrimDoorGUID;
- uint64 m_uiVolkhanDoorGUID;
- uint64 m_uiIonarDoorGUID;
- uint64 m_uiLokenDoorGUID;
- uint64 m_uiLokenGlobeGUID;
-
- void Initialize() OVERRIDE
+ struct instance_halls_of_lightning_InstanceMapScript : public InstanceScript
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ instance_halls_of_lightning_InstanceMapScript(Map* map) : InstanceScript(map)
+ {
+ SetBossNumber(EncounterCount);
+ LoadDoorData(doorData);
- m_uiGeneralBjarngrimGUID = 0;
- m_uiVolkhanGUID = 0;
- m_uiIonarGUID = 0;
- m_uiLokenGUID = 0;
+ GeneralBjarngrimGUID = 0;
+ VolkhanGUID = 0;
+ IonarGUID = 0;
+ LokenGUID = 0;
- m_uiBjarngrimDoorGUID = 0;
- m_uiVolkhanDoorGUID = 0;
- m_uiIonarDoorGUID = 0;
- m_uiLokenDoorGUID = 0;
- m_uiLokenGlobeGUID = 0;
- }
+ LokenGlobeGUID = 0;
+ }
- void OnCreatureCreate(Creature* creature) OVERRIDE
- {
- switch (creature->GetEntry())
+ void OnCreatureCreate(Creature* creature) OVERRIDE
{
- case NPC_BJARNGRIM:
- m_uiGeneralBjarngrimGUID = creature->GetGUID();
- break;
- case NPC_VOLKHAN:
- m_uiVolkhanGUID = creature->GetGUID();
- break;
- case NPC_IONAR:
- m_uiIonarGUID = creature->GetGUID();
- break;
- case NPC_LOKEN:
- m_uiLokenGUID = creature->GetGUID();
- break;
+ switch (creature->GetEntry())
+ {
+ case NPC_BJARNGRIM:
+ GeneralBjarngrimGUID = creature->GetGUID();
+ break;
+ case NPC_VOLKHAN:
+ VolkhanGUID = creature->GetGUID();
+ break;
+ case NPC_IONAR:
+ IonarGUID = creature->GetGUID();
+ break;
+ case NPC_LOKEN:
+ LokenGUID = creature->GetGUID();
+ break;
+ default:
+ break;
+ }
}
- }
- void OnGameObjectCreate(GameObject* go) OVERRIDE
- {
- switch (go->GetEntry())
+ void OnGameObjectCreate(GameObject* go) OVERRIDE
{
- case GO_BJARNGRIM_DOOR:
- m_uiBjarngrimDoorGUID = go->GetGUID();
- if (m_auiEncounter[0] == DONE)
- go->SetGoState(GO_STATE_ACTIVE);
- else
- go->SetGoState(GO_STATE_READY);
- break;
- case GO_VOLKHAN_DOOR:
- m_uiVolkhanDoorGUID = go->GetGUID();
- if (m_auiEncounter[1] == DONE)
- go->SetGoState(GO_STATE_ACTIVE);
- else
- go->SetGoState(GO_STATE_READY);
- break;
- case GO_IONAR_DOOR:
- m_uiIonarDoorGUID = go->GetGUID();
- if (m_auiEncounter[2] == DONE)
- go->SetGoState(GO_STATE_ACTIVE);
- else
- go->SetGoState(GO_STATE_READY);
- break;
- case GO_LOKEN_DOOR:
- m_uiLokenDoorGUID = go->GetGUID();
- if (m_auiEncounter[3] == DONE)
- go->SetGoState(GO_STATE_ACTIVE);
- else
- go->SetGoState(GO_STATE_READY);
- break;
- case GO_LOKEN_THRONE:
- m_uiLokenGlobeGUID = go->GetGUID();
- break;
+ switch (go->GetEntry())
+ {
+ case GO_BJARNGRIM_DOOR:
+ case GO_VOLKHAN_DOOR:
+ case GO_IONAR_DOOR:
+ case GO_LOKEN_DOOR:
+ AddDoor(go, true);
+ break;
+ case GO_LOKEN_THRONE:
+ LokenGlobeGUID = go->GetGUID();
+ break;
+ default:
+ break;
+ }
}
- }
- void SetData(uint32 uiType, uint32 uiData) OVERRIDE
- {
- switch (uiType)
+ void OnGameObjectRemove(GameObject* go) OVERRIDE
{
- case TYPE_BJARNGRIM:
- if (uiData == DONE)
- if (GameObject* pDoor = instance->GetGameObject(m_uiBjarngrimDoorGUID))
- pDoor->SetGoState(GO_STATE_ACTIVE);
- m_auiEncounter[0] = uiData;
- break;
- case TYPE_VOLKHAN:
- if (uiData == DONE)
- if (GameObject* pDoor = instance->GetGameObject(m_uiVolkhanDoorGUID))
- pDoor->SetGoState(GO_STATE_ACTIVE);
- m_auiEncounter[1] = uiData;
- break;
- case TYPE_IONAR:
- if (uiData == DONE)
- if (GameObject* pDoor = instance->GetGameObject(m_uiIonarDoorGUID))
- pDoor->SetGoState(GO_STATE_ACTIVE);
- m_auiEncounter[2] = uiData;
- break;
- case TYPE_LOKEN:
- if (uiData == DONE)
- {
- if (GameObject* pDoor = instance->GetGameObject(m_uiLokenDoorGUID))
- pDoor->SetGoState(GO_STATE_ACTIVE);
-
- // Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder
- if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID))
- pGlobe->SetGoState(GO_STATE_ACTIVE);
- }
- m_auiEncounter[3] = uiData;
- break;
+ switch (go->GetEntry())
+ {
+ case GO_BJARNGRIM_DOOR:
+ case GO_VOLKHAN_DOOR:
+ case GO_IONAR_DOOR:
+ case GO_LOKEN_DOOR:
+ AddDoor(go, false);
+ break;
+ default:
+ break;
+ }
}
- if (uiData == DONE)
- SaveToDB();
- }
-
- uint32 GetData(uint32 uiType) const OVERRIDE
- {
- switch (uiType)
+ bool SetBossState(uint32 type, EncounterState state) OVERRIDE
{
- case TYPE_BJARNGRIM:
- return m_auiEncounter[0];
- case TYPE_VOLKHAN:
- return m_auiEncounter[1];
- case TYPE_IONAR:
- return m_auiEncounter[2];
- case TYPE_LOKEN:
- return m_auiEncounter[3];
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
+
+ switch (type)
+ {
+ case DATA_LOKEN:
+ if (state == DONE)
+ if (GameObject* globe = instance->GetGameObject(LokenGlobeGUID))
+ globe->SendCustomAnim(0);
+ break;
+ default:
+ break;
+ }
+
+ return true;
}
- return 0;
- }
- uint64 GetData64(uint32 uiData) const OVERRIDE
- {
- switch (uiData)
+ uint64 GetData64(uint32 type) const OVERRIDE
{
- case DATA_BJARNGRIM:
- return m_uiGeneralBjarngrimGUID;
- case DATA_VOLKHAN:
- return m_uiVolkhanGUID;
- case DATA_IONAR:
- return m_uiIonarGUID;
- case DATA_LOKEN:
- return m_uiLokenGUID;
+ switch (type)
+ {
+ case DATA_BJARNGRIM:
+ return GeneralBjarngrimGUID;
+ case DATA_VOLKHAN:
+ return VolkhanGUID;
+ case DATA_IONAR:
+ return IonarGUID;
+ case DATA_LOKEN:
+ return LokenGUID;
+ default:
+ break;
+ }
+ return 0;
}
- return 0;
- }
- std::string GetSaveData() OVERRIDE
- {
- OUT_SAVE_INST_DATA;
+ std::string GetSaveData() OVERRIDE
+ {
+ OUT_SAVE_INST_DATA;
- std::ostringstream saveStream;
- saveStream << "H L " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
- << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
+ std::ostringstream saveStream;
+ saveStream << "H L " << GetBossSaveData();
- OUT_SAVE_INST_DATA_COMPLETE;
- return saveStream.str();
- }
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
+ }
- void Load(const char* in) OVERRIDE
- {
- if (!in)
+ void Load(const char* str) OVERRIDE
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
+ if (!str)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
- OUT_LOAD_INST_DATA(in);
+ OUT_LOAD_INST_DATA(str);
- char dataHead1, dataHead2;
- uint16 data0, data1, data2, data3;
+ char dataHead1, dataHead2;
- std::istringstream loadStream(in);
- loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
+ std::istringstream loadStream(str);
+ loadStream >> dataHead1 >> dataHead2;
- if (dataHead1 == 'H' && dataHead2 == 'L')
- {
- m_auiEncounter[0] = data0;
- m_auiEncounter[1] = data1;
- m_auiEncounter[2] = data2;
- m_auiEncounter[3] = data3;
+ if (dataHead1 == 'H' && dataHead2 == 'L')
+ {
+ for (uint32 i = 0; i < EncounterCount; ++i)
+ {
+ uint32 tmpState;
+ loadStream >> tmpState;
+ if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
+ tmpState = NOT_STARTED;
+ SetBossState(i, EncounterState(tmpState));
+ }
+ }
+ else
+ OUT_LOAD_INST_DATA_FAIL;
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
- } else OUT_LOAD_INST_DATA_FAIL;
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
- OUT_LOAD_INST_DATA_COMPLETE;
- }
- };
+ protected:
+ uint64 GeneralBjarngrimGUID;
+ uint64 VolkhanGUID;
+ uint64 IonarGUID;
+ uint64 LokenGUID;
+
+ uint64 LokenGlobeGUID;
+ };
+ InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
+ {
+ return new instance_halls_of_lightning_InstanceMapScript(map);
+ }
};
void AddSC_instance_halls_of_lightning()