Back again, and everything is mostly working, except my attempts to set a new max HP. The script compiles, and everything seems to work as it should at the moment when I log in, except for the hit points.
This is my oncliententer event script:
#include "nwnx_funcs"
void main()
{
object oPC=GetEnteringObject();
if (GetIsPC(oPC)&&!GetLocalInt(oPC, "UMBRAL_NEW"))
{
NWNXFuncs_SetAbilityScore(oPC, ABILITY_STRENGTH, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_DEXTERITY, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_CONSTITUTION, 10, TRUE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_INTELLIGENCE, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_WISDOM, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_CHARISMA, 10, FALSE);
NWNXFuncs_ModSavingThrowBonus(oPC, SAVING_THROW_ALL, 1);
NWNXFuncs_SetCurrentHitPoints(oPC, 10);
NWNXFuncs_SetMaxHitPoints(oPC, 10);
NWNXFuncs_RemoveAllFeats(oPC, TRUE);
NWNXFuncs_SetAllSkillsToZero(oPC);
NWNXFuncs_SetBaseAttackBonusOverride(oPC, 1);
SetLocalInt(oPC, "BAB", 1);
NWNXFuncs_RemoveAllSpells(oPC, CLASS_TYPE_SORCERER, 0, 9, FALSE);
SetLocalInt(oPC, "UMBRAL_NEW", 1);
}
else
{
int Current_BAB = GetLocalInt(oPC, "BAB");
NWNXFuncs_SetBaseAttackBonusOverride(oPC, Current_BAB);
}
}
It will set current hp to 10, even if that is above the current 'max', but the max doesn't seem to change. Am I using the function wrong? And if this one won't work, is there an alternative?
Ideally i'd like to be able to set it up so the user gains to their max HP over time by performing certain actions, though obviously this is just the initial script to make the player character a blank canvas that can then be expanded upon.