TrinityCore
Loading...
Searching...
No Matches
boss_faction_champions.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#include "ScriptMgr.h"
19#include "GridNotifiers.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "Player.h"
25#include "ScriptedCreature.h"
26#include "SpellAuraEffects.h"
27#include "SpellScript.h"
28#include "TemporarySummon.h"
30
31enum AIs
32{
36 AI_PET = 3
37};
38
40{
41 // generic
44
45 // druid healer
52 SPELL_THORNS = 66068,
54
55 // shaman healer
58 SPELL_SPIRIT_CLEANSE = 66056, //friendly only
61 SPELL_HEX = 66054,
65 AURA_SATED = 57724,
66
67 // paladin healer
77
78 // priest healer
79 SPELL_RENEW = 66177,
80 SPELL_SHIELD = 66099,
82 SPELL_DISPEL = 65546,
86
87 // priest dps
93 SPELL_HORROR = 65545,
96
97 // warlock
102 SPELL_FEAR = 65809,
108
109 // mage
113 SPELL_BLINK = 65793,
119
120 // hunter
126 SPELL_SHOOT = 65868,
131
132 // druid dps
140 SPELL_WRATH = 65862,
141
142 // warrior
152
153 // death knight
161 SPELL_DEATH_GRIP_PULL = 64431, // used at spellscript
162
163 // rogue
165 SPELL_BLIND = 65960,
166 SPELL_CLOAK = 65961,
172
173 // shaman dps (some spells taken from shaman healer)
177
178 // paladin dps
186
187 // warlock pet
190
191 // hunter pet
192 SPELL_CLAW = 67793
194
196{
197 // generic
200
201 // druid healer
210
211 // shaman healer
219
220 // paladin healer
229
230 // priest healer
238
239 // priest dps
248
249 // warlock
257
258 // mage
267
268 // hunter
277
278 // druid dps
287
288 // warrior
298
299 // death knight
307
308 // rogue
317
318 // shaman dps
325
326 // paladin dps
335
336 // warlock pet
340
342{
343 { 514.231f, 105.569f, 418.234f, 0 }, // 0 - Horde Initial Pos 0
344 { 508.334f, 115.377f, 418.234f, 0 }, // 1 - Horde Initial Pos 1
345 { 506.454f, 126.291f, 418.234f, 0 }, // 2 - Horde Initial Pos 2
346 { 506.243f, 106.596f, 421.592f, 0 }, // 3 - Horde Initial Pos 3
347 { 499.885f, 117.717f, 421.557f, 0 }, // 4 - Horde Initial Pos 4
348
349 { 613.127f, 100.443f, 419.74f, 0 }, // 5 - Ally Initial Pos 0
350 { 621.126f, 128.042f, 418.231f, 0 }, // 6 - Ally Initial Pos 1
351 { 618.829f, 113.606f, 418.232f, 0 }, // 7 - Ally Initial Pos 2
352 { 625.845f, 112.914f, 421.575f, 0 }, // 8 - Ally Initial Pos 3
353 { 615.566f, 109.653f, 418.234f, 0 }, // 9 - Ally Initial Pos 4
354
355 { 535.469f, 113.012f, 394.66f, 0 }, // 10 - Horde Final Pos 0
356 { 526.417f, 137.465f, 394.749f, 0 }, // 11 - Horde Final Pos 1
357 { 528.108f, 111.057f, 395.289f, 0 }, // 12 - Horde Final Pos 2
358 { 519.92f, 134.285f, 395.289f, 0 }, // 13 - Horde Final Pos 3
359 { 533.648f, 119.148f, 394.646f, 0 }, // 14 - Horde Final Pos 4
360 { 531.399f, 125.63f, 394.708f, 0 }, // 15 - Horde Final Pos 5
361 { 528.958f, 131.47f, 394.73f, 0 }, // 16 - Horde Final Pos 6
362 { 526.309f, 116.667f, 394.833f, 0 }, // 17 - Horde Final Pos 7
363 { 524.238f, 122.411f, 394.819f, 0 }, // 18 - Horde Final Pos 8
364 { 521.901f, 128.488f, 394.832f, 0 } // 19 - Horde Final Pos 9
365};
366
368{
373
375 {
379 _inProgress = false;
380 }
381
382 void Reset() override
383 {
384 Initialize();
385 }
386
387 void JustSummoned(Creature* /*summon*/) override { }
388
389 std::vector<uint32> SelectChampions(Team playerTeam)
390 {
391 std::vector<uint32> vHealersEntries;
392 vHealersEntries.clear();
393 vHealersEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_DRUID_RESTORATION : NPC_ALLIANCE_DRUID_RESTORATION);
394 vHealersEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_PALADIN_HOLY : NPC_ALLIANCE_PALADIN_HOLY);
395 vHealersEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_PRIEST_DISCIPLINE : NPC_ALLIANCE_PRIEST_DISCIPLINE);
396 vHealersEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_SHAMAN_RESTORATION : NPC_ALLIANCE_SHAMAN_RESTORATION);
397
398 std::vector<uint32> vOtherEntries;
399 vOtherEntries.clear();
400 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_DEATH_KNIGHT : NPC_ALLIANCE_DEATH_KNIGHT);
401 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_HUNTER : NPC_ALLIANCE_HUNTER);
402 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_MAGE : NPC_ALLIANCE_MAGE);
403 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_ROGUE : NPC_ALLIANCE_ROGUE);
404 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_WARLOCK : NPC_ALLIANCE_WARLOCK);
405 vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_WARRIOR : NPC_ALLIANCE_WARRIOR);
406
407 uint8 healersSubtracted = 2;
409 healersSubtracted = 1;
410 for (uint8 i = 0; i < healersSubtracted; ++i)
411 {
412 uint8 pos = urand(0, vHealersEntries.size() - 1);
413 switch (vHealersEntries[pos])
414 {
416 vOtherEntries.push_back(NPC_ALLIANCE_DRUID_BALANCE);
417 break;
419 vOtherEntries.push_back(NPC_HORDE_DRUID_BALANCE);
420 break;
422 vOtherEntries.push_back(NPC_ALLIANCE_PALADIN_RETRIBUTION);
423 break;
425 vOtherEntries.push_back(NPC_HORDE_PALADIN_RETRIBUTION);
426 break;
428 vOtherEntries.push_back(NPC_ALLIANCE_PRIEST_SHADOW);
429 break;
431 vOtherEntries.push_back(NPC_HORDE_PRIEST_SHADOW);
432 break;
434 vOtherEntries.push_back(NPC_ALLIANCE_SHAMAN_ENHANCEMENT);
435 break;
437 vOtherEntries.push_back(NPC_HORDE_SHAMAN_ENHANCEMENT);
438 break;
439 default:
440 break;
441 }
442 vHealersEntries.erase(vHealersEntries.begin() + pos);
443 }
444
446 for (uint8 i = 0; i < 4; ++i)
447 vOtherEntries.erase(vOtherEntries.begin() + urand(0, vOtherEntries.size() - 1));
448
449 std::vector<uint32> vChampionEntries;
450 vChampionEntries.clear();
451 for (uint8 i = 0; i < vHealersEntries.size(); ++i)
452 vChampionEntries.push_back(vHealersEntries[i]);
453 for (uint8 i = 0; i < vOtherEntries.size(); ++i)
454 vChampionEntries.push_back(vOtherEntries[i]);
455
456 return vChampionEntries;
457 }
458
459 void SummonChampions(Team playerTeam)
460 {
461 std::vector<Position> vChampionJumpOrigin;
462 if (playerTeam == ALLIANCE)
463 for (uint8 i = 0; i < 5; i++)
464 vChampionJumpOrigin.push_back(FactionChampionLoc[i]);
465 else
466 for (uint8 i = 5; i < 10; i++)
467 vChampionJumpOrigin.push_back(FactionChampionLoc[i]);
468
469 std::vector<Position> vChampionJumpTarget;
470 for (uint8 i = 10; i < 20; i++)
471 vChampionJumpTarget.push_back(FactionChampionLoc[i]);
472 std::vector<uint32> vChampionEntries = SelectChampions(playerTeam);
473
474 for (uint8 i = 0; i < vChampionEntries.size(); ++i)
475 {
476 uint8 pos = urand(0, vChampionJumpTarget.size()-1);
477 if (Creature* champion = me->SummonCreature(vChampionEntries[i], vChampionJumpOrigin[urand(0, vChampionJumpOrigin.size()-1)], TEMPSUMMON_MANUAL_DESPAWN))
478 {
479 summons.Summon(champion);
480 champion->SetReactState(REACT_PASSIVE);
481 champion->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
482 champion->SetImmuneToPC(false);
483 if (playerTeam == ALLIANCE)
484 {
485 champion->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0);
486 champion->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f);
487 champion->SetOrientation(0);
488 }
489 else
490 {
491 champion->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3);
492 champion->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f);
493 champion->SetOrientation(3);
494 }
495 }
496 vChampionJumpTarget.erase(vChampionJumpTarget.begin()+pos);
497 }
498 }
499
500 void SetData(uint32 uiType, uint32 uiData) override
501 {
502 switch (uiType)
503 {
504 case 0:
505 SummonChampions((Team)uiData);
506 break;
507 case 1:
508 for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
509 {
510 if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
511 {
512 summon->SetReactState(REACT_AGGRESSIVE);
513 summon->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
514 summon->SetImmuneToPC(false);
515 }
516 }
517 break;
518 case 2:
519 switch (uiData)
520 {
521 case FAIL:
524 {
528 }
529 break;
530 case IN_PROGRESS:
531 if (!_inProgress)
532 {
536 _inProgress = true;
539 }
540 break;
541 case DONE:
542 {
544 if (_championsKilled == 1)
545 instance->SetData(DATA_FACTION_CRUSADERS, 0); // Used in Resilience will Fix Achievement
546 else if (_championsKilled >= summons.size())
547 {
551 }
552 break;
553 }
554 default:
555 break;
556 }
557 break;
558 default:
559 break;
560 }
561 }
562 private:
567};
568
570{
576
577 void Reset() override
578 {
581 if (IsHeroic() && (_aiType != AI_PET))
583 }
584
585 void JustReachedHome() override
586 {
587 if (Creature* pChampionController = instance->GetCreature(DATA_FACTION_CRUSADERS))
588 pChampionController->AI()->SetData(2, FAIL);
590 }
591
592 float CalculateThreat(float distance, float armor, uint32 health)
593 {
594 float dist_mod = (_aiType == AI_MELEE || _aiType == AI_PET) ? 15.0f / (15.0f + distance) : 1.0f;
595 float armor_mod = (_aiType == AI_MELEE || _aiType == AI_PET) ? armor / 16635.0f : 0.0f;
596 float eh = (health + 1) * (1.0f + armor_mod);
597 return dist_mod * 30000.0f / eh;
598 }
599
601 {
603 if (Player* victim = ref->GetVictim()->ToPlayer())
604 {
605 ref->ScaleThreat(0.0f);
606 ref->AddThreat(1000000.0f * CalculateThreat(me->GetDistance2d(victim), victim->GetArmor(), victim->GetHealth()));
607 }
608 }
609
611 {
612 if (me->GetPowerType() == POWER_MANA)
614 }
615
625
626 void JustDied(Unit* /*killer*/) override
627 {
628 if (_aiType != AI_PET)
629 if (Creature* pChampionController = instance->GetCreature(DATA_FACTION_CRUSADERS))
630 pChampionController->AI()->SetData(2, DONE);
631 }
632
633 void JustEngagedWith(Unit* /*who*/) override
634 {
635 DoCast(me, SPELL_ANTI_AOE, true);
637 me->setActive(true);
639 if (Creature* pChampionController = instance->GetCreature(DATA_FACTION_CRUSADERS))
640 pChampionController->AI()->SetData(2, IN_PROGRESS);
641 }
642
643 void KilledUnit(Unit* who) override
644 {
645 if (who->GetTypeId() == TYPEID_PLAYER)
646 {
647 if (_teamInstance == ALLIANCE)
648 {
650 varian->AI()->DoAction(ACTION_SAY_KILLED_PLAYER);
651 }
652 else if (Creature* garrosh = instance->GetCreature(DATA_GARROSH))
653 garrosh->AI()->DoAction(ACTION_SAY_KILLED_PLAYER);
654 }
655 }
656
658 {
659 std::list<Creature*> lst = DoFindFriendlyMissingBuff(40.0f, spell);
660 std::list<Creature*>::const_iterator itr = lst.begin();
661 if (lst.empty())
662 return nullptr;
663 advance(itr, rand32() % lst.size());
664 return (*itr);
665 }
666
667 Unit* SelectEnemyCaster(bool /*casting*/)
668 {
669 for (auto const& pair : me->GetCombatManager().GetPvECombatRefs())
670 if (Player* player = pair.second->GetOther(me)->ToPlayer())
671 if (player->GetPowerType() == POWER_MANA)
672 return player;
673 return nullptr;
674 }
675
676 uint32 EnemiesInRange(float distance)
677 {
678 uint32 count = 0;
680 if (me->GetDistance2d(ref->GetVictim()) < distance)
681 ++count;
682 return count;
683 }
684
685 void AttackStart(Unit* who) override
686 {
687 if (!who)
688 return;
689
690 if (me->Attack(who, true))
691 {
692 AddThreat(who, 10.0f);
693
694 if (_aiType == AI_MELEE || _aiType == AI_PET)
695 DoStartMovement(who);
696 else
697 DoStartMovement(who, 20.0f);
698 SetCombatMovement(true);
699 }
700 }
701
702 void UpdateAI(uint32 diff) override
703 {
704 _events.Update(diff);
705
706 while (uint32 eventId = _events.ExecuteEvent())
707 {
708 switch (eventId)
709 {
710 case EVENT_THREAT:
711 UpdatePower();
712 UpdateThreat();
714 return;
715 case EVENT_REMOVE_CC:
717 {
718 RemoveCC();
720 }
721 else
723 return;
724 default:
725 return;
726 }
727 }
728
729 if (_aiType == AI_MELEE || _aiType == AI_PET)
731 }
732
733 private:
736 // make sure that every bosses separate events dont mix with these _events
738};
739
740/********************************************************************
741 HEALERS
742********************************************************************/
744{
746
760
761 void UpdateAI(uint32 diff) override
762 {
763 if (!UpdateVictim())
764 return;
765
766 events.Update(diff);
768
770 return;
771
772 while (uint32 eventId = events.ExecuteEvent())
773 {
774 switch (eventId)
775 {
776 case EVENT_LIFEBLOOM:
777 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
778 DoCast(target, SPELL_LIFEBLOOM);
780 return;
781 case EVENT_NOURISH:
782 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
783 DoCast(target, SPELL_NOURISH);
785 return;
786 case EVENT_REGROWTH:
787 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
788 DoCast(target, SPELL_REGROWTH);
790 return;
792 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
793 DoCast(target, SPELL_REJUVENATION);
795 return;
799 return;
801 if (HealthBelowPct(30))
802 {
805 }
806 else
808 return;
809 case EVENT_THORNS:
811 DoCast(target, SPELL_THORNS);
813 return;
817 return;
818 default:
819 return;
820 }
821 }
822 }
823};
824
826{
828
841
842 void UpdateAI(uint32 diff) override
843 {
844 if (!UpdateVictim())
845 return;
846
847 events.Update(diff);
849
851 return;
852
853 while (uint32 eventId = events.ExecuteEvent())
854 {
855 switch (eventId)
856 {
858 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
859 DoCast(target, SPELL_HEALING_WAVE);
861 return;
862 case EVENT_RIPTIDE:
863 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
864 DoCast(target, SPELL_RIPTIDE);
866 return;
868 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
871 return;
873 if (me->GetFaction()) // alliance = 1
874 {
877 }
878 else
879 {
880 if (!me->HasAura(AURA_SATED))
882 }
884 return;
885 case EVENT_HEX:
887 DoCast(target, SPELL_HEX);
888 events.ScheduleEvent(EVENT_HEX, 15s, 30s);
889 return;
892 DoCast(target, SPELL_EARTH_SHIELD);
894 return;
896 if (Unit* target = SelectEnemyCaster(true))
897 DoCast(target, SPELL_EARTH_SHOCK);
899 return;
900 default:
901 return;
902 }
903 }
904 }
905};
906
908{
910
924
925 void UpdateAI(uint32 diff) override
926 {
927 if (!UpdateVictim())
928 return;
929
930 events.Update(diff);
932
934 return;
935
936 while (uint32 eventId = events.ExecuteEvent())
937 {
938 switch (eventId)
939 {
944 return;
947 {
950 }
951 else
953 return;
954 case EVENT_CLEANSE:
955 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
956 DoCast(target, SPELL_CLEANSE);
958 return;
960 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
963 return;
964 case EVENT_HOLY_LIGHT:
965 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
966 DoCast(target, SPELL_HOLY_LIGHT);
968 return;
969 case EVENT_HOLY_SHOCK:
970 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
971 DoCast(target, SPELL_HOLY_SHOCK);
973 return;
975 if (Unit* target = DoSelectLowestHpFriendly(30.0f))
976 {
977 if (!target->HasAura(SPELL_FORBEARANCE))
978 {
981 }
982 else
984 }
985 else
987 return;
989 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 15.0f, true))
992 return;
993 default:
994 return;
995 }
996 }
997 }
998};
999
1001{
1003
1016
1017 void UpdateAI(uint32 diff) override
1018 {
1019 if (!UpdateVictim())
1020 return;
1021
1022 events.Update(diff);
1024
1026 return;
1027
1028 while (uint32 eventId = events.ExecuteEvent())
1029 {
1030 switch (eventId)
1031 {
1032 case EVENT_RENEW:
1033 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
1034 DoCast(target, SPELL_RENEW);
1036 return;
1037 case EVENT_SHIELD:
1038 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
1039 DoCast(target, SPELL_SHIELD);
1041 return;
1042 case EVENT_FLASH_HEAL:
1043 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
1044 DoCast(target, SPELL_FLASH_HEAL);
1046 return;
1047 case EVENT_HEAL_DISPEL:
1048 if (Unit* target = urand(0, 1) ? SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) : DoSelectLowestHpFriendly(40.0f))
1049 DoCast(target, SPELL_DISPEL);
1051 return;
1053 if (EnemiesInRange(10.0f) >= 2)
1056 return;
1057 case EVENT_MANA_BURN:
1058 if (Unit* target = SelectEnemyCaster(false))
1059 DoCast(target, SPELL_MANA_BURN);
1061 return;
1062 case EVENT_PENANCE:
1063 if (Unit* target = DoSelectLowestHpFriendly(40.0f))
1064 DoCast(target, SPELL_PENANCE);
1066 return;
1067 default:
1068 return;
1069 }
1070 }
1071 }
1072};
1073
1074/********************************************************************
1075 RANGED
1076********************************************************************/
1078{
1080
1095
1096 void UpdateAI(uint32 diff) override
1097 {
1098 if (!UpdateVictim())
1099 return;
1100
1101 events.Update(diff);
1103
1105 return;
1106
1107 while (uint32 eventId = events.ExecuteEvent())
1108 {
1109 switch (eventId)
1110 {
1111 case EVENT_SILENCE:
1112 if (Unit* target = SelectEnemyCaster(true))
1113 DoCast(target, SPELL_SILENCE);
1115 return;
1117 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
1120 return;
1121 case EVENT_SW_PAIN:
1122 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
1123 DoCast(target, SPELL_SW_PAIN);
1125 return;
1126 case EVENT_MIND_BLAST:
1129 return;
1130 case EVENT_HORROR:
1133 return;
1134 case EVENT_DISPERSION:
1135 if (HealthBelowPct(40))
1136 {
1139 }
1140 else
1142 return;
1143 case EVENT_DPS_DISPEL:
1144 if (Unit* target = urand(0, 1) ? SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) : DoSelectLowestHpFriendly(40.0f))
1145 DoCast(target, SPELL_DISPEL);
1147 return;
1149 if (EnemiesInRange(10.0f) >= 2)
1152 return;
1153 default:
1154 return;
1155 }
1156 }
1158 }
1159};
1160
1162{
1164
1177
1183
1184 void UpdateAI(uint32 diff) override
1185 {
1186 if (!UpdateVictim())
1187 return;
1188
1189 events.Update(diff);
1191
1193 return;
1194
1195 while (uint32 eventId = events.ExecuteEvent())
1196 {
1197 switch (eventId)
1198 {
1199 case EVENT_HELLFIRE:
1200 if (EnemiesInRange(10.0f) >= 2)
1203 return;
1204 case EVENT_CORRUPTION:
1205 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f))
1206 DoCast(target, SPELL_CORRUPTION);
1208 return;
1210 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f))
1213 return;
1215 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f))
1218 return;
1219 case EVENT_FEAR:
1220 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true))
1221 DoCast(target, SPELL_FEAR);
1223 return;
1224 case EVENT_SEARING_PAIN:
1227 return;
1229 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
1232 return;
1233 default:
1234 return;
1235 }
1236 }
1238 }
1239};
1240
1242{
1244
1258
1259 void UpdateAI(uint32 diff) override
1260 {
1261 if (!UpdateVictim())
1262 return;
1263
1264 events.Update(diff);
1266
1268 return;
1269
1270 while (uint32 eventId = events.ExecuteEvent())
1271 {
1272 switch (eventId)
1273 {
1277 return;
1278 case EVENT_ARCANE_BLAST:
1281 return;
1283 if (EnemiesInRange(10.0f) >= 2)
1286 return;
1287 case EVENT_BLINK:
1288 if (EnemiesInRange(10.0f) >= 2)
1290 events.ScheduleEvent(EVENT_BLINK, 10s, 30s);
1291 return;
1292 case EVENT_COUNTERSPELL:
1293 if (Unit* target = SelectEnemyCaster(true))
1294 DoCast(target, SPELL_COUNTERSPELL);
1296 return;
1297 case EVENT_FROST_NOVA:
1298 if (EnemiesInRange(10.0f) >= 2)
1301 return;
1302 case EVENT_ICE_BLOCK:
1303 if (HealthBelowPct(30))
1304 {
1307 }
1308 else
1310 return;
1311 case EVENT_POLYMORPH:
1313 DoCast(target, SPELL_POLYMORPH);
1315 return;
1316 default:
1317 return;
1318 }
1319 }
1321 }
1322};
1323
1325{
1327
1341
1342 void JustEngagedWith(Unit* who) override
1343 {
1346 }
1347
1348 void UpdateAI(uint32 diff) override
1349 {
1350 if (!UpdateVictim())
1351 return;
1352
1353 events.Update(diff);
1355
1357 return;
1358
1359 while (uint32 eventId = events.ExecuteEvent())
1360 {
1361 switch (eventId)
1362 {
1363 case EVENT_AIMED_SHOT:
1366 return;
1367 case EVENT_DETERRENCE:
1368 if (HealthBelowPct(30))
1369 {
1372 }
1373 else
1375 return;
1376 case EVENT_DISENGAGE:
1377 if (EnemiesInRange(10.0f) >= 2)
1380 return;
1384 return;
1385 case EVENT_FROST_TRAP:
1386 if (EnemiesInRange(10.0f) >= 2)
1389 return;
1390 case EVENT_STEADY_SHOT:
1393 return;
1394 case EVENT_WING_CLIP:
1395 if (Unit* target = me->GetVictim())
1396 {
1397 if (me->GetDistance2d(target) < 6.0f)
1398 DoCast(target, SPELL_WING_CLIP);
1399 }
1401 return;
1402 case EVENT_WYVERN_STING:
1404 DoCast(target, SPELL_WYVERN_STING);
1406 return;
1407 default:
1408 return;
1409 }
1410 }
1412 }
1413};
1414
1416{
1418
1433
1434 void UpdateAI(uint32 diff) override
1435 {
1436 if (!UpdateVictim())
1437 return;
1438
1439 events.Update(diff);
1441
1443 return;
1444
1445 while (uint32 eventId = events.ExecuteEvent())
1446 {
1447 switch (eventId)
1448 {
1449 case EVENT_CYCLONE:
1451 DoCast(target, SPELL_CYCLONE);
1453 return;
1455 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
1458 return;
1459 case EVENT_FAERIE_FIRE:
1462 return;
1466 return;
1467 case EVENT_INSECT_SWARM:
1470 return;
1471 case EVENT_MOONFIRE:
1474 return;
1475 case EVENT_STARFIRE:
1478 return;
1479 case EVENT_DPS_BARKSKIN:
1480 if (HealthBelowPct(30))
1481 {
1484 }
1485 else
1487 return;
1488 default:
1489 return;
1490 }
1491 }
1493 }
1494};
1495
1496/********************************************************************
1497 MELEE
1498********************************************************************/
1500{
1502
1517
1518 void UpdateAI(uint32 diff) override
1519 {
1520 if (!UpdateVictim())
1521 return;
1522
1523 events.Update(diff);
1525
1527 return;
1528
1529 while (uint32 eventId = events.ExecuteEvent())
1530 {
1531 switch (eventId)
1532 {
1533 case EVENT_BLADESTORM:
1536 return;
1540 return;
1544 return;
1545 case EVENT_WARR_CHARGE:
1548 return;
1549 case EVENT_DISARM:
1552 return;
1553 case EVENT_OVERPOWER:
1556 return;
1557 case EVENT_SUNDER_ARMOR:
1560 return;
1562 if (Unit* target = me->GetVictim())
1563 {
1564 if (target->HasAuraWithMechanic(1 << MECHANIC_IMMUNE_SHIELD))
1565 {
1568 return;
1569 }
1570 }
1572 return;
1573 case EVENT_RETALIATION:
1574 if (HealthBelowPct(50))
1575 {
1578 }
1579 else
1581 return;
1582 default:
1583 return;
1584 }
1585 }
1586 }
1587};
1588
1590{
1592
1605
1606 void UpdateAI(uint32 diff) override
1607 {
1608 if (!UpdateVictim())
1609 return;
1610
1611 events.Update(diff);
1613
1615 return;
1616
1617 while (uint32 eventId = events.ExecuteEvent())
1618 {
1619 switch (eventId)
1620 {
1624 return;
1625 case EVENT_DEATH_COIL:
1628 return;
1629 case EVENT_DEATH_GRIP:
1630 if (Unit* target = me->GetVictim())
1631 {
1632 if (me->IsInRange(target, 5.0f, 30.0f, false))
1633 {
1634 DoCast(target, SPELL_DEATH_GRIP);
1636 return;
1637 }
1638 }
1640 return;
1641 case EVENT_FROST_STRIKE:
1644 return;
1646 if (HealthBelowPct(50))
1647 {
1650 }
1651 else
1653 return;
1654 case EVENT_ICY_TOUCH:
1657 return;
1658 case EVENT_STRANGULATE:
1659 if (Unit* target = SelectEnemyCaster(false))
1660 {
1661 DoCast(target, SPELL_STRANGULATE);
1663 }
1664 else
1666 return;
1667 default:
1668 return;
1669 }
1670 }
1671 }
1672};
1673
1675{
1677
1693
1694 void UpdateAI(uint32 diff) override
1695 {
1696 if (!UpdateVictim())
1697 return;
1698
1699 events.Update(diff);
1701
1703 return;
1704
1705 while (uint32 eventId = events.ExecuteEvent())
1706 {
1707 switch (eventId)
1708 {
1710 if (EnemiesInRange(10.0f) >= 2)
1713 return;
1714 case EVENT_BLIND:
1716 DoCast(target, SPELL_BLIND);
1717 events.ScheduleEvent(EVENT_BLIND, 10s, 30s);
1718 return;
1719 case EVENT_CLOAK:
1720 if (HealthBelowPct(50))
1721 {
1724 }
1725 else
1727 return;
1728 case EVENT_BLADE_FLURRY:
1729 if (EnemiesInRange(10.0f) >= 2)
1730 {
1733 }
1734 else
1736 return;
1737 case EVENT_SHADOWSTEP:
1738 if (Unit* target = me->GetVictim())
1739 {
1740 if (me->IsInRange(target, 10.0f, 40.0f, false))
1741 {
1742 DoCast(target, SPELL_SHADOWSTEP);
1744 return;
1745 }
1746 }
1748 return;
1749 case EVENT_HEMORRHAGE:
1752 return;
1753 case EVENT_EVISCERATE:
1756 return;
1757 case EVENT_WOUND_POISON:
1760 return;
1761 default:
1762 return;
1763 }
1764 }
1765 }
1766};
1767
1769{
1771 {
1772 Initialize();
1773 }
1774
1776 {
1777 _totemCount = 0;
1780 }
1781
1796
1797 void JustSummoned(Creature* summoned) override
1798 {
1799 summons.Summon(summoned);
1800 }
1801
1802 void SummonedCreatureDespawn(Creature* /*pSummoned*/) override
1803 {
1804 --_totemCount;
1805 }
1806
1808 {
1809 _totemCount = 4;
1812 /*
1813 -Windfury (16% melee haste)
1814 -Grounding (redirects one harmful magic spell to the totem)
1815
1816 -Healing Stream (unable to find amount of healing in our logs)
1817
1818 -Tremor (prevents fear effects)
1819 -Strength of Earth (155 strength and agil for the opposing team)
1820
1821 -Searing (average ~3500 damage on a random target every ~3.5 seconds)
1822 */
1823 }
1824
1825 void JustDied(Unit* killer) override
1826 {
1829 }
1830
1831 void UpdateAI(uint32 diff) override
1832 {
1833 if (!UpdateVictim())
1834 return;
1835
1836 events.Update(diff);
1838
1840 return;
1841
1842 while (uint32 eventId = events.ExecuteEvent())
1843 {
1844 switch (eventId)
1845 {
1847 if (Unit* target = SelectEnemyCaster(true))
1848 DoCast(target, SPELL_EARTH_SHOCK);
1850 return;
1851 case EVENT_LAVA_LASH:
1854 return;
1855 case EVENT_STORMSTRIKE:
1858 return;
1860 if (me->GetFaction()) //Am i alliance?
1861 {
1862 if (!me->HasAura(AURA_EXHAUSTION))
1864 }
1865 else
1866 {
1867 if (!me->HasAura(AURA_SATED))
1869 }
1871 return;
1872 case EVENT_DEPLOY_TOTEM:
1873 if (_totemCount < 4 || me->GetDistance2d(_totemOldCenterX, _totemOldCenterY) > 20.0f)
1874 DeployTotem();
1876 return;
1877 case EVENT_WINDFURY:
1880 return;
1881 default:
1882 return;
1883 }
1884 }
1885 }
1886 private:
1889};
1890
1892{
1894
1908
1914
1915 void UpdateAI(uint32 diff) override
1916 {
1917 if (!UpdateVictim())
1918 return;
1919
1920 events.Update(diff);
1922
1924 return;
1925
1926 while (uint32 eventId = events.ExecuteEvent())
1927 {
1928 switch (eventId)
1929 {
1933 return;
1937 return;
1938 case EVENT_DIVINE_STORM:
1939 if (EnemiesInRange(10.0f) >= 2)
1942 return;
1946 return;
1950 return;
1951 case EVENT_REPENTANCE:
1953 DoCast(target, SPELL_REPENTANCE);
1955 return;
1957 if (Unit* target = DoSelectLowestHpFriendly(30.0f))
1958 {
1959 if (!target->HasAura(SPELL_FORBEARANCE))
1960 {
1963 }
1964 else
1966 }
1967 else
1969 return;
1972 {
1975 }
1976 else
1978 return;
1979 default:
1980 return;
1981 }
1982 }
1983 }
1984};
1985
1987{
1989
1990 void Reset() override
1991 {
1995 }
1996
1997 void UpdateAI(uint32 diff) override
1998 {
1999 if (!UpdateVictim())
2000 return;
2001
2002 events.Update(diff);
2004
2006 return;
2007
2008 while (uint32 eventId = events.ExecuteEvent())
2009 {
2010 switch (eventId)
2011 {
2012 case EVENT_DEVOUR_MAGIC:
2015 return;
2016 case EVENT_SPELL_LOCK:
2019 return;
2020 default:
2021 return;
2022 }
2023 }
2024 }
2025};
2026
2028{
2030 {
2031 Initialize();
2032 }
2033
2035 {
2037 }
2038
2039 void Reset() override
2040 {
2042 Initialize();
2043 }
2044
2045 void UpdateAI(uint32 diff) override
2046 {
2047 if (!UpdateVictim())
2048 return;
2049
2051
2052 if (_clawTimer <= diff)
2053 {
2056 }
2057 else
2058 _clawTimer -= diff;
2059 }
2060 private:
2062};
2063
2064// 65812, 68154, 68155, 68156 - Unstable Affliction
2085
2086// 66017, 68753, 68754, 68755 - Death Grip
2088{
2090
2091 bool Validate(SpellInfo const* /*spell*/) override
2092 {
2094 }
2095
2096 void HandleDummy(SpellEffIndex /*effIndex*/)
2097 {
2098 if (Unit* target = GetHitUnit())
2099 {
2100 if (Unit* caster = GetCaster())
2101 target->CastSpell(caster, SPELL_DEATH_GRIP_PULL);
2102 }
2103 }
2104
2109};
2110
2111// 65980 - Bloodlust
2113{
2115
2116 bool Validate(SpellInfo const* /*spellInfo*/) override
2117 {
2118 return ValidateSpellInfo({ AURA_SATED });
2119 }
2120
2121 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
2122 {
2123 targets.remove_if(Trinity::UnitAuraCheck(true, AURA_SATED));
2124 }
2125
2127 {
2128 if (Unit* target = GetHitUnit())
2129 target->CastSpell(target, AURA_SATED, true);
2130 }
2131
2138};
2139
2140// 65983 - Heroism
2142{
2144
2145 bool Validate(SpellInfo const* /*spellInfo*/) override
2146 {
2148 }
2149
2150 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
2151 {
2152 targets.remove_if(Trinity::UnitAuraCheck(true, AURA_EXHAUSTION));
2153 }
2154
2156 {
2157 if (Unit* target = GetHitUnit())
2158 target->CastSpell(target, AURA_EXHAUSTION, true);
2159 }
2160
2167};
2168
@ IN_MILLISECONDS
Definition Common.h:35
@ EQUIP_NO_CHANGE
Definition CreatureAI.h:75
@ RAID_DIFFICULTY_25MAN_HEROIC
Definition DBCEnums.h:289
@ RAID_DIFFICULTY_10MAN_NORMAL
Definition DBCEnums.h:286
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition DBCEnums.h:287
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition DBCEnums.h:288
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ IN_PROGRESS
@ FAIL
@ DONE
@ TEMPSUMMON_MANUAL_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
uint32 rand32()
Definition Random.cpp:70
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ALLY
@ MECHANIC_IMMUNE_SHIELD
@ ALLIANCE
@ POWER_ENERGY
@ POWER_MANA
@ SPELL_AURA_MOD_FEAR
@ SPELL_AURA_MOD_PACIFY
@ SPELL_AURA_MOD_ROOT
@ SPELL_AURA_MOD_CONFUSE
@ SPELL_AURA_MOD_STUN
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define SpellHitFn(F)
#define AuraDispelFn(F)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
void AddSC_boss_faction_champions()
Position const FactionChampionLoc[]
@ SPELL_HAMMER_OF_JUSTICE
@ SPELL_ICEBOUND_FORTITUDE
@ SPELL_JUDGEMENT_OF_COMMAND
@ SPELL_VAMPIRIC_TOUCH
@ SPELL_ENTANGLING_ROOTS
@ SPELL_SHATTERING_THROW
@ SPELL_UNSTABLE_AFFLICTION
@ SPELL_SUMMON_FELHUNTER
@ SPELL_FLASH_OF_LIGHT
@ SPELL_ARCANE_EXPLOSION
@ SPELL_CRUSADER_STRIKE
@ SPELL_SPIRIT_CLEANSE
@ SPELL_HAMMER_OF_JUSTICE_RET
@ SPELL_DIVINE_SHIELD
@ SPELL_FORCE_OF_NATURE
@ SPELL_DEATH_GRIP_PULL
@ SPELL_CURSE_OF_EXHAUSTION
@ SPELL_HAND_OF_FREEDOM
@ SPELL_UNSTABLE_AFFLICTION_DISPEL
@ SPELL_INTIMIDATING_SHOUT
@ SPELL_HAND_OF_PROTECTION
@ SPELL_SEAL_OF_COMMAND
@ SPELL_PSYCHIC_SCREAM
@ EVENT_DPS_DIVINE_SHIELD
@ EVENT_CURSE_OF_EXHAUSTION
@ EVENT_HEAL_HAND_OF_PROTECTION
@ EVENT_HEAL_EARTH_SHOCK
@ EVENT_DPS_PSYCHIC_SCREAM
@ EVENT_HAMMER_OF_JUSTICE
@ EVENT_DPS_HAND_OF_PROTECTION
@ EVENT_HAND_OF_FREEDOM
@ EVENT_FORCE_OF_NATURE
@ EVENT_HAMMER_OF_JUSTICE_RET
@ EVENT_ARCANE_EXPLOSION
@ EVENT_INTIMIDATING_SHOUT
@ EVENT_HEAL_BLOODLUST_HEROISM
@ EVENT_CRUSADER_STRIKE
@ EVENT_HEAL_PSYCHIC_SCREAM
@ EVENT_ICEBOUND_FORTITUDE
@ EVENT_SHATTERING_THROW
@ EVENT_JUDGEMENT_OF_COMMAND
@ EVENT_HEAL_DIVINE_SHIELD
@ EVENT_DPS_EARTH_SHOCK
@ EVENT_UNSTABLE_AFFLICTION
@ EVENT_ENTANGLING_ROOTS
@ EVENT_DPS_BLOODLUST_HEROISM
Unit * GetCaster() const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< AuraDispelHandler > AfterDispel
InstanceScript *const instance
SummonList summons
EventMap events
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs() const
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
Creature *const me
Definition CreatureAI.h:82
void SetCombatPulseDelay(uint32 delay)
Definition Creature.h:269
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
WorldObject * GetDispeller() const
Definition Unit.h:404
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:52
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
InstanceMap * instance
CreatureBoundary const * GetBossBoundary(uint32 id) const
uint8 GetSpawnMode() const
Definition Map.h:388
TypeID GetTypeId() const
Definition Object.h:93
static Player * ToPlayer(Object *o)
Definition Object.h:180
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
iterator begin()
void Summon(Creature const *summon)
iterator end()
size_type size() const
void DoZoneInCombat(uint32 entry=0)
StorageType::iterator iterator
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > GetUnsortedThreatList() const
std::vector< ThreatReference * > GetModifiableThreatList()
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
bool DoSpellAttackIfReady(uint32 spell)
Definition UnitAI.cpp:78
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8439
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
ThreatManager & GetThreatManager()
Definition Unit.h:1155
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
Definition Unit.cpp:693
Powers GetPowerType() const
Definition Unit.h:931
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:5535
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
uint32 GetFaction() const override
Definition Unit.h:973
void SetFullPower(Powers power)
Definition Unit.h:941
void SetPowerType(Powers power, bool sendUpdate=true)
Definition Unit.cpp:5408
Unit * GetVictim() const
Definition Unit.h:859
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
CombatManager & GetCombatManager()
Definition Unit.h:1130
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
void setActive(bool isActiveObject)
Definition Object.cpp:991
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1141
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition Object.cpp:1283
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_faction_champion_death_grip)
PrepareAuraScript(spell_faction_champion_warl_unstable_affliction)
PrepareSpellScript(spell_toc_bloodlust)
bool Validate(SpellInfo const *) override
void RemoveInvalidTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_toc_heroism)
bool Validate(SpellInfo const *) override
void RemoveInvalidTargets(std::list< WorldObject * > &targets)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
bool IsHeroic() const
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
void SetCombatMovement(bool allowMovement)
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
bool HealthBelowPct(uint32 pct) const
std::list< Creature * > DoFindFriendlyMissingBuff(float range, uint32 spellId)
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Creature * SelectRandomFriendlyMissingBuff(uint32 spell)
void JustEngagedWith(Unit *) override
void AttackStart(Unit *who) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *who) override
float CalculateThreat(float distance, float armor, uint32 health)
uint32 EnemiesInRange(float distance)
boss_faction_championsAI(Creature *creature, uint32 aitype)
std::vector< uint32 > SelectChampions(Team playerTeam)
void JustSummoned(Creature *) override
boss_toc_champion_controller(Creature *creature)
void SetData(uint32 uiType, uint32 uiData) override
npc_toc_boomkin(Creature *creature)
void UpdateAI(uint32 diff) override
void UpdateAI(uint32 diff) override
void Reset() override
npc_toc_dk(Creature *creature)
void UpdateAI(uint32 diff) override
npc_toc_druid(Creature *creature)
void JustSummoned(Creature *summoned) override
void SummonedCreatureDespawn(Creature *) override
npc_toc_enh_shaman(Creature *creature)
void JustDied(Unit *killer) override
void UpdateAI(uint32 diff) override
npc_toc_hunter(Creature *creature)
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
npc_toc_mage(Creature *creature)
void UpdateAI(uint32 diff) override
void UpdateAI(uint32 diff) override
npc_toc_paladin(Creature *creature)
void UpdateAI(uint32 diff) override
npc_toc_pet_hunter(Creature *creature)
npc_toc_pet_warlock(Creature *creature)
void UpdateAI(uint32 diff) override
npc_toc_priest(Creature *creature)
void UpdateAI(uint32 diff) override
void UpdateAI(uint32 diff) override
npc_toc_retro_paladin(Creature *creature)
void JustEngagedWith(Unit *who) override
npc_toc_rogue(Creature *creature)
void UpdateAI(uint32 diff) override
void UpdateAI(uint32 diff) override
npc_toc_shadow_priest(Creature *creature)
npc_toc_shaman(Creature *creature)
void UpdateAI(uint32 diff) override
npc_toc_warlock(Creature *creature)
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
npc_toc_warrior(Creature *creature)
void UpdateAI(uint32 diff) override
Position const ToCCommonLoc[]
@ NPC_ALLIANCE_SHAMAN_RESTORATION
@ NPC_ALLIANCE_MAGE
@ NPC_ALLIANCE_PALADIN_HOLY
@ NPC_HORDE_SHAMAN_RESTORATION
@ NPC_ALLIANCE_DRUID_RESTORATION
@ NPC_ALLIANCE_DRUID_BALANCE
@ NPC_ALLIANCE_HUNTER
@ NPC_HORDE_ROGUE
@ NPC_HORDE_HUNTER
@ NPC_HORDE_PRIEST_SHADOW
@ NPC_HORDE_WARLOCK
@ NPC_ALLIANCE_ROGUE
@ NPC_HORDE_PALADIN_RETRIBUTION
@ NPC_ALLIANCE_WARRIOR
@ NPC_HORDE_DRUID_RESTORATION
@ NPC_HORDE_DEATH_KNIGHT
@ NPC_ALLIANCE_PALADIN_RETRIBUTION
@ NPC_HORDE_DRUID_BALANCE
@ NPC_HORDE_WARRIOR
@ NPC_HORDE_SHAMAN_ENHANCEMENT
@ NPC_ALLIANCE_PRIEST_DISCIPLINE
@ NPC_HORDE_PRIEST_DISCIPLINE
@ NPC_ALLIANCE_DEATH_KNIGHT
@ NPC_ALLIANCE_SHAMAN_ENHANCEMENT
@ NPC_ALLIANCE_WARLOCK
@ NPC_HORDE_PALADIN_HOLY
@ NPC_ALLIANCE_PRIEST_SHADOW
@ ACTION_SAY_KILLED_PLAYER
@ DATA_FACTION_CHAMPIONS
@ DATA_FACTION_CRUSADERS
#define RegisterTrialOfTheCrusaderCreatureAI(ai_name)