TrinityCore
instance_azjol_nerub.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 "AreaBoundary.h"
20#include "azjol_nerub.h"
21#include "Creature.h"
22#include "CreatureAI.h"
23#include "InstanceScript.h"
24
26{
32};
33
35{
42 { 0, 0 } // END
43};
44
46{
49 { 0, 0 } // END
50};
51
53{
54 { DATA_KRIKTHIR, new RectangleBoundary(400.0f, 580.0f, 623.5f, 810.0f) },
55 { DATA_HADRONOX, new ZRangeBoundary(666.0f, 776.0f) },
56 { DATA_ANUBARAK, new CircleBoundary(Position(550.6178f, 253.5917f), 26.0f) }
57};
58
60{
61 { DATA_KRIKTHIR, {{ 1971 }} },
62 { DATA_HADRONOX, {{ 1972 }} },
63 { DATA_ANUBARAK, {{ 1973 }} }
64};
65
67{
68 public:
70
72 {
74 {
82 }
83
84 void OnUnitDeath(Unit* who) override
85 {
87
89 return;
90
91 Creature* creature = who->ToCreature();
92 if (creature->IsCritter() || creature->IsCharmedOwnedByPlayerOrPlayer())
93 return;
94
95 if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR))
96 gatewatcher->AI()->DoAction(-ACTION_GATEWATCHER_GREET);
97 }
98
99 bool CheckRequiredBosses(uint32 bossId, Player const* player) const override
100 {
101 if (_SkipCheckRequiredBosses(player))
102 return true;
103
104 if (bossId > DATA_KRIKTHIR && GetBossState(DATA_KRIKTHIR) != DONE)
105 return false;
106
107 return true;
108 }
109
110 uint32 GetData(uint32 type) const override
111 {
112 switch (type)
113 {
115 return GateWatcherGreet;
116 default:
117 return 0;
118 }
119 }
120
121 void SetData(uint32 type, uint32 data) override
122 {
123 switch (type)
124 {
126 GateWatcherGreet = data;
127 break;
128 default:
129 break;
130 }
131 }
132
133 protected:
135 };
136
138 {
140 }
141};
142
144{
146}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
@ DONE
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
#define DataHeader
uint32 const EncounterCount
@ DATA_KRIKTHIR
Definition: azjol_nerub.h:31
@ DATA_GATEWATCHER_GREET
Definition: azjol_nerub.h:41
@ DATA_WATCHER_SILTHIK
Definition: azjol_nerub.h:38
@ DATA_ANUBARAK
Definition: azjol_nerub.h:33
@ DATA_HADRONOX
Definition: azjol_nerub.h:32
@ DATA_WATCHER_GASHRA
Definition: azjol_nerub.h:37
@ DATA_ANUBARAK_WALL_2
Definition: azjol_nerub.h:40
@ DATA_WATCHER_NARJIL
Definition: azjol_nerub.h:36
@ DATA_ANUBARAK_WALL
Definition: azjol_nerub.h:39
#define AzjolNerubScriptName
Definition: azjol_nerub.h:23
@ NPC_KRIKTHIR
Definition: azjol_nerub.h:46
@ NPC_WATCHER_GASHRA
Definition: azjol_nerub.h:51
@ NPC_ANUBARAK
Definition: azjol_nerub.h:48
@ NPC_WATCHER_NARJIL
Definition: azjol_nerub.h:50
@ NPC_HADRONOX
Definition: azjol_nerub.h:47
@ NPC_WATCHER_SILTHIK
Definition: azjol_nerub.h:52
@ ACTION_GATEWATCHER_GREET
Definition: azjol_nerub.h:66
@ GO_ANUBARAK_DOOR_1
Definition: azjol_nerub.h:58
@ GO_ANUBARAK_DOOR_3
Definition: azjol_nerub.h:60
@ GO_KRIKTHIR_DOOR
Definition: azjol_nerub.h:57
@ GO_ANUBARAK_DOOR_2
Definition: azjol_nerub.h:59
CreatureAI * AI() const
Definition: Creature.h:214
void SetBossNumber(uint32 number)
Creature * GetCreature(uint32 type)
void LoadDungeonEncounterData(T const &encounters)
EncounterState GetBossState(uint32 id) const
void LoadDoorData(DoorData const *data)
void LoadBossBoundaries(BossBoundaryData const &data)
bool _SkipCheckRequiredBosses(Player const *player=nullptr) const
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
static Creature * ToCreature(Object *o)
Definition: Object.h:219
TypeID GetTypeId() const
Definition: Object.h:173
virtual void DoAction(int32)
Definition: UnitAI.h:72
Definition: Unit.h:627
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition: Unit.h:1196
bool IsCritter() const
Definition: Unit.h:1010
virtual void OnUnitDeath(Unit *unit)
Definition: ZoneScript.h:80
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const creatureData[]
void AddSC_instance_azjol_nerub()
DoorData const doorData[]
ObjectData const gameobjectData[]
BossBoundaryData const boundaries
DungeonEncounterData const encounters[]
bool CheckRequiredBosses(uint32 bossId, Player const *player) const override