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
33
44
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 public:
63
65 {
75
76 void OnUnitDeath(Unit* who) override
77 {
79
81 return;
82
83 Creature* creature = who->ToCreature();
84 if (creature->IsCritter() || creature->IsCharmedOwnedByPlayerOrPlayer())
85 return;
86
87 if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR))
88 gatewatcher->AI()->DoAction(-ACTION_GATEWATCHER_GREET);
89 }
90
91 bool CheckRequiredBosses(uint32 bossId, Player const* player) const override
92 {
93 if (_SkipCheckRequiredBosses(player))
94 return true;
95
96 if (bossId > DATA_KRIKTHIR && GetBossState(DATA_KRIKTHIR) != DONE)
97 return false;
98
99 return true;
100 }
101
102 uint32 GetData(uint32 type) const override
103 {
104 switch (type)
105 {
107 return GateWatcherGreet;
108 default:
109 return 0;
110 }
111 }
112
113 void SetData(uint32 type, uint32 data) override
114 {
115 switch (type)
116 {
118 GateWatcherGreet = data;
119 break;
120 default:
121 break;
122 }
123 }
124
125 protected:
127 };
128
130 {
132 }
133};
134
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ DONE
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ 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
@ ACTION_GATEWATCHER_GREET
Definition azjol_nerub.h:58
@ 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
@ GO_ANUBARAK_DOOR_1
Definition azjol_nerub.h:64
@ GO_ANUBARAK_DOOR_3
Definition azjol_nerub.h:66
@ GO_KRIKTHIR_DOOR
Definition azjol_nerub.h:63
@ GO_ANUBARAK_DOOR_2
Definition azjol_nerub.h:65
#define DataHeader
uint32 const EncounterCount
CreatureAI * AI() const
Definition Creature.h:154
void SetBossNumber(uint32 number)
Creature * GetCreature(uint32 type)
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:186
TypeID GetTypeId() const
Definition Object.h:93
virtual void DoAction(int32)
Definition UnitAI.h:154
Definition Unit.h:769
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1261
bool IsCritter() const
Definition Unit.h:1117
virtual void OnUnitDeath(Unit *)
Definition ZoneScript.h:45
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const creatureData[]
void AddSC_instance_azjol_nerub()
DoorData const doorData[]
ObjectData const gameobjectData[]
BossBoundaryData const boundaries
bool CheckRequiredBosses(uint32 bossId, Player const *player) const override