TrinityCore
Loading...
Searching...
No Matches
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
33
44
51
53{
54 public:
56
58 {
66
67 void OnCreatureCreate(Creature* creature) override
68 {
70
71 switch (creature->GetEntry())
72 {
75 {
76 if (Creature* volkhan = GetCreature(BOSS_VOLKHAN))
77 if (CreatureAI* ai = volkhan->AI())
78 ai->JustSummoned(creature);
79 }
80 else // These golems are summoned via trigger missile so we have to clean them up if they spawned during a wipe/completion
81 creature->DespawnOrUnsummon();
82 break;
83 default:
84 break;
85 }
86 }
87
88 bool SetBossState(uint32 type, EncounterState state) override
89 {
90 if (!InstanceScript::SetBossState(type, state))
91 return false;
92
93 switch (type)
94 {
95 case BOSS_LOKEN:
96 if (state == DONE)
98 globe->SendCustomAnim(0);
99 break;
100 default:
101 break;
102 }
103
104 return true;
105 }
106 };
107
112};
113
@ NPC_INVISIBLE_STALKER
uint32_t uint32
Definition Define.h:133
EncounterState
@ IN_PROGRESS
@ DONE
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
#define DataHeader
uint32 const EncounterCount
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
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:81
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_VOLKHANS_ANVIL
@ BOSS_VOLKHAN
@ DATA_INVISIBLE_STALKER
@ DATA_LOKEN_GLOBE
@ BOSS_LOKEN
@ DATA_VOLKHAN_TEMPER_VISUAL
@ BOSS_GENERAL_BJARNGRIM
@ BOSS_IONAR
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_halls_of_lightning()