Core/ScriptSystem:

Add basic code for runtime checks of function calls in AuraScripts
 Make AuraScript::PreventDefaultAction() do not take parameters and add description for the function
 Remove PreventDefaultEffect() from aura script, use PreventDefaultAction() instead
 Unload aura scripts memory on aura delete

--HG--
branch : trunk
This commit is contained in:
QAston
2010-10-04 17:44:49 +02:00
parent 5adaf5887e
commit caaa77deb2
8 changed files with 178 additions and 42 deletions

View File

@@ -961,11 +961,12 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
if (GetUnitOwner()->getPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
if (Creature* saurfang = GetUnitOwner()->ToCreature())
saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
PreventDefaultAction();
}
void Register()
{
PreventDefaultEffect(EFFECT_1);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathbringer_blood_link_AuraScript::HandlePeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}

View File

@@ -754,11 +754,11 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader
int32 missingHealth = caster->GetMaxHealth() - caster->GetHealth();
caster->ModifyHealth(missingHealth);
caster->ModifyPower(POWER_MANA, -missingHealth);
PreventDefaultAction();
}
void Register()
{
PreventDefaultEffect(EFFECT_0);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathwhisper_mana_barrier_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};