Core/ScriptSystem: Add compile time type check of function assigned to hooks -

prevents incorrect function calls. Since this rev you have to put
PrepareAuraScript(<yourscriptclassnamehere>) at the beginning of every aura
script.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2010-10-08 22:33:21 +02:00
1 parent ce712adda2
commit f8a4312701
11 files changed
+34 -7

No files matched your search

@@ -135,6 +135,7 @@ class spell_ex_66244 : public SpellScriptLoader
class spell_ex_66244AuraScript : public AuraScript
{
PrepareAuraScript(spell_ex_66244AuraScript)
enum Spells
{
SPELL_TRIGGERED = 18282
@@ -297,6 +298,7 @@ class spell_ex : public SpellScriptLoader
class spell_ex_AuraScript : public AuraScript
{
PrepareAuraScript(spell_ex)
//bool Validate(SpellEntry const * spellEntry){return true;}
//bool Load(){return true;}
//void Unload(){}
@@ -949,6 +949,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
class spell_deathbringer_blood_link_AuraScript : public AuraScript
{
PrepareAuraScript(spell_deathbringer_blood_link_AuraScript)
bool Validate(SpellEntry const* /*spellInfo*/)
{
if (!sSpellStore.LookupEntry(SPELL_MARK_OF_THE_FALLEN_CHAMPION))
@@ -1006,6 +1007,7 @@ class spell_deathbringer_blood_power : public SpellScriptLoader
class spell_deathbringer_blood_power_AuraScript : public AuraScript
{
PrepareAuraScript(spell_deathbringer_blood_power_AuraScript)
void RecalculateHook(AuraEffect const* /*aurEffect*/, int32& amount, bool& canBeRecalculated)
{
amount = GetUnitOwner()->GetPower(POWER_ENERGY);
@@ -400,6 +400,7 @@ class spell_festergut_blighted_spores : public SpellScriptLoader
class spell_festergut_blighted_spores_AuraScript : public AuraScript
{
PrepareAuraScript(spell_festergut_blighted_spores_AuraScript)
void ExtraEffect(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
{
if (!GetCaster()->IsAIEnabled || GetCaster()->GetTypeId() != TYPEID_UNIT)
@@ -747,6 +747,7 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
class spell_deathwhisper_mana_barrier_AuraScript : public AuraScript
{
PrepareAuraScript(spell_deathwhisper_mana_barrier_AuraScript)
void HandlePeriodicTick(AuraEffect const * /*aurEff*/, AuraApplication const * /*aurApp*/)
{
Unit* caster = GetCaster();
@@ -439,6 +439,7 @@ class spell_ignis_slag_pot : public SpellScriptLoader
class spell_ignis_slag_pot_AuraScript : public AuraScript
{
PrepareAuraScript(spell_ignis_slag_pot_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_SLAG_POT_DAMAGE))
@@ -33,6 +33,7 @@ public:
class spell_gen_aura_of_anger_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_aura_of_anger_AuraScript)
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
{
if (AuraEffect * aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1))
@@ -60,6 +61,7 @@ public:
class spell_gen_burn_brutallus_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_burn_brutallus_AuraScript)
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
{
if (aurEff->GetTickNumber() % 11 == 0)
@@ -92,6 +94,7 @@ public:
class spell_gen_parachute_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_parachute_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE))
@@ -231,6 +234,7 @@ public:
class spell_gen_leeching_swarm_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_leeching_swarm_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG))
@@ -400,6 +404,7 @@ class spell_creature_permanent_feign_death : public SpellScriptLoader
class spell_creature_permanent_feign_deathAuraScript : public AuraScript
{
PrepareAuraScript(spell_creature_permanent_feign_deathAuraScript)
void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/)
{
Unit* pTarget = aurApp->GetTarget();
@@ -345,6 +345,7 @@ public:
class spell_hun_sniper_training_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_sniper_training_AuraScript)
bool Validate(SpellEntry const * /*entry*/)
{
if (!sSpellStore.LookupEntry(SPELL_SNIPER_TRAINING_R1))
+1
View File
@@ -684,6 +684,7 @@ public:
class spell_item_shadowmourne_AuraScript : public AuraScript
{
public:
PrepareAuraScript(spell_item_shadowmourne_AuraScript)
spell_item_shadowmourne_AuraScript() : AuraScript() { }
bool Validate(SpellEntry const* /*spellEntry*/)
@@ -100,6 +100,7 @@ public:
class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript)
bool Validate(SpellEntry const* /*entry*/)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
@@ -101,6 +101,7 @@ public:
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
{
PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_PREY_ON_THE_WEAK))