TrinityCore
boss_ambassador_hellmaw.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/* ScriptData
19SDName: Boss_Ambassador_Hellmaw
20SD%Complete: 80
21SDComment: Enrage spell missing/not known
22SDCategory: Auchindoun, Shadow Labyrinth
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "InstanceScript.h"
27#include "ScriptedEscortAI.h"
28#include "shadow_labyrinth.h"
29
31{
36 SAY_DEATH = 4
37};
38
40{
41 SPELL_BANISH = 30231,
43 SPELL_FEAR = 33547,
44 SPELL_ENRAGE = 34970
45};
46
48{
52};
53
54static constexpr uint32 PATH_ESCORT_HELLMAW = 149850;
55
57{
59 {
60 _instance = creature->GetInstanceScript();
61 _intro = false;
62 }
63
64 void Reset() override
65 {
66 if (!me->IsAlive())
67 return;
68
69 _events.Reset();
71
74 if (IsHeroic())
76
78 }
79
80 void MoveInLineOfSight(Unit* who) override
81 {
83 return;
84
86 }
87
88 void DoAction(int32 actionId) override
89 {
90 if (actionId == ACTION_AMBASSADOR_HELLMAW_INTRO)
91 DoIntro();
92 else if (actionId == ACTION_AMBASSADOR_HELLMAW_BANISH)
93 {
95 DoCast(me, SPELL_BANISH, true); // this will not work, because he is immune to banish
96 }
97 }
98
99 void DoIntro()
100 {
101 if (_intro)
102 return;
103
104 _intro = true;
105
106 if (me->HasAura(SPELL_BANISH))
108
111 Start(true, ObjectGuid::Empty, nullptr, false, true);
112 }
113
114 void JustEngagedWith(Unit* /*who*/) override
115 {
118 }
119
120 void KilledUnit(Unit* who) override
121 {
122 if (who->GetTypeId() == TYPEID_PLAYER)
123 Talk(SAY_SLAY);
124 }
125
126 void JustDied(Unit* /*killer*/) override
127 {
130 }
131
132 void UpdateEscortAI(uint32 diff) override
133 {
134 if (!UpdateVictim())
135 return;
136
137 if (me->HasAura(SPELL_BANISH))
138 {
140 return;
141 }
142
143 _events.Update(diff);
144
146 return;
147
148 while (uint32 eventId = _events.ExecuteEvent())
149 {
150 switch (eventId)
151 {
155 break;
156 case EVENT_FEAR:
159 break;
160 case EVENT_BERSERK:
161 DoCast(me, SPELL_ENRAGE, true);
162 break;
163 default:
164 break;
165 }
166 }
167 }
168
169private:
172 bool _intro;
173};
174
176{
178}
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_CORROSIVE_ACID
void AddSC_boss_ambassador_hellmaw()
static constexpr uint32 PATH_ESCORT_HELLMAW
@ EVENT_CORROSIVE_ACID
Yells
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
virtual bool SetBossState(uint32 id, EncounterState state)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
TypeID GetTypeId() const
Definition: Object.h:173
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool IsAlive() const
Definition: Unit.h:1164
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
@ ACTION_AMBASSADOR_HELLMAW_BANISH
@ ACTION_AMBASSADOR_HELLMAW_INTRO
#define RegisterShadowLabyrinthCreatureAI(ai_name)
@ DATA_AMBASSADOR_HELLMAW
@ DATA_FEL_OVERSEER
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false)
void EnterEvadeMode(EvadeReason why) override
void MoveInLineOfSight(Unit *who) override
void LoadPath(uint32 pathId)
bool IsHeroic() const
void KilledUnit(Unit *who) override
void JustEngagedWith(Unit *) override
void UpdateEscortAI(uint32 diff) override
boss_ambassador_hellmaw(Creature *creature)
void MoveInLineOfSight(Unit *who) override
void DoAction(int32 actionId) override