Author Topic: Increase Hit Points in a Non-Temporary Way?  (Read 330 times)

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Increase Hit Points in a Non-Temporary Way?
« on: November 10, 2012, 01:03:26 am »


               Is there a way to increase the max hit points of a character via scripting?  In other words, player puts on armor A and receives 5 extra max hit points.  If they take the armor off, they revert to their previous max hit points.

Obviously the HP per level of class can be changed.  And temporary HP can be added.  I also know HG and other servers using a modification of that system use something to increase the max HP...but is what they do that with able to be done when swapping gear (and if so, is it too expensive of an operation to be viable)?  And is it also easily revertable?

I'm also guessing that involves NWNX or something similar?

I realize constitution on gear or giving Epic Toughness feats on gear can sort of simulate this but I was hoping for a solution that could scale better.  I could also use temporary hit points, but my concern is that you can't see temporary hit points dropping very easily.
               
               

               


                     Modifié par MagicalMaster, 10 novembre 2012 - 01:04 .
                     
                  


            

Legacy_Aelis Eine

  • Full Member
  • ***
  • Posts: 212
  • Karma: +0/-0
Increase Hit Points in a Non-Temporary Way?
« Reply #1 on: November 10, 2012, 02:12:47 am »


               You can modify HP with an NWNX plugin, nwnx_funcs I believe. Trying to bind it to gear is risky because HP is innately bound to character rather than gear, so you'll have to tally all gear and class HP that number on equip (I think con and toughness are hardcoded, so no need to worry about that). Level 1 should be a safe number to set HP. It probably won't work very well for in-combat equipment swaps - they might end up killing themselves, but it should work well enough.

AFAIK, nwnx_funcs is Linux-only. There might be a Windows version now.
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Increase Hit Points in a Non-Temporary Way?
« Reply #2 on: November 10, 2012, 05:10:13 am »


               Yeah, I expected to have to keep track of the total HP they're supposed to have using some scripting, that's how I'd have to do it with the temp HP anyway.  Basically check their gear and talents, use those to determine what the HP bonus is supposed to be.  If they wound up killing themselves with in-combat swaps that'd be apt punishment, as long as they don't get an advantage.
               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
Increase Hit Points in a Non-Temporary Way?
« Reply #3 on: November 10, 2012, 07:36:57 am »


               If you're going along the lines of NWNX on Linux and are familiar with C, there is another option.  In my old branch of nwnx_defenses I hooked and replaced the max hitpoints function: h_GetMaxHitpoints.c  You could port it back to the original plugin easy enough.  Might not worth it tho, unless you wanted to modify some of the other hardcoded behaviors.

The effects bit is specific to my PW and needs to be deleted (it served as an EffectPermanentHitpoints basically).
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Increase Hit Points in a Non-Temporary Way?
« Reply #4 on: November 10, 2012, 07:45:21 am »


               I've never used NWNX whatsoever and have pretty much no idea how it works, though I'm reasonably familiar with C.

This is all stuff I'll have to look into, just trying to find out if it's even possible first (and if so, if it's reasonable).
               
               

               


                     Modifié par MagicalMaster, 10 novembre 2012 - 07:45 .