Script to add stat point

Bonjour à tous !
Je cherche un script de conversation qui me permettrait d’ajouter un point de stat (intelligence, force…) au personnage joueur de façon définitive.
J’ai tenté avec “ga_effect” mais ne suis jamais parvenu à rien de satisfaisant. Soit l’effet n’est pas permanent, soit le jeu le considère comme un “buff” (avec le chiffre de la stat en bleu).
De même, forcer l’ajout de “Great Intelligence (+1)” n’a pas d’effet sur le personnage.
Merci d’avance, bonne soirée!

Hello everyone !
I am looking for a conversation script that would allow me to add a stat point (intelligence, strength …) to the player character permanently.
I tried with “ga_effect” but never achieved anything satisfactory. Either the effect is not permanent, or the game considers it as a “buff” (with the stat number in blue).
Similarly, forcing the addition of “Great Intelligence (+1)” has no effect on the character.
Thank you in advance, good evening!

Try this:

// ga_change_stats
/*
	int    ABILITY_STRENGTH         = 0;
	int    ABILITY_DEXTERITY        = 1;
	int    ABILITY_CONSTITUTION     = 2;
	int    ABILITY_INTELLIGENCE     = 3;
	int    ABILITY_WISDOM           = 4;
	int    ABILITY_CHARISMA         = 5;
*/

#include "ginc_param_const"

void main(string sTarget, int nStat, int nDelta)
{
	object oTarget = GetTarget(sTarget, TARGET_OWNER);
	int nNewStat = ABILITY_STRENGTH;

	switch (nStat)
	{
		case 0:     // Strength
			nNewStat = ABILITY_STRENGTH;
			break;
		case 1:     // Dexterity
			nNewStat = ABILITY_DEXTERITY;
			break;
		case 2:     // Constitution
			nNewStat = ABILITY_CONSTITUTION;
			break;
		case 3:     // Intelligence
			nNewStat = ABILITY_INTELLIGENCE;
			break;
		case 4:     // Wisdom
			nNewStat = ABILITY_WISDOM;
			break;
		case 5:     // Charisma
			nNewStat = ABILITY_CHARISMA;
			break;
	}

	int nOldScore = GetAbilityScore(oTarget, nNewStat, TRUE);
	int nNewScore = nOldScore + nDelta;

	if (nNewScore < 0)
	{
		nNewScore = 0;
	}
	else if (nNewScore > 50)
	{
		nNewScore = 50;
	}

	SetBaseAbilityScore(oTarget, nNewStat, nNewScore);
}
2 Likes

It worked! Thank you very much.

Keep in mind that using this method renders a character illegal in some Persistent Worlds. At least that’s what I heard once.

1 Like

Correct - one work around that will help with some persistent worlds is to grant your bonuses through custom feats. That way they only “function” when you are in the environment that gave them. Outside the gameworld, they are just flavor text saved to the player.bic file.

1 Like

You might want to look at Wyrin’s White Plume Mountain. He used The Manual of Health to increase the Constitution by +1. The script is i_manualhealth_ac. You might be able to adapt it to a conversation instead of running it by using an item.

2 Likes