TrinityCore
instance_halls_of_lightning.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "Creature.h"
20#include "CreatureAI.h"
21#include "GameObject.h"
22#include "halls_of_lightning.h"
23#include "InstanceScript.h"
24#include "Map.h"
25
27{
32};
33
35{
42 { 0, 0 } // END
43};
44
46{
49 { 0, 0 } // END
50};
51
53{
54 { DATA_GENERAL_BJARNGRIM, {{ 1987 }} },
55 { DATA_VOLKHAN, {{ 1985 }} },
56 { DATA_IONAR, {{ 1984 }} },
57 { DATA_LOKEN, {{ 1986 }} }
58};
59
61{
62 public:
64
66 {
68 {
74 }
75
76 void OnCreatureCreate(Creature* creature) override
77 {
79
80 switch (creature->GetEntry())
81 {
84 {
85 if (Creature* volkhan = GetCreature(DATA_VOLKHAN))
86 if (CreatureAI* ai = volkhan->AI())
87 ai->JustSummoned(creature);
88 }
89 else // These golems are summoned via trigger missile so we have to clean them up if they spawned during a wipe/completion
90 creature->DespawnOrUnsummon();
91 break;
92 default:
93 break;
94 }
95 }
96
97 bool SetBossState(uint32 type, EncounterState state) override
98 {
99 if (!InstanceScript::SetBossState(type, state))
100 return false;
101
102 switch (type)
103 {
104 case DATA_LOKEN:
105 if (state == DONE)
107 globe->SendCustomAnim(0);
108 break;
109 default:
110 break;
111 }
112
113 return true;
114 }
115 };
116
118 {
120 }
121};
122
124{
126}
uint32_t uint32
Definition: Define.h:142
EncounterState
@ IN_PROGRESS
@ DONE
#define DataHeader
uint32 const EncounterCount
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
void LoadDungeonEncounterData(T const &encounters)
EncounterState GetBossState(uint32 id) const
void LoadDoorData(DoorData const *data)
GameObject * GetGameObject(uint32 type)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
uint32 GetEntry() const
Definition: Object.h:161
InstanceScript * GetInstanceScript(InstanceMap *map) const override
@ NPC_VOLKHANS_ANVIL
@ NPC_GENERAL_BJARNGRIM
@ NPC_MOLTEN_GOLEM
@ NPC_LOKEN
@ NPC_IONAR
@ NPC_VOLKHAN
@ GO_LOKEN_THRONE
@ GO_VOLKHAN_DOOR
@ GO_VOLKHAN_TEMPER_VISUAL
@ GO_LOKEN_DOOR
@ GO_IONAR_DOOR
#define HoLScriptName
@ DATA_IONAR
@ DATA_VOLKHANS_ANVIL
@ DATA_VOLKHAN
@ DATA_GENERAL_BJARNGRIM
@ DATA_INVISIBLE_STALKER
@ DATA_LOKEN_GLOBE
@ DATA_VOLKHAN_TEMPER_VISUAL
@ DATA_LOKEN
@ NPC_INVISIBLE_STALKER
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_halls_of_lightning()
DungeonEncounterData const encounters[]