//::///////////////////////////////////////////////
//:: Shimmering Lights: On Exit
//:: jx_spll_shimlightsB.nss
//:://////////////////////////////////////////////
/*
	This spell may be triggered when a creature
	casts another spell in a wild magic zone.
	It creates shimmering colors that swirl around
	the caster in a 9 meters radius.
	All creatures inside the area must succeed a
	Will Save or be blinded for the duration of
	the spell. Moreover, all creatures take a
	-40 malus to hide checks and invisibility
	effects are removed.
*/
//:://////////////////////////////////////////////
//:: Created By: jallaix
//:: Created On: Mar 24, 2007
//:://////////////////////////////////////////////

//#include "jx_inc_magic_wild"
#include "2d2f_inc_magic_wild"


void main()
{
	object oTarget = GetExitingObject();

	// Shimmering Lights effects are removed
	effect eLoop = GetFirstEffect(oTarget);
	while (GetIsEffectValid(eLoop))
	{
		if (GetEffectCreator(eLoop) == GetAreaOfEffectCreator())
			if (GetEffectSpellId(eLoop) == SPELL_SHIMMER_LIGHTS)
				RemoveEffect(oTarget, eLoop);
		eLoop = GetNextEffect(oTarget);
	}
}