Convert spell scripts to new system.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-06 11:35:39 -07:00
parent 5a345eeade
commit 14459bc467
10 changed files with 523 additions and 528 deletions
-7
View File
@@ -25,12 +25,5 @@
void AddSC_deathknight_spell_scripts()
{
//Script *newscript;
/*
newscript = new Script;
newscript->Name = "spell_dk_";
newscript->GetSpellScript = &GetSpellScript_spell_dk_;
newscript->RegisterSelf();
*/
}
@@ -25,12 +25,5 @@
void AddSC_druid_spell_scripts()
{
//Script *newscript;
/*
newscript = new Script;
newscript->Name = "spell_dru_";
newscript->GetSpellScript = &GetSpellScript_spell_dru_;
newscript->RegisterSelf();
*/
}
+5 -5
View File
@@ -252,9 +252,9 @@ class spell_hun_pet_carrion_feeder : public SpellHandlerScript
void AddSC_hunter_spell_scripts()
{
new spell_hun_last_stand_pet();
new spell_hun_masters_call();
new spell_hun_readiness();
new spell_hun_pet_heart_of_the_phoenix();
new spell_hun_pet_carrion_feeder();
new spell_hun_last_stand_pet;
new spell_hun_masters_call;
new spell_hun_readiness;
new spell_hun_pet_heart_of_the_phoenix;
new spell_hun_pet_carrion_feeder;
}
+39 -34
View File
@@ -37,8 +37,13 @@ enum MageSpells
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907,
};
class spell_mage_cold_snap_SpellScript : public SpellScript
class spell_mage_cold_snap : public SpellHandlerScript
{
public:
spell_mage_cold_snap() : SpellHandlerScript("spell_mage_cold_snap") { }
class spell_mage_cold_snap_SpellScript : public SpellScript
{
void HandleDummy(SpellEffIndex effIndex)
{
Unit *caster = GetCaster();
@@ -68,15 +73,21 @@ class spell_mage_cold_snap_SpellScript : public SpellScript
// add dummy effect spell handler to Cold Snap
EffectHandlers += EffectHandlerFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mage_cold_snap_SpellScript();
}
};
SpellScript * GetSpellScript_spell_mage_cold_snap()
class spell_mage_polymorph_cast_visual : public SpellHandlerScript
{
return new spell_mage_cold_snap_SpellScript();
}
public:
spell_mage_polymorph_cast_visual() : SpellHandlerScript("spell_mage_polymorph_visual") { }
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
static const uint32 spell_list[6];
bool Validate(SpellEntry const * spellEntry)
@@ -100,25 +111,31 @@ class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
// add dummy effect spell handler to Polymorph visual
EffectHandlers += EffectHandlerFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
const uint32 spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] =
{
const uint32 spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] =
{
SPELL_MAGE_SQUIRREL_FORM,
SPELL_MAGE_GIRAFFE_FORM,
SPELL_MAGE_SERPENT_FORM,
SPELL_MAGE_DRAGONHAWK_FORM,
SPELL_MAGE_WORGEN_FORM,
SPELL_MAGE_SHEEP_FORM
};
SpellScript* GetSpellScript() const
{
return new spell_mage_polymorph_cast_visual_SpellScript();
}
};
SpellScript * GetSpellScript_spell_mage_polymorph_visual()
class spell_mage_summon_water_elemental : public SpellHandlerScript
{
return new spell_mage_polymorph_cast_visual_SpellScript();
}
public:
spell_mage_summon_water_elemental() : SpellHandlerScript("spell_mage_summon_water_elemental") { }
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
@@ -147,29 +164,17 @@ class spell_mage_summon_water_elemental_SpellScript : public SpellScript
// add dummy effect spell handler to Summon Water Elemental
EffectHandlers += EffectHandlerFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
SpellScript * GetSpellScript_spell_mage_summon_water_elemental()
{
SpellScript * GetSpellScript() const
{
return new spell_mage_summon_water_elemental_SpellScript();
}
}
};
void AddSC_mage_spell_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "spell_mage_cold_snap";
newscript->GetSpellScript = &GetSpellScript_spell_mage_cold_snap;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_mage_polymorph_visual";
newscript->GetSpellScript = &GetSpellScript_spell_mage_polymorph_visual;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_mage_summon_water_elemental";
newscript->GetSpellScript = &GetSpellScript_spell_mage_summon_water_elemental;
newscript->RegisterSelf();
new spell_mage_cold_snap;
new spell_mage_polymorph_cast_visual;
new spell_mage_summon_water_elemental;
}
+36 -31
View File
@@ -35,8 +35,13 @@ enum PaladinSpells
SPELL_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
};
class spell_pal_blessing_of_faith_SpellScript : public SpellScript
class spell_pal_blessing_of_faith : public SpellHandlerScript
{
public:
spell_pal_blessing_of_faith() : SpellHandlerScript("spell_pal_blessing_of_faith") { }
class spell_pal_blessing_of_faith_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
@@ -73,15 +78,21 @@ class spell_pal_blessing_of_faith_SpellScript : public SpellScript
// add dummy effect spell handler to Blessing of Faith
EffectHandlers += EffectHandlerFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_pal_blessing_of_faith_SpellScript();
}
};
SpellScript * GetSpellScript_spell_pal_blessing_of_faith()
class spell_pal_holy_shock : public SpellHandlerScript
{
return new spell_pal_blessing_of_faith_SpellScript();
}
public:
spell_pal_holy_shock() : SpellHandlerScript("spell_pal_holy_shock") { }
class spell_pal_holy_shock_SpellScript : public SpellScript
{
class spell_pal_holy_shock_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
@@ -120,15 +131,21 @@ class spell_pal_holy_shock_SpellScript : public SpellScript
// add dummy effect spell handler to Holy Shock
EffectHandlers += EffectHandlerFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_pal_holy_shock_SpellScript();
}
};
SpellScript * GetSpellScript_spell_pal_holy_shock()
class spell_pal_judgement_of_command : public SpellHandlerScript
{
return new spell_pal_holy_shock_SpellScript();
}
public:
spell_pal_judgement_of_command() : SpellHandlerScript("spell_pal_judgement_of_command") { }
class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
void HandleDummy(SpellEffIndex effIndex)
{
if (Unit *unitTarget = GetHitUnit())
@@ -141,29 +158,17 @@ class spell_pal_judgement_of_command_SpellScript : public SpellScript
// add dummy effect spell handler to Judgement of Command
EffectHandlers += EffectHandlerFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
SpellScript * GetSpellScript_spell_pal_judgement_of_command()
{
SpellScript *GetSpellScript() const
{
return new spell_pal_judgement_of_command_SpellScript();
}
}
};
void AddSC_paladin_spell_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "spell_pal_blessing_of_faith";
newscript->GetSpellScript = &GetSpellScript_spell_pal_blessing_of_faith;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_pal_holy_shock";
newscript->GetSpellScript = &GetSpellScript_spell_pal_holy_shock;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_pal_judgement_of_command";
newscript->GetSpellScript = &GetSpellScript_spell_pal_judgement_of_command;
newscript->RegisterSelf();
new spell_pal_blessing_of_faith;
new spell_pal_holy_shock;
new spell_pal_judgement_of_command;
}
+26 -23
View File
@@ -31,9 +31,14 @@ enum PriestSpells
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
};
// 47948 Pain and Suffering (proc)
class spell_pri_pain_and_suffering_proc_SpellScript : public SpellScript
class spell_pri_pain_and_suffering_proc : public SpellHandlerScript
{
public:
spell_pri_pain_and_suffering_proc() : SpellHandlerScript("spell_pri_pain_and_suffering_proc") { }
// 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
@@ -46,15 +51,21 @@ class spell_pri_pain_and_suffering_proc_SpellScript : public SpellScript
{
EffectHandlers += EffectHandlerFn(spell_pri_pain_and_suffering_proc_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript *GetSpellScript() const
{
return new spell_pri_pain_and_suffering_proc_SpellScript;
}
};
SpellScript *GetSpellScript_spell_pri_pain_and_suffering_proc()
class spell_pri_penance : public SpellHandlerScript
{
return new spell_pri_pain_and_suffering_proc_SpellScript();
}
public:
spell_pri_penance() : SpellHandlerScript("spell_pri_penance") { }
class spell_pri_penance_SpellScript : public SpellScript
{
class spell_pri_penance_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1))
@@ -93,24 +104,16 @@ class spell_pri_penance_SpellScript : public SpellScript
// add dummy effect spell handler to Penance
EffectHandlers += EffectHandlerFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
SpellScript *GetSpellScript_spell_pri_penance()
{
return new spell_pri_penance_SpellScript();
}
SpellScript *GetSpellScript() const
{
return new spell_pri_penance_SpellScript;
}
};
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;
newscript->RegisterSelf();
new spell_pri_pain_and_suffering_proc;
new spell_pri_penance;
}
+48 -41
View File
@@ -31,8 +31,13 @@ enum RogueSpells
ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819,
};
class spell_rog_cheat_death_SpellScript : public SpellScript
class spell_rog_cheat_death : public SpellHandlerScript
{
public:
spell_rog_cheat_death() : SpellHandlerScript("spell_rog_cheat_death") { }
class spell_rog_cheat_death_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_CHEATING_DEATH))
@@ -51,15 +56,21 @@ class spell_rog_cheat_death_SpellScript : public SpellScript
// add dummy effect spell handler to Cheat Death
EffectHandlers += EffectHandlerFn(spell_rog_cheat_death_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_rog_cheat_death_SpellScript;
}
};
SpellScript *GetSpellScript_spell_rog_cheat_death()
class spell_rog_hunger_for_blood : public SpellHandlerScript
{
return new spell_rog_cheat_death_SpellScript();
}
public:
spell_rog_hunger_for_blood() : SpellHandlerScript("spell_rog_hunger_for_blood") { }
class spell_rog_hunger_for_blood_SpellScript : public SpellScript
{
class spell_rog_hunger_for_blood_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_HUNGER_FOR_BLOOD_BUFF))
@@ -78,15 +89,21 @@ class spell_rog_hunger_for_blood_SpellScript : public SpellScript
// add dummy effect spell handler to Hunger for Blood
EffectHandlers += EffectHandlerFn(spell_rog_hunger_for_blood_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_rog_hunger_for_blood_SpellScript();
}
};
SpellScript *GetSpellScript_spell_rog_hunger_for_blood()
class spell_rog_preparation : public SpellHandlerScript
{
return new spell_rog_hunger_for_blood_SpellScript();
}
public:
spell_rog_preparation() : SpellHandlerScript("spell_rog_preparation") { }
class spell_rog_preparation_SpellScript : public SpellScript
{
class spell_rog_preparation_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_GLYPH_OF_PREPARATION))
@@ -134,15 +151,21 @@ class spell_rog_preparation_SpellScript : public SpellScript
// add dummy effect spell handler to Preparation
EffectHandlers += EffectHandlerFn(spell_rog_preparation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_rog_preparation_SpellScript();
}
};
SpellScript *GetSpellScript_spell_rog_preparation()
class spell_rog_shiv : public SpellHandlerScript
{
return new spell_rog_preparation_SpellScript();
}
public:
spell_rog_shiv() : SpellHandlerScript("spell_rog_shiv") { }
class spell_rog_shiv_SpellScript : public SpellScript
{
class spell_rog_shiv_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_SHIV_TRIGGERED))
@@ -165,34 +188,18 @@ class spell_rog_shiv_SpellScript : public SpellScript
// add dummy effect spell handler to Shiv
EffectHandlers += EffectHandlerFn(spell_rog_shiv_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
SpellScript *GetSpellScript_spell_rog_shiv()
{
SpellScript *GetSpellScript() const
{
return new spell_rog_shiv_SpellScript();
}
}
};
void AddSC_rogue_spell_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "spell_rog_cheat_death";
newscript->GetSpellScript = &GetSpellScript_spell_rog_cheat_death;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_rog_hunger_for_blood";
newscript->GetSpellScript = &GetSpellScript_spell_rog_hunger_for_blood;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_rog_preparation";
newscript->GetSpellScript = &GetSpellScript_spell_rog_preparation;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_rog_shiv";
newscript->GetSpellScript = &GetSpellScript_spell_rog_shiv;
newscript->RegisterSelf();
new spell_rog_cheat_death;
new spell_rog_hunger_for_blood;
new spell_rog_preparation;
new spell_rog_shiv;
}
@@ -25,12 +25,5 @@
void AddSC_shaman_spell_scripts()
{
//Script *newscript;
/*
newscript = new Script;
newscript->Name = "spell_sha_";
newscript->GetSpellScript = &GetSpellScript_spell_sha_;
newscript->RegisterSelf();
*/
}
@@ -25,12 +25,5 @@
void AddSC_warlock_spell_scripts()
{
//Script *newscript;
/*
newscript = new Script;
newscript->Name = "spell_warl_";
newscript->GetSpellScript = &GetSpellScript_spell_warl_;
newscript->RegisterSelf();
*/
}
+24 -21
View File
@@ -29,8 +29,13 @@ enum WarriorSpells
WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED = 21887,
};
class spell_warr_last_stand_SpellScript : public SpellScript
class spell_warr_last_stand : public SpellHandlerScript
{
public:
spell_warr_last_stand() : SpellHandlerScript("spell_warr_last_stand") { }
class spell_warr_last_stand_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(WARRIOR_SPELL_LAST_STAND_TRIGGERED))
@@ -49,15 +54,21 @@ class spell_warr_last_stand_SpellScript : public SpellScript
// add dummy effect spell handler to Last Stand
EffectHandlers += EffectHandlerFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript *GetSpellScript() const
{
return new spell_warr_last_stand_SpellScript();
}
};
SpellScript * GetSpellScript_spell_warr_last_stand()
class spell_warr_warriors_wrath : public SpellHandlerScript
{
return new spell_warr_last_stand_SpellScript();
}
public:
spell_warr_warriors_wrath() : SpellHandlerScript("spell_warr_warriors_wrath") { }
class spell_warr_warriors_wrath_SpellScript : public SpellScript
{
class spell_warr_warriors_wrath_SpellScript : public SpellScript
{
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED))
@@ -76,24 +87,16 @@ class spell_warr_warriors_wrath_SpellScript : public SpellScript
// add dummy effect spell handler to Warrior's Wrath
EffectHandlers += EffectHandlerFn(spell_warr_warriors_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
};
SpellScript * GetSpellScript_spell_warr_warriors_wrath()
{
SpellScript *GetSpellScript() const
{
return new spell_warr_warriors_wrath_SpellScript();
}
}
};
void AddSC_warrior_spell_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "spell_warr_last_stand";
newscript->GetSpellScript = &GetSpellScript_spell_warr_last_stand;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_warr_warriors_wrath";
newscript->GetSpellScript = &GetSpellScript_spell_warr_warriors_wrath;
newscript->RegisterSelf();
new spell_warr_last_stand;
new spell_warr_warriors_wrath;
}