This is code from NWN2 which dex2 used for this, but should be similar...
Something like this, inside of nw_c2_default7.nss which is the on death script attached to the various creatures. Basically a custom xp system which refuses to give xp above the specified level. ( if you go on the nexus, the complete code base for Dex2 is on there under the name CSL Library. )
iLevel = CSLGetRealLevel(oPartyMember);
nECL = CSLGetRaceDataECLCap( GetSubRace(oPartyMember) );//CSLGetECL(GetSubRace(oPartyMember));
nMaxXP = CSLGetXPByLevel(40-nECL);
nXPGiven = GetXP(oPartyMember); // STORE CURRENT
nLeech = nMaxLevel - iLevel;
if (nXPGiven > nMaxXP) {
CSLMessage_SendText(oPartyMember, "Max XP reached, no experience rewarded.", FALSE, COLOR_RED);
if (nGold) GiveGoldToCreature(oPartyMember, nGold);
Modifié par painofdungeoneternal, 07 juillet 2013 - 06:48 .