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
116
118{
121
122// 70656 - Advantage (T10 4P Melee Bonus)
124{
125 bool CheckProc(ProcEventInfo& eventInfo)
126 {
127 if (Unit* caster = eventInfo.GetActor())
128 {
129 Player* player = caster->ToPlayer();
130 if (!player || caster->GetClass() != CLASS_DEATH_KNIGHT)
131 return false;
132
133 for (uint8 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
134 if (player->GetRuneCooldown(i) == 0)
135 return false;
136
137 return true;
138 }
139
140 return false;
141 }
142
147};
148
149// 48707 - Anti-Magic Shell
151{
152public:
154 {
155 absorbPct = 0;
156 maxHealth = 0;
157 absorbedAmount = 0;
158 }
159
160 bool Validate(SpellInfo const* spellInfo) override
161 {
164 }
165
166 bool Load() override
167 {
170 absorbedAmount = 0;
171 return true;
172 }
173
174 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
175 {
177
178 if (AuraEffect* const antiMagicBarrier = GetCaster()->GetAuraEffect(SPELL_DK_ANTI_MAGIC_BARRIER, EFFECT_2))
179 AddPct(amount, antiMagicBarrier->GetAmount());
180
181 if (Player const* player = GetUnitOwner()->ToPlayer())
182 AddPct(amount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + player->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY));
183 }
184
185 void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
186 {
187 absorbedAmount += absorbAmount;
188
189 CastSpellExtraArgs args(aurEff);
190 args.AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(absorbAmount, UI64LIT(2) * absorbAmount * 100 / maxHealth));
192 }
193
199
200private:
204};
205
206// 195182 - Marrowrend
207// 195292 - Death's Caress
209{
210public:
211 explicit spell_dk_apply_bone_shield(SpellEffIndex effIndex) : _effIndex(effIndex) { }
212
213 bool Validate(SpellInfo const* spellInfo) override
214 {
216 && ValidateSpellEffect({ { spellInfo->Id, _effIndex } })
217 && spellInfo->GetEffect(_effIndex).CalcBaseValue(nullptr, nullptr, 0, 0) <= SpellEffectValue(sSpellMgr->AssertSpellInfo(SPELL_DK_BONE_SHIELD, DIFFICULTY_NONE)->StackAmount);
218 }
219
228
233
234private:
236};
237
247
248// 127517 - Army Transform
251{
252 bool Validate(SpellInfo const* /*spellInfo*/) override
253 {
255 }
256
257 bool Load() override
258 {
259 return GetCaster()->IsGuardian();
260 }
261
263 {
264 if (Unit* owner = GetCaster()->GetOwner())
265 if (owner->HasAura(SPELL_DK_GLYPH_OF_FOUL_MENAGERIE))
266 return SPELL_CAST_OK;
267
269 }
270
275
281};
282
283// 1217740 - Birth (used by ghoul on spawn)
285{
290
291 void HandleDummy(SpellEffIndex /*effIndex*/) const
292 {
293 Unit* caster = GetCaster();
294 Unit* owner = GetCaster()->GetOwner();
295
298 args.TriggeringSpell = GetSpell();
299
300 caster->CastSpell(caster, SPELL_DK_GHOUL_BIRTH, args);
301
303 caster->CastSpell(caster, SPELL_DK_BLOOD_BOND_PERIODIC, args);
304 }
305
310};
311
312// 207167 - Blinding Sleet
331
332// 206931 - Blooddrinker
334{
335 bool Validate(SpellInfo const* /*spellInfo*/) override
336 {
338 }
339
340 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
341 {
342 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
343 return;
344
345 if (Unit* caster = GetCaster())
348 .TriggeringAura = aurEff
349 });
350 }
351
356};
357
358// 50842 - Blood Boil
360{
361 bool Validate(SpellInfo const* /*spellInfo*/) override
362 {
364 }
365
370
371 void Register() override
372 {
374 }
375};
376
377// 1267044 - Blood Bond
379{
384
385 void HandleDummyTick(AuraEffect const* aurEff) const
386 {
387 Unit* owner = GetTarget()->GetOwner();
388 Unit* target = GetTarget();
389 SpellInfo const* bloodBondTalent = sSpellMgr->AssertSpellInfo(SPELL_DK_BLOOD_BOND_TALENT, GetCastDifficulty());
390 if (owner->GetHealthPct() >= bloodBondTalent->GetEffect(EFFECT_0).CalcValueAsInt(owner))
391 return;
392
395 args.TriggeringAura = aurEff;
396 target->CastSpell(target, SPELL_DK_BLOOD_BOND_GHOUL_HEALTH_PCT, args);
398 }
399
404};
405
406// 374504 - Brittle
408{
409 bool Validate(SpellInfo const* /*spellInfo*/) override
410 {
412 }
413
414 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
415 {
417 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
418 });
419 }
420
425};
426
427// 81136 - Crimson Scourge
429{
434
435 static bool CheckProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& procInfo)
436 {
437 return procInfo.GetActionTarget()->HasAura(SPELL_DK_BLOOD_PLAGUE, procInfo.GetActor()->GetGUID());
438 }
439
440 static void HandleProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
441 {
442 Unit* actor = eventInfo.GetActor();
443 actor->GetSpellHistory()->RestoreCharge(sSpellMgr->AssertSpellInfo(SPELL_DK_DEATH_AND_DECAY, DIFFICULTY_NONE)->ChargeCategoryId);
445 }
446
452};
453
454// 49028 - Dancing Rune Weapon
457{
458 bool Validate(SpellInfo const* /*spellInfo*/) override
459 {
460 if (!sObjectMgr->GetCreatureTemplate(NPC_DK_DANCING_RUNE_WEAPON))
461 return false;
462 return true;
463 }
464
465 // This is a port of the old switch hack in Unit.cpp, it's not correct
466 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
467 {
469 Unit* caster = GetCaster();
470 if (!caster)
471 return;
472
473 Unit* drw = nullptr;
474 for (Unit* controlled : caster->m_Controlled)
475 {
476 if (controlled->GetEntry() == NPC_DK_DANCING_RUNE_WEAPON)
477 {
478 drw = controlled;
479 break;
480 }
481 }
482
483 if (!drw || !drw->GetVictim())
484 return;
485
486 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
487 if (!spellInfo)
488 return;
489
490 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
491 if (!damageInfo || !damageInfo->GetDamage())
492 return;
493
494 int32 amount = static_cast<int32>(damageInfo->GetDamage()) / 2;
495 SpellNonMeleeDamage log(drw, drw->GetVictim(), spellInfo, { spellInfo->GetSpellXSpellVisualId(drw), 0 }, spellInfo->GetSchoolMask());
496 log.damage = amount;
497 Unit::DealDamage(drw, drw->GetVictim(), amount, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true);
499 }
500
505};
506
507// 77606 - Dark Simulacrum
509{
510 bool Validate(SpellInfo const* /*spellInfo*/) override
511 {
513 }
514
515 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
516 {
517 Spell const* procSpell = eventInfo.GetProcSpell();
518 if (!procSpell)
519 return false;
520
521 if (!GetTarget()->IsPlayer())
523
524 if (!procSpell->HasPowerTypeCost(POWER_MANA))
525 return false;
526
527 // filter out spells not castable by mind controlled players (teleports, summons, item creations (healthstones))
529 return false;
530
531 return true;
532 }
533
534 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
535 {
536 Unit* caster = GetCaster();
537 if (!caster)
538 return;
539
542 .SetTriggeringSpell(eventInfo.GetProcSpell())
544
547 .SetTriggeringSpell(eventInfo.GetProcSpell())
549 .AddSpellMod(SPELLVALUE_BASE_POINT1, GetTarget()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_MAGIC)));
550 }
551
557};
558
559// 77616 - Dark Simulacrum
561{
562 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
563 {
564 return uint32(aurEff->GetAmountAsInt()) == eventInfo.GetSpellInfo()->Id;
565 }
566
571};
572
573// 43265 - Death and Decay (Aura)
575{
576 void HandleDummyTick(AuraEffect const* aurEff)
577 {
578 if (Unit* caster = GetCaster())
579 caster->CastSpell(GetTarget(), SPELL_DK_DEATH_AND_DECAY_DAMAGE, aurEff);
580 }
581
586};
587
588// 47541 - Death Coil
590{
591 bool Validate(SpellInfo const* /*spell*/) override
592 {
594 }
595
596 void HandleDummy(SpellEffIndex /*effIndex*/)
597 {
598 Unit* caster = GetCaster();
600 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
601 caster->CastSpell(caster, SPELL_DK_UNHOLY_VIGOR, unholyAura);
602 }
603
608};
609
610// 52751 - Death Gate
612{
623
625 {
626 PreventHitDefaultEffect(effIndex);
627 if (Unit* target = GetHitUnit())
628 target->CastSpell(target, GetEffectValueAsInt(), false);
629 }
630
636};
637
638// 49576 - Death Grip Initial
640{
641 bool Validate(SpellInfo const* /*spellInfo*/) override
642 {
643 return ValidateSpellInfo(
644 {
649 });
650 }
651
653 {
654 Unit* caster = GetCaster();
655 // Death Grip should not be castable while jumping/falling
657 return SPELL_FAILED_MOVING;
658
659 return SPELL_CAST_OK;
660 }
661
669
675};
676
677// 48743 - Death Pact
679{
680 bool Validate(SpellInfo const* spellInfo) override
681 {
682 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
683 }
684
685 void HandleCalcAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
686 {
687 if (Unit* caster = GetCaster())
688 amount = caster->CountPctFromMaxHealth(GetEffectInfo(EFFECT_2).CalcValue(caster));
689 }
690
695};
696
697// 49998 - Death Strike
699{
713
714 void HandleDummy(SpellEffIndex /*effIndex*/)
715 {
716 Unit* caster = GetCaster();
717
718 if (AuraEffect* enabler = caster->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID()))
719 {
720 // Heals you for 25% of all damage taken in the last 5 sec,
721 SpellEffectValue heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetEffectInfo(EFFECT_1).CalcValue(GetCaster()));
722 // minimum 7.0% of maximum health.
723 SpellEffectValue pctOfMaxHealth = CalculatePct(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()), caster->GetMaxHealth());
724 heal = std::max(heal, pctOfMaxHealth);
725
727
730
731 if (caster->HasAura(SPELL_DK_FROST))
733 }
734 }
735
740
746};
747
748// 89832 - Death Strike Enabler - SPELL_DK_DEATH_STRIKE_ENABLER
750{
751 // Amount of seconds we calculate damage over
752 constexpr static uint8 LAST_SECONDS = 5;
753
754 bool CheckProc(ProcEventInfo& eventInfo)
755 {
756 return eventInfo.GetDamageInfo() != nullptr;
757 }
758
759 void Update(AuraEffect* /*aurEff*/)
760 {
761 // Move backwards all datas by one from [23][0][0][0][0] -> [0][23][0][0][0]
762 std::move_backward(_damagePerSecond.begin(), std::next(_damagePerSecond.begin(), LAST_SECONDS - 1), _damagePerSecond.end());
763 _damagePerSecond[0] = 0;
764 }
765
766 void HandleCalcAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& canBeRecalculated)
767 {
768 canBeRecalculated = true;
769 amount = std::accumulate(_damagePerSecond.begin(), _damagePerSecond.end(), 0u);
770 }
771
772 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
773 {
774 _damagePerSecond[0] += eventInfo.GetDamageInfo()->GetDamage();
775 }
776
784
785private:
786 std::array<uint32, LAST_SECONDS> _damagePerSecond = { };
787};
788
789// 85948 - Festering Strike
807
808// 195621 - Frost Fever
810{
811 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
812 {
813 return roll_chance(aurEff->GetAmount());
814 }
815
820};
821
822// 47496 - Explode, Ghoul spell for Corpse Explosion
824{
825 bool Validate(SpellInfo const* spellInfo) override
826 {
828 }
829
830 void HandleDamage(SpellEffIndex /*effIndex*/)
831 {
832 SetHitDamage(GetCaster()->CountPctFromMaxHealth(GetEffectInfo(EFFECT_2).CalcValue(GetCaster())));
833 }
834
835 void Suicide(SpellEffIndex /*effIndex*/)
836 {
837 if (Unit* unitTarget = GetHitUnit())
838 {
839 // Corpse Explosion (Suicide)
840 unitTarget->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED, true);
841 }
842 }
843
849};
850
851// 69961 - Glyph of Scourge Strike
853{
855 {
856 Unit* caster = GetCaster();
857 Unit* target = GetHitUnit();
858
860 for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
861 {
862 AuraEffect const* aurEff = *i;
863 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
864 // search our Blood Plague and Frost Fever on target
865 if (spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && spellInfo->SpellFamilyFlags[2] & 0x2 &&
866 aurEff->GetCasterGUID() == caster->GetGUID())
867 {
868 uint32 countMin = aurEff->GetBase()->GetMaxDuration();
869 uint32 countMax = spellInfo->GetMaxDuration();
870
871 // this Glyph
872 countMax += 9000;
873
874 if (countMin < countMax)
875 {
876 aurEff->GetBase()->SetDuration(aurEff->GetBase()->GetDuration() + 3000);
877 aurEff->GetBase()->SetMaxDuration(countMin + 3000);
878 }
879 }
880 }
881 }
882
887};
888
889// Called by 206930 - Heart Strike
914
915// 49184 - Howling Blast
917{
918 bool Validate(SpellInfo const* /*spellInfo*/) override
919 {
921 }
922
927
932};
933
934// Called by 45524 - Chains of Ice
935// 454786 - Ice Prison
937{
938 bool Validate(SpellInfo const* /*spellInfo*/) override
939 {
941 }
942
943 bool Load() override
944 {
946 }
947
955
956 void Register() override
957 {
959 }
960};
961
962// 194878 - Icy Talons
964{
965 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
966 {
967 if (Spell const* procSpell = eventInfo.GetProcSpell())
968 return procSpell->GetPowerTypeCostAmount(POWER_RUNIC_POWER) > 0;
969
970 return false;
971 }
972
977};
978
979// 194879 - Icy Talons
981{
982 bool Validate(SpellInfo const* /*spellInfo*/) override
983 {
985 }
986
988 {
990 target = nullptr;
991 }
992
997};
998
999// 374277 - Improved Death Strike
1027
1028// 206940 - Mark of Blood
1030{
1031 bool Validate(SpellInfo const* /*spellInfo*/) override
1032 {
1034 }
1035
1036 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1037 {
1039 if (Unit* caster = GetCaster())
1040 caster->CastSpell(eventInfo.GetActionTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true);
1041 }
1042
1047};
1048
1049// 207346 - Necrosis
1051{
1052 bool Validate(SpellInfo const* /*spellInfo*/) override
1053 {
1055 }
1056
1057 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1058 {
1061 }
1062
1067};
1068
1069// 207256 - Obliteration
1071{
1077
1078 void HandleProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
1079 {
1080 Unit* target = GetTarget();
1081 target->CastSpell(target, SPELL_DK_KILLING_MACHINE_PROC, aurEff);
1082
1083 if (AuraEffect const* oblitaration = target->GetAuraEffect(SPELL_DK_OBLITERATION, EFFECT_1))
1084 if (roll_chance(oblitaration->GetAmount()))
1085 target->CastSpell(target, SPELL_DK_OBLITERATION_RUNE_ENERGIZE, aurEff);
1086 }
1087
1092};
1093
1094// 207200 - Permafrost
1096{
1097 bool Validate(SpellInfo const* /*spellInfo*/) override
1098 {
1100 }
1101
1102 void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1103 {
1104 CastSpellExtraArgs args(aurEff);
1107 }
1108
1113};
1114
1115// 121916 - Glyph of the Geist (Unholy)
1118{
1119 bool Validate(SpellInfo const* /*spellInfo*/) override
1120 {
1122 }
1123
1124 bool Load() override
1125 {
1126 return GetCaster()->IsPet();
1127 }
1128
1130 {
1131 if (Unit* owner = GetCaster()->GetOwner())
1132 if (owner->HasAura(SPELL_DK_GLYPH_OF_THE_GEIST))
1133 return SPELL_CAST_OK;
1134
1136 }
1137
1142};
1143
1144// 147157 Glyph of the Skeleton (Unholy)
1147{
1148 bool Validate(SpellInfo const* /*spellInfo*/) override
1149 {
1151 }
1152
1154 {
1155 if (Unit* owner = GetCaster()->GetOwner())
1156 if (owner->HasAura(SPELL_DK_GLYPH_OF_THE_SKELETON))
1157 return SPELL_CAST_OK;
1158
1160 }
1161
1166};
1167
1168// 61257 - Runic Power Back on Snare/Root
1171{
1172 bool Validate(SpellInfo const* /*spellInfo*/) override
1173 {
1175 }
1176
1177 bool CheckProc(ProcEventInfo& eventInfo)
1178 {
1179 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1180 if (!spellInfo)
1181 return false;
1182
1183 return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_SNARE))) != 0;
1184 }
1185
1186 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1187 {
1189 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_DK_RUNIC_RETURN, true);
1190 }
1191
1197};
1198
1199// 46584 - Raise Dead
1201{
1202 bool Validate(SpellInfo const* /*spellInfo*/) override
1203 {
1205 }
1206
1207 void HandleDummy(SpellEffIndex /*effIndex*/)
1208 {
1210 GetCaster()->CastSpell(nullptr, spellId, true);
1211 }
1212
1217};
1218
1219// 440002 - Reaper of Souls (attached to 343294 - Soul Reaper)
1221{
1222 bool Validate(SpellInfo const* /*spellInfo*/) override
1223 {
1225 }
1226
1228 {
1229 if (Aura* reaperOfSouls = GetCaster()->GetAura(SPELL_DK_REAPER_OF_SOULS_PROC))
1230 return GetSpell()->m_appliedMods.contains(reaperOfSouls);
1231 return false;
1232 }
1233
1234 void HandleDefault(WorldObject*& target) const
1235 {
1237 target = nullptr;
1238 }
1239
1241 {
1243 PreventHitDefaultEffect(effIndex);
1244 }
1245
1251};
1252
1253// 59057 - Rime
1255{
1256 bool Validate(SpellInfo const* spellInfo) override
1257 {
1258 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } }) && ValidateSpellInfo({ SPELL_DK_FROST_SCYTHE });
1259 }
1260
1261 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
1262 {
1264 if (eventInfo.GetSpellInfo()->Id == SPELL_DK_FROST_SCYTHE)
1265 chance /= 2.f;
1266
1267 return roll_chance(chance);
1268 }
1269
1274};
1275
1276// 343294 - Soul Reaper
1277// 469180 - Soul Reaper
1279{
1280public:
1281 explicit spell_dk_soul_reaper(SpellEffIndex auraEffectIndex, Optional<SpellEffIndex> healthLimitEffectIndex)
1282 : _auraEffectIndex(auraEffectIndex), _healthLimitEffectIndex(healthLimitEffectIndex) { }
1283
1284 bool Validate(SpellInfo const* /*spellInfo*/) override
1285 {
1287 }
1288
1289 void HandleOnTick(AuraEffect const* aurEff) const
1290 {
1291 Unit* target = GetTarget();
1292 Unit* caster = GetCaster();
1293 if (!caster)
1294 return;
1295
1296 if (!_healthLimitEffectIndex || target->GetHealthPct() < GetEffectInfo(*_healthLimitEffectIndex).CalcValue(caster))
1299 .TriggeringAura = aurEff
1300 });
1301 }
1302
1303 void RemoveEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
1304 {
1305 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
1306 return;
1307
1308 Player* caster = Object::ToPlayer(GetCaster());
1309 if (!caster)
1310 return;
1311
1312 if (caster->isHonorOrXPTarget(GetTarget()))
1315 .TriggeringAura = aurEff
1316 });
1317 }
1318
1324
1325private:
1328};
1329
1330// Called by 383312 Abomination Limb and 49576 - Death Grip
1331// 454822 - Subduing Grasp
1360
1361// 374049 - Suppression
1363{
1364 bool CheckProc(ProcEventInfo& eventInfo)
1365 {
1366 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1367 if (!spellInfo)
1368 return false;
1369
1370 return (spellInfo->GetAllEffectsMechanicMask() & MECHANIC_LOSS_CONTROL_MASK) != 0;
1371 }
1372
1377};
1378
1379// 242057 - Rune Empowered
1381{
1382 bool Validate(SpellInfo const* /*spellInfo*/) override
1383 {
1385 }
1386
1387 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& procInfo)
1388 {
1389 Spell const* procSpell = procInfo.GetProcSpell();
1390 if (!procSpell)
1391 return;
1392
1393 Aura* pillarOfFrost = GetTarget()->GetAura(SPELL_DK_PILLAR_OF_FROST);
1394 if (!pillarOfFrost)
1395 return;
1396
1398 // Breath of Sindragosa special case
1399 SpellInfo const* breathOfSindragosa = sSpellMgr->AssertSpellInfo(SPELL_DK_BREATH_OF_SINDRAGOSA, DIFFICULTY_NONE);
1400 if (procSpell->IsTriggeredByAura(breathOfSindragosa))
1401 {
1402 auto powerItr = std::find_if(breathOfSindragosa->PowerCosts.begin(), breathOfSindragosa->PowerCosts.end(),
1403 [](SpellPowerEntry const* power) { return power->PowerType == POWER_RUNIC_POWER && power->PowerPctPerSecond > 0.0f; });
1404 if (powerItr != breathOfSindragosa->PowerCosts.end())
1405 _runicPowerSpent += CalculatePct(GetTarget()->GetMaxPower(POWER_RUNIC_POWER), (*powerItr)->PowerPctPerSecond);
1406 }
1407
1408 if (_runicPowerSpent >= 600)
1409 {
1410 pillarOfFrost->SetDuration(pillarOfFrost->GetDuration() + 1000);
1411 _runicPowerSpent -= 600;
1412 }
1413 }
1414
1419
1421};
1422
1423// 55233 - Vampiric Blood
1425{
1426 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
1427 {
1428 amount = GetUnitOwner()->CountPctFromMaxHealth(amount);
1429 }
1430
1435};
1436
1437// 454851 - Vestigial Shell (attached to 48707 - Anti-Magic Shell)
1439{
1440 bool Validate(SpellInfo const* /*spellInfo*/) override
1441 {
1443 }
1444
1445 bool Load() override
1446 {
1448 }
1449
1450 void HandleAfterCast() const
1451 {
1452 Unit* caster = GetCaster();
1455 .TriggeringSpell = GetSpell()
1456 });
1457 }
1458
1463};
1464
1465// 273953 - Voracious (attached to 49998 - Death Strike)
1467{
1468 bool Validate(SpellInfo const* /*spellInfo*/) override
1469 {
1471 }
1472
1473 bool Load() override
1474 {
1476 }
1477
1478 void HandleHit(SpellEffIndex /*effIndex*/) const
1479 {
1480 Unit* caster = GetCaster();
1483 .TriggeringSpell = GetSpell()
1484 });
1485 }
1486
1491};
1492
1493// 43265 - Death and Decay
1495{
1497
1498 void OnUnitEnter(Unit* unit) override
1499 {
1500 if (unit->GetGUID() != at->GetCasterGuid())
1501 return;
1502
1505
1508 }
1509
1510 void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
1511 {
1512 if (unit->GetGUID() != at->GetCasterGuid())
1513 return;
1514
1515 if (Aura* deathAndDecay = unit->GetAura(SPELL_DK_DEATH_AND_DECAY_INCREASE_TARGETS))
1516 {
1517 if (AuraEffect* const cleavingStrikes = unit->GetAuraEffect(SPELL_DK_CLEAVING_STRIKES, EFFECT_3))
1518 deathAndDecay->SetDuration(cleavingStrikes->GetAmountAsInt());
1519 }
1520
1522 }
1523};
1524
1526{
1529 RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_marrowrend_apply_bone_shield", EFFECT_2);
1530 RegisterSpellScriptWithArgs(spell_dk_apply_bone_shield, "spell_dk_deaths_caress_apply_bone_shield", EFFECT_2);
1570 RegisterSpellScriptWithArgs(spell_dk_soul_reaper, "spell_dk_soul_reaper_reaper_of_souls", EFFECT_0, Optional<SpellEffIndex>());
1577
1579}
AreaTriggerExitReason
Definition AreaTrigger.h:70
@ DIFFICULTY_NONE
Definition DBCEnums.h:936
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
@ MOVEMENTFLAG_FALLING
#define sObjectMgr
Definition ObjectMgr.h:1873
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
bool roll_chance(float chance, PseudoRandomDistributionState &state)
Definition Random.cpp:131
#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
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ CLASS_DEATH_KNIGHT
@ TARGET_UNIT_TARGET_ENEMY
@ TARGET_UNIT_CASTER
@ SPELL_SCHOOL_MASK_MAGIC
@ SPELL_ATTR1_NO_AUTOCAST_AI
@ 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)
@ SPELL_DIRECT_DAMAGE
@ UNIT_STATE_JUMPING
Definition Unit.h:293
@ CR_VERSATILITY_DAMAGE_DONE
Definition Unit.h:359
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:466
Player * ToPlayer()
Definition Object.h:126
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2818
bool isHonorOrXPTarget(Unit const *victim) const
Definition Player.cpp:26295
Unit * GetActionTarget() const
Definition Unit.h:514
Spell const * GetProcSpell() const
Definition Unit.h:527
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
DamageInfo * GetDamageInfo() const
Definition Unit.h:524
Unit * GetActor() const
Definition Unit.h:513
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:590
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:8088
Optional< int32 > GetPowerTypeCostAmount(Powers power) const
Definition Spell.cpp:8093
bool IsTriggeredByAura(SpellInfo const *auraSpellInfo) const
Definition Spell.h:677
UsedSpellMods m_appliedMods
Definition Spell.h:654
Definition Unit.h:647
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:825
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1362
float GetHealthPct() const
Definition Unit.h:808
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:809
uint8 GetClass() const
Definition Unit.h:776
std::forward_list< AuraEffect * > AuraEffectList
Definition Unit.h:664
bool IsPet() const
Definition Unit.h:763
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4622
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10105
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition Unit.cpp:5559
ControlList m_Controlled
Definition Unit.h:1252
uint64 GetMaxHealth() const
Definition Unit.h:801
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4718
bool IsGuardian() const
Definition Unit.h:762
Unit * GetVictim() const
Definition Unit.h:738
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
bool HasUnitMovementFlag(MovementFlags f) const
Definition Unit.h:1761
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
SpellHistory * GetSpellHistory()
Definition Unit.h:1521
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
Unit * GetOwner() const
Definition Object.cpp:1603
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:125
void Register() override
Definition spell_dk.cpp:143
SpellEffectValue absorbPct
Definition spell_dk.cpp:201
void Trigger(AuraEffect *aurEff, DamageInfo &, uint32 &absorbAmount)
Definition spell_dk.cpp:185
void CalculateAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
Definition spell_dk.cpp:174
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:160
void Register() override
Definition spell_dk.cpp:194
spell_dk_apply_bone_shield(SpellEffIndex effIndex)
Definition spell_dk.cpp:211
void Register() override
Definition spell_dk.cpp:229
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:213
void HandleHitTarget(SpellEffIndex) const
Definition spell_dk.cpp:220
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:251
void Register() override
Definition spell_dk.cpp:276
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:271
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:252
SpellCastResult CheckCast()
Definition spell_dk.cpp:262
bool Load() override
Definition spell_dk.cpp:257
void HandleDummy(SpellEffIndex) const
Definition spell_dk.cpp:291
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:286
void Register() override
Definition spell_dk.cpp:306
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition spell_dk.cpp:320
void Register() override
Definition spell_dk.cpp:326
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:315
void Register() override
Definition spell_dk.cpp:371
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:361
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:380
void HandleDummyTick(AuraEffect const *aurEff) const
Definition spell_dk.cpp:385
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:335
void Register() override
Definition spell_dk.cpp:352
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes) const
Definition spell_dk.cpp:340
void HandleProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:414
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:409
void Register() override
Definition spell_dk.cpp:421
static void HandleProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &eventInfo)
Definition spell_dk.cpp:440
void Register() override
Definition spell_dk.cpp:447
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:430
static bool CheckProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &procInfo)
Definition spell_dk.cpp:435
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:458
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:466
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:562
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:510
bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:515
void Register() override
Definition spell_dk.cpp:552
void HandleProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:534
void Register() override
Definition spell_dk.cpp:582
void HandleDummyTick(AuraEffect const *aurEff)
Definition spell_dk.cpp:576
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:591
void Register() override
Definition spell_dk.cpp:604
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:596
void HandleScript(SpellEffIndex effIndex)
Definition spell_dk.cpp:624
SpellCastResult CheckClass()
Definition spell_dk.cpp:613
void Register() override
Definition spell_dk.cpp:631
SpellCastResult CheckCast()
Definition spell_dk.cpp:652
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:641
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:662
void Register() override
Definition spell_dk.cpp:691
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:680
void HandleCalcAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
Definition spell_dk.cpp:685
void HandleCalcAmount(AuraEffect const *, SpellEffectValue &amount, bool &canBeRecalculated)
Definition spell_dk.cpp:766
std::array< uint32, LAST_SECONDS > _damagePerSecond
Definition spell_dk.cpp:786
void Update(AuraEffect *)
Definition spell_dk.cpp:759
bool CheckProc(ProcEventInfo &eventInfo)
Definition spell_dk.cpp:754
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:772
static constexpr uint8 LAST_SECONDS
Definition spell_dk.cpp:752
void TriggerRecentlyUsedDeathStrike()
Definition spell_dk.cpp:736
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:700
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:714
void Register() override
Definition spell_dk.cpp:741
void Register() override
Definition spell_dk.cpp:802
void HandleScriptEffect(SpellEffIndex)
Definition spell_dk.cpp:797
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:792
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo const &) const
Definition spell_dk.cpp:811
void Register() override
Definition spell_dk.cpp:816
void HandleDamage(SpellEffIndex)
Definition spell_dk.cpp:830
bool Validate(SpellInfo const *spellInfo) override
Definition spell_dk.cpp:825
void Suicide(SpellEffIndex)
Definition spell_dk.cpp:835
void Register() override
Definition spell_dk.cpp:844
bool Load() override
Definition spell_dk.cpp:897
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:892
void HandleEnergize(SpellEffIndex)
Definition spell_dk.cpp:902
void Register() override
Definition spell_dk.cpp:909
void HandleFrostFever(SpellEffIndex)
Definition spell_dk.cpp:923
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:918
void Register() override
Definition spell_dk.cpp:928
bool Load() override
Definition spell_dk.cpp:943
void HandleOnHit() const
Definition spell_dk.cpp:948
void Register() override
Definition spell_dk.cpp:956
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:938
void HandleSmotheringOffense(WorldObject *&target) const
Definition spell_dk.cpp:987
void Register() override
Definition spell_dk.cpp:993
bool Validate(SpellInfo const *) override
Definition spell_dk.cpp:982
bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
Definition spell_dk.cpp:965
void Register() override
Definition spell_dk.cpp:973
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
void HandleAfterCast() const
bool Validate(SpellInfo const *) override
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:119
static uint32 const ArmyTransforms[]
Definition spell_dk.cpp:239
@ 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_VESTIGIAL_SHELL_TALENT
Definition spell_dk.cpp:111
@ 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:114
@ 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:113
@ 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
@ SPELL_DK_VESTIGIAL_SHELL
Definition spell_dk.cpp:112
void AddSC_deathknight_spell_scripts()
TriggerCastFlags TriggerFlags
Spell const * TriggeringSpell
AuraEffect const * TriggeringAura
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition Spell.cpp:9646
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
void OnUnitExit(Unit *unit, AreaTriggerExitReason) override
void OnUnitEnter(Unit *unit) override