Set current/max hitpoints for a DOOR?
ReachPW
Member Posts: 27
I'd like to be able to dynamically set the hitpoints and hardness for a door. Hardness has a GetHardness/SetHardness function and works prefect. But don't know how to set the MAX hitpoints for a door?
I've tried these:
int nHP = 999; NWNX_Creature_SetMaxHitPointsByLevel(oDoor, 1, nHP); SetCurrentHitPoints(oDoor, nHP); ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectTemporaryHitpoints(nHP), oDoor);
Those don't work if I want to adjust the doors hitpoints upwards (ie, more than it currently has).
The only "solution" I found, was to set the door to 10,000 hitpoints and then use SetCurrentHitPoints to adjust it DOWN, but can't adjust it UP.
That is, if door has Max of 10 hitpoints, there is no way to set it to max of 99 hitpoints?
0
Comments
I suspect the solution you found is the only one in this case.
If you want to take the time to learn moneo and letto script, it would be a good fit for what it sounds like you want to do (Increase the base HP for a lot of doors in your module, so that you can lower them with a script). That is if you have already made the doors you want to change, tagged or identifiable in some way.
thank you! Apparently I can't read documentation. I found the creature one but didn't look in the object plugin.
this works wonderful: