Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_ambassador_hellmaw.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Ambassador_Hellmaw
8SD%Complete: 80
9SDComment: Enrage spell missing/not known
10SDCategory: Auchindoun, Shadow Labyrinth
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "ScriptedEscortAI.h"
16#include "shadow_labyrinth.h"
17
19{
25};
26
28{
29 SPELL_BANISH = 30231,
31 SPELL_FEAR = 33547,
33};
34
41
43{
44 public:
45 boss_ambassador_hellmaw() : CreatureScript("boss_ambassador_hellmaw") { }
46
48 {
50 {
51 _instance = creature->GetInstanceScript();
52 _intro = false;
53 }
54
56 {
57 if (!me->IsAlive())
58 return;
59
60 _events.Reset();
62
63 _events.ScheduleEvent(EVENT_CORROSIVE_ACID, std::rand() % 10000 + 5000);
64 _events.ScheduleEvent(EVENT_FEAR, std::rand() % 30000 + 25000);
65 if (IsHeroic())
66 _events.ScheduleEvent(EVENT_BERSERK, 180000);
67
69 }
70
72 {
73 if (me->HasAura(SPELL_BANISH))
74 return;
75
77 }
78
79 void WaypointReached(uint32 /*waypointId*/) OVERRIDE
80 {
81 }
82
83 void DoAction(int32 actionId) OVERRIDE
84 {
85 if (actionId == ACTION_AMBASSADOR_HELLMAW_INTRO)
86 DoIntro();
87 else if (actionId == ACTION_AMBASSADOR_HELLMAW_BANISH)
88 {
89 if (_instance->GetData(DATA_FEL_OVERSEER) && me->HasAura(SPELL_BANISH))
90 DoCast(me, SPELL_BANISH, true); // this will not work, because he is immune to banish
91 }
92 }
93
94 void DoIntro()
95 {
96 if (_intro)
97 return;
98
99 _intro = true;
100
101 if (me->HasAura(SPELL_BANISH))
102 me->RemoveAurasDueToSpell(SPELL_BANISH);
103
105 Start(true, false, 0, NULL, false, true);
106 }
107
108 void EnterCombat(Unit* /*who*/) OVERRIDE
109 {
112 }
113
115 {
116 if (who->GetTypeId() == TypeID::TYPEID_PLAYER)
117 Talk(SAY_SLAY);
118 }
119
120 void JustDied(Unit* /*killer*/) OVERRIDE
121 {
122 _instance->SetBossState(DATA_AMBASSADOR_HELLMAW, DONE);
124 }
125
127 {
128 if (!UpdateVictim())
129 return;
130
131 if (me->HasAura(SPELL_BANISH))
132 {
134 return;
135 }
136
137 _events.Update(diff);
138
139 if (me->HasUnitState(UNIT_STATE_CASTING))
140 return;
141
142 while (uint32 eventId = _events.ExecuteEvent())
143 {
144 switch (eventId)
145 {
148 _events.ScheduleEvent(EVENT_CORROSIVE_ACID, std::rand() % 25000 + 15000);
149 break;
150 case EVENT_FEAR:
152 _events.ScheduleEvent(EVENT_FEAR, std::rand() % 35000 + 20000);
153 break;
154 case EVENT_BERSERK:
155 DoCast(me, SPELL_ENRAGE, true);
156 break;
157 default:
158 break;
159 }
160 }
161
163 }
164
165 private:
168 bool _intro;
169 };
170
172 {
174 }
175};
176
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SPELL_ENRAGE
@ SAY_SLAY
@ SAY_INTRO
void AddSC_boss_ambassador_hellmaw()
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_CORROSIVE_ACID
Definition boss_gyth.cpp:13
@ EVENT_CORROSIVE_ACID
Definition boss_gyth.cpp:29
@ SPELL_BANISH
@ SPELL_FEAR
@ EVENT_FEAR
@ EVENT_BERSERK
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AI * GetShadowLabyrinthAI(Creature *creature)
@ ACTION_AMBASSADOR_HELLMAW_BANISH
@ ACTION_AMBASSADOR_HELLMAW_INTRO
@ DATA_AMBASSADOR_HELLMAW
@ DATA_FEL_OVERSEER
bool IsHeroic() const
Creature * me
void EnterEvadeMode() OVERRIDE
npc_escortAI(Creature *creature)
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
void MoveInLineOfSight(Unit *who) OVERRIDE