Modifying player's toon - custom bonuses

Hey guys, need your help once again. Just wanted to be sure what approach is correct.

Sooo, I want to modify oPC by adding some custom bonuses via feats or just by checking the class, level etc.

Example:

  • feat ABC gives +5% movement speed
  • X levels in certain class = add new feat
  • X levels of certain class = modify oPC’s appearance

Let’s say, that I have a custom function ‘ModifyPC(object oPC)’ - where do I have to put it to apply those changes correctly? On player enter, on level up, on rest?
I want to ensure, that those bonuses do not stack incorrectly and that they’re deleted when needed (e.g. when player doesn’t meet the requirements anymore, like lost level).

Any tips how to handle changes like that?

EDIT: I’m setting this up for NWN:EE with nwnx (linux version).

You need to do this in:

  • OnEnter
  • OnLevelUp
  • OnLevelDown (if nwnx_event has it, if not you can live without it or you can redirect all your SetXP and GiveXP to custom function which will call it)
  • OnRespawn
  • OnResurrect (70_mod_resurrect with CPP or inside script for Raise Dead & Resurrect)

you would need also equip and unequip if you allow that new feat on items as bonus feat

You can check my LegendaryLevel system for an example.

1 Like