//::///////////////////////////////////////////////
//:: Shimmering Lights
//:: jx_spll_shimlights.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"


void main()
{
	// N.B. : This spell doesn't start pre & post-cast hooks as it should
	//        only be triggered from the pre-cast hook of another spell

	object oCaster = OBJECT_SELF;

	float fDuration = RoundsToSeconds(d4());
	effect eShimmeringLights = EffectNWN2SpecialEffectFile("jx_shimmer_lights.sef");

	ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eShimmeringLights, GetLocation(oCaster), fDuration);
	JXApplyAreaEffectAtLocation(AOE_PER_CUSTOM09_AOE, GetLocation(oCaster), fDuration, "jx_spll_shimlightsa", "", "jx_spll_shimlightsb");
}