//::///////////////////////////////////////////////
//:: Wild Mage Spell - Wildzone on Enter
//::///////////////////////////////////////////////
/*
Description modified from AD&D 2nd Edition - "Tome of Magic"

Wildzone

Caster Level(s): Wizard / Sorcerer 8
Innate Level: 8
School: Conjuration 
Descriptor(s): Wild Magic
Component(s): Verbal, Somatic
Range: 0
Area of Effect / Target: 300‘ x 300’ square
Duration: 2d6 turns ww
Save: None
Spell Resistance: No
This powerful spell creates a disruption in magical forces 
similar to the conditions found in wild magic regions (areas 
where the effects of magic have been permanently altered). 
This spell has only a temporary effect, although the effects 
of wildzone could possibly be rendered permanent. The spell 
creates a wild magic region centered on the caster. The area 
of effect cannot be shaped in any way; it is always a square 
300 feet long on each side (90,000 square feet). Within the 
wildzone, wild magic reigns. Any spell cast in the area of 
effect is automatically treated as a wild surge. Spells cast 
into the wildzone from outside the area of effect function 
normally, but spells cannot be cast out of the area of effect 
without triggering a wild surge. 




2d2f_sp_wildzone_enter.nss
*/
//::///////////////////////////////////////////////
//:: Created By: 2DruNk2Frag
//:: Created On: 02-18-2008
//:: Last Update: 03-24-2008
//::///////////////////////////////////////////////

#include "2d2f_includes"
#include "jx_inc_magic"
#include "x2_inc_spellhook" 
#include "jx_inc_magic_info"
#include "nwn2_inc_spells"
#include "nw_i0_spells"
#include "X0_I0_SPELLS"



void main()
{
		object oPC = GetFirstPC();
		object oCaster = GetLocalObject(oPC,"oFakeCaster");
		int nSpellId = SPELL_WILDZONE;
		object oTarget = GetEnteringObject();
		effect eVis = EffectVisualEffect(VFX_DUR_WILDZONE);
		eVis = SetEffectSpellId(eVis,nSpellId);
		//SendMessageToPC(oPC,"wildzone enter fired");
		
		SignalEvent(oTarget, EventSpellCastAt(oPC, nSpellId, TRUE));
		
		JXApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oTarget);
		//SendMessageToPC(oPC, "Applying Wildzone to " + GetName(oTarget));
	
}