diff options
-rw-r--r-- | sql/updates/world/2012_06_18_01_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 34 |
2 files changed, 34 insertions, 3 deletions
diff --git a/sql/updates/world/2012_06_18_01_world_spell_script_names.sql b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql new file mode 100644 index 00000000000..5f227a887d7 --- /dev/null +++ b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 23880; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(23880, 'spell_warr_bloodthirst_heal'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 0ba5c866d63..f1276c24a75 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -184,9 +184,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); - + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; @@ -405,7 +405,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } }; @@ -415,6 +415,33 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +class spell_warr_bloodthirst_heal : public SpellScriptLoader +{ +public: + spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } + + class spell_warr_bloodthirst_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); + + void HandleHeal(SpellEffIndex /* effIndex */) + { + if (GetTriggeringSpell()) + SetHitHeal(CalculatePctN(GetCaster()->GetMaxHealth(),GetTriggeringSpell()->Effects[EFFECT_1].CalcValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_bloodthirst_heal_SpellScript(); + } +}; + enum Overpower { SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, @@ -472,4 +499,5 @@ void AddSC_warrior_spell_scripts() new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); new spell_warr_overpower(); + new spell_warr_bloodthirst_heal(); } |