A little more clarity will help us to help you. You've said when you DON'T want them to be able to relevel - what about when you DO want to allow it? Bear in mind that appraise is only one potential way to abuse such a system.
The mechanic for dropping someone to their last level is simple:
void DelevelPC (object oPC) {
int nLevel = GetHitDice(oPC);
int nNewXP = ((nLevel * (nLevel - 1)) / 2 * 1000) - 1;
SetXP(oPC, nNewXP);
}
If you want to relevel them, just get their xp, and after you delevel, reset it back to where it was. Like so:
//this function will drop them to 1 xp below what they need for their present level
void DelevelPC (object oPC) {
int nLevel = GetHitDice(oPC);
int nNewXP = ((nLevel * (nLevel - 1)) / 2 * 1000) - 1;
SetXP(oPC, nNewXP);
}
void main() {
object oPC = GetPCSpeaker();
int nXP = GetXP(oPC);
DelevelPC(oPC);
SetXP(oPC, nXP);
}
Funky
Modifié par FunkySwerve, 20 décembre 2012 - 11:38 .