TrinityCore
boss_nethekurse.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_Grand_Warlock_Nethekurse
20SD%Complete: 75
21SDComment: encounter not fully completed. missing part where boss kill minions.
22SDCategory: Hellfire Citadel, Shattered Halls
23EndScriptData */
24
25/* ContentData
26boss_grand_warlock_nethekurse
27npc_fel_orc_convert
28npc_lesser_shadow_fissure
29EndContentData */
30
31#include "ScriptMgr.h"
32#include "InstanceScript.h"
33#include "ObjectAccessor.h"
34#include "ScriptedCreature.h"
35#include "shattered_halls.h"
36
37enum Says
38{
45 SAY_DIE = 6
46};
47
49{
50 SPELL_DEATH_COIL = 30500, // 30741 heroic
51 SPELL_DARK_SPIN = 30502, // core bug spell attack caster :D
52 SPELL_SHADOW_FISSURE = 30496, // Summon the ShadowFissure NPC
57 SPELL_TEMPORARY_VISUAL = 39312, // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should
58
59 SPELL_SHADOW_SEAR = 30735 // cast on entry 17083 which then makes sound 1343
60 // 30948 cast on self by 17687
61};
62
64{
68};
69
71{
72 // Fel Orc Convert
74};
75
76// ########################################################
77// Grand Warlock Nethekurse
78// ########################################################
79
81{
82 public:
83 boss_grand_warlock_nethekurse() : CreatureScript("boss_grand_warlock_nethekurse") { }
84
86 {
88 {
89 Initialize();
90 }
91
93 {
94 IsIntroEvent = false;
95 IntroOnce = false;
96 IsMainEvent = false;
97 //HasTaunted = false;
98 SpinOnce = false;
99 Phase = false;
100
102 PeonKilledCount = 0;
103
104 IntroEvent_Timer = 90000; // how long before getting bored and kills his minions?
105 DeathCoil_Timer = 20000;
106 ShadowFissure_Timer = 8000;
107 Cleave_Timer = 5000;
108 }
109
110 void Reset() override
111 {
112 _Reset();
114 me->SetCanMelee(true);
115
116 Initialize();
117 }
118
119 void JustDied(Unit* /*killer*/) override
120 {
121 _JustDied();
122 Talk(SAY_DIE);
123 }
124
125 void SetData(uint32 data, uint32 value) override
126 {
127 if (data != SETDATA_DATA)
128 return;
129
130 switch (value)
131 {
133 if (PeonEngagedCount >= 4)
134 return;
135
138 break;
140 if (PeonKilledCount >= 4)
141 return;
142
145
146 if (PeonKilledCount == 4)
147 {
148 IsIntroEvent = false;
149 IsMainEvent = true;
151 }
152 break;
153 default:
154 break;
155 }
156 }
157
159 {
161
163 IsIntroEvent = false;
165 PeonKilledCount = 4;
166 IsMainEvent = true;
168 }
169
170 void AttackStart(Unit* who) override
171 {
173 return;
174
175 if (me->Attack(who, true))
176 {
177 if (Phase)
179 else
180 DoStartMovement(who);
181 }
182 }
183
184 void MoveInLineOfSight(Unit* who) override
185 {
186 if (!IntroOnce && me->IsWithinDistInMap(who, 30.0f))
187 {
188 if (who->GetTypeId() != TYPEID_PLAYER)
189 return;
190
192 IntroOnce = true;
193 IsIntroEvent = true;
194
196 }
197
199 return;
200
202 }
203
204 void JustEngagedWith(Unit* /*who*/) override
205 {
207 }
208
209 void JustSummoned(Creature* summoned) override
210 {
211 //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid?
212 summoned->CastSpell(summoned, SPELL_TEMPORARY_VISUAL, true);
213 summoned->CastSpell(summoned, SPELL_CONSUMPTION, CastSpellExtraArgs().SetOriginalCaster(me->GetGUID()));
214 }
215
216 void KilledUnit(Unit* /*victim*/) override
217 {
218 Talk(SAY_SLAY);
219 }
220
221 void UpdateAI(uint32 diff) override
222 {
223 if (IsIntroEvent)
224 {
226 {
227 if (IntroEvent_Timer <= diff)
228 DoTauntPeons();
229 else
230 IntroEvent_Timer -= diff;
231 }
232 }
233
234 if (!UpdateVictim())
235 return;
236
237 if (!IsMainEvent)
238 return;
239
240 if (Phase)
241 {
242 if (!SpinOnce)
243 {
245 SpinOnce = true;
246 }
247
248 if (Cleave_Timer <= diff)
249 {
251 Cleave_Timer = 6000 + rand32() % 2500;
252 }
253 else
254 Cleave_Timer -= diff;
255 }
256 else
257 {
258 if (ShadowFissure_Timer <= diff)
259 {
262 ShadowFissure_Timer = urand(7500, 15000);
263 }
264 else
265 ShadowFissure_Timer -= diff;
266
267 if (DeathCoil_Timer <= diff)
268 {
270 DoCast(target, SPELL_DEATH_COIL);
271 DeathCoil_Timer = urand(15000, 20000);
272 }
273 else
274 DeathCoil_Timer -= diff;
275
276 if (!HealthAbovePct(20))
277 {
278 Phase = true;
279 me->SetCanMelee(false);
280 }
281 }
282 }
283
284 private:
295 //bool HasTaunted;
296 bool Phase;
297 };
298
299 CreatureAI* GetAI(Creature* creature) const override
300 {
301 return GetShatteredHallsAI<boss_grand_warlock_nethekurseAI>(creature);
302 }
303};
304
305// ########################################################
306// Fel Orc Convert
307// ########################################################
308
310{
311 public:
312 npc_fel_orc_convert() : CreatureScript("npc_fel_orc_convert") { }
313
315 {
317 {
318 instance = creature->GetInstanceScript();
319 }
320
321 void Reset() override
322 {
323 me->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!)
324 }
325
326 void MoveInLineOfSight(Unit* /*who*/) override { }
327
328 void JustEngagedWith(Unit* /*who*/) override
329 {
331
333 if (me->IsWithinDist(Kurse, 45.0f))
334 Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_AGGRO);
335 }
336
337 void JustDied(Unit* /*killer*/) override
338 {
340 return;
341
343 Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH);
344 }
345
346 void UpdateAI(uint32 diff) override
347 {
348 if (!UpdateVictim())
349 return;
350
351 events.Update(diff);
352
354 {
357 }
358 }
359
360 private:
363 };
364
365 CreatureAI* GetAI(Creature* creature) const override
366 {
367 return GetShatteredHallsAI<npc_fel_orc_convertAI>(creature);
368 }
369};
370
371// ########################################################
372// Lesser Shadow Fissure
373// ########################################################
374
376{
377 public:
378 npc_lesser_shadow_fissure() : CreatureScript("npc_lesser_shadow_fissure") { }
379
381 {
383
384 void Reset() override { }
385 void MoveInLineOfSight(Unit* /*who*/) override { }
386 void AttackStart(Unit* /*who*/) override { }
387 void JustEngagedWith(Unit* /*who*/) override { }
388 };
389
390 CreatureAI* GetAI(Creature* creature) const override
391 {
392 return GetShatteredHallsAI<npc_lesser_shadow_fissureAI>(creature);
393 }
394};
395
397{
401}
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
uint32 rand32()
Definition: Random.cpp:70
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
Says
@ SAY_PEON_DIES
@ SAY_PEON_ATTACKED
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_TAUNT
@ SAY_DIE
@ SAY_INTRO
@ SETDATA_DATA
@ SETDATA_PEON_DEATH
@ SETDATA_PEON_AGGRO
@ SPELL_SHADOW_FISSURE
@ SPELL_DEATH_COIL
@ SPELL_TEMPORARY_VISUAL
@ SPELL_SHADOW_SEAR
@ SPELL_CONSUMPTION
@ SPELL_HEMORRHAGE
@ SPELL_DARK_SPIN
@ H_SPELL_SHADOW_SLAM
@ SPELL_SHADOW_CLEAVE
void AddSC_boss_grand_warlock_nethekurse()
@ EVENT_HEMORRHAGE
InstanceScript *const instance
void _JustDied()
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:122
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
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
Definition: Creature.cpp:2822
void SetNoCallAssistance(bool val)
Definition: Creature.h:317
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
virtual bool SetBossState(uint32 id, EncounterState state)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
TypeID GetTypeId() const
Definition: Object.h:173
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:5670
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:833
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:834
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1147
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1142
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
@ DATA_NETHEKURSE
@ NPC_GRAND_WARLOCK_NETHEKURSE
void DoStartNoMovement(Unit *target)
bool HealthAbovePct(uint32 pct) const
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
void AttackStart(Unit *who) override
== Triggered Actions Requested ==================
void AttackStart(Unit *) override
== Triggered Actions Requested ==================