aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-07-21 13:36:32 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-07-21 13:36:32 +0200
commitef50383811365f302028fbaaa8d7682ef51436bc (patch)
tree5a057783b7fc8e175093d2d28bbf6162f462e35a /src/server/scripts/Spells
parentafc242211caba4eace65abfcd3345ff0478ecbdc (diff)
Core/Spells: Update/Convert priest "Vampiric Embrace" for 4.3.4
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 1976a2c05cf..c83643af29e 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -55,6 +55,7 @@ enum PriestSpells
SPELL_PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH = 107904,
SPELL_PRIEST_SHADOW_WORD_DEATH = 32409,
SPELL_PRIEST_T9_HEALING_2P = 67201,
+ SPELL_PRIEST_VAMPRIC_EMBRACE = 15290,
SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL = 64085,
};
@@ -860,6 +861,78 @@ class spell_pri_shadowform : public SpellScriptLoader
}
};
+// 15286 - Vampiric Embrace
+class spell_pri_vampiric_embrace : public SpellScriptLoader
+{
+ public:
+ spell_pri_vampiric_embrace() : SpellScriptLoader("spell_pri_vampiric_embrace") { }
+
+ class spell_pri_vampiric_embrace_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_vampiric_embrace_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPRIC_EMBRACE))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ // Not proc from Mind Sear
+ return !(eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x80000);
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ int32 self = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()));
+ int32 team = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount() / 2));
+
+ GetTarget()->CastCustomSpell((Unit*)NULL, SPELL_PRIEST_VAMPRIC_EMBRACE, &team, &self, NULL, true, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ DoCheckProc += AuraCheckProcFn(spell_pri_vampiric_embrace_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_pri_vampiric_embrace_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pri_vampiric_embrace_AuraScript();
+ }
+};
+
+// 15290 - Vampiric Embrace (heal)
+class spell_pri_vampiric_embrace_target : public SpellScriptLoader
+{
+ public:
+ spell_pri_vampiric_embrace_target() : SpellScriptLoader("spell_pri_vampiric_embrace_target") { }
+
+ class spell_pri_vampiric_embrace_target_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_vampiric_embrace_target_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& unitList)
+ {
+ unitList.remove(GetCaster());
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_vampiric_embrace_target_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pri_vampiric_embrace_target_SpellScript();
+ }
+};
+
// 34914 - Vampiric Touch
class spell_pri_vampiric_touch : public SpellScriptLoader
{
@@ -921,5 +994,7 @@ void AddSC_priest_spell_scripts()
new spell_pri_renew();
new spell_pri_shadow_word_death();
new spell_pri_shadowform();
+ new spell_pri_vampiric_embrace();
+ new spell_pri_vampiric_embrace_target();
new spell_pri_vampiric_touch();
}