Is there a way to give players max HP when leveling up on a servervault run server?
Something to add to the OnPlayerLevelUp event?
Is there a way to give players max HP when leveling up on a servervault run server?
Something to add to the OnPlayerLevelUp event?
This should do the trick:
void main
{
oPC = GetPCLevellingUp();
int iMAXHP = GetMaxHitPoints(oPC);
int iHP = GetCurrentHitPoints(oPC);
effect eHeal = EffectHeal(iMAXHP - iHP);
if (iHP>0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC);
}
}
It wont trigger until they confirm their selection on the level up screen, meaning they will NOT be healed mid combat as soon as they have enough XP to level up. This is because âOnPlayerLevelUpâ triggers when level up selection is confirmed (where you click cancel/confirm based on how many hit points you rolled.)
Also, Iâm not sure EffectHeal is optimal, as it will also stop people from dying and remove wounding effects, but Iâm writing things from memory (with help from lexicon) as NWN is currently not installed. If thereâs a way to simply âSetCurrentHitPointsâ that would probably be better. EffectHeal probably has a healing visual effect as well.
Edit: I changed the code to only heal people who are above 0 hp. Otherwise they would be able to âsave a level upâ until/in case they died, at which point they would be able to jump right back. This is in case your server has the thing where people bleed out and can be stabilized. If it doesnât, then it doesnât matter because the character should be dead at 0 hp anyway.
Isnât there a .ini setting to enable this without scripting?
Dave
In nwnplayer.ini
[Server Options]
Max Hit Points=1
Thank you! I donât know how I missed this.