TrinityCore
Loading...
Searching...
No Matches
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
32
42
48
50{
51 { DATA_KRIKTHIR, new RectangleBoundary(400.0f, 580.0f, 623.5f, 810.0f) },
52 { DATA_HADRONOX, new ZRangeBoundary(666.0f, 776.0f) },
53 { DATA_ANUBARAK, new CircleBoundary(Position(550.6178f, 253.5917f), 26.0f) }
54};
55
56static constexpr DungeonEncounterData encounters[] =
57{
58 { DATA_KRIKTHIR, {{ 1971 }} },
59 { DATA_HADRONOX, {{ 1972 }} },
60 { DATA_ANUBARAK, {{ 1973 }} }
61};
62
64{
65 public:
67
69 {
80
81 void OnUnitDeath(Unit* who) override
82 {
84
86 return;
87
88 Creature* creature = who->ToCreature();
89 if (creature->IsCritter() || creature->IsCharmedOwnedByPlayerOrPlayer())
90 return;
91
92 if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR))
93 gatewatcher->AI()->DoAction(-ACTION_GATEWATCHER_GREET);
94 }
95
96 bool CheckRequiredBosses(uint32 bossId, Player const* player) const override
97 {
98 if (_SkipCheckRequiredBosses(player))
99 return true;
100
101 if (bossId > DATA_KRIKTHIR && GetBossState(DATA_KRIKTHIR) != DONE)
102 return false;
103
104 return true;
105 }
106
107 uint32 GetData(uint32 type) const override
108 {
109 switch (type)
110 {
112 return GateWatcherGreet;
113 default:
114 return 0;
115 }
116 }
117
118 void SetData(uint32 type, uint32 data) override
119 {
120 switch (type)
121 {
123 GateWatcherGreet = data;
124 break;
125 default:
126 break;
127 }
128 }
129
130 protected:
132 };
133
135 {
137 }
138};
139
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ DONE
@ TYPEID_UNIT
Definition ObjectGuid.h:43
#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
TypeID GetTypeId() const
Definition BaseEntity.h:166
CreatureAI * AI() const
Definition Creature.h:228
void SetBossNumber(uint32 number)
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)
void LoadBossBoundaries(BossBoundaryData const &data)
bool _SkipCheckRequiredBosses(Player const *player=nullptr) const
Creature * ToCreature()
Definition Object.h:121
virtual void DoAction(int32 param)
Definition UnitAI.h:73
Definition Unit.h:635
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1217
bool IsCritter() const
Definition Unit.h:1025
virtual void OnUnitDeath(Unit *unit)
Definition ZoneScript.h:85
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
void AddSC_instance_azjol_nerub()
static constexpr DoorData doorData[]
BossBoundaryData const boundaries
static constexpr DungeonEncounterData encounters[]
static constexpr ObjectData gameobjectData[]
bool CheckRequiredBosses(uint32 bossId, Player const *player) const override