Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

AddHitPoints Permanently. Is there a way?

HillyanHillyan Member Posts: 17
Hi, i have a pw from 12 years, i use prc/cep/cmp/cpp/ctp/bcm and many other haks without problems, with customized spells and prc spells.

I'm not a scripter but doing all alone, i've learned a lot.
I'm italian; my english could not be so correct.

Now i have a problem; i've searched on google and tried every workaround possible.
I use nwnx but not Leto. I don't use a myswl db;

is there a way to add permanently hitpoints to characters? I know how to identify control classes, how to script a legendary levels of my own creation, with a conversation. I never, NEVER achieve to add hit points via script.

I use nwnx to add and modify ability score, skill score, feats.
I can't add hit points. Do you know how to do this? I've opened hgll of funkyswerve. It's a great work; i've read several funky scripts but i don't use leto.
Is there another way? A function? a workaround?

Please, give me a tip.

DerpCity

Comments

  • SherincallSherincall Member Posts: 236
    Assuming this is for EE, look in nwnx_creature.nss, there's:
    // Gets the maximum hit points for creature for level. int NWNX_Creature_GetMaxHitPointsByLevel(object creature, int level); // Sets the maximum hit points for creature for level to nValue. void NWNX_Creature_SetMaxHitPointsByLevel(object creature, int level, int value);

  • HillyanHillyan Member Posts: 17
    It's not for the ee but that function is already in 1.69 nwnx.
    I try to explain better :)
    I would like to to add some X hitpoints to a player when he gains a legendary level (in conversation). I've done a script that after the eventual choice of ability/feat/skill, gets the current hitpoints, gets the hitpoints that the player should take on normal levelup (control class type + con mod + toughness feat) and gives me a total of hitpoints the player should have after leveling.

    I need a function to add some X hitpoints or a function that sets the maximum hitpoints of the player to a value X.

    In that function sherincall, there is the level int and i don't understand how to script it, because i made the legendary level system and i've a variable system, nothing more. If i put on int level the number 42 for example, i think it will not work

  • SherincallSherincall Member Posts: 236
    Creatures get their HP on a per-level basis, you cannot modify their total HP. This is so that when they lose a level, you know how much HP they need to lose.

    The level needs to be 1-40 for this work, and they need to have that level. So you can either modify it for level 1 (so they never lose it when losing levels) or for last level so they do.

    Just note that if you have e.g. level 40 fighter with 400hp, and you want to set their HP to 600, doing this:
    NWNX_Creature_SetMaxHitPointsByLevel(oPC, 1, 600);
    will make them have 990hp - 600 at level 1, and 10 at each level 2-40. Instead you need to set that level's max HP to desired max minus current max.

  • HillyanHillyan Member Posts: 17
    Thank you for your explanation. It is as i was thinking about.
    If i want to add hit points at every level after 40(i use levels made by me from 41 to 100), so Leto is the only option available? There is no function in nwnx that Adds hit points permanently as it is for modify ability score function.

    Someone can suggest me a way trhough Leto?

  • ShadooowShadooow Member Posts: 163
    My nwnx_patch can do that but it is available only for 1.69 - though the code can be easily ported to EE-nwnx (by someone else than me...).

    Basically creature/players max hitpoints are influenced by two local variables:
    HP_BONUS int X
    HP_% int X

    Both variables can contain negative number, HP_BONUS simply adds value to the max hitpoints, HP_% will add X% of the max hp to the max hp, ie: if player has 100hp and HP_% = 20 then his hitpoints will be 120. The percentual variable is calculated after maxhitpoints were modified by HP_BONUS variable.

    I even made new itemproperties to increase/decrease hitpoints that are using these variables but they are not part of the nwnx_patch plugin.

  • HillyanHillyan Member Posts: 17
    You should have a reward for this. Thank to you and also to sherincall. I will try and let you know here :)

  • SherincallSherincall Member Posts: 236
    Hillyan said:

    Thank you for your explanation. It is as i was thinking about.
    If i want to add hit points at every level after 40(i use levels made by me from 41 to 100), so Leto is the only option available? There is no function in nwnx that Adds hit points permanently as it is for modify ability score function.

    Someone can suggest me a way trhough Leto?

    You don't really have levels after 40 - the engine is limited to 40 levels in several places. You probably just have the players go through the 39->40 levelup screen, apply the bonuses to level 39 or something, then delevel them and have them levelup 39->40 again.
    In which case you want to apply the bonus to some level 1-39. If you support losing levels, you need to keep track of bonuses separately, so you only remove part of it when a player loses level e.g. 66.

  • HillyanHillyan Member Posts: 17
    Hi again shadoow. I've installed nwncx to my client side. Nwnx was already installed because i use it server and client side.

    I've dowloaded the patch.
    I've put the nwnx_patch.dll in my nwn main folder. How can i have in my toolset the new functions ?? (with the beautiful hp_bonus int). Is there something i have to do?

  • ShadooowShadooow Member Posts: 163
    as I said this works on variable, just add variable HP_BONUS to player with value you wish

    assuming you downloaded latest version it will work

    the plugin has regular functions for use too but i forgot to add the nwscript files into last version so to get them you need to download this but do not replace nwnx_patch, as this is the latest version and contain bugs - use this one

  • HillyanHillyan Member Posts: 17
    IT WORKS

    Ok, thanks. Just a last question. Every player will have to download the nwncx? I've added the latest nwnx patch to my client and to remote hosting server and it works. Now i wandering what files players will have to download. (NOW WE CAN USE PRC CLASSES FROM THE FIRST LEVEL thanks to that patch)

  • HillyanHillyan Member Posts: 17
    They most have only the patch or only the nwncx? I'm a bit confused after all my attempt to make it work.

  • ShadooowShadooow Member Posts: 163
    edited May 17
    For this feature no they don't need nwncx_patch. That would be needed for custom spellcaster claasses.

  • ShadooowShadooow Member Posts: 163
    Hillyan said:

    Now i wandering what files players will have to download. (NOW WE CAN USE PRC CLASSES FROM THE FIRST LEVEL thanks to that patch)

    Ah yes this is feature of nwncx_patch, as long as preloading hak packs so you can select PRC feats and spells at lvl 1. So your players should be recommended to use nwncx + nwncx_patch but it is not required for most of nwnx_patch features.

  • HillyanHillyan Member Posts: 17
    I'm glad to say thanks you shadoow and also sherincall for your time and (without money) support. Great thanks for you and nwn. :)

Sign In or Register to comment.