Author Topic: RE: How do you disable the automatic HP regain OnPlayerRest?  (Read 372 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: How do you disable the automatic HP regain OnPlayerRest?
« on: December 12, 2014, 08:46:51 am »


               

Is there any way to disable the automatic healing that occurs when a player rests? I want to setup healing through rest as in PnP - 1 hp/level for a full night's rest (i.e. 8 hours). I have that part scripted but every time the PC rests they are at full HP when the rest ends. How do I stop this? No I don't want a solution that uses NwnX.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
RE: How do you disable the automatic HP regain OnPlayerRest?
« Reply #1 on: December 12, 2014, 01:31:59 pm »


               

As far as I know there is no way to stop that. Most systems that do what you are trying to do save the HPs at the start of rest and then re-apply damage to get back to the appropriate level at the end. It works but you see "Someone damaged Foobar: magical" or whatever when the rest ends. I'll be changing mine to use NWNX when available to get around that...


               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
RE: How do you disable the automatic HP regain OnPlayerRest?
« Reply #2 on: December 12, 2014, 02:13:20 pm »


               

Yup. Magical damage. Would be interesting to see the NWNX solution. What plugin would that be, Meaglyn?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
RE: How do you disable the automatic HP regain OnPlayerRest?
« Reply #3 on: December 12, 2014, 05:55:51 pm »


               

Nwnx_funcs has this:



/* Set oCreature's current hit points */
int SetCurrentHitPoints (object oCreature, int nHP);

I'll have a wrapper that uses this if nwnx is available and does the other calculation and magical damage thing if not. Then the rest completion code does not have to know anything. Have not done it yet, the list is long...




 



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: How do you disable the automatic HP regain OnPlayerRest?
« Reply #4 on: December 12, 2014, 08:29:59 pm »


               

Meh, the damage then heal work around is good enough for what I'm doing.