* Converted hunter spell scripts to the new format (mostly for example purposes for the rest of the team).

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-08-06 19:46:02 +02:00
parent 255158f535
commit 7f6fe6394c
9 changed files with 208 additions and 178 deletions
+66 -37
View File
@@ -34,6 +34,15 @@ enum HunterSpells
HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED = 54045, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED = 54045,
}; };
class spell_hun_last_stand_pet : public SpellHandlerScript
{
public:
spell_hun_last_stand_pet()
: SpellHandlerScript("spell_hun_last_stand_pet")
{
}
class spell_hun_last_stand_pet_SpellScript : public SpellScript class spell_hun_last_stand_pet_SpellScript : public SpellScript
{ {
bool Validate(SpellEntry const * spellEntry) bool Validate(SpellEntry const * spellEntry)
@@ -57,10 +66,20 @@ class spell_hun_last_stand_pet_SpellScript : public SpellScript
} }
}; };
SpellScript * GetSpellScript_spell_hun_last_stand_pet() SpellScript* GetSpellScript() const
{ {
return new spell_hun_last_stand_pet_SpellScript(); return new spell_hun_last_stand_pet_SpellScript();
} }
};
class spell_hun_masters_call : public SpellHandlerScript
{
public:
spell_hun_masters_call()
: SpellHandlerScript("spell_hun_masters_call")
{
}
class spell_hun_masters_call_SpellScript : public SpellScript class spell_hun_masters_call_SpellScript : public SpellScript
{ {
@@ -84,10 +103,20 @@ class spell_hun_masters_call_SpellScript : public SpellScript
} }
}; };
SpellScript * GetSpellScript_spell_hun_masters_call() SpellScript* GetSpellScript() const
{ {
return new spell_hun_masters_call_SpellScript(); return new spell_hun_masters_call_SpellScript();
} }
};
class spell_hun_readiness : public SpellHandlerScript
{
public:
spell_hun_readiness()
: SpellHandlerScript("spell_hun_readiness")
{
}
class spell_hun_readiness_SpellScript : public SpellScript class spell_hun_readiness_SpellScript : public SpellScript
{ {
@@ -120,12 +149,22 @@ class spell_hun_readiness_SpellScript : public SpellScript
} }
}; };
SpellScript * GetSpellScript_spell_hun_readiness() SpellScript* GetSpellScript() const
{ {
return new spell_hun_readiness_SpellScript(); return new spell_hun_readiness_SpellScript();
} }
};
class spell_hun_pet_heart_of_the_phoenix : public SpellScript class spell_hun_pet_heart_of_the_phoenix : public SpellHandlerScript
{
public:
spell_hun_pet_heart_of_the_phoenix()
: SpellHandlerScript("spell_hun_pet_heart_of_the_phoenix")
{
}
class spell_hun_pet_heart_of_the_phoenix_SpellScript : public SpellScript
{ {
bool Validate(SpellEntry const * spellEntry) bool Validate(SpellEntry const * spellEntry)
{ {
@@ -148,7 +187,7 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScript
void Register() void Register()
{ {
// add dummy effect spell handler to pet's Last Stand // add dummy effect spell handler to pet's Last Stand
EffectHandlers += EffectHandlerFn(spell_hun_pet_heart_of_the_phoenix::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); EffectHandlers += EffectHandlerFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
} }
bool Load() bool Load()
@@ -159,12 +198,22 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScript
} }
}; };
SpellScript * GetSpellScript_spell_hun_pet_heart_of_the_phoenix() SpellScript* GetSpellScript() const
{
return new spell_hun_pet_heart_of_the_phoenix_SpellScript();
}
};
class spell_hun_pet_carrion_feeder : public SpellHandlerScript
{
public:
spell_hun_pet_carrion_feeder()
: SpellHandlerScript("spell_hun_pet_carrion_feeder")
{ {
return new spell_hun_pet_heart_of_the_phoenix();
} }
class spell_hun_pet_carrion_feeder : public SpellScript class spell_hun_pet_carrion_feeder_SpellScript : public SpellScript
{ {
bool Validate(SpellEntry const * spellEntry) bool Validate(SpellEntry const * spellEntry)
{ {
@@ -184,7 +233,7 @@ class spell_hun_pet_carrion_feeder : public SpellScript
void Register() void Register()
{ {
// add dummy effect spell handler to pet's Last Stand // add dummy effect spell handler to pet's Last Stand
EffectHandlers += EffectHandlerFn(spell_hun_pet_carrion_feeder::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); EffectHandlers += EffectHandlerFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
bool Load() bool Load()
@@ -195,37 +244,17 @@ class spell_hun_pet_carrion_feeder : public SpellScript
} }
}; };
SpellScript * GetSpellScript_spell_hun_pet_carrion_feeder() SpellScript* GetSpellScript() const
{ {
return new spell_hun_pet_carrion_feeder(); return new spell_hun_pet_carrion_feeder_SpellScript();
} }
};
void AddSC_hunter_spell_scripts() void AddSC_hunter_spell_scripts()
{ {
Script *newscript; new spell_hun_last_stand_pet();
new spell_hun_masters_call();
newscript = new Script; new spell_hun_readiness();
newscript->Name = "spell_hun_last_stand_pet"; new spell_hun_pet_heart_of_the_phoenix();
newscript->GetSpellScript = &GetSpellScript_spell_hun_last_stand_pet; new spell_hun_pet_carrion_feeder();
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_hun_masters_call";
newscript->GetSpellScript = &GetSpellScript_spell_hun_masters_call;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_hun_readiness";
newscript->GetSpellScript = &GetSpellScript_spell_hun_readiness;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_hun_pet_heart_of_the_phoenix";
newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_heart_of_the_phoenix;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_hun_pet_carrion_feeder";
newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_carrion_feeder;
newscript->RegisterSelf();
} }
+2 -1
View File
@@ -102,7 +102,8 @@ class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
} }
}; };
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_SQUIRREL_FORM,
SPELL_MAGE_GIRAFFE_FORM, SPELL_MAGE_GIRAFFE_FORM,
SPELL_MAGE_SERPENT_FORM, SPELL_MAGE_SERPENT_FORM,