/
boss_kologarn.cpp
671 lines (575 loc) · 25.2 KB
/
boss_kologarn.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "ulduar.h"
#include "Vehicle.h"
#include "Player.h"
/* ScriptData
SDName: boss_kologarn
SD%Complete: 90
SDComment: @todo Achievements
SDCategory: Ulduar
EndScriptData */
enum Spells
{
SPELL_ARM_DEAD_DAMAGE = 63629,
SPELL_TWO_ARM_SMASH = 63356,
SPELL_ONE_ARM_SMASH = 63573,
SPELL_ARM_SWEEP = 63766,
SPELL_STONE_SHOUT = 63716,
SPELL_PETRIFY_BREATH = 62030,
SPELL_STONE_GRIP = 62166,
SPELL_STONE_GRIP_CANCEL = 65594,
SPELL_SUMMON_RUBBLE = 63633,
SPELL_FALLING_RUBBLE = 63821,
SPELL_ARM_ENTER_VEHICLE = 65343,
SPELL_ARM_ENTER_VISUAL = 64753,
SPELL_SUMMON_FOCUSED_EYEBEAM = 63342,
SPELL_FOCUSED_EYEBEAM_PERIODIC = 63347,
SPELL_FOCUSED_EYEBEAM_VISUAL = 63369,
SPELL_FOCUSED_EYEBEAM_VISUAL_LEFT = 63676,
SPELL_FOCUSED_EYEBEAM_VISUAL_RIGHT = 63702,
// Passive
SPELL_KOLOGARN_REDUCE_PARRY = 64651,
SPELL_KOLOGARN_PACIFY = 63726,
SPELL_KOLOGARN_UNK_0 = 65219, // Not found in DBC
SPELL_BERSERK = 47008 // guess
};
enum NPCs
{
NPC_RUBBLE_STALKER = 33809,
NPC_ARM_SWEEP_STALKER = 33661
};
enum Events
{
EVENT_NONE = 0,
EVENT_INSTALL_ACCESSORIES,
EVENT_MELEE_CHECK,
EVENT_SMASH,
EVENT_SWEEP,
EVENT_STONE_SHOUT,
EVENT_STONE_GRIP,
EVENT_FOCUSED_EYEBEAM,
EVENT_RESPAWN_LEFT_ARM,
EVENT_RESPAWN_RIGHT_ARM,
EVENT_ENRAGE,
};
enum Yells
{
SAY_AGGRO = 0,
SAY_SLAY = 1,
SAY_LEFT_ARM_GONE = 2,
SAY_RIGHT_ARM_GONE = 3,
SAY_SHOCKWAVE = 4,
SAY_GRAB_PLAYER = 5,
SAY_DEATH = 6,
SAY_BERSERK = 7,
EMOTE_STONE_GRIP = 8
};
class boss_kologarn : public CreatureScript
{
public:
boss_kologarn() : CreatureScript("boss_kologarn") { }
struct boss_kologarnAI : public BossAI
{
boss_kologarnAI(Creature* creature) : BossAI(creature, BOSS_KOLOGARN),
left(false), right(false)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
DoCast(SPELL_KOLOGARN_REDUCE_PARRY);
SetCombatMovement(false);
Reset();
}
bool left, right;
ObjectGuid eyebeamTarget;
void EnterCombat(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_MELEE_CHECK, 6000);
events.ScheduleEvent(EVENT_SMASH, 5000);
events.ScheduleEvent(EVENT_SWEEP, 19000);
events.ScheduleEvent(EVENT_STONE_GRIP, 25000);
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 21000);
events.ScheduleEvent(EVENT_ENRAGE, 600000);
if (Vehicle* vehicle = me->GetVehicleKit())
for (uint8 i = 0; i < 2; ++i)
if (Unit* arm = vehicle->GetPassenger(i))
arm->ToCreature()->SetInCombatWithZone();
_EnterCombat();
}
void Reset() override
{
_Reset();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
eyebeamTarget.Clear();
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DEATH);
DoCast(SPELL_KOLOGARN_PACIFY);
me->GetMotionMaster()->MoveTargetedHome();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetCorpseDelay(604800); // Prevent corpse from despawning.
_JustDied();
}
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_SLAY);
}
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
{
bool isEncounterInProgress = instance->GetBossState(BOSS_KOLOGARN) == IN_PROGRESS;
if (who->GetEntry() == NPC_LEFT_ARM)
{
left = apply;
if (!apply && isEncounterInProgress)
{
Talk(SAY_LEFT_ARM_GONE);
events.ScheduleEvent(EVENT_RESPAWN_LEFT_ARM, 40000);
}
}
else if (who->GetEntry() == NPC_RIGHT_ARM)
{
right = apply;
if (!apply && isEncounterInProgress)
{
Talk(SAY_RIGHT_ARM_GONE);
events.ScheduleEvent(EVENT_RESPAWN_RIGHT_ARM, 40000);
}
}
if (!isEncounterInProgress)
return;
if (!apply)
{
who->CastSpell(me, SPELL_ARM_DEAD_DAMAGE, true);
if (Creature* rubbleStalker = who->FindNearestCreature(NPC_RUBBLE_STALKER, 70.0f))
{
rubbleStalker->CastSpell(rubbleStalker, SPELL_FALLING_RUBBLE, true);
rubbleStalker->CastSpell(rubbleStalker, SPELL_SUMMON_RUBBLE, true);
who->ToCreature()->DespawnOrUnsummon();
}
if (!right && !left)
events.ScheduleEvent(EVENT_STONE_SHOUT, 5000);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, CRITERIA_DISARMED);
}
else
{
events.CancelEvent(EVENT_STONE_SHOUT);
who->ToCreature()->SetInCombatWithZone();
}
}
void JustSummoned(Creature* summon) override
{
switch (summon->GetEntry())
{
case NPC_FOCUSED_EYEBEAM:
summon->CastSpell(me, SPELL_FOCUSED_EYEBEAM_VISUAL_LEFT, true);
break;
case NPC_FOCUSED_EYEBEAM_RIGHT:
summon->CastSpell(me, SPELL_FOCUSED_EYEBEAM_VISUAL_RIGHT, true);
break;
case NPC_RUBBLE:
summons.Summon(summon);
// absence of break intended
default:
return;
}
summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_PERIODIC, true);
summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true);
summon->SetReactState(REACT_PASSIVE);
// One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work
summon->ClearUnitState(UNIT_STATE_CASTING);
// Victim gets 67351
if (!eyebeamTarget.IsEmpty())
{
if (Unit* target = ObjectAccessor::GetUnit(*summon, eyebeamTarget))
{
summon->Attack(target, false);
summon->GetMotionMaster()->MoveChase(target);
}
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_MELEE_CHECK:
if (!me->IsWithinMeleeRange(me->GetVictim()))
DoCast(SPELL_PETRIFY_BREATH);
events.ScheduleEvent(EVENT_MELEE_CHECK, 1 * IN_MILLISECONDS);
break;
case EVENT_SWEEP:
if (left)
DoCast(me->FindNearestCreature(NPC_ARM_SWEEP_STALKER, 500.0f, true), SPELL_ARM_SWEEP, true);
events.ScheduleEvent(EVENT_SWEEP, 25 * IN_MILLISECONDS);
break;
case EVENT_SMASH:
if (left && right)
DoCastVictim(SPELL_TWO_ARM_SMASH);
else if (left || right)
DoCastVictim(SPELL_ONE_ARM_SMASH);
events.ScheduleEvent(EVENT_SMASH, 15 * IN_MILLISECONDS);
break;
case EVENT_STONE_SHOUT:
DoCast(SPELL_STONE_SHOUT);
events.ScheduleEvent(EVENT_STONE_SHOUT, 2 * IN_MILLISECONDS);
break;
case EVENT_ENRAGE:
DoCast(SPELL_BERSERK);
Talk(SAY_BERSERK);
break;
case EVENT_RESPAWN_LEFT_ARM:
case EVENT_RESPAWN_RIGHT_ARM:
{
if (Vehicle* vehicle = me->GetVehicleKit())
{
int8 seat = eventId == EVENT_RESPAWN_LEFT_ARM ? 0 : 1;
uint32 entry = eventId == EVENT_RESPAWN_LEFT_ARM ? NPC_LEFT_ARM : NPC_RIGHT_ARM;
vehicle->InstallAccessory(entry, seat, true, TEMPSUMMON_MANUAL_DESPAWN, 0);
}
break;
}
case EVENT_STONE_GRIP:
{
if (right)
{
DoCast(SPELL_STONE_GRIP);
Talk(SAY_GRAB_PLAYER);
Talk(EMOTE_STONE_GRIP);
}
events.ScheduleEvent(EVENT_STONE_GRIP, 25 * IN_MILLISECONDS);
break;
}
case EVENT_FOCUSED_EYEBEAM:
if (Unit* eyebeamTargetUnit = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0, true))
{
eyebeamTarget = eyebeamTargetUnit->GetGUID();
DoCast(me, SPELL_SUMMON_FOCUSED_EYEBEAM, true);
}
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, urand(15, 35) * IN_MILLISECONDS);
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetUlduarAI<boss_kologarnAI>(creature);
}
};
class spell_ulduar_rubble_summon : public SpellScriptLoader
{
public:
spell_ulduar_rubble_summon() : SpellScriptLoader("spell_ulduar_rubble_summon") { }
class spell_ulduar_rubble_summonSpellScript : public SpellScript
{
PrepareSpellScript(spell_ulduar_rubble_summonSpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
ObjectGuid originalCaster = caster->GetInstanceScript() ? caster->GetInstanceScript()->GetGuidData(BOSS_KOLOGARN) : ObjectGuid::Empty;
uint32 spellId = GetEffectValue();
for (uint8 i = 0; i < 5; ++i)
caster->CastSpell(caster, spellId, true, NULL, NULL, originalCaster);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ulduar_rubble_summonSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_ulduar_rubble_summonSpellScript();
}
};
// predicate function to select non main tank target
class StoneGripTargetSelector : public std::unary_function<Unit*, bool>
{
public:
StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) { }
bool operator()(WorldObject* target)
{
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
return true;
if (target->GetTypeId() != TYPEID_PLAYER)
return true;
return false;
}
Creature* _me;
Unit const* _victim;
};
class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
{
public:
spell_ulduar_stone_grip_cast_target() : SpellScriptLoader("spell_ulduar_stone_grip_cast_target") { }
class spell_ulduar_stone_grip_cast_target_SpellScript : public SpellScript
{
PrepareSpellScript(spell_ulduar_stone_grip_cast_target_SpellScript);
bool Load() override
{
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
return false;
return true;
}
void FilterTargetsInitial(std::list<WorldObject*>& unitList)
{
// Remove "main tank" and non-player targets
unitList.remove_if(StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->GetVictim()));
// Maximum affected targets per difficulty mode
uint32 maxTargets = 1;
if (GetSpellInfo()->Id == 63981)
maxTargets = 3;
// Return a random amount of targets based on maxTargets
while (maxTargets < unitList.size())
{
std::list<WorldObject*>::iterator itr = unitList.begin();
advance(itr, urand(0, unitList.size()-1));
unitList.erase(itr);
}
// For subsequent effects
_unitList = unitList;
}
void FillTargetsSubsequential(std::list<WorldObject*>& unitList)
{
unitList = _unitList;
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
}
private:
// Shared between effects
std::list<WorldObject*> _unitList;
};
SpellScript* GetSpellScript() const override
{
return new spell_ulduar_stone_grip_cast_target_SpellScript();
}
};
class spell_ulduar_cancel_stone_grip : public SpellScriptLoader
{
public:
spell_ulduar_cancel_stone_grip() : SpellScriptLoader("spell_ulduar_cancel_stone_grip") { }
class spell_ulduar_cancel_stone_gripSpellScript : public SpellScript
{
PrepareSpellScript(spell_ulduar_cancel_stone_gripSpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* target = GetHitUnit();
if (!target || !target->GetVehicle())
return;
switch (target->GetMap()->GetDifficultyID())
{
case DIFFICULTY_10_N:
target->RemoveAura(GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue());
break;
case DIFFICULTY_25_N:
target->RemoveAura(GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue());
break;
default:
break;
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ulduar_cancel_stone_gripSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_ulduar_cancel_stone_gripSpellScript();
}
};
class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
{
public:
spell_ulduar_squeezed_lifeless() : SpellScriptLoader("spell_ulduar_squeezed_lifeless") { }
class spell_ulduar_squeezed_lifeless_SpellScript : public SpellScript
{
PrepareSpellScript(spell_ulduar_squeezed_lifeless_SpellScript);
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle())
return;
//! Proper exit position does not work currently,
//! See documentation in void Unit::ExitVehicle(Position const* exitPosition)
Position pos;
pos.m_positionX = 1756.25f + irand(-3, 3);
pos.m_positionY = -8.3f + irand(-3, 3);
pos.m_positionZ = 448.8f;
pos.SetOrientation(float(M_PI));
GetHitPlayer()->DestroyForNearbyPlayers();
GetHitPlayer()->ExitVehicle(&pos);
GetHitPlayer()->UpdateObjectVisibility(false);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ulduar_squeezed_lifeless_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_ulduar_squeezed_lifeless_SpellScript();
}
};
class spell_ulduar_stone_grip_absorb : public SpellScriptLoader
{
public:
spell_ulduar_stone_grip_absorb() : SpellScriptLoader("spell_ulduar_stone_grip_absorb") { }
class spell_ulduar_stone_grip_absorb_AuraScript : public AuraScript
{
PrepareAuraScript(spell_ulduar_stone_grip_absorb_AuraScript);
//! This will be called when Right Arm (vehicle) has sustained a specific amount of damage depending on instance mode
//! What we do here is remove all harmful aura's related and teleport to safe spot.
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
return;
if (!GetOwner()->ToCreature())
return;
uint32 rubbleStalkerEntry = (GetOwner()->GetMap()->GetDifficultyID() == DIFFICULTY_NORMAL ? 33809 : 33942);
Creature* rubbleStalker = GetOwner()->FindNearestCreature(rubbleStalkerEntry, 200.0f, true);
if (rubbleStalker)
rubbleStalker->CastSpell(rubbleStalker, SPELL_STONE_GRIP_CANCEL, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_absorb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_ulduar_stone_grip_absorb_AuraScript();
}
};
class spell_ulduar_stone_grip : public SpellScriptLoader
{
public:
spell_ulduar_stone_grip() : SpellScriptLoader("spell_ulduar_stone_grip") { }
class spell_ulduar_stone_grip_AuraScript : public AuraScript
{
PrepareAuraScript(spell_ulduar_stone_grip_AuraScript);
void OnRemoveStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Player* owner = GetOwner()->ToPlayer())
owner->RemoveAurasDueToSpell(aurEff->GetAmount());
}
void OnRemoveVehicle(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PreventDefaultAction();
Unit* caster = GetCaster();
if (!caster)
return;
Position exitPosition;
exitPosition.m_positionX = 1750.0f;
exitPosition.m_positionY = -7.5f + frand(-3.0f, 3.0f);
exitPosition.m_positionZ = 457.9322f;
// Remove pending passengers before exiting vehicle - might cause an Uninstall
GetTarget()->GetVehicleKit()->RemovePendingEventsForPassenger(caster);
caster->_ExitVehicle(&exitPosition);
caster->RemoveAurasDueToSpell(GetId());
// Temporarily relocate player to vehicle exit dest serverside to send proper fall movement
// beats me why blizzard sends these 2 spline packets one after another instantly
Position oldPos = caster->GetPosition();
caster->Relocate(exitPosition);
caster->GetMotionMaster()->MoveFall();
caster->Relocate(oldPos);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_AuraScript::OnRemoveVehicle, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_AuraScript::OnRemoveStun, EFFECT_2, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_ulduar_stone_grip_AuraScript();
}
};
class spell_kologarn_stone_shout : public SpellScriptLoader
{
public:
spell_kologarn_stone_shout() : SpellScriptLoader("spell_kologarn_stone_shout") { }
class spell_kologarn_stone_shout_SpellScript : public SpellScript
{
PrepareSpellScript(spell_kologarn_stone_shout_SpellScript);
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(PlayerOrPetCheck());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_kologarn_stone_shout_SpellScript();
}
};
class spell_kologarn_summon_focused_eyebeam : public SpellScriptLoader
{
public:
spell_kologarn_summon_focused_eyebeam() : SpellScriptLoader("spell_kologarn_summon_focused_eyebeam") { }
class spell_kologarn_summon_focused_eyebeam_SpellScript : public SpellScript
{
PrepareSpellScript(spell_kologarn_summon_focused_eyebeam_SpellScript);
void HandleForceCast(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_kologarn_summon_focused_eyebeam_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
OnEffectHitTarget += SpellEffectFn(spell_kologarn_summon_focused_eyebeam_SpellScript::HandleForceCast, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_kologarn_summon_focused_eyebeam_SpellScript();
}
};
void AddSC_boss_kologarn()
{
new boss_kologarn();
new spell_ulduar_rubble_summon();
new spell_ulduar_squeezed_lifeless();
new spell_ulduar_cancel_stone_grip();
new spell_ulduar_stone_grip_cast_target();
new spell_ulduar_stone_grip_absorb();
new spell_ulduar_stone_grip();
new spell_kologarn_stone_shout();
new spell_kologarn_summon_focused_eyebeam();
}