Aller au contenu

Photo

Subrace level cap


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

#1
Repe87

Repe87
  • Members
  • 4 messages
Hi,

I was wondering if there is a way to cap certain subraces to certain max levels. For an instance drow is ecl +2, so if the server max is 30 they should only reach 28?

Thanks.

#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
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 .