Spell Functions
Posted: Sun Sep 12, 2010 6:52 pm
This is a handy little variation on the Bioware RemoveSpellEffects function, but does not require the caster as an input. Handy in spell scripts for preventing stacking.
Code: Select all
void RemoveEffectFromSpellID(int nSpell_ID, object oTarget)
{
//Declare major variables
effect eRemove = GetFirstEffect(oTarget);
while (GetIsEffectValid(eRemove))
{
//If the effect was created by the spell then remove it
if(GetEffectSpellId(eRemove) == nSpell_ID)
{
RemoveEffect(oTarget, eRemove);
}
eRemove = GetNextEffect(oTarget);
}
}