#include "jw_tiles_inc" void main() { int nEvent = GetUserDefinedEventNumber(); if (nEvent == 50) { SpeakString("*The fungus reacts to your presence*"); ///// Do the spell effect //Declare major variables object oCaster = OBJECT_SELF; effect eExplode = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_GREASE); effect eEffect = EffectVisualEffect(VFX_IMP_FROST_L); effect eMirv = EffectVisualEffect(VFX_IMP_MIRV_ELECTRIC); effect eCessate = EffectVisualEffect(VFX_DUR_CESSATE_NEUTRAL); effect eConfusion = EffectSlow(); effect eLink=EffectLinkEffects(eCessate,eConfusion); effect eDur=EffectVisualEffect(VFX_DUR_ICESKIN); eLink=EffectLinkEffects(eDur,eLink); eLink=ExtraordinaryEffect(eLink); effect eIce=EffectVisualEffect(426); // Could possibly be an ice effect float fDelay; float fDist; int nSave; float fDuration; object oTile; //Get the spell target location as opposed to the spell target. location lTarget = GetLocation(OBJECT_SELF); //Apply the fireball explosion at the location captured above. ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); //Declare the spell shape, size and the location. Capture the first target object in the shape. object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 40.0, lTarget, TRUE, OBJECT_TYPE_CREATURE); //Cycle through the targets within the spell shape until an invalid object is captured. while (GetIsObjectValid(oTarget)) { if (!GetIsFriend(oTarget)) { //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW)); // Do the Mirv ApplyEffectToObject(DURATION_TYPE_INSTANT, eMirv, oTarget); /////Get the distance between the explosion and the target to calculate delay // * recalculate appropriate distances fDist = GetDistanceBetween(OBJECT_SELF, oTarget); fDelay = fDist/(3.0 * log(fDist) + 2.0); //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. nSave = ReflexSave(oTarget,18,SAVING_THROW_TYPE_COLD); //Set the damage effect /// Apply the icy ground DelayCommand(fDelay,(JWChangeoneAreaGroundTileOnly(GetLocation(oTarget),426))); if(nSave == 0) { // choose a duration fDuration=RoundsToSeconds(d6(2)+6); // Apply effects to the currently selected target. DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget,fDuration)); //This visual effect is applied to the target object not the location as above. This visual effect //represents the flame that erupts on the target not on the ground. DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget)); } } //Select the next target within the spell shape. oTarget = GetNextObjectInShape(SHAPE_SPHERE, 40.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); } } }