We all know there is a module switch (constant) that can be set to set things so that a PC with expertise (or improved expertise) mode running will shift off of the mode if he casts a spell. I believe the switch is MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, which corresponds to the constant X2_L_STOP_EXPERTISE_ABUSE.
My question is, where is this handled? I was thinking it might be in x2_inc_spellhook, but I am not seeing it there. Can anyone point me to the script?
BTW, I am more concerned with NWN:EE, in the off chance that Beamdog has changed this.