Invisibility Purge

Spell Description
Caster Level(s) Cleric 3, Ranger 3
Innate Level 3
School Evocation
Descriptor(s) Visual
Component(s) Verbal, Somatic
Range Personal
Area of Effect / Target Colossal
Duration 1 Turn / Level
Save None
Spell Resistance No
Additional Counterspells Invisibility
Dispel Yes
Description This spell removes the invisibility from all invisible creatures and items.

Spell Scripts
Main nw_s0_invpurge
AoE OnEnter nw_s0_invpurgea
AoE OnExit amb_invpurgeb

Changes/Updates for Thain
Script Change Custom GetCasterLevel function
Before Get the level of the casterclass used or item property
After Get the level of the casterclass used or item property, pluss any modifiers (Palemaster++)
Script Change Custom ApplyEffectToObject function
Before Adds a given effect to object
After Same as before, but saves some variables. This is to fix the Dispel spells (Palemaster++)
Script Change Dispel of AoE changed to fit description of dispel
Before Base Chance: Lesser - 25%, Dispel - 50%, Greater -75%, Mordenkainens - 100 %.
Chance modified by caster level: Base Chance + ( CLevel + CMod ) - ( 10 + CMod ) * 2
NPC caster: Modified chance + 30
Caster of spell that is being atempted to dispel: Chance = 100%
DM trying to dispel: Chance = 100%
After Dispel Roll: d20 + CLevel. Where CLevel is capped: Lesser - 5, Dispel - 10, Greater - 15, Mordenkainens - No cap
Dispel DC: 11 + CLevel of caster of spell
Script Change Added OnExit script for tracking of purge effects
Before No OnExit script
After OnExit script used to reduce count of effects

Concept: Ankh_Phoenix and Aremah, Code: Ankh_Phoenix