TrinityCore
Loading...
Searching...
No Matches
boss_blood_prince_council.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 "icecrown_citadel.h"
19#include "InstanceScript.h"
20#include "Map.h"
21#include "MotionMaster.h"
22#include "ObjectAccessor.h"
23#include "PassiveAI.h"
24#include "Player.h"
25#include "ScriptedCreature.h"
26#include "ScriptMgr.h"
27#include "SpellAuraEffects.h"
28#include "SpellInfo.h"
29#include "SpellScript.h"
30#include "TemporarySummon.h"
31
64
66{
70
71 // Heroic mode
75
76 // Prince Keleseth
81
82 // Dark Nucleus
85
86 // Prince Taldaram
91
92 // Ball of Flame
96 SPELL_FLAMES = 71393,
98
99 // Ball of Inferno Flame
102
103 // Prince Valanar
110
111 // Kinetic Bomb
116
117 // Shock Vortex
120
121 // Visual Spells
126
149
160
166
176
178{
179 public:
180 StandUpEvent(Creature* owner) : BasicEvent(), _owner(owner) { }
181
182 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
183 {
186 return true;
187 }
188
189 private:
191};
192
194{
195public:
196 VortexEvent(Creature* owner) : _owner(owner) { }
197
198 bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
199 {
201 return true;
202 }
203
204private:
206};
207
208Position const introFinalPos = {4660.490f, 2769.200f, 430.0000f, 0.000000f};
209Position const triggerPos = {4680.231f, 2769.134f, 379.9256f, 3.121708f};
210Position const triggerEndPos = {4680.180f, 2769.150f, 365.5000f, 3.121708f};
211
218
220{
226
228 {
230 _resetCounter = 0;
231 }
232
233 void Reset() override
234 {
235 _Reset();
236 Initialize();
238
240 for (uint32 bossData : PrincesData)
241 if (Creature* prince = ObjectAccessor::GetCreature(*me, instance->GetGuidData(bossData)))
242 {
243 prince->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
244 prince->SetImmuneToPC(false);
245 if (bossData == DATA_PRINCE_VALANAR)
246 {
247 prince->SetHealth(prince->GetMaxHealth());
248 prince->CastSpell(prince, SPELL_REMOVE_EMPOWERED_BLOOD, true);
249 }
250 }
251 }
252
253 void EnterEvadeMode(EvadeReason /*why*/) override
254 {
255 for (uint32 bossData : PrincesData)
256 if (Creature* prince = ObjectAccessor::GetCreature(*me, instance->GetGuidData(bossData)))
258
261 }
262
263 void JustEngagedWith(Unit* who) override
264 {
266 return;
267
269 {
272 return;
273 }
274
275 me->setActive(true);
278
280
281 for (uint32 bossData : PrincesData)
282 if (Creature* prince = ObjectAccessor::GetCreature(*me, instance->GetGuidData(bossData)))
283 {
285 DoZoneInCombat(prince);
286 }
287
289
291 if (roll_chance(50))
292 {
295 }
296 else
297 {
300 }
301 }
302
303 void SetData(uint32 /*type*/, uint32 data) override
304 {
305 _resetCounter += uint8(data);
306 if (_resetCounter == 3)
308 }
309
310 uint32 GetData(uint32 data) const override
311 {
313 return DATA_INTRO_DONE;
314 return 0;
315 }
316
317 void JustDied(Unit* killer) override
318 {
319 events.Reset();
321 // Kill all prices
322 for (uint8 i = 0; i < 3; ++i)
323 {
324 if (++_invocationStage == 3)
326
328 {
329 // Make sure looting is allowed
330 prince->LowerPlayerDamageReq(prince->GetMaxHealth());
331 Unit::Kill(killer, prince);
332 }
333 }
334 }
335
336 void DoAction(int32 actionId) override
337 {
339 {
342 bloodQueen->AI()->DoAction(ACTION_START_INTRO);
343 }
344 else if (actionId == ACTION_INTRO_DONE)
345 {
346 // Remove feigh death from princes
347 for (uint32 bossData : PrincesData)
348 if (Creature* prince = ObjectAccessor::GetCreature(*me, instance->GetGuidData(bossData)))
349 {
350 prince->AI()->DoAction(ACTION_STAND_UP);
351 if (bossData == DATA_PRINCE_VALANAR)
352 prince->SetHealth(prince->GetMaxHealth());
353 }
354 }
355 }
356
357 void UpdateAI(uint32 diff) override
358 {
359 if (!UpdateVictim())
360 return;
361
362 events.Update(diff);
363
365 return;
366
367 while (uint32 eventId = events.ExecuteEvent())
368 {
369 switch (eventId)
370 {
372 {
374 if (++_invocationStage == 3)
376
378 if (oldPrince)
379 {
380 oldPrince->AI()->DoAction(ACTION_REMOVE_INVOCATION);
381 if (newPrince)
382 oldPrince->CastSpell(newPrince, _invocationOrder[_invocationStage].visualSpell, true);
383 }
384
385 if (newPrince)
386 {
387 newPrince->SetHealth(me->GetHealth());
388 newPrince->AI()->Talk(uint8(_invocationOrder[_invocationStage].textId));
389 }
390
392 events.Repeat(Seconds(46) + Milliseconds(500));
393 break;
394 }
395 default:
396 break;
397 }
398
400 return;
401 }
402 }
403
404private:
406 {
411
412 InvocationData(ObjectGuid _guid, uint32 _spellId, uint32 _textId, uint32 _visualSpell)
413 {
414 guid = _guid;
415 spellId = _spellId;
416 textId = _textId;
417 visualSpell = _visualSpell;
418 }
419
422
425};
426
428{
429 BloodPrincesBossAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId), _spawnHealth (creature->GetMaxHealth()), _isEmpowered(false)
430 {
432 }
433
434 void InitializeAI() override
435 {
436 _spawnHealth = 1;
437 if (!me->isDead())
438 JustAppeared();
439 }
440
441 void Reset() override
442 {
443 events.Reset();
445
446 me->SetImmuneToPC(false);
447 _isEmpowered = false;
450 }
451
452 void JustEngagedWith(Unit* /*who*/) override
453 {
454 me->setActive(true);
456 DoZoneInCombat(controller);
458 }
459
460 virtual void ScheduleEvents() = 0;
461
462 void JustDied(Unit* /*killer*/) override
463 {
464 events.Reset();
467
468 switch (me->GetEntry())
469 {
472 break;
475 break;
478 break;
479 default:
480 break;
481 }
482 }
483
484 void JustAppeared() override
485 {
487 if (controller->AI()->GetData(DATA_INTRO) != DATA_INTRO_DONE)
489
491 }
492
493 void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
494 {
495 if (!_isEmpowered)
496 {
497 AddThreat(attacker, float(damage));
498 damage = 0;
499 }
500 }
501
502 void KilledUnit(Unit* victim) override
503 {
504 if (victim->GetTypeId() == TYPEID_PLAYER)
505 switch (me->GetEntry())
506 {
509 break;
512 break;
515 break;
516 default:
517 break;
518 }
519 }
520
532
533 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
534 {
535 if (spellInfo->Id == SelectInvocationSpell())
537 }
538
539 void DamageDealt(Unit* /*target*/, uint32& damage, DamageEffectType damageType) override
540 {
541 if (damageType != SPELL_DIRECT_DAMAGE)
542 return;
543
544 if (damage > RAID_MODE<uint32>(23000, 25000, 23000, 25000))
546 }
547
548 void DoAction(int32 action) override
549 {
550 switch (action)
551 {
552 case ACTION_STAND_UP:
554 me->SetUninteractible(false);
555 me->SetImmuneToPC(false);
558 break;
562 _isEmpowered = true;
563 break;
568 _isEmpowered = false;
569 break;
570 default:
571 break;
572 }
573 }
574
576 {
577 switch (me->GetEntry())
578 {
585 default: // Should never happen
586 return 0;
587 }
588 }
589
591 {
592 switch (me->GetEntry())
593 {
600 default: // Should never happen
601 return 0;
602 }
603 }
604
605protected:
608};
609
611{
616
629
630 void JustSummoned(Creature* summon) override
631 {
632 summons.Summon(summon);
633 Position pos = me->GetPosition();
634 float maxRange = me->GetDistance2d(summon);
635 float angle = me->GetAbsoluteAngle(summon);
636 me->MovePositionToFirstCollision(pos, maxRange, angle);
637 summon->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
639 }
640
641 void UpdateAI(uint32 diff) override
642 {
643 if (!UpdateVictim())
644 return;
645
646 events.Update(diff);
647
649 return;
650
651 while (uint32 eventId = events.ExecuteEvent())
652 {
653 switch (eventId)
654 {
655 case EVENT_BERSERK:
658 break;
662 events.Repeat(Seconds(10), Seconds(15));
663 break;
667 break;
668 default:
669 break;
670 }
671
673 return;
674 }
675 }
676};
677
679{
681
690
691 void JustSummoned(Creature* summon) override
692 {
693 summons.Summon(summon);
694 Unit* target = SelectTarget(SelectTargetMethod::Random, 1, -10.0f, true); // first try at distance
695 if (!target)
696 target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true); // too bad for you raiders, its going to boom
697
698 if (summon->GetEntry() == NPC_BALL_OF_INFERNO_FLAME && target)
699 Talk(EMOTE_TALDARAM_FLAME, target);
700
701 if (target)
702 summon->AI()->SetGUID(target->GetGUID(), DATA_CHASE_TARGET_GUID);
703 }
704
705 void UpdateAI(uint32 diff) override
706 {
707 if (!UpdateVictim())
708 return;
709
710 events.Update(diff);
711
713 return;
714
715 while (uint32 eventId = events.ExecuteEvent())
716 {
717 switch (eventId)
718 {
719 case EVENT_BERSERK:
722 break;
725 events.Repeat(Seconds(15), Seconds(50));
726 break;
728 if (_isEmpowered)
729 {
731 events.Repeat(Seconds(15), Seconds(25));
732 }
733 else
734 {
736 events.Repeat(Seconds(20), Seconds(30));
737 }
739 break;
740 default:
741 break;
742 }
743
745 return;
746 }
747 }
748};
749
751{
753
754 void ScheduleEvents() override
755 {
759 if (IsHeroic())
761 }
762
763 void JustSummoned(Creature* summon) override
764 {
765 switch (summon->GetEntry())
766 {
770 .SetOriginalCaster(me->GetGUID()));
771 break;
772 case NPC_KINETIC_BOMB:
773 {
774 float x, y, z;
775 summon->GetPosition(x, y, z);
776 float ground_Z = summon->GetMap()->GetHeight(summon->GetPhaseShift(), x, y, z, true, 500.0f);
777 summon->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, x, y, ground_Z);
778 summon->SetUninteractible(false);
779 break;
780 }
781 case NPC_SHOCK_VORTEX:
782 summon->CastSpell(summon, SPELL_SHOCK_VORTEX_DUMMY, true);
783 summon->m_Events.AddEvent(new VortexEvent(summon), summon->m_Events.CalculateTime(5s));
784 break;
785 default:
786 break;
787 }
788
789 summons.Summon(summon);
790 if (me->IsInCombat())
791 DoZoneInCombat(summon);
792 }
793
794 void UpdateAI(uint32 diff) override
795 {
796 if (!UpdateVictim())
797 return;
798
799 events.Update(diff);
800
802 return;
803
804 while (uint32 eventId = events.ExecuteEvent())
805 {
806 switch (eventId)
807 {
808 case EVENT_BERSERK:
811 break;
813 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
814 {
817 }
818 events.Repeat(Seconds(18), Seconds(24));
819 break;
821 if (_isEmpowered)
822 {
825 events.Repeat(Seconds(30));
826 }
827 else
828 {
829 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
830 DoCast(target, SPELL_SHOCK_VORTEX);
831 events.Repeat(Seconds(18), Seconds(23));
832 }
833 break;
834 default:
835 break;
836 }
837
839 return;
840 }
841 }
842};
843
845{
846 npc_blood_queen_lana_thel(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()) { }
847
848 void Reset() override
849 {
850 _events.Reset();
851 me->SetDisableGravity(true);
853 }
854
855 void DoAction(int32 action) override
856 {
857 switch (action)
858 {
861 _events.SetPhase(1);
863 // summon a visual trigger
865 {
866 summon->CastSpell(summon, SPELL_OOC_INVOCATION_VISUAL, true);
867 summon->SetSpeedRate(MOVE_RUN, 0.14f);
868 summon->GetMotionMaster()->MovePoint(0, triggerEndPos);
869 }
870 break;
871 default:
872 break;
873 }
874 }
875
876 void MovementInform(uint32 type, uint32 id) override
877 {
878 if (type == POINT_MOTION_TYPE && id == POINT_INTRO_DESPAWN)
879 me->SetVisible(false);
880 }
881
882 void UpdateAI(uint32 diff) override
883 {
884 if (!_events.GetPhaseMask())
885 return;
886
887 _events.Update(diff);
888
890 {
893 _events.Reset();
894
896 controller->AI()->DoAction(ACTION_INTRO_DONE);
897 }
898 }
899
900private:
903};
904
906{
907 npc_ball_of_flame(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
908
919
920 void MovementInform(uint32 type, uint32 id) override
921 {
922 if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && !_chaseGUID.IsEmpty())
923 {
926 _scheduler.Schedule(Seconds(2), [this](TaskContext const& /*context*/)
927 {
929 });
931 }
932 }
933
934 void SetGUID(ObjectGuid const& guid, int32 id) override
935 {
936 if (id != DATA_CHASE_TARGET_GUID)
937 return;
938
939 _chaseGUID = guid;
940 }
941
942 void DoAction(int32 action) override
943 {
944 if (action == ACTION_FLAME_BALL_CHASE)
946 {
947 // need to clear states now because this call is before AuraEffect is fully removed
949 if (me->Attack(target, true))
950 me->GetMotionMaster()->MoveChase(target, 1.0f);
951 }
952 }
953
954 void DamageDealt(Unit* /*target*/, uint32& damage, DamageEffectType damageType) override
955 {
956 if (damageType != SPELL_DIRECT_DAMAGE)
957 return;
958
959 if (damage > RAID_MODE<uint32>(23000, 25000, 23000, 25000))
961 }
962
963 void UpdateAI(uint32 diff) override
964 {
965 _scheduler.Update(diff);
966 }
967
968private:
972};
973
975{
976 npc_kinetic_bomb(Creature* creature) : ScriptedAI(creature), _x(0.f), _y(0.f), _groundZ(0.f) { }
977
978 void Reset() override
979 {
980 _events.Reset();
981 me->SetWalk(true);
986 me->DespawnOrUnsummon(60s);
987 _groundZ = me->GetMap()->GetHeight(me->GetPhaseShift(), _x, _y, _groundZ, true, 500.0f);
988 }
989
990 void DoAction(int32 action) override
991 {
992 if (action == SPELL_KINETIC_BOMB_EXPLOSION)
994
995 else if (action == ACTION_KINETIC_BOMB_JUMP)
996 {
998 {
1001 }
1003 }
1004 }
1005
1006 void UpdateAI(uint32 diff) override
1007 {
1008 _events.Update(diff);
1009
1010 while (uint32 eventId = _events.ExecuteEvent())
1011 {
1012 switch (eventId)
1013 {
1014 case EVENT_BOMB_DESPAWN:
1015 me->SetVisible(false);
1016 me->DespawnOrUnsummon(5s);
1017 break;
1019 me->GetMotionMaster()->Clear();
1021 break;
1022 default:
1023 break;
1024 }
1025 }
1026 }
1027
1028private:
1030 float _x;
1031 float _y;
1033};
1034
1036{
1037 npc_dark_nucleus(Creature* creature) : ScriptedAI(creature) { }
1038
1039 void Reset() override
1040 {
1043 }
1044
1045 void JustEngagedWith(Unit* who) override
1046 {
1047 _scheduler.Schedule(Seconds(1), [this](TaskContext& targetAuraCheck)
1048 {
1049 if (Unit* victim = me->GetVictim())
1050 {
1051 if (me->GetDistance(victim) < 15.0f && !victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()))
1052 DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
1053 else
1054 MoveInLineOfSight(me->GetVictim());
1055 }
1056 targetAuraCheck.Repeat();
1057 });
1058
1059 if (me->GetDistance(who) >= 15.0f)
1060 {
1061 DoStartMovement(who);
1062 return;
1063 }
1064
1066 }
1067
1068 void DamageTaken(Unit* attacker, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
1069 {
1070 if (attacker == me)
1071 return;
1072
1074 AddThreat(attacker, 500000000.0f);
1075 }
1076
1077 void UpdateAI(uint32 diff) override
1078 {
1079 if (!UpdateVictim())
1080 return;
1081
1082 _scheduler.Update(diff);
1083 }
1084
1085private:
1087};
1088
1089// 71806 - Glittering Sparks
1103
1104/* 71718 - Conjure Flame
1105 72040 - Conjure Empowered Flame */
1119
1120/* 55891 - Flame Sphere Spawn Effect
1121 55947 - Flame Sphere Death Effect */
1123{
1124 bool Load() override
1125 {
1127 return true;
1128 return false;
1129 }
1130
1131 bool Validate(SpellInfo const* /*spell*/) override
1132 {
1134 }
1135
1136 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1137 {
1138 Creature* target = GetTarget()->ToCreature();
1139 if (!target)
1140 return;
1141
1142 // SPELL_FLAME_SPHERE_SPAWN_EFFECT
1144 {
1145 target->CastSpell(target, SPELL_BALL_OF_FLAMES, true);
1147 }
1148 else // SPELL_FLAME_SPHERE_DEATH_EFFECT
1149 target->DespawnOrUnsummon();
1150 }
1151
1156};
1157
1158/* 71756 - Ball of Flames Proc
1159 72782 - Ball of Flames Proc
1160 72783 - Ball of Flames Proc
1161 72784 - Ball of Flames Proc */
1163{
1165 {
1166 if (Aura* aur = GetHitAura())
1167 aur->SetStackAmount(uint8(GetSpellInfo()->StackAmount));
1168 }
1169
1174};
1175
1177{
1178 void HandleStackDrop(ProcEventInfo& /*eventInfo*/)
1179 {
1180 ModStackAmount(-1);
1181 }
1182
1187};
1188
1189// 72080 - Kinetic Bomb
1191{
1193 {
1194 Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
1195 dest.RelocateOffset(offset);
1196 }
1197
1202};
1203
1205{
1206 bool Validate(SpellInfo const* /*spell*/) override
1207 {
1209 }
1210
1211 void HandleDummyTick(AuraEffect const* /*aurEff*/)
1212 {
1213 Unit* target = GetTarget();
1214 if (target->GetTypeId() != TYPEID_UNIT)
1215 return;
1216
1217 if (Creature* bomb = target->FindNearestCreature(NPC_KINETIC_BOMB, 1.0f, true))
1218 {
1219 bomb->CastSpell(bomb, SPELL_KINETIC_BOMB_EXPLOSION, true);
1220 bomb->RemoveAurasDueToSpell(SPELL_KINETIC_BOMB_VISUAL);
1221 target->RemoveAura(GetAura());
1222 bomb->AI()->DoAction(SPELL_KINETIC_BOMB_EXPLOSION);
1223 }
1224 }
1225
1230};
1231
1232// 72087 - Kinetic Bomb Knockback
1234{
1236 {
1237 if (missInfo != SPELL_MISS_NONE)
1238 return;
1239
1240 if (Creature* target = GetHitCreature())
1241 target->AI()->DoAction(ACTION_KINETIC_BOMB_JUMP);
1242 }
1243
1248};
1249
1250// 72054 - Kinetic Bomb Visual
1252{
1253 void OnAbsorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
1254 {
1255 absorbAmount = CalculatePct(dmgInfo.GetDamage(), aurEff->GetAmount());
1256 RoundToInterval<uint32>(absorbAmount, 0, dmgInfo.GetDamage());
1257 dmgInfo.AbsorbDamage(absorbAmount);
1258 }
1259
1264};
1265
1266// 73001 - Shadow Prison
1268{
1269 bool Validate(SpellInfo const* /*spell*/) override
1270 {
1272 }
1273
1274 void HandleDummyTick(AuraEffect const* aurEff)
1275 {
1276 if (GetTarget()->isMoving())
1278 }
1279
1284};
1285
1286// 72999 - Shadow Prison
1288{
1289 void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
1290 {
1291 if (Aura const* aur = victim->GetAura(GetSpellInfo()->Id))
1292 if (AuraEffect const* eff = aur->GetEffect(EFFECT_1))
1293 flatMod += eff->GetAmountAsInt();
1294 }
1295
1300};
1301
1303{
1304 public:
1305 at_blood_prince_council_start_intro() : AreaTriggerScript("at_blood_prince_council_start_intro") { }
1306
1307 bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
1308 {
1309 if (InstanceScript* instance = player->GetInstanceScript())
1310 if (Creature* controller = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_BLOOD_PRINCES_CONTROL)))
1311 controller->AI()->DoAction(ACTION_START_INTRO);
1312
1313 return true;
1314 }
1315};
1316
T GetEntry(std::unordered_map< uint32, T > const &map, CriteriaTreeEntry const *tree)
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
@ IN_PROGRESS
@ DONE
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ CHASE_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_CORPSE_DESPAWN
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
@ SPELL_BERSERK
Definition PlayerAI.cpp:371
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1381
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
SpellMissInfo
@ SPELL_MISS_NONE
@ TARGET_DEST_CASTER
@ EMOTE_ONESHOT_ROAR
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_STUN
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#define AuraProcFn(F)
#define BeforeSpellHitFn(F)
#define SpellEffectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellCalcDamageFn(F)
#define SpellDestinationTargetSelectFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
EvadeReason
@ MOVE_RUN
@ REACT_DEFENSIVE
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ SPELL_DIRECT_DAMAGE
@ UNIT_FLAG3_FAKE_DEAD
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ UNIT_STATE_STUNNED
Definition Unit.h:264
T CalculatePct(T base, U pct)
Definition Util.h:72
@ DATA_PRINCE_TALDARAM
Definition ahnkahet.h:32
@ NPC_PRINCE_TALDARAM
Definition ahnkahet.h:46
Position const triggerPos
@ SPELL_SHADOW_RESONANCE_RESIST
@ SPELL_INVOCATION_OF_BLOOD_VALANAR
@ SPELL_INVOCATION_OF_BLOOD_TALDARAM
@ SPELL_BALL_OF_FLAMES_PERIODIC
@ SPELL_FLAME_SPHERE_DEATH_EFFECT
@ SPELL_BALL_OF_FLAMES_VISUAL
@ SPELL_KINETIC_BOMB_KNOCKBACK
@ SPELL_FLAME_SPHERE_SPAWN_EFFECT
@ SPELL_EMPOWERED_SHADOW_LANCE
@ SPELL_INVOCATION_VISUAL_TALDARAM
@ SPELL_SHADOW_PRISON_DUMMY
@ SPELL_OOC_INVOCATION_VISUAL
@ SPELL_KINETIC_BOMB_EXPLOSION
@ SPELL_INVOCATION_VISUAL_VALANAR
@ SPELL_INVOCATION_OF_BLOOD_KELESETH
@ SPELL_SHADOW_PRISON_DAMAGE
@ SPELL_SHOCK_VORTEX_PERIODIC
@ SPELL_REMOVE_EMPOWERED_BLOOD
@ SPELL_SHADOW_RESONANCE_AURA
@ SPELL_CONJURE_EMPOWERED_FLAME
@ SPELL_INVOCATION_VISUAL_ACTIVE
@ SPELL_EMPOWERED_SHOCK_VORTEX
@ SPELL_INVOCATION_VISUAL_KELESETH
void AddSC_boss_blood_prince_council()
Position const triggerEndPos
@ EMOTE_TALDARAM_INVOCATION
@ EMOTE_KELESETH_INVOCATION
@ EMOTE_VALANAR_SHOCK_VORTEX
Position const introFinalPos
uint32 const PrincesData[]
SpellEffectValue GetAmount() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
Unit * GetCaster() const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
Unit * GetTarget() const
HookList< AuraProcHandler > OnProc
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
void DoZoneInCombat()
Definition CreatureAI.h:169
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
bool UpdateVictim()
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
Creature *const me
Definition CreatureAI.h:63
Creature * DoSummon(uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
void SetImmuneToPC(bool apply) override
Definition Creature.h:184
void SetReactState(ReactStates st)
Definition Creature.h:174
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
CreatureAI * AI() const
Definition Creature.h:228
void AbsorbDamage(uint32 amount)
Definition Unit.cpp:212
uint32 GetDamage() const
Definition Unit.h:452
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
uint8 GetPhaseMask() const
Definition EventMap.h:80
void SetPhase(uint8 phase)
Definition EventMap.cpp:32
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:56
void Reset()
Definition EventMap.cpp:25
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
Milliseconds CalculateTime(Milliseconds t_offset) const
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
virtual ObjectGuid GetGuidData(uint32 type) const override
CreatureBoundary const * GetBossBoundary(uint32 id) const
EncounterState GetBossState(uint32 id) const
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
float GetHeight(PhaseShift const &phaseShift, float x, float y, float z, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH)
Definition Map.h:326
void MoveChase(Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
LowType GetCounter() const
Definition ObjectGuid.h:336
bool IsEmpty() const
Definition ObjectGuid.h:362
void Clear()
Definition ObjectGuid.h:329
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< DamageAndHealingCalcHandler > CalcDamage
Creature * GetHitCreature() const
Aura * GetHitAura(bool dynObjAura=false, bool withRemoved=false) const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
int32 GetEffectValueAsInt() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
HookList< EffectHandler > OnEffectHitTarget
HookList< BeforeHitHandler > BeforeHit
SpellInfo const * GetSpellInfo() const
bool Execute(uint64, uint32) override
StandUpEvent(Creature *owner)
void Summon(Creature const *summon)
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
void SetTempSummonType(TempSummonType type)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
virtual void SetGUID(ObjectGuid const &guid, int32 id)
Definition UnitAI.h:76
virtual void DoAction(int32 param)
Definition UnitAI.h:73
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void ClearUnitState(uint32 f)
Definition Unit.h:744
void SetVisible(bool x)
Definition Unit.cpp:8768
void SetHealth(uint64 val)
Definition Unit.cpp:9973
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:8932
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
ThreatManager & GetThreatManager()
Definition Unit.h:1078
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
TempSummon * ToTempSummon()
Definition Unit.h:1828
void RemoveUnitFlag3(UnitFlags3 flags)
Definition Unit.h:857
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13361
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:5853
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
uint64 GetHealth() const
Definition Unit.h:788
bool SetWalk(bool enable)
Definition Unit.cpp:13343
Unit * GetVictim() const
Definition Unit.h:726
void NearTeleportTo(TeleportLocation const &target, bool casting=false)
Definition Unit.cpp:12958
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition Unit.cpp:1657
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:846
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition Unit.cpp:11225
bool IsInCombat() const
Definition Unit.h:1058
bool isDead() const
Definition Unit.h:1187
VortexEvent(Creature *owner)
bool Execute(uint64, uint32) override
Map * GetMap() const
Definition Object.h:411
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
PhaseShift & GetPhaseShift()
Definition Object.h:310
void setActive(bool isActiveObject)
Definition Object.cpp:276
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:450
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1517
EventProcessor m_Events
Definition Object.h:561
void MovePositionToFirstCollision(Position &pos, float dist, float angle) const
Definition Object.cpp:2828
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:432
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:99
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
void CalculateDamage(SpellEffectInfo const &, Unit const *victim, int32 &, int32 &flatMod, float &) const
bool Validate(SpellInfo const *) override
void HandleDummyTick(AuraEffect const *aurEff)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnAbsorb(AuraEffect *aurEff, DamageInfo &dmgInfo, uint32 &absorbAmount)
bool Validate(SpellInfo const *) override
void SetDest(SpellDestination &dest)
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
@ DATA_ORB_WHISPERER_ACHIEVEMENT
@ DATA_BLOOD_PRINCE_COUNCIL_INTRO
@ DATA_BLOOD_PRINCE_COUNCIL
@ DATA_PRINCE_VALANAR
@ DATA_BLOOD_QUEEN_LANA_THEL_COUNCIL
also used by conditions
@ DATA_BLOOD_PRINCES_CONTROL
@ DATA_PRINCE_KELESETH
@ NPC_KINETIC_BOMB
@ NPC_PRINCE_VALANAR
@ NPC_SHOCK_VORTEX
@ NPC_BALL_OF_FLAME
@ NPC_FLOATING_TRIGGER
@ NPC_BALL_OF_INFERNO_FLAME
@ NPC_KINETIC_BOMB_TARGET
@ NPC_PRINCE_KELESETH
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void DamageTaken(Unit *attacker, uint32 &damage, DamageEffectType, SpellInfo const *) override
void KilledUnit(Unit *victim) override
void DoAction(int32 action) override
void JustDied(Unit *) override
virtual void ScheduleEvents()=0
BloodPrincesBossAI(Creature *creature, uint32 bossId)
void JustEngagedWith(Unit *) override
void DamageDealt(Unit *, uint32 &damage, DamageEffectType damageType) override
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
float GetAbsoluteAngle(float x, float y) const
Definition Position.h:136
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
constexpr float GetOrientation() const
Definition Position.h:90
constexpr float GetPositionZ() const
Definition Position.h:89
bool IsHeroic() const
void SetCombatMovement(bool allowMovement)
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
void RelocateOffset(Position const &offset)
Definition Spell.cpp:90
InvocationData(ObjectGuid _guid, uint32 _spellId, uint32 _textId, uint32 _visualSpell)
uint32 GetData(uint32 data) const override
void SetData(uint32, uint32 data) override
struct boss_blood_council_controller::InvocationData _invocationOrder[3]
void DoAction(int32 actionId) override
void EnterEvadeMode(EvadeReason) override
void UpdateAI(uint32 diff) override
void JustSummoned(Creature *summon) override
void UpdateAI(uint32 diff) override
void JustSummoned(Creature *summon) override
void UpdateAI(uint32 diff) override
boss_prince_valanar_icc(Creature *creature)
void JustSummoned(Creature *summon) override
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void SetGUID(ObjectGuid const &guid, int32 id) override
void DamageDealt(Unit *, uint32 &damage, DamageEffectType damageType) override
npc_ball_of_flame(Creature *creature)
void MovementInform(uint32 type, uint32 id) override
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void MovementInform(uint32 type, uint32 id) override
void JustEngagedWith(Unit *who) override
npc_dark_nucleus(Creature *creature)
void UpdateAI(uint32 diff) override
void DamageTaken(Unit *attacker, uint32 &, DamageEffectType, SpellInfo const *) override
void DoAction(int32 action) override
npc_kinetic_bomb(Creature *creature)
void UpdateAI(uint32 diff) override