Author Topic: Subrace level cap  (Read 309 times)

Legacy_Repe87

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Subrace level cap
« on: July 06, 2013, 09:10:03 am »


               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.
               
               

               
            

Legacy_painofdungeoneternal

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +0/-0
Subrace level cap
« Reply #1 on: July 07, 2013, 07:46:50 am »


               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 .