Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_lady_vashj.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_Lady_Vashj
8SD%Complete: 99
9SDComment: Missing blizzlike Shield Generators coords
10SDCategory: Coilfang Resevoir, Serpent Shrine Cavern
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "serpent_shrine.h"
16#include "Spell.h"
17#include "Player.h"
18#include "WorldSession.h"
19
50
51#define MIDDLE_X 30.134f
52#define MIDDLE_Y -923.65f
53#define MIDDLE_Z 42.9f
54
55#define SPOREBAT_X 30.977156f
56#define SPOREBAT_Y -925.297761f
57#define SPOREBAT_Z 77.176567f
58#define SPOREBAT_O 5.223932f
59
60
61
62#define TEXT_NOT_INITIALIZED "Instance script not initialized"
63#define TEXT_ALREADY_DEACTIVATED "Already deactivated"
64
65float ElementPos[8][4] =
66{
67 {8.3f, -835.3f, 21.9f, 5.0f},
68 {53.4f, -835.3f, 21.9f, 4.5f},
69 {96.0f, -861.9f, 21.8f, 4.0f},
70 {96.0f, -986.4f, 21.4f, 2.5f},
71 {54.4f, -1010.6f, 22, 1.8f},
72 {9.8f, -1012, 21.7f, 1.4f},
73 {-35.0f, -987.6f, 21.5f, 0.8f},
74 {-58.9f, -901.6f, 21.5f, 6.0f}
75};
76
77float ElementWPPos[8][3] =
78{
79 {71.700752f, -883.905884f, 41.097168f},
80 {45.039848f, -868.022827f, 41.097015f},
81 {14.585141f, -867.894470f, 41.097061f},
82 {-25.415508f, -906.737732f, 41.097061f},
83 {-11.801594f, -963.405884f, 41.097067f},
84 {14.556657f, -979.051514f, 41.097137f},
85 {43.466549f, -979.406677f, 41.097027f},
86 {69.945908f, -964.663940f, 41.097054f}
87};
88
89float SporebatWPPos[8][3] =
90{
91 {31.6f, -896.3f, 59.1f},
92 {9.1f, -913.9f, 56.0f},
93 {5.2f, -934.4f, 52.4f},
94 {20.7f, -946.9f, 49.7f},
95 {41.0f, -941.9f, 51.0f},
96 {47.7f, -927.3f, 55.0f},
97 {42.2f, -912.4f, 51.7f},
98 {27.0f, -905.9f, 50.0f}
99};
100
101float CoilfangElitePos[3][4] =
102{
103 {28.84f, -923.28f, 42.9f, 6.0f},
104 {31.183281f, -953.502625f, 41.523602f, 1.640957f},
105 {58.895180f, -923.124268f, 41.545307f, 3.152848f}
106};
107
109{
110 {66.427010f, -948.778503f, 41.262245f, 2.584220f},
111 {7.513962f, -959.538208f, 41.300422f, 1.034629f},
112 {-12.843201f, -907.798401f, 41.239620f, 6.087094f}
113};
114
116{
117 {49.6262f, -902.181f, 43.0975f, 3.95683f},
118 {10.988f, -901.616f, 42.5371f, 5.4373f},
119 {10.3859f, -944.036f, 42.5446f, 0.779888f},
120 {49.3126f, -943.398f, 42.5501f, 2.40174f}
121};
122
124{
125public:
126 boss_lady_vashj() : CreatureScript("boss_lady_vashj") { }
127
129 {
130 return new boss_lady_vashjAI(creature);
131 }
132
134 {
135 boss_lady_vashjAI(Creature* creature) : ScriptedAI(creature)
136 {
137 instance = creature->GetInstanceScript();
138 Intro = false;
139 JustCreated = true;
140 creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
141 for (uint8 i = 0; i < 4; ++i)
143 }
144
146
148
163
165 bool Intro;
168
170 {
171 AggroTimer = 19000;
172 ShockBlastTimer = 1+rand()%60000;
173 EntangleTimer = 30000;
174 StaticChargeTimer = 10000+rand()%15000;
176 CheckTimer = 15000;
178 TaintedElementalTimer = 50000;
179 CoilfangEliteTimer = 45000+rand()%5000;
180 CoilfangStriderTimer = 60000+rand()%10000;
181 SummonSporebatTimer = 10000;
184 Phase = 0;
185
186 Entangle = false;
187 if (JustCreated)
188 {
189 CanAttack = false;
190 JustCreated = false;
191 } else CanAttack = true;
192
193 for (uint8 i = 0; i < 4; ++i)
194 {
196 {
198 {
199 remo->setDeathState(DeathState::JUST_DIED);
201 }
202 }
203 }
204
205 if (instance)
207
208 me->SetCorpseDelay(1000*60*60);
209 }
210
211 // Called when a tainted elemental dies
213 {
214 // the next will spawn 50 seconds after the previous one's death
215 if (TaintedElementalTimer > 50000)
216 TaintedElementalTimer = 50000;
217 }
218 void KilledUnit(Unit* /*victim*/) OVERRIDE
219 {
220 Talk(SAY_SLAY);
221 }
222
223 void JustDied(Unit* /*killer*/) OVERRIDE
224 {
226
227 if (instance)
229 }
230
232 {
234
235 Phase = 1;
236
237 if (instance)
239 }
240
242 {
243 if (instance)
244 {
245 // remove old tainted cores to prevent cheating in phase 2
246 Map* map = me->GetMap();
247 Map::PlayerList const &PlayerList = map->GetPlayers();
248 for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
249 if (Player* player = itr->GetSource())
250 player->DestroyItemCount(31088, 1, true);
251 }
252 StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event
253
254 if (Phase != 2)
255 AttackStart(who);
256 }
257
259
260 {
261 if (!Intro)
262 {
263 Intro = true;
265 }
266 if (!CanAttack)
267 return;
268 if (!who || me->GetVictim())
269 return;
270
271 if (me->CanCreatureAttack(who))
272 {
273 float attackRadius = me->GetAttackDistance(who);
274 if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
275 {
276 if (!me->IsInCombat()) // AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
277 StartEvent();
278
279 if (Phase != 2)
280 AttackStart(who);
281 }
282 }
283 }
284
286 {
287 switch (std::rand() % 1)
288 {
289 case 0:
290 // Shoot
291 // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
293 break;
294 case 1:
295 // Multishot
296 // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
298 break;
299 }
300 if (rand()%3)
301 {
303 }
304 }
305
307 {
308 if (!CanAttack && Intro)
309 {
310 if (AggroTimer <= diff)
311 {
312 CanAttack = true;
314 AggroTimer=19000;
315 }
316 else
317 {
318 AggroTimer-=diff;
319 return;
320 }
321 }
322 // to prevent abuses during phase 2
323 if (Phase == 2 && !me->GetVictim() && me->IsInCombat())
324 {
326 return;
327 }
328 // Return since we have no target
329 if (!UpdateVictim())
330 return;
331
332 if (Phase == 1 || Phase == 3)
333 {
334 // ShockBlastTimer
335 if (ShockBlastTimer <= diff)
336 {
337 // Shock Burst
338 // Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
340 me->TauntApply(me->GetVictim());
341
342 ShockBlastTimer = 1000+rand()%14000; // random cooldown
343 } else ShockBlastTimer -= diff;
344
345 // StaticChargeTimer
346 if (StaticChargeTimer <= diff)
347 {
348 // Static Charge
349 // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
350 Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
351 if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
352 DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds
353
354 StaticChargeTimer = 10000+rand()%20000;
355 } else StaticChargeTimer -= diff;
356
357 // EntangleTimer
358 if (EntangleTimer <= diff)
359 {
360 if (!Entangle)
361 {
362 // Entangle
363 // Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
365 Entangle = true;
366 EntangleTimer = 10000;
367 }
368 else
369 {
371 Entangle = false;
372 EntangleTimer = 20000+rand()%5000;
373 }
374 } else EntangleTimer -= diff;
375
376 // Phase 1
377 if (Phase == 1)
378 {
379 // Start phase 2
380 if (HealthBelowPct(70))
381 {
382 // Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
383 Phase = 2;
384
385 me->GetMotionMaster()->Clear();
387
388 for (uint8 i = 0; i < 4; ++i)
390 ShieldGeneratorChannel[i] = creature->GetGUID();
391
393 }
394 }
395 // Phase 3
396 else
397 {
398 // SummonSporebatTimer
399 if (SummonSporebatTimer <= diff)
400 {
402 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
403 sporebat->AI()->AttackStart(target);
404
405 // summon sporebats faster and faster
406 if (SummonSporebatStaticTimer > 1000)
408
410
411 if (SummonSporebatTimer < 5000)
412 SummonSporebatTimer = 5000;
413
414 } else SummonSporebatTimer -= diff;
415 }
416
417 // Melee attack
419
420 // CheckTimer - used to check if somebody is in melee range
421 if (CheckTimer <= diff)
422 {
423 bool inMeleeRange = false;
424 std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
425 for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
426 {
427 Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
428 if (target && target->IsWithinDistInMap(me, 5)) // if in melee range
429 {
430 inMeleeRange = true;
431 break;
432 }
433 }
434
435 // if nobody is in melee range
436 if (!inMeleeRange)
438
439 CheckTimer = 5000;
440 } else CheckTimer -= diff;
441 }
442 // Phase 2
443 else
444 {
445 // ForkedLightningTimer
446 if (ForkedLightningTimer <= diff)
447 {
448 // Forked Lightning
449 // Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
451
452 if (!target)
453 target = me->GetVictim();
454
456
457 ForkedLightningTimer = 2000+rand()%6000;
458 } else ForkedLightningTimer -= diff;
459
460 // EnchantedElementalTimer
461 if (EnchantedElementalTimer <= diff)
462 {
464
465 if (EnchantedElementalPos == 7)
467 else
469
470 EnchantedElementalTimer = 10000+rand()%5000;
471 } else EnchantedElementalTimer -= diff;
472
473 // TaintedElementalTimer
474 if (TaintedElementalTimer <= diff)
475 {
476 uint32 pos = rand()%8;
477 me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TempSummonType::TEMPSUMMON_DEAD_DESPAWN, 0);
478
479 TaintedElementalTimer = 120000;
480 } else TaintedElementalTimer -= diff;
481
482 // CoilfangEliteTimer
483 if (CoilfangEliteTimer <= diff)
484 {
485 uint32 pos = rand()%3;
487 if (coilfangElite)
488 {
489 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
490 coilfangElite->AI()->AttackStart(target);
491 else if (me->GetVictim())
492 coilfangElite->AI()->AttackStart(me->GetVictim());
493 }
494 CoilfangEliteTimer = 45000+rand()%5000;
495 } else CoilfangEliteTimer -= diff;
496
497 // CoilfangStriderTimer
498 if (CoilfangStriderTimer <= diff)
499 {
500 uint32 pos = rand()%3;
502 {
503 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
504 CoilfangStrider->AI()->AttackStart(target);
505 else if (me->GetVictim())
506 CoilfangStrider->AI()->AttackStart(me->GetVictim());
507 }
508 CoilfangStriderTimer = 60000+rand()%10000;
509 } else CoilfangStriderTimer -= diff;
510
511 // CheckTimer
512 if (CheckTimer <= diff)
513 {
514 // Start Phase 3
515 if (instance && instance->GetData(DATA_CANSTARTPHASE3))
516 {
517 // set life 50%
518 me->SetHealth(me->CountPctFromMaxHealth(50));
519
520 me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
521
523
524 Phase = 3;
525
526 // return to the tank
527 me->GetMotionMaster()->MoveChase(me->GetVictim());
528 }
529 CheckTimer = 1000;
530 } else CheckTimer -= diff;
531 }
532 }
533 };
534};
535
536// Enchanted Elemental
537// If one of them reaches Vashj he will increase her damage done by 5%.
539{
540public:
541 npc_enchanted_elemental() : CreatureScript("npc_enchanted_elemental") { }
542
544 {
545 return new npc_enchanted_elementalAI(creature);
546 }
547
549 {
551 {
552 instance = creature->GetInstanceScript();
553 }
554
558 float X, Y, Z;
559
561
563 {
564 me->SetSpeed(MOVE_WALK, 0.6f); // walk
565 me->SetSpeed(MOVE_RUN, 0.6f); // run
566 Move = 0;
567 Phase = 1;
568
569 VashjGUID = 0;
570
571 X = ElementWPPos[0][0];
572 Y = ElementWPPos[0][1];
573 Z = ElementWPPos[0][2];
574
575 //search for nearest waypoint (up on stairs)
576 for (uint32 i = 1; i < 8; ++i)
577 {
578 if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(X, Y, Z))
579 {
580 X = ElementWPPos[i][0];
581 Y = ElementWPPos[i][1];
582 Z = ElementWPPos[i][2];
583 }
584 }
585
586 if (instance)
587 VashjGUID = instance->GetData64(DATA_LADYVASHJ);
588 }
589
590 void EnterCombat(Unit* /*who*/) OVERRIDE { }
591
592 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
593
594
596 {
597 if (!instance)
598 return;
599
600 if (!VashjGUID)
601 return;
602
603 if (Move <= diff)
604 {
605 me->SetWalk(true);
606 if (Phase == 1)
607 me->GetMotionMaster()->MovePoint(0, X, Y, Z);
608 if (Phase == 1 && me->IsWithinDist3d(X, Y, Z, 0.1f))
609 Phase = 2;
610 if (Phase == 2)
611 {
612 me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
613 Phase = 3;
614 }
615 if (Phase == 3)
616 {
617 me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
618 if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
620 }
621 if (Creature* vashj = Unit::GetCreature(*me, VashjGUID))
622 if (!vashj->IsInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase != 2 || vashj->isDead())
623 me->Kill(me);
624 Move = 1000;
625 } else Move -= diff;
626 }
627 };
628};
629
630// Tainted Elemental
631// This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
633{
634public:
635 npc_tainted_elemental() : CreatureScript("npc_tainted_elemental") { }
636
638 {
639 return new npc_tainted_elementalAI(creature);
640 }
641
643 {
645 {
646 instance = creature->GetInstanceScript();
647 }
648
650
653
655 {
656 PoisonBoltTimer = 5000+rand()%5000;
657 DespawnTimer = 30000;
658 }
659
660 void JustDied(Unit* /*killer*/) OVERRIDE
661 {
662 if (instance)
663 if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ)))
664 CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath();
665 }
666
668 {
669 me->AddThreat(who, 0.1f);
670 }
671
673 {
674 // PoisonBoltTimer
675 if (PoisonBoltTimer <= diff)
676 {
678
679 if (target && target->IsWithinDistInMap(me, 30))
680 DoCast(target, SPELL_POISON_BOLT);
681
682 PoisonBoltTimer = 5000+rand()%5000;
683 } else PoisonBoltTimer -= diff;
684
685 // DespawnTimer
686 if (DespawnTimer <= diff)
687 {
688 // call Unsummon()
689 me->setDeathState(DeathState::DEAD);
690
691 // to prevent crashes
692 DespawnTimer = 1000;
693 } else DespawnTimer -= diff;
694 }
695 };
696};
697
698//Toxic Sporebat
699//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it.
701{
702public:
703 npc_toxic_sporebat() : CreatureScript("npc_toxic_sporebat") { }
704
706 {
707 return new npc_toxic_sporebatAI(creature);
708 }
709
711 {
713 {
714 instance = creature->GetInstanceScript();
716 }
717
719
724
726 {
727 me->SetDisableGravity(true);
728 me->setFaction(14);
729 MovementTimer = 0;
730 ToxicSporeTimer = 5000;
731 BoltTimer = 5500;
732 CheckTimer = 1000;
733 }
734
736
737 {
738 }
739
741 {
742 if (type != POINT_MOTION_TYPE)
743 return;
744
745 if (id == 1)
746 MovementTimer = 0;
747 }
748
750 {
751 // Random movement
752 if (MovementTimer <= diff)
753 {
754 uint32 rndpos = rand()%8;
755 me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
756 MovementTimer = 6000;
757 } else MovementTimer -= diff;
758
759 // toxic spores
760 if (BoltTimer <= diff)
761 {
762 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
763 {
764 if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 30000))
765 {
766 trig->setFaction(14);
767 trig->CastSpell(trig, SPELL_TOXIC_SPORES, true);
768 }
769 }
770 BoltTimer = 10000+rand()%5000;
771 }
772 else BoltTimer -= diff;
773
774 // CheckTimer
775 if (CheckTimer <= diff)
776 {
777 if (instance)
778 {
779 // check if vashj is death
780 Unit* Vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
781 if (!Vashj || !Vashj->IsAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
782 {
783 // remove
784 me->setDeathState(DeathState::DEAD);
785 me->RemoveCorpse();
786 me->setFaction(35);
787 }
788 }
789
790 CheckTimer = 1000;
791 }
792 else
793 CheckTimer -= diff;
794 }
795 };
796};
797
799{
800public:
801 npc_shield_generator_channel() : CreatureScript("npc_shield_generator_channel") { }
802
804 {
805 return new npc_shield_generator_channelAI(creature);
806 }
807
809 {
811 {
812 instance = creature->GetInstanceScript();
813 }
814
817 bool Casted;
818
820 {
821 CheckTimer = 0;
822 Casted = false;
823 me->SetDisplayId(11686); // invisible
824
826 }
827
828 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
829
830
832 {
833 if (!instance)
834 return;
835
836 if (CheckTimer <= diff)
837 {
838 Unit* vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
839
840 if (vashj && vashj->IsAlive())
841 {
842 // start visual channel
843 if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER))
844 {
845 DoCast(vashj, SPELL_MAGIC_BARRIER, true);
846 Casted = true;
847 }
848 }
849 CheckTimer = 1000;
850 } else CheckTimer -= diff;
851 }
852 };
853};
854
856{
857public:
858 item_tainted_core() : ItemScript("item_tainted_core") { }
859
860 bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets) OVERRIDE
861 {
862 InstanceScript* instance = player->GetInstanceScript();
863 if (!instance)
864 {
865 player->GetSession()->SendNotification(TEXT_NOT_INITIALIZED);
866 return true;
867 }
868
869 Creature* vashj = Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ));
870 if (vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase == 2))
871 {
872 if (GameObject* gObj = targets.GetGOTarget())
873 {
874 uint32 identifier;
875 uint8 channelIdentifier;
876 switch (gObj->GetEntry())
877 {
878 case 185052:
879 identifier = DATA_SHIELDGENERATOR1;
880 channelIdentifier = 0;
881 break;
882 case 185053:
883 identifier = DATA_SHIELDGENERATOR2;
884 channelIdentifier = 1;
885 break;
886 case 185051:
887 identifier = DATA_SHIELDGENERATOR3;
888 channelIdentifier = 2;
889 break;
890 case 185054:
891 identifier = DATA_SHIELDGENERATOR4;
892 channelIdentifier = 3;
893 break;
894 default:
895 return true;
896 }
897
898 if (instance->GetData(identifier))
899 {
900 player->GetSession()->SendNotification(TEXT_ALREADY_DEACTIVATED);
901 return true;
902 }
903
904 // get and remove channel
905 if (Unit* channel = Unit::GetCreature(*vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->ShieldGeneratorChannel[channelIdentifier]))
906 channel->setDeathState(DeathState::JUST_DIED); // call Unsummon()
907
908 instance->SetData(identifier, 1);
909
910 // remove this item
911 player->DestroyItemCount(31088, 1, true);
912 return true;
913 }
914 else if (targets.GetUnitTarget()->GetTypeId() == TypeID::TYPEID_UNIT)
915 return false;
916 else if (targets.GetUnitTarget()->GetTypeId() == TypeID::TYPEID_PLAYER)
917 {
918 player->DestroyItemCount(31088, 1, true);
919 player->CastSpell(targets.GetUnitTarget(), 38134, true);
920 return true;
921 }
922 }
923 return true;
924 }
925};
926
#define CREATURE_Z_ATTACK_RANGE
Definition Creature.h:422
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_UNIT
Definition Object.h:54
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:72
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:74
#define CAST_AI(a, b)
@ JUST_DIED
Definition Unit.h:504
@ MOVE_RUN
Definition Unit.h:556
@ MOVE_WALK
Definition Unit.h:555
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
@ SAY_SLAY
@ SAY_INTRO
#define SAY_DEATH
#define SAY_AGGRO
#define MIDDLE_X
#define SPOREBAT_X
float ElementPos[8][4]
void AddSC_boss_lady_vashj()
float SporebatWPPos[8][3]
@ SHIED_GENERATOR_CHANNEL
@ SAY_DEATH
@ SPELL_SHOOT
@ SPELL_SHOCK_BLAST
@ SAY_AGGRO
@ SPELL_POISON_BOLT
@ SAY_PHASE3
@ COILFANG_ELITE
@ SPELL_MAGIC_BARRIER
@ SPELL_TOXIC_SPORES
@ TAINTED_ELEMENTAL
@ COILFANG_STRIDER
@ SAY_BOWSHOT
@ SAY_SLAY
@ SPELL_ENTANGLE
@ SPELL_STATIC_CHARGE_TRIGGER
@ TOXIC_SPOREBAT
@ ENCHANTED_ELEMENTAL
@ SPELL_MULTI_SHOT
@ SAY_PHASE2
@ TOXIC_SPORES_TRIGGER
@ SPELL_SURGE
@ SAY_PHASE1
@ SPELL_FORKED_LIGHTNING
@ SAY_INTRO
#define MIDDLE_Y
float CoilfangElitePos[3][4]
#define MIDDLE_Z
#define SPOREBAT_Z
#define SPOREBAT_Y
#define TEXT_NOT_INITIALIZED
#define SPOREBAT_O
float CoilfangStriderPos[3][4]
float ShieldGeneratorChannelPos[4][4]
float ElementWPPos[8][3]
#define TEXT_ALREADY_DEACTIVATED
@ SPELL_SHOCK_BLAST
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureAI * AI() const
Definition Creature.h:483
CreatureScript(const char *name)
Definition Item.h:202
ItemScript(const char *name)
Definition Map.h:238
MapRefManager PlayerList
Definition Map.h:406
PlayerList const & GetPlayers() const
Definition Map.h:407
iterator end()
iterator begin()
LinkedListHead::Iterator< MapReference const > const_iterator
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:1261
Creature * ToCreature()
Definition Object.h:207
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:16
Definition Unit.h:1367
bool IsAlive() const
Definition Unit.h:2032
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition Unit.cpp:4905
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:36
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:37
virtual uint64 GetData64(uint32) const
Definition ZoneScript.h:32
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnUse(Player *player, Item *, SpellCastTargets const &targets) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_SHIELDGENERATOR1
@ DATA_SHIELDGENERATOR3
@ DATA_SHIELDGENERATOR2
@ DATA_LADYVASHJEVENT
@ DATA_CANSTARTPHASE3
@ DATA_SHIELDGENERATOR4
@ DATA_LADYVASHJ
Creature * me
void DoTeleportTo(float x, float y, float z, uint32 time=0)
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void AttackStart(Unit *) OVERRIDE
void EnterCombat(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MoveInLineOfSight(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MovementInform(uint32 type, uint32 id) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================