Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
spell_dk.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/*
7 * Scripts for spells with SPELLFAMILY_DEATHKNIGHT and SPELLFAMILY_GENERIC spells used by deathknight players.
8 * Ordered alphabetically using scriptname.
9 * Scriptnames of files in this file should be prefixed with "spell_dk_".
10 */
11
12#include "Player.h"
13#include "ScriptMgr.h"
14#include "SpellScript.h"
15#include "SpellAuraEffects.h"
16
49
50// Gorefiend's Grasp - 108199
52{
53public:
54 spell_dk_gorefiends_grasp() : SpellScriptLoader("spell_dk_gorefiends_grasp") { }
55
57 {
59
61 {
62 if (Player* _player = GetCaster()->ToPlayer())
63 {
64 if (Unit* target = GetHitUnit())
65 {
66 std::list<Unit*> tempList;
67 std::list<Unit*> gripList;
68
69 target->GetAttackableUnitListInRange(tempList, 20.0f);
70
71 for (std::list<Unit*>::iterator itr = tempList.begin(); itr != tempList.end(); ++itr)
72 {
73 Unit* tlist = (*itr);
74
75 if (tlist->GetGUID())
76 if (tlist->GetGUID() == target->GetGUID())
77 continue;
78
79 if (!_player->IsValidAttackTarget(tlist))
80 continue;
81
85 continue;
86
88 continue;
89
90 if (_player->HasVisionObscured(tlist))
91 continue;
92
93 if (!tlist->IsWithinLOSInMap(target))
94 continue;
95
96 gripList.push_back(tlist);
97 }
98
99 for (std::list<Unit*>::iterator itr = gripList.begin(); itr != gripList.end(); ++itr)
100 {
101 Unit* glist = (*itr);
102 glist->CastSpell(target, SPELL_DK_DEATH_GRIP_ONLY_JUMP, true);
103 glist->CombatStart(_player, true);
104 target->CombatStart(_player, true);
105 target->CastSpell(glist, SPELL_DK_GOREFIENDS_GRASP_GRIP_VISUAL, true);
106 }
107 }
108 }
109 }
110
115 };
116
121};
122
123// Called by Death Coil (damage) - 47632, Frost Strike - 49143 and Runic Strike - 56815
124// Runic Empowerment - 81229
126{
127public:
128 spell_dk_runic_empowerment() : SpellScriptLoader("spell_dk_runic_empowerment") { }
129
131 {
133
135 {
136 if (Player* _player = GetCaster()->ToPlayer())
137 {
138 if (_player->HasAura(SPELL_DK_RUNIC_EMPOWERMENT))
139 {
140 if (roll_chance_i(45))
141 {
142 std::set<uint8> runes;
143 for (uint8 i = 0; i < MAX_RUNES; i++)
144 if (_player->GetRuneCooldown(i) == _player->GetRuneBaseCooldown(i))
145 runes.insert(i);
146 if (!runes.empty())
147 {
148 std::set<uint8>::iterator itr = runes.begin();
149 std::advance(itr, std::rand() % (runes.size() - 1));
150 _player->SetRuneCooldown((*itr), 0);
151 _player->ResyncRunes(MAX_RUNES);
152 }
153 }
154 }
155 }
156 }
157
162 };
163
168};
169
170// Called by Death Coil (damage) - 47632, Frost Strike - 49143 and Runic Strike - 56815
171// Runic Corruption - 51462
173{
174public:
175 spell_dk_runic_corruption() : SpellScriptLoader("spell_dk_runic_corruption") { }
176
178 {
180
182 {
183 if (Player* _player = GetCaster()->ToPlayer())
184 {
185 if (AuraEffect* const runicCorruption = _player->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 4068, 0))
186 {
187 if (roll_chance_i(45))
188 {
189 int32 basepoints0 = runicCorruption->GetAmount();
190 if (Aura* aur = _player->GetAura(SPELL_DK_RUNIC_CORRUPTION_REGEN))
191 aur->SetDuration(aur->GetDuration() + 3000);
192 else
193 _player->CastCustomSpell(_player, SPELL_DK_RUNIC_CORRUPTION_REGEN, &basepoints0, NULL, NULL, true);
194 }
195 }
196 }
197 }
198
203 };
204
209};
210
211// Raise Dead - 46584
213{
214public:
215 spell_dk_raise_dead() : SpellScriptLoader("spell_dk_raise_dead") { }
216
218 {
220
221 void HandleDummy(SpellEffIndex /*effIndex*/)
222 {
223 if (Player* _player = GetCaster()->ToPlayer())
224 {
225 if (_player->HasAura(SPELL_DK_MASTER_OF_GHOULS))
226 _player->CastSpell(_player, SPELL_DK_GHOUL_AS_PET, true);
227 else
228 _player->CastSpell(_player, SPELL_DK_GHOUL_AS_GUARDIAN, true);
229 }
230 }
231
236 };
237
242};
243
244// 50462 - Anti-Magic Shell (on raid member)
246{
247public:
248 spell_dk_anti_magic_shell_raid() : SpellScriptLoader("spell_dk_anti_magic_shell_raid") { }
249
251 {
253
255 {
257 return true;
258 }
259
260 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
261 {
263 amount = -1;
264 }
265
266 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
267 {
268 absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
269 }
270
276 private:
278 };
279
284};
285
286// 48707 - Anti-Magic Shell (on self)
288{
289public:
290 spell_dk_anti_magic_shell_self() : SpellScriptLoader("spell_dk_anti_magic_shell_self") { }
291
293 {
295
302
303 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
304 {
305 if (!sSpellMgr->GetSpellInfo(SPELL_DK_RUNIC_POWER_ENERGIZE))
306 return false;
307 return true;
308 }
309
310 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
311 {
313 }
314
315 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
316 {
317 absorbAmount = std::min(CalculatePct(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
318 }
319
320 void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
321 {
322 Unit* target = GetTarget();
323 // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
324 // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power.
325 int32 bp = absorbAmount * 2 / 10;
326 target->CastCustomSpell(target, SPELL_DK_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff);
327 }
328
335 private:
338 };
339
344};
345
346// 50461 - Anti-Magic Zone
348{
349public:
350 spell_dk_anti_magic_zone() : SpellScriptLoader("spell_dk_anti_magic_zone") { }
351
353 {
355
357 {
359 return true;
360 }
361
362 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
363 {
365 return false;
366 return true;
367 }
368
369 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
370 {
371 SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
372 amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
373 if (Player* player = GetCaster()->ToPlayer())
374 amount += int32(2 * player->GetTotalAttackPowerValue(WeaponAttackType::BASE_ATTACK));
375 }
376
377 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
378 {
379 absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
380 }
381
387 private:
389 };
390
395};
396
397// 50453 - Bloodworms Health Leech
399{
400public:
401 spell_dk_blood_gorged() : SpellScriptLoader("spell_dk_blood_gorged") { }
402
404 {
406
407 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
408 {
409 if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL))
410 return false;
411 return true;
412 }
413
415 {
416 _procTarget = NULL;
417 return true;
418 }
419
420 bool CheckProc(ProcEventInfo& /*eventInfo*/)
421 {
423 return _procTarget;
424 }
425
426 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
427 {
428 int32 heal = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 150));
430 }
431
437
438 private:
440 };
441
446};
447
448// 47541, 52375, 59134, -62900 - Death Coil
450{
451public:
452 spell_dk_death_coil() : SpellScriptLoader("spell_dk_death_coil") { }
453
455 {
457
458 bool Validate(SpellInfo const* /*spell*/) OVERRIDE
459 {
460 if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_HEAL))
461 return false;
462 return true;
463 }
464
465 void HandleDummy(SpellEffIndex /*effIndex*/)
466 {
467 int32 damage = GetEffectValue();
468 Unit* caster = GetCaster();
469 if (Unit* target = GetHitUnit())
470 {
471 if (caster->IsFriendlyTo(target))
472 {
473 int32 bp = int32(damage * 1.5f);
474 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, NULL, NULL, true);
475 }
476 else
477 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true);
478 }
479 }
480
482 {
483 Unit* caster = GetCaster();
484 if (Unit* target = GetExplTargetUnit())
485 {
486 if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
488
489 if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
491 }
492 else
494
496 }
497
503 };
504
509};
510
511// 52751 - Death Gate
551
552// 49560 - Death Grip
554{
555public:
556 spell_dk_death_grip() : SpellScriptLoader("spell_dk_death_grip") { }
557
559 {
561
562 void HandleDummy(SpellEffIndex /*effIndex*/)
563 {
564 int32 damage = GetEffectValue();
565 Position const* pos = GetExplTargetDest();
566 if (Unit* target = GetHitUnit())
567 {
568 if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence
569 target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true);
570 }
571 }
572
577 };
578
583};
584
585// 48743 - Death Pact
587{
588public:
589 spell_dk_death_pact() : SpellScriptLoader("spell_dk_death_pact") { }
590
592 {
594
596 {
597 // Check if we have valid targets, otherwise skip spell casting here
598 if (Player* player = GetCaster()->ToPlayer())
599 for (Unit::ControlList::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
600 if (Creature* undeadPet = (*itr)->ToCreature())
601 if (undeadPet->IsAlive() &&
602 undeadPet->GetOwnerGUID() == player->GetGUID() &&
603 undeadPet->GetCreatureType() == CREATURE_TYPE_UNDEAD &&
604 undeadPet->IsWithinDist(player, 100.0f, false))
606
608 }
609
610 void FilterTargets(std::list<WorldObject*>& targetList)
611 {
612 Unit* target = NULL;
613 for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
614 {
615 if (Unit* unit = (*itr)->ToUnit())
616 if (unit->GetOwnerGUID() == GetCaster()->GetGUID() && unit->GetCreatureType() == CREATURE_TYPE_UNDEAD)
617 {
618 target = unit;
619 break;
620 }
621 }
622
623 targetList.clear();
624 if (target)
625 targetList.push_back(target);
626 }
627
633 };
634
639};
640
641// 49998 - Death Strike
643{
644public:
645 spell_dk_death_strike() : SpellScriptLoader("spell_dk_death_strike") { }
646
648 {
650
651 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
652 {
653 if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_ENABLER) ||
654 !sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_HEAL) ||
657 return false;
658 return true;
659 }
660
661 void HandleDummy(SpellEffIndex /*effIndex*/)
662 {
663 if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID()))
664 {
665 // Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method
666 int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier);
667
668 if (AuraEffect const* aurEff = GetCaster()->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_DEATH_STRIKE, EFFECT_2))
669 heal = AddPct(heal, aurEff->GetAmount());
670
671 heal = std::max(heal, int32(GetCaster()->CountPctFromMaxHealth(GetEffectValue())));
673 }
674
675 if (!GetCaster()->HasAura(SPELL_DK_BLOOD_PRESENCE))
676 return;
677
678 if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_DK_BLOOD_SHIELD_MASTERY, EFFECT_0))
679 GetCaster()->CastCustomSpell(SPELL_DK_BLOOD_SHIELD_ABSORB, SPELLVALUE_BASE_POINT0, GetCaster()->CountPctFromMaxHealth(aurEff->GetAmount()), GetCaster());
680 }
681
686 };
687
692};
693
694// 89832 - Death Strike (Save damage taken in last 5 sec)
696{
697public:
698 spell_dk_death_strike_enabler() : SpellScriptLoader("spell_dk_death_strike_enabler") { }
699
701 {
703
705 {
706 for (uint8 i = 0; i < 5; ++i)
707 _damagePerSecond[i] = 0;
708 return true;
709 }
710
711 bool CheckProc(ProcEventInfo& eventInfo)
712 {
713 return eventInfo.GetDamageInfo();
714 }
715
716 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
717 {
718 if (!GetUnitOwner()->HasAura(SPELL_DK_BLOOD_PRESENCE))
719 {
720 for (uint8 i = 0; i < 5; ++i)
721 _damagePerSecond[i] = 0;
722 }
723 else
724 _damagePerSecond[0] += eventInfo.GetDamageInfo()->GetDamage();
725 }
726
727 // Cheap hack to have update calls
728 void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
729 {
730 isPeriodic = true;
731 amplitude = 1000;
732 }
733
734 void Update(AuraEffect* /*aurEff*/)
735 {
736 // Move backwards all datas by one
737 for (uint8 i = 4; i > 0; --i)
739 _damagePerSecond[0] = 0;
740 }
741
742 void HandleCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
743 {
744 canBeRecalculated = true;
745 amount = 0;
746 for (uint8 i = 0; i < 5; ++i)
747 amount += int32(_damagePerSecond[i]);
748 }
749
758 private:
760 };
761
766};
767
768// 47496 - Explode, Ghoul spell for Corpse Explosion
770{
771public:
772 spell_dk_ghoul_explode() : SpellScriptLoader("spell_dk_ghoul_explode") { }
773
775 {
777
778 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
779 {
781 return false;
782 return true;
783 }
784
785 void Suicide(SpellEffIndex /*effIndex*/)
786 {
787 if (Unit* unitTarget = GetHitUnit())
788 {
789 // Corpse Explosion (Suicide)
790 unitTarget->CastSpell(unitTarget, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED, true);
791 }
792 }
793
798 };
799
804};
805
806// 48792 - Icebound Fortitude
808{
809public:
810 spell_dk_icebound_fortitude() : SpellScriptLoader("spell_dk_icebound_fortitude") { }
811
813 {
815
817 {
818 Unit* caster = GetCaster();
819 return caster && caster->GetTypeId() == TypeID::TYPEID_PLAYER;
820 }
821
822 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
823 {
824 if (Unit* caster = GetCaster())
825 {
826 int32 value = amount;
827 uint32 defValue = uint32(caster->ToPlayer()->GetSkillValue(SKILL_DEFENSE) + caster->ToPlayer()->GetRatingBonusValue(CombatRating::CR_DEFENSE_SKILL));
828
829 if (defValue > 400)
830 value -= int32((defValue - 400) * 0.15);
831
832 // Glyph of Icebound Fortitude
833 if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE, EFFECT_0))
834 {
835 int32 valMax = -aurEff->GetAmount();
836 if (value > valMax)
837 value = valMax;
838 }
839 amount = value;
840 }
841 }
842
847 };
848
853};
854
855// 73975 - Necrotic Strike
857{
858public:
859 spell_dk_necrotic_strike() : SpellScriptLoader("spell_dk_necrotic_strike") { }
860
862 {
864
865 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
866 {
867 if (Unit* caster = GetCaster())
868 amount = int32(caster->GetTotalAttackPowerValue(WeaponAttackType::BASE_ATTACK) * 0.7f);
869 }
870
875 };
876
881};
882
883// 59754 Rune Tap - Party
909
910// 50421 - Scent of Blood
912{
913public:
914 spell_dk_scent_of_blood() : SpellScriptLoader("spell_dk_scent_of_blood") { }
915
917 {
919
920 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
921 {
922 if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD))
923 return false;
924 return true;
925 }
926
927 void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
928 {
930 GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff);
932 }
933
938 };
939
944};
945
946// 55090 - Scourge Strike
948{
949public:
950 spell_dk_scourge_strike() : SpellScriptLoader("spell_dk_scourge_strike") { }
951
953 {
955
957 {
958 multiplier = 1.0f;
959 return true;
960 }
961
962 bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
963 {
964 if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCOURGE_STRIKE_TRIGGERED) ||
966 return false;
967 return true;
968 }
969
970 void HandleDummy(SpellEffIndex /*effIndex*/)
971 {
972 Unit* caster = GetCaster();
973 if (Unit* unitTarget = GetHitUnit())
974 {
975 multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f);
976 // Death Knight T8 Melee 4P Bonus
978 AddPct(multiplier, aurEff->GetAmount());
979 }
980 }
981
983 {
984 Unit* caster = GetCaster();
985 if (Unit* unitTarget = GetHitUnit())
986 {
988 caster->CastCustomSpell(unitTarget, SPELL_DK_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
989 }
990 }
991
997 private:
998 float multiplier = 0.0f;
999 };
1000
1005};
1006
1007// 55233 - Vampiric Blood
1009{
1010public:
1011 spell_dk_vampiric_blood() : SpellScriptLoader("spell_dk_vampiric_blood") { }
1012
1027
1029 {
1031 }
1032};
1033
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TYPEID_PLAYER
Definition Object.h:55
#define MAX_RUNES
Definition Player.h:476
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_CASTER_AREA_PARTY
@ CREATURE_TYPE_UNDEAD
@ CLASS_DEATH_KNIGHT
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT
@ SKILL_DEFENSE
SpellCastResult
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_INCREASE_HEALTH
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_DEFLECT_SPELLS
@ SPELL_AURA_SCHOOL_ABSORB
#define sSpellMgr
Definition SpellMgr.h:744
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectCalcPeriodicFn(F, I, N)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
@ SPELLVALUE_BASE_POINT0
Definition Unit.h:114
@ CR_DEFENSE_SKILL
Definition Unit.h:582
@ UNIT_FLAG_STUNNED
Definition Unit.h:643
@ UNIT_FLAG_PACIFIED
Definition Unit.h:642
@ UNIT_FLAG_DISABLE_MOVE
Definition Unit.h:627
@ UNIT_FIELD_FLAGS
bool roll_chance_i(int chance)
Definition Util.h:89
T AddPct(T &base, U pct)
Definition Util.h:109
T CalculatePct(T base, U pct)
Definition Util.h:103
void PreventDefaultAction()
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectAbsorbHandler > AfterEffectAbsorb
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
HookList< EffectAbsorbHandler > OnEffectAbsorb
Unit * GetTarget() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
uint32 GetId() const
uint32 GetDamage() const
Definition Unit.h:923
uint64 GetGUID() const
Definition Object.h:119
TypeID GetTypeId() const
Definition Object.h:131
Creature * ToCreature()
Definition Object.h:207
bool HasFlag(uint16 index, uint32 flag) const
Definition Object.cpp:1309
Unit * ToUnit()
Definition Object.h:210
DamageInfo * GetDamageInfo() const
Definition Unit.h:985
int32 CalcValue(Unit const *caster=NULL, int32 const *basePoints=NULL, Unit const *target=NULL) const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
Definition SpellInfo.h:255
Unit * GetExplTargetUnit()
HookList< CheckCastHandler > OnCheckCast
WorldLocation const * GetExplTargetDest()
HookList< HitHandler > AfterHit
SpellInfo const * GetSpellInfo()
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
HookList< EffectHandler > OnEffectHitTarget
Unit * GetHitUnit()
int32 GetEffectValue()
void SetCustomCastResultMessage(SpellCustomErrors result)
Unit * GetCaster()
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
int32 GetHitDamage()
SpellScriptLoader(const char *name)
Definition Unit.h:1367
Unit * GetOwner() const
Definition Unit.cpp:2339
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void CombatStart(Unit *target, bool initialAggro=true)
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo) const
Definition Unit.cpp:3456
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
bool IsFriendlyTo(Unit const *unit) const
Definition Unit.cpp:2283
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1633
bool isInFront(WorldObject const *target, float arc=M_PI) const
Definition Object.cpp:1940
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition Object.cpp:1656
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
Definition spell_dk.cpp:266
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_dk.cpp:260
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:280
void Trigger(AuraEffect *aurEff, DamageInfo &, uint32 &absorbAmount)
Definition spell_dk.cpp:320
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_dk.cpp:310
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
Definition spell_dk.cpp:315
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:340
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
Definition spell_dk.cpp:377
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_dk.cpp:369
PrepareAuraScript(spell_dk_anti_magic_zone_AuraScript)
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:391
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:426
PrepareAuraScript(spell_dk_blood_gorged_AuraScript)
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:442
PrepareSpellScript(spell_dk_death_coil_SpellScript)
bool Validate(SpellInfo const *) OVERRIDE
Definition spell_dk.cpp:458
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:505
PrepareSpellScript(spell_dk_death_gate_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:546
PrepareSpellScript(spell_dk_death_grip_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:579
PrepareSpellScript(spell_dk_death_pact_SpellScript)
void FilterTargets(std::list< WorldObject * > &targetList)
Definition spell_dk.cpp:610
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:635
PrepareSpellScript(spell_dk_death_strike_SpellScript)
void HandleCalcAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
Definition spell_dk.cpp:742
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
Definition spell_dk.cpp:716
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &amplitude)
Definition spell_dk.cpp:728
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:762
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:688
PrepareSpellScript(spell_dk_ghoul_explode_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:800
PrepareSpellScript(spell_dk_gorefiends_grasp_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:117
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_dk.cpp:822
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:849
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_dk.cpp:865
PrepareAuraScript(spell_dk_necrotic_strike_AuraScript)
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:877
PrepareSpellScript(spell_dk_raise_dead_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:238
void CheckTargets(std::list< WorldObject * > &targets)
Definition spell_dk.cpp:893
PrepareSpellScript(spell_dk_rune_tap_party_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:904
PrepareSpellScript(spell_dk_runic_corruption_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:205
PrepareSpellScript(spell_dk_runic_empowerment_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
Definition spell_dk.cpp:164
void OnProc(AuraEffect const *aurEff, ProcEventInfo &)
Definition spell_dk.cpp:927
PrepareAuraScript(spell_dk_scent_of_blood_AuraScript)
AuraScript * GetAuraScript() const OVERRIDE
Definition spell_dk.cpp:940
PrepareSpellScript(spell_dk_scourge_strike_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
PrepareAuraScript(spell_dk_vampiric_blood_AuraScript)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
AuraScript * GetAuraScript() const OVERRIDE
DeathKnightSpells
Definition pet_dk.cpp:20
@ SPELL_DK_RUNE_TAP
Definition spell_dk.cpp:44
@ SPELL_DK_GHOUL_EXPLODE
Definition spell_dk.cpp:33
@ SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE
Definition spell_dk.cpp:36
@ SPELL_DK_GHOUL_AS_PET
Definition spell_dk.cpp:35
@ SPELL_DK_FROST_PRESENCE
Definition spell_dk.cpp:32
@ SPELL_DK_GHOUL_AS_GUARDIAN
Definition spell_dk.cpp:34
@ SPELL_DK_ANTI_MAGIC_SHELL_TALENT
Definition spell_dk.cpp:19
@ SPELL_DK_CORPSE_EXPLOSION_VISUAL
Definition spell_dk.cpp:26
@ SPELL_DK_SCOURGE_STRIKE_TRIGGERED
Definition spell_dk.cpp:46
@ SPELL_DK_BLOOD_GORGED_HEAL
Definition spell_dk.cpp:21
@ SPELL_DK_MASTER_OF_GHOULS
Definition spell_dk.cpp:40
@ SPELL_DK_RUNIC_EMPOWERMENT
Definition spell_dk.cpp:42
@ SPELL_DK_BLOOD_SHIELD_ABSORB
Definition spell_dk.cpp:24
@ SPELL_DK_IMPROVED_DEATH_STRIKE
Definition spell_dk.cpp:38
@ SPELL_DK_DEATH_COIL_HEAL
Definition spell_dk.cpp:28
@ SPELL_DK_GOREFIENDS_GRASP_GRIP_VISUAL
Definition spell_dk.cpp:37
@ SPELL_DK_BLOOD_SHIELD_MASTERY
Definition spell_dk.cpp:23
@ SPELL_DK_DEATH_STRIKE_HEAL
Definition spell_dk.cpp:30
@ SPELL_DK_RUNIC_POWER_ENERGIZE
Definition spell_dk.cpp:43
@ SPELL_DK_RUNIC_CORRUPTION_REGEN
Definition spell_dk.cpp:41
@ SPELL_DK_ITEM_T8_MELEE_4P_BONUS
Definition spell_dk.cpp:39
@ SPELL_DK_DEATH_GRIP_ONLY_JUMP
Definition spell_dk.cpp:29
@ SPELL_DK_SCENT_OF_BLOOD
Definition spell_dk.cpp:45
@ SPELL_DK_DEATH_STRIKE_ENABLER
Definition spell_dk.cpp:31
@ SPELL_DK_UNHOLY_PRESENCE
Definition spell_dk.cpp:47
@ SPELL_DK_BLOOD_PRESENCE
Definition spell_dk.cpp:22
@ SPELL_DK_DEATH_COIL_DAMAGE
Definition spell_dk.cpp:27
@ SPELL_DK_CORPSE_EXPLOSION_TRIGGERED
Definition spell_dk.cpp:25
void AddSC_deathknight_spell_scripts()
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329