Controlling PRC Classes

It is possible to ban players from levelling in a specific PRC class. Both base classes and prestige classes can be restricted. This is based on the Bioware Prestige Class control variables script.

This example uses the OA Samurai, but will work for any class. A variable is set on the PC in the OnClientEnter script to stop leveling in that class.

Step 1: Go looking for the variable name

The variable name can be found by looking through the PRC 2da files. Which you will have handily extracted to run the precacher. If not, open prc_2das.hak in nwnexplorer.

You need the 2da called cls_pres_xxx.2da, where xxx is an abbreviation of the class name. For OA samurai, it is cls_pres_samur.2da. Browse/open this file.

Step 2: Find the variable name

The 2da should look like:

2DA V2.0

  LABEL     ReqType ReqParam1        ReqParam2
0 ScriptVar VAR     PRC_AllowSamurai 0

This one is nice and simple – the only line there is what we want. Other classes have more entries in their cls_pres_xxx 2da. The one you want will have the label ScriptVar and be called something like PRC_Allow[...] in the ReqParam1 column. The variable name we use is PRC_AllowSamurai.

Step 3: Add the code to onClientEnter

object oPC = GetEnteringObject();
 
// bans PCs from taking OA samurai levels
SetLocalInt(oPC, "PRC_AllowSamurai", 1);

It can also be used to make leveling in a certain class conditional on, for example, having completed a quest.