Core/Spells: Fix runic power gain from Blood Boil

Closes #1718
This commit is contained in:
DrTenma
2011-05-28 03:12:41 +07:00
committed by tobmaps
parent 60f00e4015
commit 0dedf84bd9
3 changed files with 56 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `spell_id` = -48721;
INSERT INTO `spell_script_names` VALUES (-48721,'spell_dk_blood_boil');

View File

@@ -734,10 +734,13 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
case SPELLFAMILY_DEATHKNIGHT:
{
// Blood Boil - bonus for diseased targets
if (m_spellInfo->SpellFamilyFlags[0] & 0x00040000 && unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0, 0x00000002, m_caster->GetGUID()))
if (m_spellInfo->SpellFamilyFlags[0] & 0x00040000)
{
damage += m_damage / 2;
damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)* 0.035f);
if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0, 0x00000002, m_caster->GetGUID()))
{
damage += m_damage / 2;
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.035f);
}
}
break;
}

View File

@@ -33,6 +33,7 @@ enum DeathKnightSpells
DK_SPELL_GHOUL_EXPLODE = 47496,
DISPLAY_GHOUL_CORPSE = 25537,
DK_SPELL_SCOURGE_STRIKE_TRIGGERED = 70890,
DK_SPELL_BLOOD_BOIL_TRIGGERED = 65658,
DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
};
@@ -484,6 +485,52 @@ class spell_dk_spell_deflection : public SpellScriptLoader
}
};
// 48721 Blood Boil
class spell_dk_blood_boil : public SpellScriptLoader
{
public:
spell_dk_blood_boil() : SpellScriptLoader("spell_dk_blood_boil") { }
class spell_dk_blood_boil_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dk_blood_boil_SpellScript);
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_BOIL_TRIGGERED))
return false;
return true;
}
bool Load()
{
_executed = false;
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT;
}
void HandleAfterHit()
{
if (_executed || !GetHitUnit())
return;
_executed = true;
GetCaster()->CastSpell(GetCaster(), DK_SPELL_BLOOD_BOIL_TRIGGERED, true);
}
void Register()
{
AfterHit += SpellHitFn(spell_dk_blood_boil_SpellScript::HandleAfterHit);
}
bool _executed;
};
SpellScript* GetSpellScript() const
{
return new spell_dk_blood_boil_SpellScript();
}
};
// 52284 - Will of the Necropolis
class spell_dk_will_of_the_necropolis : public SpellScriptLoader
{
@@ -560,5 +607,6 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_runic_power_feed();
new spell_dk_scourge_strike();
new spell_dk_spell_deflection();
new spell_dk_blood_boil();
new spell_dk_will_of_the_necropolis();
}