/
boss_fathomlord_karathress.cpp
737 lines (625 loc) · 23 KB
/
boss_fathomlord_karathress.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
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* 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/>.
*/
/* ScriptData
SDName: Boss_Fathomlord_Karathress
SD%Complete: 70
SDComment: Cyclone workaround
SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "serpent_shrine.h"
#include "ScriptedEscortAI.h"
enum FathomlordKarathress
{
SAY_AGGRO = 0,
SAY_GAIN_BLESSING = 1,
SAY_GAIN_ABILITY1 = 2,
SAY_GAIN_ABILITY2 = 3,
SAY_GAIN_ABILITY3 = 4,
SAY_SLAY = 5,
SAY_DEATH = 6,
//Karathress spells
SPELL_CATACLYSMIC_BOLT = 38441,
SPELL_POWER_OF_SHARKKIS = 38455,
SPELL_POWER_OF_TIDALVESS = 38452,
SPELL_POWER_OF_CARIBDIS = 38451,
SPELL_ENRAGE = 24318,
SPELL_SEAR_NOVA = 38445,
SPELL_BLESSING_OF_THE_TIDES = 38449,
//Sharkkis spells
SPELL_LEECHING_THROW = 29436,
SPELL_THE_BEAST_WITHIN = 38373,
SPELL_MULTISHOT = 38366,
SPELL_SUMMON_FATHOM_LURKER = 38433,
SPELL_SUMMON_FATHOM_SPOREBAT = 38431,
SPELL_PET_ENRAGE = 19574,
//Tidalvess spells
SPELL_FROST_SHOCK = 38234,
SPELL_SPITFIRE_TOTEM = 38236,
SPELL_POISON_CLEANSING_TOTEM = 38306,
// Spell obsolete
SPELL_EARTHBIND_TOTEM = 38304,
SPELL_EARTHBIND_TOTEM_EFFECT = 6474,
SPELL_WINDFURY_WEAPON = 38184,
//Caribdis Spells
SPELL_WATER_BOLT_VOLLEY = 38335,
SPELL_TIDAL_SURGE = 38358,
SPELL_TIDAL_SURGE_FREEZE = 38357,
SPELL_HEAL = 38330,
SPELL_SUMMON_CYCLONE = 38337,
SPELL_CYCLONE_CYCLONE = 29538,
//Yells and Quotes
SOUND_GAIN_BLESSING_OF_TIDES = 11278,
SOUND_MISC = 11283,
//Summoned Unit GUIDs
CREATURE_CYCLONE = 22104,
CREATURE_FATHOM_SPOREBAT = 22120,
CREATURE_FATHOM_LURKER = 22119,
CREATURE_SPITFIRE_TOTEM = 22091,
CREATURE_EARTHBIND_TOTEM = 22486,
CREATURE_POISON_CLEANSING_TOTEM = 22487,
};
//entry and position for Seer Olum
#define SEER_OLUM 22820
#define OLUM_X 446.78f
#define OLUM_Y -542.76f
#define OLUM_Z -7.54773f
#define OLUM_O 0.401581f
#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!"
#define SAY_MISC "Alana be'lendor!" //don't know what use this
#define MAX_ADVISORS 3
//Fathom-Lord Karathress AI
class boss_fathomlord_karathress : public CreatureScript
{
public:
boss_fathomlord_karathress() : CreatureScript("boss_fathomlord_karathress") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_fathomlord_karathressAI (creature);
}
struct boss_fathomlord_karathressAI : public ScriptedAI
{
boss_fathomlord_karathressAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
Advisors[0] = 0;
Advisors[1] = 0;
Advisors[2] = 0;
}
InstanceScript* instance;
uint32 CataclysmicBolt_Timer;
uint32 Enrage_Timer;
uint32 SearNova_Timer;
bool BlessingOfTides;
uint64 Advisors[MAX_ADVISORS];
void Reset()
{
CataclysmicBolt_Timer = 10000;
Enrage_Timer = 600000; //10 minutes
SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds
BlessingOfTides = false;
if (instance)
{
uint64 RAdvisors[MAX_ADVISORS];
RAdvisors[0] = instance->GetData64(DATA_SHARKKIS);
RAdvisors[1] = instance->GetData64(DATA_TIDALVESS);
RAdvisors[2] = instance->GetData64(DATA_CARIBDIS);
//Respawn of the 3 Advisors
Creature* pAdvisor = NULL;
for (int i=0; i<MAX_ADVISORS; ++i)
if (RAdvisors[i])
{
pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
if (pAdvisor && !pAdvisor->isAlive())
{
pAdvisor->Respawn();
pAdvisor->AI()->EnterEvadeMode();
pAdvisor->GetMotionMaster()->MoveTargetedHome();
}
}
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
}
void EventSharkkisDeath()
{
Talk(SAY_GAIN_ABILITY1);
DoCast(me, SPELL_POWER_OF_SHARKKIS);
}
void EventTidalvessDeath()
{
Talk(SAY_GAIN_ABILITY2);
DoCast(me, SPELL_POWER_OF_TIDALVESS);
}
void EventCaribdisDeath()
{
Talk(SAY_GAIN_ABILITY3);
DoCast(me, SPELL_POWER_OF_CARIBDIS);
}
void GetAdvisors()
{
if (!instance)
return;
Advisors[0] = instance->GetData64(DATA_SHARKKIS);
Advisors[1] = instance->GetData64(DATA_TIDALVESS);
Advisors[2] = instance->GetData64(DATA_CARIBDIS);
}
void StartEvent(Unit* who)
{
if (!instance)
return;
GetAdvisors();
Talk(SAY_AGGRO);
DoZoneInCombat();
instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/)
{
Talk(SAY_SLAY);
}
void JustDied(Unit* /*killer*/)
{
Talk(SAY_DEATH);
if (instance)
instance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
//support for quest 10944
me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
}
void EnterCombat(Unit* who)
{
StartEvent(who);
}
void UpdateAI(uint32 diff)
{
//Only if not incombat check if the event is started
if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
{
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
{
AttackStart(target);
GetAdvisors();
}
}
//Return since we have no target
if (!UpdateVictim())
return;
//someone evaded!
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
{
EnterEvadeMode();
return;
}
//CataclysmicBolt_Timer
if (CataclysmicBolt_Timer <= diff)
{
//select a random unit other than the main tank
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
//if there aren't other units, cast on the tank
if (!target)
target = me->getVictim();
if (target)
DoCast(target, SPELL_CATACLYSMIC_BOLT);
CataclysmicBolt_Timer = 10000;
} else CataclysmicBolt_Timer -= diff;
//SearNova_Timer
if (SearNova_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SEAR_NOVA);
SearNova_Timer = 20000+rand()%40000;
} else SearNova_Timer -= diff;
//Enrage_Timer
if (Enrage_Timer <= diff)
{
DoCast(me, SPELL_ENRAGE);
Enrage_Timer = 90000;
} else Enrage_Timer -= diff;
//Blessing of Tides Trigger
if (!HealthAbovePct(75) && !BlessingOfTides)
{
BlessingOfTides = true;
bool continueTriggering = false;
Creature* Advisor;
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
if (Advisors[i])
{
Advisor = (Unit::GetCreature(*me, Advisors[i]));
if (Advisor && Advisor->isAlive())
{
continueTriggering = true;
break;
}
}
if (continueTriggering)
{
DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
}
DoMeleeAttackIfReady();
}
};
};
//Fathom-Guard Sharkkis AI
class boss_fathomguard_sharkkis : public CreatureScript
{
public:
boss_fathomguard_sharkkis() : CreatureScript("boss_fathomguard_sharkkis") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_fathomguard_sharkkisAI (creature);
}
struct boss_fathomguard_sharkkisAI : public ScriptedAI
{
boss_fathomguard_sharkkisAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
uint32 LeechingThrow_Timer;
uint32 TheBeastWithin_Timer;
uint32 Multishot_Timer;
uint32 Pet_Timer;
bool pet;
uint64 SummonedPet;
void Reset()
{
LeechingThrow_Timer = 20000;
TheBeastWithin_Timer = 30000;
Multishot_Timer = 15000;
Pet_Timer = 10000;
pet = false;
Creature* Pet = Unit::GetCreature(*me, SummonedPet);
if (Pet && Pet->isAlive())
{
Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
SummonedPet = 0;
if (instance)
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/)
{
if (instance)
{
if (Creature* Karathress = (Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS))))
CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
}
}
void EnterCombat(Unit* who)
{
if (instance)
{
instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
}
void UpdateAI(uint32 diff)
{
//Only if not incombat check if the event is started
if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
{
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
AttackStart(target);
}
//Return since we have no target
if (!UpdateVictim())
return;
//someone evaded!
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
{
EnterEvadeMode();
return;
}
//LeechingThrow_Timer
if (LeechingThrow_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_LEECHING_THROW);
LeechingThrow_Timer = 20000;
} else LeechingThrow_Timer -= diff;
//Multishot_Timer
if (Multishot_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MULTISHOT);
Multishot_Timer = 20000;
} else Multishot_Timer -= diff;
//TheBeastWithin_Timer
if (TheBeastWithin_Timer <= diff)
{
DoCast(me, SPELL_THE_BEAST_WITHIN);
Creature* Pet = Unit::GetCreature(*me, SummonedPet);
if (Pet && Pet->isAlive())
{
Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true);
}
TheBeastWithin_Timer = 30000;
} else TheBeastWithin_Timer -= diff;
//Pet_Timer
if (Pet_Timer < diff && pet == false)
{
pet = true;
//uint32 spell_id;
uint32 pet_id;
if (!urand(0, 1))
{
//spell_id = SPELL_SUMMON_FATHOM_LURKER;
pet_id = CREATURE_FATHOM_LURKER;
}
else
{
//spell_id = SPELL_SUMMON_FATHOM_SPOREBAT;
pet_id = CREATURE_FATHOM_SPOREBAT;
}
//DoCast(me, spell_id, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (Creature* Pet = DoSpawnCreature(pet_id, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
{
Pet->AI()->AttackStart(target);
SummonedPet = Pet->GetGUID();
}
}
} else Pet_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
//Fathom-Guard Tidalvess AI
class boss_fathomguard_tidalvess : public CreatureScript
{
public:
boss_fathomguard_tidalvess() : CreatureScript("boss_fathomguard_tidalvess") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_fathomguard_tidalvessAI (creature);
}
struct boss_fathomguard_tidalvessAI : public ScriptedAI
{
boss_fathomguard_tidalvessAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
uint32 FrostShock_Timer;
uint32 Spitfire_Timer;
uint32 PoisonCleansing_Timer;
uint32 Earthbind_Timer;
void Reset()
{
FrostShock_Timer = 25000;
Spitfire_Timer = 60000;
PoisonCleansing_Timer = 30000;
Earthbind_Timer = 45000;
if (instance)
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/)
{
if (instance)
{
if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
}
}
void EnterCombat(Unit* who)
{
if (instance)
{
instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
DoCast(me, SPELL_WINDFURY_WEAPON);
}
void UpdateAI(uint32 diff)
{
//Only if not incombat check if the event is started
if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
{
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
AttackStart(target);
}
//Return since we have no target
if (!UpdateVictim())
return;
//someone evaded!
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
{
EnterEvadeMode();
return;
}
if (!me->HasAura(SPELL_WINDFURY_WEAPON))
{
DoCast(me, SPELL_WINDFURY_WEAPON);
}
//FrostShock_Timer
if (FrostShock_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROST_SHOCK);
FrostShock_Timer = 25000+rand()%5000;
} else FrostShock_Timer -= diff;
//Spitfire_Timer
if (Spitfire_Timer <= diff)
{
DoCast(me, SPELL_SPITFIRE_TOTEM);
if (Unit* SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM))
SpitfireTotem->ToCreature()->AI()->AttackStart(me->getVictim());
Spitfire_Timer = 60000;
}
else
Spitfire_Timer -= diff;
//PoisonCleansing_Timer
if (PoisonCleansing_Timer <= diff)
{
DoCast(me, SPELL_POISON_CLEANSING_TOTEM);
PoisonCleansing_Timer = 30000;
}
else
PoisonCleansing_Timer -= diff;
//Earthbind_Timer
if (Earthbind_Timer <= diff)
{
DoCast(me, SPELL_EARTHBIND_TOTEM);
Earthbind_Timer = 45000;
}
else
Earthbind_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
//Fathom-Guard Caribdis AI
class boss_fathomguard_caribdis : public CreatureScript
{
public:
boss_fathomguard_caribdis() : CreatureScript("boss_fathomguard_caribdis") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_fathomguard_caribdisAI (creature);
}
struct boss_fathomguard_caribdisAI : public ScriptedAI
{
boss_fathomguard_caribdisAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
uint32 WaterBoltVolley_Timer;
uint32 TidalSurge_Timer;
uint32 Heal_Timer;
uint32 Cyclone_Timer;
void Reset()
{
WaterBoltVolley_Timer = 35000;
TidalSurge_Timer = 15000+rand()%5000;
Heal_Timer = 55000;
Cyclone_Timer = 30000+rand()%10000;
if (instance)
instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/)
{
if (instance)
{
if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
}
}
void EnterCombat(Unit* who)
{
if (instance)
{
instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
}
void UpdateAI(uint32 diff)
{
//Only if not incombat check if the event is started
if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
{
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
AttackStart(target);
}
//Return since we have no target
if (!UpdateVictim())
return;
//someone evaded!
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
{
EnterEvadeMode();
return;
}
//WaterBoltVolley_Timer
if (WaterBoltVolley_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY);
WaterBoltVolley_Timer = 30000;
} else WaterBoltVolley_Timer -= diff;
//TidalSurge_Timer
if (TidalSurge_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_TIDAL_SURGE);
// Hacky way to do it - won't trigger elseways
me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
TidalSurge_Timer = 15000+rand()%5000;
} else TidalSurge_Timer -= diff;
//Cyclone_Timer
if (Cyclone_Timer <= diff)
{
//DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
Cyclone_Timer = 30000+rand()%10000;
if (Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000))
{
Cyclone->SetObjectScale(3.0f);
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Cyclone->setFaction(me->getFaction());
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
Cyclone->AI()->AttackStart(target);
}
}
else
Cyclone_Timer -= diff;
//Heal_Timer
if (Heal_Timer <= diff)
{
// It can be cast on any of the mobs
Unit* unit = NULL;
while (unit == NULL || !unit->isAlive())
unit = selectAdvisorUnit();
if (unit && unit->isAlive())
DoCast(unit, SPELL_HEAL);
Heal_Timer = 60000;
}
else
Heal_Timer -= diff;
DoMeleeAttackIfReady();
}
Unit* selectAdvisorUnit()
{
Unit* unit = NULL;
if (instance)
{
switch (rand()%4)
{
case 0:
unit = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESS));
break;
case 1:
unit = Unit::GetUnit(*me, instance->GetData64(DATA_SHARKKIS));
break;
case 2:
unit = Unit::GetUnit(*me, instance->GetData64(DATA_TIDALVESS));
break;
case 3:
unit = me;
break;
}
} else unit = me;
return unit;
}
};
};
void AddSC_boss_fathomlord_karathress()
{
new boss_fathomlord_karathress();
new boss_fathomguard_sharkkis();
new boss_fathomguard_tidalvess();
new boss_fathomguard_caribdis();
}