Hey guys,
Need some help with editing the script for Invisibility purge. I’m trying to edit the spell to remove only the invisibility effect from the targets (without the concealment effect from improved insivility and spellabilities as improved invisibility), plus I don’t want it to work on the caster. I might want to edit it further so it doesn’t work on those spellabilities, but for now the first part is giving me trouble, no idea why.
Here’s a part of my onEnter NW_S0_InvPurgeA script:
void main()
{
//Declare major variables
aoesDeclareMajorVariables();
object oTarget = GetEnteringObject();
effect eInvis = GetFirstEffect(oTarget);
int bRemove;
while (GetIsEffectValid(eInvis))
{
switch (GetEffectSpellId(eInvis))
{
case SPELL_INVISIBILITY:
case SPELL_IMPROVED_INVISIBILITY:
case SPELL_INVISIBILITY_SPHERE:
case SPELLABILITY_AS_INVISIBILITY:
case SPELLABILITY_AS_IMPROVED_INVISIBLITY:
bRemove = TRUE;
break;
default:
bRemove = GetEffectType(eInvis) == EFFECT_TYPE_INVISIBILITY || GetEffectType(eInvis) == EFFECT_TYPE_IMPROVEDINVISIBILITY;
break;
}
if (bRemove)
{
if (spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE, aoe.Creator))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(aoe.AOE, spell.Id));
}
else
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(aoe.AOE, spell.Id, FALSE));
}
if (oTarget != spell.Caster)
{
//Remove invisibility
RemoveSpecificEffect(EFFECT_TYPE_INVISIBILITY, oTarget);
}
}
//Get Next Effect
eInvis = GetNextEffect(oTarget);
}
}
It removes only the invisibility effect, as intended, but causes an error:
Script: NW_S0_InvPurgeA
OID: 80000834
TAG: VFX_MOB_INVISIBILITY_PURGE
Too many commands
What am I doing wrong? Any tips?