The Harvest Moon Consortium

A NeverWinterNights Guild and Player community

This scripting forum is to discuss scripting and for those needing help scripting to get help from others.

Moderators: Mermut, rdjparadis

Spell Functions

Postby Pstemarie » 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);
User avatar
Posts: 157
Joined: Sun Sep 12, 2010 6:42 pm


Return to Scripting Forum

Who is online

Users browsing this forum: No registered users and 1 guest