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
31
41
47
48static constexpr DungeonEncounterData encounters[] =
49{
50 { DATA_GENERAL_BJARNGRIM, {{ 1987 }} },
51 { DATA_VOLKHAN, {{ 1985 }} },
52 { DATA_IONAR, {{ 1984 }} },
53 { DATA_LOKEN, {{ 1986 }} }
54};
55
57{
58 public:
60
62 {
71
72 void OnCreatureCreate(Creature* creature) override
73 {
75
76 switch (creature->GetEntry())
77 {
80 {
81 if (Creature* volkhan = GetCreature(DATA_VOLKHAN))
82 if (CreatureAI* ai = volkhan->AI())
83 ai->JustSummoned(creature);
84 }
85 else // These golems are summoned via trigger missile so we have to clean them up if they spawned during a wipe/completion
86 creature->DespawnOrUnsummon();
87 break;
88 default:
89 break;
90 }
91 }
92
93 bool SetBossState(uint32 type, EncounterState state) override
94 {
95 if (!InstanceScript::SetBossState(type, state))
96 return false;
97
98 switch (type)
99 {
100 case DATA_LOKEN:
101 if (state == DONE)
103 globe->SendCustomAnim(0);
104 break;
105 default:
106 break;
107 }
108
109 return true;
110 }
111 };
112
117};
118
uint32_t uint32
Definition Define.h:154
EncounterState
@ IN_PROGRESS
@ DONE
#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)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
EncounterState GetBossState(uint32 id) const
void LoadDoorData(std::span< DoorData const > data)
GameObject * GetGameObject(uint32 type)
uint32 GetEntry() const
Definition Object.h:89
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
static constexpr ObjectData creatureData[]
static constexpr DoorData doorData[]
static constexpr ObjectData gameObjectData[]
void AddSC_instance_halls_of_lightning()
static constexpr DungeonEncounterData encounters[]