Aller au contenu

Photo

Relevel Script


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Kingdom_Of_Hearts

Kingdom_Of_Hearts
  • Members
  • 72 messages
I need a script to relevel their last level. Also, I need to make sure that they don't relevel to max appraise and relevel to retake their skills.. Help please? :) Thanks

(Script would run off conversation)

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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 .