I’m a newbie and when reading NWN Lexicon on
OnPlayerRest this part attracts my attention:
A summary of what happens on rest:
- Rest start:
- Fires OnPlayerRest with REST_EVENTTYPE_REST_STARTED - at this point it could be cancelled and the rest not do anything (so saves magical effects etc. from being lost)
- Removal of all magical effects, temporary effects (of any subtype) and temporary magical item properties cast by the rester (on self and others).
- Poison is applied
- Animation begins; sit on floor
- A gradual replacement of spell slots over the duration (doesn’t start instantly and goes up in level so level 0 spells are replenished, then 1, etc.)
- A gradual replacement of HP (eg; starting on 20 of 100 means you gain 80 over the time sitting down)
- Rest end:
I digged into the script file
x2_mod_def_rest as well as
x2_inc_restsys and only found a few lines that seem to be relevant, and the most suspicious one is:
effect eSleep = EffectVisualEffect(VFX_IMP_SLEEP); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSleep, oPC);
I have two questions:
How do I find out what
eSleepdoes and can I edit the script inside?
In general, if I want to have a custom rest system, let’s say whenever the player clicks “R”, he/she must go through a series of conversions with a “DM” character, and only have a X% chance to memorize each spell, where should I hook the code into? Is putting everything in Module’s OnPlayerRest a good choice?
Thanks in advance~~