diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2015-01-27 17:44:24 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2015-01-27 17:44:24 +0100 |
| commit | 34bbf031c04916b104432dc6e5d12b5ab05c4833 (patch) | |
| tree | 48c678901ffbb318242d40a4e2a10413c81c4a27 /src/server/scripts | |
| parent | b9e435631db3ec4770bd7a61916e14f3e6267a1b (diff) | |
| parent | 870d50648f1fff4a53172f2dafb204c62d42e06b (diff) | |
Merge pull request #13960 from Unholychick/6.x
Scripts/Spells: Fix some faulty code in spell_dk.cpp
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 00071c4804e..a3d3eee8d6d 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -658,11 +658,7 @@ class spell_dk_festering_strike : public SpellScriptLoader { PrepareSpellScript(spell_dk_festering_strike_SpellScript); - public: - spell_dk_festering_strike_SpellScript() { } - - private: - bool Validate(SpellInfo const* spellInfo) override + bool Validate(SpellInfo const* /*spellInfo*/) override { if (!sSpellMgr->GetSpellInfo(SPELL_DK_FROST_FEVER) || !sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PLAGUE) || !sSpellMgr->GetSpellInfo(SPELL_DK_CHAINS_OF_ICE)) return false; @@ -760,7 +756,8 @@ class spell_dk_glyph_of_deaths_embrace : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return (GetTarget()->GetCreatureType() == CREATURE_TYPE_UNDEAD && GetTarget()->GetOwner()); + Unit* actionTarget = eventInfo.GetActionTarget(); + return actionTarget && actionTarget->GetCreatureType() == CREATURE_TYPE_UNDEAD && actionTarget->GetOwner(); } void Register() override @@ -793,6 +790,11 @@ class spell_dk_glyph_of_runic_power : public SpellScriptLoader return true; } + bool Load() override + { + return GetUnitOwner()->getClass() == CLASS_DEATH_KNIGHT; + } + bool CheckProc(ProcEventInfo& eventInfo) { return eventInfo.GetSpellInfo() && (eventInfo.GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_SNARE | 1 << MECHANIC_ROOT | 1 << MECHANIC_FREEZE)); @@ -801,8 +803,7 @@ class spell_dk_glyph_of_runic_power : public SpellScriptLoader void HandleProc(ProcEventInfo& eventInfo) { if (Unit* target = eventInfo.GetProcTarget()) - if (target->getClass() == CLASS_DEATH_KNIGHT) - target->CastSpell(target, SPELL_DK_GLYPH_OF_RUNIC_POWER_TRIGGERED, true); + target->CastSpell(target, SPELL_DK_GLYPH_OF_RUNIC_POWER_TRIGGERED, true); } void Register() override @@ -1075,19 +1076,23 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader { PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + bool Validate(SpellInfo const* spellInfo) override { if (!sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS)) return false; + if (!spellInfo->GetEffect(EFFECT_0)) + return false; return true; } bool CheckProc(ProcEventInfo& eventInfo) { - if (GetTarget()->HasAura(SPELL_DK_WILL_OF_THE_NECROPOLIS)) + Unit* target = GetTarget(); + + if (target->HasAura(SPELL_DK_WILL_OF_THE_NECROPOLIS)) return false; - return GetTarget()->HealthBelowPctDamaged(30, eventInfo.GetDamageInfo()->GetDamage()); + return target->HealthBelowPctDamaged(GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(target), eventInfo.GetDamageInfo()->GetDamage()); } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) |
