Dispel check
A dispel check is a roll of 1d20 + caster level of the character making the attempt to dispel (usually used with dispel magic). The DC is 11 plus the level of the spellcaster who initiated the effect being dispelled.
See also
Notes
According to the eminent Valefort, CL 29 is not immune to Greater Dispel Magic, as the code sees a 40 v 40 check as a failure. So, be forewarned!
// Actual dispel roll for this effect
iRoll = d20() + nCasterlevel;
iDC = 11 + iEffectCasterLevel;
// The effect is dispelled
if(iRoll >= iDC)
{
DispelSpellFromTarget(oTarget, iSpellId, nId, oCaster);
}