Dispell Invis Through Conversation



  • Pretty much as the subject says, as its come up a few times since I started here, figured I'd throw this together.

    /*Written by Deloril - 14/02/2011
     *Conversation script that clears all invisibility effects except,
     *and all creature and item granted abilities that use the Invisibility
     *or Improved Invisibilty spell effects to run.
     *NOTE: If used by the caster of invisibility Sphere, all becme visible, not
     *just the caster. If someone inside the Sphere uses it, only they become visible.
     *Also clears Concealment bonus from Improved Invisibility*/
    
    #include "x0_i0_spells"
    void main()
    {
        //Declare major variables
        object oPC = GetPCSpeaker();
    
        if (GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY, oPC) == TRUE)
        {
            RemoveAnySpellEffects(SPELL_IMPROVED_INVISIBILITY, oPC);
        }
        else if (GetHasSpellEffect(SPELL_INVISIBILITY, oPC) == TRUE)
        {
            RemoveAnySpellEffects(SPELL_INVISIBILITY, oPC);
        }
        else if (GetHasSpellEffect(SPELLABILITY_AS_INVISIBILITY, oPC) == TRUE)
        {
            RemoveAnySpellEffects(SPELLABILITY_AS_INVISIBILITY, oPC);
        }
        else if (GetHasSpellEffect(SPELLABILITY_AS_IMPROVED_INVISIBLITY   , oPC) == TRUE)
        {
            RemoveAnySpellEffects(SPELLABILITY_AS_IMPROVED_INVISIBLITY   , oPC);
        }
        else if (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oPC) == TRUE)
        {
            RemoveAnySpellEffects(SPELL_INVISIBILITY_SPHERE, oPC);
        }
    }
    

Log in to reply