Moved Pain and Suffering (47948) script effect to spell script.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-06 23:03:43 +06:00
parent b63a31f513
commit 2562a4651f
4 changed files with 31 additions and 19 deletions
@@ -22,6 +22,7 @@
*/
#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
enum PriestSpells
{
@@ -30,6 +31,28 @@ enum PriestSpells
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
};
// 47948 Pain and Suffering (proc)
class spell_pri_pain_and_suffering_proc_SpellScript : public SpellScript
{
void HandleEffectScriptEffect(SpellEffIndex effIndex)
{
// Refresh Shadow Word: Pain on target
if (Unit *unitTarget = GetHitUnit())
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetCaster()->GetGUID()))
aur->GetBase()->RefreshDuration();
}
void Register()
{
EffectHandlers += EffectHandlerFn(spell_pri_pain_and_suffering_proc_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript *GetSpellScript_spell_pri_pain_and_suffering_proc()
{
return new spell_pri_pain_and_suffering_proc_SpellScript();
}
class spell_pri_penance_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
@@ -81,6 +104,11 @@ void AddSC_priest_spell_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "spell_pri_pain_and_suffering_proc";
newscript->GetSpellScript = &GetSpellScript_spell_pri_pain_and_suffering_proc;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_pri_penance";
newscript->GetSpellScript = &GetSpellScript_spell_pri_penance;