In spells.cpp, in Mob::IsImmuneToSpell add the && and the 3rd line to the condition check.
Code:
// check max level for spell
effect_index = GetSpellEffectIndex(spell_id, SE_Mez);
assert(effect_index >= 0);
// NPCs get to ignore the max level
if(((GetLevel() > spells[spell_id].max[effect_index]) &&
(!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) &&
!(IsClient() && caster->IsClient() ) // Added by Alecta to allow players to bypass mezz level check in pvp.
)
{
mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]);
caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL);
return true;
}
}