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

--HG--
branch : trunk
This commit is contained in:
azazel committed 2010-08-06 23:03:43 +06:00
1 parent b63a31f513
commit 2562a4651f
4 files changed
+31 -19

No files matched your search

+1
View File
@@ -14731,6 +14731,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 31231, 'spell_rog_cheat_death'),
( 51662, 'spell_rog_hunger_for_blood'),
-- priest
( 47948, 'spell_pri_pain_and_suffering_proc'),
(-47540, 'spell_pri_penance'),
-- death knight
-- shaman
@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=47948 AND `ScriptName`='spell_pri_pain_and_suffering_proc';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (47948, 'spell_pri_pain_and_suffering_proc');
-19
View File
@@ -5928,25 +5928,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
break;
}
case SPELLFAMILY_PRIEST:
{
switch(m_spellInfo->Id)
{
// Pain and Suffering
case 47948:
{
if (!unitTarget)
return;
// Refresh Shadow Word: Pain on target
if (AuraEffect * aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, m_caster->GetGUID()))
aur->GetBase()->RefreshDuration();
return;
}
default:
break;
}
break;
}
case SPELLFAMILY_HUNTER:
{
switch(m_spellInfo->Id)
@@ -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;