TrinityCore
Loading...
Searching...
No Matches
spell_dk.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/*
19 * Scripts for spells with SPELLFAMILY_DEATHKNIGHT and SPELLFAMILY_GENERIC spells used by deathknight players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_dk_".
22 */
23
24#include "ScriptMgr.h"
25#include "AreaTrigger.h"
26#include "AreaTriggerAI.h"
27#include "Containers.h"
28#include "ObjectMgr.h"
29#include "Player.h"
30#include "Spell.h"
31#include "SpellAuraEffects.h"
32#include "SpellHistory.h"
33#include "SpellMgr.h"
34#include "SpellScript.h"
35#include <numeric>
36
38{
71 SPELL_DK_DEATH_STRIKE_ENABLER = 89832, // Server Side
114
116{
119
120// 70656 - Advantage (T10 4P Melee Bonus)
122{
123 bool CheckProc(ProcEventInfo& eventInfo)
124 {
125 if (Unit* caster = eventInfo.GetActor())
126 {
127 Player* player = caster->ToPlayer();
128 if (!player || caster->GetClass() != CLASS_DEATH_KNIGHT)
129 return false;
130
131 for (uint8 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
132 if (player->GetRuneCooldown(i) == 0)
133 return false;
134
135 return true;
136 }
137
138 return false;
139 }
140
145};
146
147// 48707 - Anti-Magic Shell
149{
150public:
152 {
153 absorbPct = 0;
154 maxHealth = 0;
155 absorbedAmount = 0;
156 }
157
158 bool Validate(SpellInfo const* spellInfo) override
159 {
162 }
163
164 bool Load() override
165 {
168 absorbedAmount = 0;
169 return true;
170 }
171
172 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
173 {
175
176 if (AuraEffect* const antiMagicBarrier = GetCaster()->GetAuraEffect(SPELL_DK_ANTI_MAGIC_BARRIER, EFFECT_2))
177 AddPct(amount, antiMagicBarrier->GetAmount());
178
179 if (Player const* player = GetUnitOwner()->ToPlayer())
180 AddPct(amount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + player->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY));
181 }
182
183 void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
184 {
185 absorbedAmount += absorbAmount;
186
187 CastSpellExtraArgs args(aurEff);
188 args.AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(absorbAmount, UI64LIT(2) * absorbAmount * 100 / maxHealth));
190 }
191
197
198private:
202};
203
204// 195182 - Marrowrend
205// 195292 - Death's Caress
207{
208public:
209 explicit spell_dk_apply_bone_shield(SpellEffIndex effIndex) : _effIndex(effIndex) { }
210
211 bool Validate(SpellInfo const* spellInfo) override
212 {
214 && ValidateSpellEffect({ { spellInfo->Id, _effIndex } })
215 && spellInfo->GetEffect(_effIndex).CalcBaseValue(nullptr, nullptr, 0, 0) <= SpellEffectValue(sSpellMgr->AssertSpellInfo(SPELL_DK_BONE_SHIELD, DIFFICULTY_NONE)->StackAmount);
216 }
217
226
231
232private:
234};
235
245
246// 127517 - Army Transform
249{
250 bool Validate(SpellInfo const* /*spellInfo*/) override
251 {
253 }
254
255 bool Load() override
256 {
257 return GetCaster()->IsGuardian();
258 }
259
261 {
262 if (Unit* owner = GetCaster()->GetOwner())
263 if (owner->HasAura(SPELL_DK_GLYPH_OF_FOUL_MENAGERIE))
264 return SPELL_CAST_OK;
265
267 }
268
273
279};
280
281// 1217740 - Birth (used by ghoul on spawn)
283{
288
289 void HandleDummy(SpellEffIndex /*effIndex*/) const
290 {
291 Unit* caster = GetCaster();
292 Unit* owner = GetCaster()->GetOwner();
293
296 args.TriggeringSpell = GetSpell();
297
298 caster->CastSpell(caster, SPELL_DK_GHOUL_BIRTH, args);
299
301 caster->CastSpell(caster, SPELL_DK_BLOOD_BOND_PERIODIC, args);
302 }
303
308};
309
310// 207167 - Blinding Sleet
329
330// 206931 - Blooddrinker
332{
333 bool Validate(SpellInfo const* /*spellInfo*/) override
334 {
336 }
337
338 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
339 {
340 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
341 return;
342
343 if (Unit* caster = GetCaster())
346 .TriggeringAura = aurEff
347 });
348 }
349
354};
355
356// 50842 - Blood Boil
358{
359 bool Validate(SpellInfo const* /*spellInfo*/) override
360 {
362 }
363
368
369 void Register() override
370 {
372 }
373};
374
375// 1267044 - Blood Bond
377{
382
383 void HandleDummyTick(AuraEffect const* aurEff) const
384 {
385 Unit* owner = GetTarget()->GetOwner();
386 Unit* target = GetTarget();
387 SpellInfo const* bloodBondTalent = sSpellMgr->AssertSpellInfo(SPELL_DK_BLOOD_BOND_TALENT, GetCastDifficulty());
388 if (owner->GetHealthPct() >= bloodBondTalent->GetEffect(EFFECT_0).CalcValueAsInt(owner))
389 return;
390
393 args.TriggeringAura = aurEff;
394 target->CastSpell(target, SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT, args);
396 }
397
402};
403
404// 374504 - Brittle
406{
407 bool Validate(SpellInfo const* /*spellInfo*/) override
408 {
410 }
411
412 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
413 {
415 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
416 });
417 }
418
423};
424
425// 81136 - Crimson Scourge
427{
432
433 static bool CheckProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& procInfo)
434 {
435 return procInfo.GetProcTarget()->HasAura(SPELL_DK_BLOOD_PLAGUE, procInfo.GetActor()->GetGUID());
436 }
437
438 static void HandleProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
439 {
440 Unit* actor = eventInfo.GetActor();
441 actor->GetSpellHistory()->RestoreCharge(sSpellMgr->AssertSpellInfo(SPELL_DK_DEATH_AND_DECAY, DIFFICULTY_NONE)->ChargeCategoryId);
443 }
444
450};
451
452// 49028 - Dancing Rune Weapon
455{
456 bool Validate(SpellInfo const* /*spellInfo*/) override
457 {
458 if (!sObjectMgr->GetCreatureTemplate(NPC_DK_DANCING_RUNE_WEAPON))
459 return false;
460 return true;
461 }
462
463 // This is a port of the old switch hack in Unit.cpp, it's not correct
464 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
465 {
467 Unit* caster = GetCaster();
468 if (!caster)
469 return;
470
471 Unit* drw = nullptr;
472 for (Unit* controlled : caster->m_Controlled)
473 {
474 if (controlled->GetEntry() == NPC_DK_DANCING_RUNE_WEAPON)
475 {
476 drw = controlled;
477 break;
478 }
479 }
480
481 if (!drw || !drw->GetVictim())
482 return;
483
484 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
485 if (!spellInfo)
486 return;
487
488 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
489 if (!damageInfo || !damageInfo->GetDamage())
490 return;
491
492 int32 amount = static_cast<int32>(damageInfo->GetDamage()) / 2;
493 SpellNonMeleeDamage log(drw, drw->GetVictim(), spellInfo, { spellInfo->GetSpellXSpellVisualId(drw), 0 }, spellInfo->GetSchoolMask());
494 log.damage = amount;
495 Unit::DealDamage(drw, drw->GetVictim(), amount, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true);
497 }
498
503};
504
505// 77606 - Dark Simulacrum
507{
508 bool Validate(SpellInfo const* /*spellInfo*/) override
509 {
511 }
512
513 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
514 {
515 Spell const* procSpell = eventInfo.GetProcSpell();
516 if (!procSpell)
517 return false;
518
519 if (!GetTarget()->IsPlayer())
521
522 if (!procSpell->HasPowerTypeCost(POWER_MANA))
523 return false;
524
525 // filter out spells not castable by mind controlled players (teleports, summons, item creations (healthstones))
527 return false;
528
529 return true;
530 }
531
532 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
533 {
534 Unit* caster = GetCaster();
535 if (!caster)
536 return;
537
540 .SetTriggeringSpell(eventInfo.GetProcSpell())
542
545 .SetTriggeringSpell(eventInfo.GetProcSpell())
547 .AddSpellMod(SPELLVALUE_BASE_POINT1, GetTarget()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_MAGIC)));
548 }
549
555};
556
557// 77616 - Dark Simulacrum
559{
560 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
561 {
562 return uint32(aurEff->GetAmountAsInt()) == eventInfo.GetSpellInfo()->Id;
563 }
564
569};
570
571// 43265 - Death and Decay (Aura)
573{
574 void HandleDummyTick(AuraEffect const* aurEff)
575 {
576 if (Unit* caster = GetCaster())
577 caster->CastSpell(GetTarget(), SPELL_DK_DEATH_AND_DECAY_DAMAGE, aurEff);
578 }
579
584};
585
586// 47541 - Death Coil
588{
589 bool Validate(SpellInfo const* /*spell*/) override
590 {
592 }
593
594 void HandleDummy(SpellEffIndex /*effIndex*/)
595 {
596 Unit* caster = GetCaster();
598 if (AuraEffect const* unholyAura = caster->GetAuraEffect(SPELL_DK_UNHOLY, EFFECT_6)) // can be any effect, just here to send SPELL_FAILED_DONT_REPORT on failure
599 caster->CastSpell(caster, SPELL_DK_UNHOLY_VIGOR, unholyAura);
600 }
601
606};
607
608// 52751 - Death Gate
610{
621
623 {
624 PreventHitDefaultEffect(effIndex);
625 if (Unit* target = GetHitUnit())
626 target->CastSpell(target, GetEffectValueAsInt(), false);
627 }
628
634};
635
636// 49576 - Death Grip Initial
638{
639 bool Validate(SpellInfo const* /*spellInfo*/) override
640 {
641 return ValidateSpellInfo(
642 {
647 });
648 }
649
651 {
652 Unit* caster = GetCaster();
653 // Death Grip should not be castable while jumping/falling
655 return SPELL_FAILED_MOVING;
656
657 return SPELL_CAST_OK;
658 }
659
667
673};
674
675// 48743 - Death Pact
677{
678 bool Validate(SpellInfo const* spellInfo) override
679 {
680 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
681 }
682
683 void HandleCalcAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
684 {
685 if (Unit* caster = GetCaster())
686 amount = caster->CountPctFromMaxHealth(GetEffectInfo(EFFECT_2).CalcValue(caster));
687 }
688
693};
694
695// 49998 - Death Strike
697{
711
712 void HandleDummy(SpellEffIndex /*effIndex*/)
713 {
714 Unit* caster = GetCaster();
715
716 if (AuraEffect* enabler = caster->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID()))
717 {
718 // Heals you for 25% of all damage taken in the last 5 sec,
719 SpellEffectValue heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetEffectInfo(EFFECT_1).CalcValue(GetCaster()));
720 // minimum 7.0% of maximum health.
721 SpellEffectValue pctOfMaxHealth = CalculatePct(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()), caster->GetMaxHealth());
722 heal = std::max(heal, pctOfMaxHealth);
723
725
728
729 if (caster->HasAura(SPELL_DK_FROST))
731 }
732 }
733
738
744};
745
746// 89832 - Death Strike Enabler - SPELL_DK_DEATH_STRIKE_ENABLER
748{
749 // Amount of seconds we calculate damage over
750 constexpr static uint8 LAST_SECONDS = 5;
751
752 bool CheckProc(ProcEventInfo& eventInfo)
753 {
754 return eventInfo.GetDamageInfo() != nullptr;
755 }
756
757 void Update(AuraEffect* /*aurEff*/)
758 {
759 // Move backwards all datas by one from [23][0][0][0][0] -> [0][23][0][0][0]
760 std::move_backward(_damagePerSecond.begin(), std::next(_damagePerSecond.begin(), LAST_SECONDS - 1), _damagePerSecond.end());
761 _damagePerSecond[0] = 0;
762 }
763
764 void HandleCalcAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& canBeRecalculated)
765 {
766 canBeRecalculated = true;
767 amount = std::accumulate(_damagePerSecond.begin(), _damagePerSecond.end(), 0u);
768 }
769
770 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
771 {
772 _damagePerSecond[0] += eventInfo.GetDamageInfo()->GetDamage();
773 }
774
782
783private:
784 std::array<uint32, LAST_SECONDS> _damagePerSecond = { };
785};
786
787// 85948 - Festering Strike
805
806// 195621 - Frost Fever
808{
809 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
810 {
811 return roll_chance(aurEff->GetAmount());
812 }
813
818};
819
820// 47496 - Explode, Ghoul spell for Corpse Explosion
822{
823 bool Validate(SpellInfo const* spellInfo) override
824 {
826 }
827
828 void HandleDamage(SpellEffIndex /*effIndex*/)
829 {
830 SetHitDamage(GetCaster()->CountPctFromMaxHealth(GetEffectInfo(EFFECT_2).CalcValue(GetCaster())));
831 }
832
833 void Suicide(SpellEffIndex /*effIndex*/)
834 {
835 if (Unit* unitTarget = GetHitUnit())
836 {
837 // Corpse Explosion (Suicide)
838 unitTarget->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED, true);
839 }
840 }
841
847};
848
849// 69961 - Glyph of Scourge Strike
851{
853 {
854 Unit* caster = GetCaster();
855 Unit* target = GetHitUnit();
856
858 for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
859 {
860 AuraEffect const* aurEff = *i;
861 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
862 // search our Blood Plague and Frost Fever on target
863 if (spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && spellInfo->SpellFamilyFlags[2] & 0x2 &&
864 aurEff->GetCasterGUID() == caster->GetGUID())
865 {
866 uint32 countMin = aurEff->GetBase()->GetMaxDuration();
867 uint32 countMax = spellInfo->GetMaxDuration();
868
869 // this Glyph
870 countMax += 9000;
871
872 if (countMin < countMax)
873 {
874 aurEff->GetBase()->SetDuration(aurEff->GetBase()->GetDuration() + 3000);
875 aurEff->GetBase()->SetMaxDuration(countMin + 3000);
876 }
877 }
878 }
879 }
880
885};
886
887// Called by 206930 - Heart Strike
912
913// 49184 - Howling Blast
915{
916 bool Validate(SpellInfo const* /*spellInfo*/) override
917 {
919 }
920
925
930};
931
932// Called by 45524 - Chains of Ice
933// 454786 - Ice Prison
935{
936 bool Validate(SpellInfo const* /*spellInfo*/) override
937 {
939 }
940
941 bool Load() override
942 {
944 }
945
953
954 void Register() override
955 {
957 }
958};
959
960// 194878 - Icy Talons
962{
963 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
964 {
965 if (Spell const* procSpell = eventInfo.GetProcSpell())
966 return procSpell->GetPowerTypeCostAmount(POWER_RUNIC_POWER) > 0;
967
968 return false;
969 }
970
975};
976
977// 194879 - Icy Talons
979{
980 bool Validate(SpellInfo const* /*spellInfo*/) override
981 {
983 }
984
986 {
988 target = nullptr;
989 }
990
995};
996
997// 374277 - Improved Death Strike
1025
1026// 206940 - Mark of Blood
1028{
1029 bool Validate(SpellInfo const* /*spellInfo*/) override
1030 {
1032 }
1033
1034 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1035 {
1037 if (Unit* caster = GetCaster())
1038 caster->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true);
1039 }
1040
1045};
1046
1047// 207346 - Necrosis
1049{
1050 bool Validate(SpellInfo const* /*spellInfo*/) override
1051 {
1053 }
1054
1055 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1056 {
1059 }
1060
1065};
1066
1067// 207256 - Obliteration
1069{
1075
1076 void HandleProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
1077 {
1078 Unit* target = GetTarget();
1079 target->CastSpell(target, SPELL_DK_KILLING_MACHINE_PROC, aurEff);
1080
1081 if (AuraEffect const* oblitaration = target->GetAuraEffect(SPELL_DK_OBLITERATION, EFFECT_1))
1082 if (roll_chance(oblitaration->GetAmount()))
1083 target->CastSpell(target, SPELL_DK_OBLITERATION_RUNE_ENERGIZE, aurEff);
1084 }
1085
1090};
1091
1092// 207200 - Permafrost
1094{
1095 bool Validate(SpellInfo const* /*spellInfo*/) override
1096 {
1098 }
1099
1100 void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1101 {
1102 CastSpellExtraArgs args(aurEff);
1105 }
1106
1111};
1112
1113// 121916 - Glyph of the Geist (Unholy)
1116{
1117 bool Validate(SpellInfo const* /*spellInfo*/) override
1118 {
1120 }
1121
1122 bool Load() override
1123 {
1124 return GetCaster()->IsPet();
1125 }
1126
1128 {
1129 if (Unit* owner = GetCaster()->GetOwner())
1130 if (owner->HasAura(SPELL_DK_GLYPH_OF_THE_GEIST))
1131 return SPELL_CAST_OK;
1132
1134 }
1135
1140};
1141
1142// 147157 Glyph of the Skeleton (Unholy)
1145{
1146 bool Validate(SpellInfo const* /*spellInfo*/) override
1147 {
1149 }
1150
1152 {
1153 if (Unit* owner = GetCaster()->GetOwner())
1154 if (owner->HasAura(SPELL_DK_GLYPH_OF_THE_SKELETON))
1155 return SPELL_CAST_OK;
1156
1158 }
1159
1164};
1165
1166// 61257 - Runic Power Back on Snare/Root
1169{
1170 bool Validate(SpellInfo const* /*spellInfo*/) override
1171 {
1173 }
1174
1175 bool CheckProc(ProcEventInfo& eventInfo)
1176 {
1177 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1178 if (!spellInfo)
1179 return false;
1180
1181 return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_SNARE))) != 0;
1182 }
1183
1184 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1185 {
1187 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_DK_RUNIC_RETURN, true);
1188 }
1189
1195};
1196
1197// 46584 - Raise Dead
1199{
1200 bool Validate(SpellInfo const* /*spellInfo*/) override
1201 {
1203 }
1204
1205 void HandleDummy(SpellEffIndex /*effIndex*/)
1206 {
1208 GetCaster()->CastSpell(nullptr, spellId, true);
1209 }
1210
1215};
1216
1217// 440002 - Reaper of Souls (attached to 343294 - Soul Reaper)
1219{
1220 bool Validate(SpellInfo const* /*spellInfo*/) override
1221 {
1223 }
1224
1226 {
1227 if (Aura* reaperOfSouls = GetCaster()->GetAura(SPELL_DK_REAPER_OF_SOULS_PROC))
1228 return GetSpell()->m_appliedMods.contains(reaperOfSouls);
1229 return false;
1230 }
1231
1232 void HandleDefault(WorldObject*& target) const
1233 {
1235 target = nullptr;
1236 }
1237
1239 {
1241 PreventHitDefaultEffect(effIndex);
1242 }
1243
1249};
1250
1251// 59057 - Rime
1253{
1254 bool Validate(SpellInfo const* spellInfo) override
1255 {
1256 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } }) && ValidateSpellInfo({ SPELL_DK_FROST_SCYTHE });
1257 }
1258
1259 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
1260 {
1262 if (eventInfo.GetSpellInfo()->Id == SPELL_DK_FROST_SCYTHE)
1263 chance /= 2.f;
1264
1265 return roll_chance(chance);
1266 }
1267
1272};
1273
1274// 343294 - Soul Reaper
1275// 469180 - Soul Reaper
1277{
1278public:
1279 explicit spell_dk_soul_reaper(SpellEffIndex auraEffectIndex, Optional<SpellEffIndex> healthLimitEffectIndex)
1280 : _auraEffectIndex(auraEffectIndex), _healthLimitEffectIndex(healthLimitEffectIndex) { }
1281
1282 bool Validate(SpellInfo const* /*spellInfo*/) override
1283 {
1285 }
1286
1287 void HandleOnTick(AuraEffect const* aurEff) const
1288 {
1289 Unit* target = GetTarget();
1290 Unit* caster = GetCaster();
1291 if (!caster)
1292 return;
1293
1294 if (!_healthLimitEffectIndex || target->GetHealthPct() < GetEffectInfo(*_healthLimitEffectIndex).CalcValue(caster))
1297 .TriggeringAura = aurEff
1298 });
1299 }
1300
1301 void RemoveEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
1302 {
1303 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
1304 return;
1305
1306 Player* caster = Object::ToPlayer(GetCaster());
1307 if (!caster)
1308 return;
1309
1310 if (caster->isHonorOrXPTarget(GetTarget()))
1313 .TriggeringAura = aurEff
1314 });
1315 }
1316
1322
1323private:
1326};
1327
1328// Called by 383312 Abomination Limb and 49576 - Death Grip
1329// 454822 - Subduing Grasp
1358
1359// 374049 - Suppression
1361{
1362 bool CheckProc(ProcEventInfo& eventInfo)
1363 {
1364 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1365 if (!spellInfo)
1366 return false;
1367
1368 return (spellInfo->GetAllEffectsMechanicMask() & MECHANIC_LOSS_CONTROL_MASK) != 0;
1369 }
1370
1375};
1376
1377// 242057 - Rune Empowered
1379{
1380 bool Validate(SpellInfo const* /*spellInfo*/) override
1381 {
1383 }
1384
1385 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& procInfo)
1386 {
1387 Spell const* procSpell = procInfo.GetProcSpell();
1388 if (!procSpell)
1389 return;
1390
1391 Aura* pillarOfFrost = GetTarget()->GetAura(SPELL_DK_PILLAR_OF_FROST);
1392 if (!pillarOfFrost)
1393 return;
1394
1396 // Breath of Sindragosa special case
1397 SpellInfo const* breathOfSindragosa = sSpellMgr->AssertSpellInfo(SPELL_DK_BREATH_OF_SINDRAGOSA, DIFFICULTY_NONE);
1398 if (procSpell->IsTriggeredByAura(breathOfSindragosa))
1399 {
1400 auto powerItr = std::find_if(breathOfSindragosa->PowerCosts.begin(), breathOfSindragosa->PowerCosts.end(),
1401 [](SpellPowerEntry const* power) { return power->PowerType == POWER_RUNIC_POWER && power->PowerPctPerSecond > 0.0f; });
1402 if (powerItr != breathOfSindragosa->PowerCosts.end())
1403 _runicPowerSpent += CalculatePct(GetTarget()->GetMaxPower(POWER_RUNIC_POWER), (*powerItr)->PowerPctPerSecond);
1404 }
1405
1406 if (_runicPowerSpent >= 600)
1407 {
1408 pillarOfFrost->SetDuration(pillarOfFrost->GetDuration() + 1000);
1409 _runicPowerSpent -= 600;
1410 }
1411 }
1412
1417
1419};
1420
1421// 55233 - Vampiric Blood
1423{
1424 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
1425 {
1426 amount = GetUnitOwner()->CountPctFromMaxHealth(amount);
1427 }
1428
1433};
1434
1435// 273953 - Voracious (attached to 49998 - Death Strike)
1437{
1438 bool Validate(SpellInfo const* /*spellInfo*/) override
1439 {
1441 }
1442
1443 bool Load() override
1444 {
1446 }
1447
1448 void HandleHit(SpellEffIndex /*effIndex*/) const
1449 {
1450 Unit* caster = GetCaster();
1453 .TriggeringSpell = GetSpell()
1454 });
1455 }
1456
1461};
1462
1463// 43265 - Death and Decay
1465{
1467
1468 void OnUnitEnter(Unit* unit) override
1469 {
1470 if (unit->GetGUID() != at->GetCasterGuid())
1471 return;
1472
1475
1478 }
1479
1480 void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
1481 {
1482 if (unit->GetGUID() != at->GetCasterGuid())
1483 return;
1484
1485 if (Aura* deathAndDecay = unit->GetAura(SPELL_DK_DEATH_AND_DECAY_INCREASE_TARGETS))
1486 {
1487 if (AuraEffect* const cleavingStrikes = unit->GetAuraEffect(SPELL_DK_CLEAVING_STRIKES, EFFECT_3))
1488 deathAndDecay->SetDuration(cleavingStrikes->GetAmountAsInt());
1489 }
1490
1492 }
1493};
1494
1496{
1499 RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_marrowrend_apply_bone_shield", EFFECT_2);
1500 RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_deaths_caress_apply_bone_shield", EFFECT_2);
1540 RegisterSpellScriptWithArgs(spell_dk_soul_reaper, "spell_dk_soul_reaper_reaper_of_souls", EFFECT_0, Optional<SpellEffIndex>());
1546
1548}
AreaTriggerExitReason
Definition AreaTrigger.h:69
@ DIFFICULTY_NONE
Definition DBCEnums.h:933
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
#define UI64LIT(N)
Definition Define.h:139
uint32_t uint32
Definition Define.h:154
#define sObjectMgr
Definition ObjectMgr.h:1885
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1382
SpellEffIndex
@ EFFECT_3
@ EFFECT_6
@ EFFECT_1
@ EFFECT_0
@ EFFECT_4
@ EFFECT_2
@ SPELL_ATTR9_ALLOW_DARK_SIMULACRUM
@ CLASS_DEATH_KNIGHT
@ TARGET_UNIT_TARGET_ENEMY
@ TARGET_UNIT_CASTER
@ SPELL_SCHOOL_MASK_MAGIC
@ SPELL_ATTR1_NO_AUTOCAST_AI
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ MECHANIC_ROOT
@ MECHANIC_SNARE
@ SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT
@ POWER_RUNIC_POWER
@ POWER_RUNES
@ POWER_MANA
constexpr uint64 MECHANIC_LOSS_CONTROL_MASK(IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK &~((1<< MECHANIC_SNARE)|(1<< MECHANIC_TURN)|(1<< MECHANIC_DAZE)))
SpellCastResult
@ SPELL_FAILED_MOVING
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_CAST_OK
@ SPELL_FAILED_SPELL_UNAVAILABLE
@ SPELLFAMILY_DEATHKNIGHT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_DEATH
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_ADD_PCT_MODIFIER
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_INCREASE_HEALTH_2
@ SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED
@ SPELL_AURA_MOD_VERSATILITY
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_MOD_CONFUSE
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELLVALUE_AURA_STACK
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_BASE_POINT1
@ SPELLVALUE_BASE_POINT0
#define sSpellMgr
Definition SpellMgr.h:812
#define SpellObjectTargetSelectFn(F, I, N)
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckEffectProcFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define SpellCastFn(F)
#define AuraEffectAbsorbFn(F, I)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ MOVEMENTFLAG_FALLING
@ SPELL_DIRECT_DAMAGE
@ UNIT_STATE_JUMPING
Definition Unit.h:279
@ CR_VERSATILITY_DAMAGE_DONE
Definition Unit.h:345
T AddPct(T &base, U pct)
Definition Util.h:85
T CalculatePct(T base, U pct)
Definition Util.h:72
AreaTrigger *const at
AreaTriggerAI(AreaTrigger *a, uint32 scriptId={}) noexcept
ObjectGuid const & GetCasterGuid() const
SpellInfo const * GetSpellInfo() const
int32 GetAmountAsInt() const
Aura * GetBase() const
SpellEffectValue GetAmount() const
ObjectGuid GetCasterGUID() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectProcHandler > AfterEffectProc
HookList< EffectAbsorbHandler > AfterEffectAbsorb
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
Unit * GetTarget() const
Difficulty GetCastDifficulty() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
int32 GetMaxDuration() const
Definition SpellAuras.h:217
int32 GetDuration() const
Definition SpellAuras.h:222
void SetDuration(int32 duration, bool withMods=false)
void SetMaxDuration(int32 duration)
Definition SpellAuras.h:218
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
uint32 GetDamage() const
Definition Unit.h:452
Player * ToPlayer()
Definition Object.h:126
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2833
bool isHonorOrXPTarget(Unit const *victim) const
Definition Player.cpp:26354
Unit * GetActionTarget() const
Definition Unit.h:500
Spell const * GetProcSpell() const
Definition Unit.h:514
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
DamageInfo * GetDamageInfo() const
Definition Unit.h:511
Unit * GetProcTarget() const
Definition Unit.h:501
Unit * GetActor() const
Definition Unit.h:499
SpellEffectValue CalcValue(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
int32 CalcValueAsInt(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
SpellEffectValue CalcBaseValue(WorldObject const *caster, Unit const *target, uint32 itemId, int32 itemLevel) const
void RestoreCharge(uint32 chargeCategoryId)
std::array< SpellPowerEntry const *, MAX_POWERS_PER_SPELL > PowerCosts
Definition SpellInfo.h:391
uint64 GetAllEffectsMechanicMask() const
uint32 const Id
Definition SpellInfo.h:328
int32 GetMaxDuration() const
flag128 SpellFamilyFlags
Definition SpellInfo.h:415
SpellSchoolMask GetSchoolMask() const
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:456
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:588
uint32 SpellFamilyName
Definition SpellInfo.h:414
uint32 m_scriptSpellId
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< CastHandler > AfterCast
HookList< CheckCastHandler > OnCheckCast
Unit * GetCaster() const
int32 GetEffectValueAsInt() const
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
void SetCustomCastResultMessage(SpellCustomErrors result)
Spell * GetSpell() const
void SetHitDamage(int32 damage)
HookList< EffectHandler > OnEffectLaunch
Definition Spell.h:277
SpellInfo const * GetSpellInfo() const
Definition Spell.h:702
bool HasPowerTypeCost(Powers power) const
Definition Spell.cpp:8152
Optional< int32 > GetPowerTypeCostAmount(Powers power) const
Definition Spell.cpp:8157
bool IsTriggeredByAura(SpellInfo const *auraSpellInfo) const
Definition Spell.h:677
UsedSpellMods m_appliedMods
Definition Spell.h:654
Definition Unit.h:635
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
Definition Unit.cpp:820
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1342
float GetHealthPct() const
Definition Unit.h:796
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:797
uint8 GetClass() const
Definition Unit.h:764
std::forward_list< AuraEffect * > AuraEffectList
Definition Unit.h:652
bool IsPet() const
Definition Unit.h:751
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4604
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10037
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition Unit.cpp:5540
ControlList m_Controlled
Definition Unit.h:1232
uint64 GetMaxHealth() const
Definition Unit.h:789
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:1734
bool IsGuardian() const
Definition Unit.h:750
Unit * GetVictim() const
Definition Unit.h:726
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
SpellHistory * GetSpellHistory()
Definition Unit.h:1498
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
Unit * GetOwner() const
Definition Object.cpp:1598
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:123
void Register() override
Definition spell_dk.cpp:141
SpellEffectValue absorbPct
Definition spell_dk.cpp:199
void Trigger(AuraEffect *aurEff, DamageInfo &, uint32 &absorbAmount)
Definition spell_dk.cpp:183
void CalculateAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
Definition spell_dk.cpp:172
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:158
void Register() override
Definition spell_dk.cpp:192
spell_dk_apply_bone_shield(SpellEffIndex effIndex)
Definition spell_dk.cpp:209
void Register() override
Definition spell_dk.cpp:227
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:211
void HandleHitTarget(SpellEffIndex) const
Definition spell_dk.cpp:218
6.x, does this belong here or in spell_generic? where do we cast this? sniffs say this is only cast w...
Definition spell_dk.cpp:249
void Register() override
Definition spell_dk.cpp:274
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:269
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:250
SpellCastResult CheckCast()
Definition spell_dk.cpp:260
bool Load() override
Definition spell_dk.cpp:255
void HandleDummy(SpellEffIndex) const
Definition spell_dk.cpp:289
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:284
void Register() override
Definition spell_dk.cpp:304
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition spell_dk.cpp:318
void Register() override
Definition spell_dk.cpp:324
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:313
void Register() override
Definition spell_dk.cpp:369
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:359
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:378
void HandleDummyTick(AuraEffect const *aurEff) const
Definition spell_dk.cpp:383
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:333
void Register() override
Definition spell_dk.cpp:350
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes) const
Definition spell_dk.cpp:338
void HandleProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:412
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:407
void Register() override
Definition spell_dk.cpp:419
static void HandleProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &eventInfo)
Definition spell_dk.cpp:438
void Register() override
Definition spell_dk.cpp:445
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:428
static bool CheckProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &procInfo)
Definition spell_dk.cpp:433
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:456
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:464
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:560
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:508
bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:513
void Register() override
Definition spell_dk.cpp:550
void HandleProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:532
void Register() override
Definition spell_dk.cpp:580
void HandleDummyTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:574
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:589
void Register() override
Definition spell_dk.cpp:602
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:594
void HandleScript(SpellEffIndex effIndex)
Definition spell_dk.cpp:622
SpellCastResult CheckClass()
Definition spell_dk.cpp:611
void Register() override
Definition spell_dk.cpp:629
SpellCastResult CheckCast()
Definition spell_dk.cpp:650
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:639
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:660
void Register() override
Definition spell_dk.cpp:689
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:678
void HandleCalcAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
Definition spell_dk.cpp:683
void HandleCalcAmount(AuraEffect const *, SpellEffectValue &amount, bool &canBeRecalculated)
Definition spell_dk.cpp:764
std::array< uint32, LAST_SECONDS > _damagePerSecond
Definition spell_dk.cpp:784
void Update(AuraEffect *)
Definition spell_dk.cpp:757
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:752
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:770
static constexpr uint8 LAST_SECONDS
Definition spell_dk.cpp:750
void TriggerRecentlyUsedDeathStrike()
Definition spell_dk.cpp:734
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:698
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:712
void Register() override
Definition spell_dk.cpp:739
void Register() override
Definition spell_dk.cpp:800
void HandleScriptEffect(SpellEffIndex)
Definition spell_dk.cpp:795
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:790
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo const &) const
Definition spell_dk.cpp:809
void Register() override
Definition spell_dk.cpp:814
void HandleDamage(SpellEffIndex)
Definition spell_dk.cpp:828
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:823
void Suicide(SpellEffIndex)
Definition spell_dk.cpp:833
void Register() override
Definition spell_dk.cpp:842
bool Load() override
Definition spell_dk.cpp:895
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:890
void HandleEnergize(SpellEffIndex)
Definition spell_dk.cpp:900
void Register() override
Definition spell_dk.cpp:907
void HandleFrostFever(SpellEffIndex)
Definition spell_dk.cpp:921
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:916
void Register() override
Definition spell_dk.cpp:926
bool Load() override
Definition spell_dk.cpp:941
void HandleOnHit() const
Definition spell_dk.cpp:946
void Register() override
Definition spell_dk.cpp:954
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:936
void HandleSmotheringOffense(WorldObject *&target) const
Definition spell_dk.cpp:985
void Register() override
Definition spell_dk.cpp:991
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:980
bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:963
void Register() override
Definition spell_dk.cpp:971
void CalcHealIncrease(AuraEffect const *, SpellEffectValue &amount, bool &) const
bool Validate(SpellInfo const *spellInfo) override
void CalcPowerCostReduction(AuraEffect const *, SpellEffectValue &amount, bool &) const
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void Register() override
void HandleEffectProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
6.x, does this belong here or in spell_generic? apply this in creature_template_addon?...
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
6.x, does this belong here or in spell_generic? apply this in creature_template_addon?...
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleDefault(WorldObject *&target) const
void Register() override
bool IsAffectedByReaperOfSouls() const
void HandleReaperOfSouls(SpellEffIndex effIndex)
void Register() override
bool CheckProc(AuraEffect const *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *spellInfo) override
void RemoveEffect(AuraEffect const *aurEff, AuraEffectHandleModes) const
void HandleOnTick(AuraEffect const *aurEff) const
spell_dk_soul_reaper(SpellEffIndex auraEffectIndex, Optional< SpellEffIndex > healthLimitEffectIndex)
Optional< SpellEffIndex > _healthLimitEffectIndex
SpellEffIndex _auraEffectIndex
bool Validate(SpellInfo const *) override
void Register() override
bool Load() override
void Register() override
void HandleSubduingGrasp(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *, ProcEventInfo &procInfo)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
void Register() override
bool Validate(SpellInfo const *) override
void HandleHit(SpellEffIndex) const
void Register() override
bool Load() override
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
DeathKnightSpells
Definition pet_dk.cpp:30
@ NPC_DK_DANCING_RUNE_WEAPON
Definition spell_dk.cpp:117
static uint32 const ArmyTransforms[]
Definition spell_dk.cpp:237
@ SPELL_DK_DEATH_STRIKE_OFFHAND
Definition spell_dk.cpp:73
@ SPELL_DK_CLEAVING_STRIKES
Definition spell_dk.cpp:59
@ SPELL_DK_FROST_SHIELD
Definition spell_dk.cpp:78
@ SPELL_DK_SANGUINE_GROUND_TALENT
Definition spell_dk.cpp:100
@ SPELL_DK_RUNIC_RETURN
Definition spell_dk.cpp:99
@ SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT
Definition spell_dk.cpp:51
@ SPELL_DK_ARMY_SPIKED_GHOUL_TRANSFORM
Definition spell_dk.cpp:44
@ SPELL_DK_ICE_PRISON_TALENT
Definition spell_dk.cpp:87
@ SPELL_DK_GOREFIENDS_GRASP
Definition spell_dk.cpp:83
@ SPELL_DK_UNHOLY_VIGOR
Definition spell_dk.cpp:110
@ SPELL_DK_OBLITERATION
Definition spell_dk.cpp:91
@ SPELL_DK_HEARTBREAKER_ENERGIZE
Definition spell_dk.cpp:84
@ SPELL_DK_ARMY_NORTHREND_SKELETON_TRANSFORM
Definition spell_dk.cpp:42
@ SPELL_DK_ICE_PRISON_ROOT
Definition spell_dk.cpp:86
@ SPELL_DK_BLOOD_BOND_PLAYER_HEAL_PCT
Definition spell_dk.cpp:52
@ SPELL_DK_ARMY_FLESH_BEAST_TRANSFORM
Definition spell_dk.cpp:40
@ SPELL_DK_ARMY_SKELETON_TRANSFORM
Definition spell_dk.cpp:43
@ SPELL_DK_DEATH_AND_DECAY
Definition spell_dk.cpp:64
@ SPELL_DK_BLOOD_PLAGUE
Definition spell_dk.cpp:53
@ SPELL_DK_MARK_OF_BLOOD_HEAL
Definition spell_dk.cpp:89
@ SPELL_DK_CRIMSON_SCOURGE_BUFF
Definition spell_dk.cpp:61
@ SPELL_DK_UNHOLY
Definition spell_dk.cpp:109
@ SPELL_DK_BLOOD_BOND_PERIODIC
Definition spell_dk.cpp:49
@ SPELL_DK_FESTERING_WOUND
Definition spell_dk.cpp:74
@ SPELL_DK_REAPER_OF_SOULS_PROC
Definition spell_dk.cpp:95
@ SPELL_DK_GHOUL_BIRTH
Definition spell_dk.cpp:79
@ SPELL_DK_HEARTBREAKER_TALENT
Definition spell_dk.cpp:85
@ SPELL_DK_DEATH_AND_DECAY_DAMAGE
Definition spell_dk.cpp:65
@ SPELL_DK_SUBDUING_GRASP_DEBUFF
Definition spell_dk.cpp:107
@ SPELL_DK_RAISE_DEAD_SUMMON
Definition spell_dk.cpp:94
@ SPELL_DK_SOUL_REAPER
Definition spell_dk.cpp:105
@ SPELL_DK_DEATH_GRIP_JUMP
Definition spell_dk.cpp:69
@ SPELL_DK_DEATH_AND_DECAY_INCREASE_TARGETS
Definition spell_dk.cpp:66
@ SPELL_DK_BLOOD_SHIELD_ABSORB
Definition spell_dk.cpp:54
@ SPELL_DK_DEATH_GRIP_DUMMY
Definition spell_dk.cpp:68
@ SPELL_DK_FROST_FEVER
Definition spell_dk.cpp:76
@ SPELL_DK_KILLING_MACHINE_PROC
Definition spell_dk.cpp:88
@ SPELL_DK_DEATH_GRIP_TAUNT
Definition spell_dk.cpp:70
@ SPELL_DK_FROST
Definition spell_dk.cpp:75
@ SPELL_DK_PILLAR_OF_FROST
Definition spell_dk.cpp:93
@ SPELL_DK_BLOOD_SHIELD_MASTERY
Definition spell_dk.cpp:55
@ SPELL_DK_GLYPH_OF_FOUL_MENAGERIE
Definition spell_dk.cpp:80
@ SPELL_DK_DEATH_STRIKE_HEAL
Definition spell_dk.cpp:72
@ SPELL_DK_SLUDGE_BELCHER
Definition spell_dk.cpp:102
@ SPELL_DK_NECROSIS_EFFECT
Definition spell_dk.cpp:90
@ SPELL_DK_BONE_SHIELD
Definition spell_dk.cpp:56
@ SPELL_DK_GLYPH_OF_THE_SKELETON
Definition spell_dk.cpp:82
@ SPELL_DK_RUNIC_POWER_ENERGIZE
Definition spell_dk.cpp:98
@ SPELL_DH_VORACIOUS_TALENT
Definition spell_dk.cpp:112
@ SPELL_DK_BLINDING_SLEET_SLOW
Definition spell_dk.cpp:46
@ SPELL_DK_SMOTHERING_OFFENSE
Definition spell_dk.cpp:104
@ SPELL_DK_ARMY_SUPER_ZOMBIE_TRANSFORM
Definition spell_dk.cpp:45
@ SPELL_DK_RECENTLY_USED_DEATH_STRIKE
Definition spell_dk.cpp:96
@ SPELL_DK_RUNIC_CORRUPTION
Definition spell_dk.cpp:97
@ SPELL_DK_DARK_SIMULACRUM_BUFF
Definition spell_dk.cpp:62
@ SPELL_DK_BLOODDRINKER_DEBUFF
Definition spell_dk.cpp:48
@ SPELL_DK_BRITTLE_DEBUFF
Definition spell_dk.cpp:58
@ SPELL_DK_DARK_SIMULACRUM_SPELLPOWER_BUFF
Definition spell_dk.cpp:63
@ SPELL_DK_SOUL_REAPER_DAMAGE
Definition spell_dk.cpp:106
@ SPELL_DK_SLUDGE_BELCHER_SUMMON
Definition spell_dk.cpp:103
@ SPELL_DK_SUBDUING_GRASP_TALENT
Definition spell_dk.cpp:108
@ SPELL_DK_DEATH_STRIKE_ENABLER
Definition spell_dk.cpp:71
@ SPELL_DK_SANGUINE_GROUND
Definition spell_dk.cpp:101
@ SPELL_DK_ARMY_GEIST_TRANSFORM
Definition spell_dk.cpp:41
@ SPELL_DK_ANTI_MAGIC_BARRIER
Definition spell_dk.cpp:39
@ SPELL_DK_GLYPH_OF_THE_GEIST
Definition spell_dk.cpp:81
@ SPELL_DK_OBLITERATION_RUNE_ENERGIZE
Definition spell_dk.cpp:92
@ SPELL_DK_BREATH_OF_SINDRAGOSA
Definition spell_dk.cpp:57
@ SPELL_DK_BLOOD_BOND_TALENT
Definition spell_dk.cpp:50
@ SPELL_DK_DEATH_COIL_DAMAGE
Definition spell_dk.cpp:67
@ SPELL_DH_VORACIOUS_LEECH
Definition spell_dk.cpp:111
@ SPELL_DK_BLOOD
Definition spell_dk.cpp:47
@ SPELL_DK_FROST_SCYTHE
Definition spell_dk.cpp:77
@ SPELL_DK_CORPSE_EXPLOSION_TRIGGERED
Definition spell_dk.cpp:60
void AddSC_deathknight_spell_scripts()
TriggerCastFlags TriggerFlags
Spell const * TriggeringSpell
AuraEffect const * TriggeringAura
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition Spell.cpp:9707
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
void OnUnitExit(Unit *unit, AreaTriggerExitReason) override
void OnUnitEnter(Unit *unit) override