Files
PRC8/nwn/nwnprc/trunk/scripts/ft_vowpoverty_ab.nss
Jaysyn904 c1188ebb28 2026/02/19 Update
Eldritch Disciple should have Verminlord as an epic bonus feat.
Only spellcasters can use Craft (Alchemy).
Added Great Charisma and removed Great Wisdom as Force Missile Mage epic bonus feats.
Frenzied Berserker was missing Great STR 10 as an epic bonus feat.
Oozemaster had several epic bonus feats only grantable at 10th lvl.
Pyromancer's Great Charisma bonus feats were pointing at wrong or non-existent feats.
Corrected Frenzied Berserker's skill list.
Corrected Legendary Dreadnought's skill list.
Added placeholders for Combat Form feats.
Added Combat Forms masterfeats.
Fixed ASF issue with Eldritch Sculptor's 2nd blast.
Gated debug in CheckIfDeleveled().
Updated AddRacialRestrictions() for latest races.
Vow of Poverty & Forsaker work better together at level up.
Maybe fixed the mass ability buffs not hitting all targets issue.  Needs mulitplayer testing.
Updated some creature abilities to use PRC functions.
2026-02-19 21:10:22 -05:00

138 lines
4.9 KiB
Plaintext

//:://////////////////////////////////////////////
//:: Vow of Poverty Ability Boost Conversation
//:: ft_vowpoverty_ab
//:://////////////////////////////////////////////
/** @file
This allows you to choose ability to boost.
@original author Stratovarius
@date Created - 27.12.2019
@modified by Fencas
@data modified - 2024-12-03
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "inc_dynconv"
#include "prc_inc_function"
#include "NW_I0_GENERIC"
#include "inc_persist_loca"
//////////////////////////////////////////////////
/* Constant defintions */
//////////////////////////////////////////////////
const int STAGE_SELECT_ABIL = 0;
//////////////////////////////////////////////////
/* Function defintions */
//////////////////////////////////////////////////
void main()
{
object oPC = GetPCSpeaker();
int nValue = GetLocalInt(oPC, DYNCONV_VARIABLE);
int nStage = GetStage(oPC);
int nLevel = GetPersistantLocalInt(oPC, "VoPBoostCheck");
int i, j, nStr, nDex, nCon, nInt, nWis, nCha, nTest;
// Check which of the conversation scripts called the scripts
if(nValue == 0) // All of them set the DynConv_Var to non-zero value, so something is wrong -> abort
{
if(DEBUG) DoDebug("ft_vowpoverty_ab: Aborting due to error.");
return;
}
if(nValue == DYNCONV_SETUP_STAGE)
{
// Check if this stage is marked as already set up
// This stops list duplication when scrolling
if(!GetIsStageSetUp(nStage, oPC))
{
// Maneuver selection stage
if(nStage == STAGE_SELECT_ABIL)
{
for(i = 0; i <= nLevel; i++)
{
if(GetPersistantLocalInt(oPC, "VoPBoost"+IntToString(i))>=10)
{
nTest = GetPersistantLocalInt(oPC, "VoPBoost"+IntToString(i))-10;
if (nTest == ABILITY_STRENGTH) nStr++;
if (nTest == ABILITY_DEXTERITY) nDex++;
if (nTest == ABILITY_CONSTITUTION) nCon++;
if (nTest == ABILITY_INTELLIGENCE) nInt++;
if (nTest == ABILITY_WISDOM) nWis++;
if (nTest == ABILITY_CHARISMA) nCha++;
}
}
SetHeader("Choose which ability to boost for this new level under a Vow of Poverty:");
//If an ability has already been chosen, do not add it (avoid duplication)
if (nStr == 0) AddChoice("Strength", ABILITY_STRENGTH, oPC);
if (nDex == 0) AddChoice("Dexterity", ABILITY_DEXTERITY, oPC);
if (nCon == 0) AddChoice("Constitution", ABILITY_CONSTITUTION, oPC);
if (nInt == 0) AddChoice("Intelligence", ABILITY_INTELLIGENCE, oPC);
if (nWis == 0) AddChoice("Wisdom", ABILITY_WISDOM, oPC);
if (nCha == 0) AddChoice("Charisma", ABILITY_CHARISMA, oPC);
MarkStageSetUp(STAGE_SELECT_ABIL, oPC);
}
}
// Do token setup
SetupTokens();
}
else if(nValue == DYNCONV_EXITED)
{
if(DEBUG) DoDebug("ft_vowpoverty_ab/ft: Running exit handler");
if(GetLocalInt(oPC, "PRC_VoP_Exit_Ran_Forsaker_Check")) return;
SetLocalInt(oPC, "PRC_VoP_Exit_Ran_Forsaker_Check", TRUE);
DelayCommand(3.0f, DeleteLocalInt(oPC, "PRC_VoP_Exit_Ran_Forsaker_Check"));
if (GetLevelByClass(CLASS_TYPE_FORSAKER, oPC) > 0)
{
int nForsakerLvl = GetLevelByClass(CLASS_TYPE_FORSAKER, oPC);
int nLvlCheck;
for (nLvlCheck = 1; nLvlCheck <= nForsakerLvl; nLvlCheck++)
{
if (!GetPersistantLocalInt(oPC, "ForsakerBoost"+IntToString(nLvlCheck)))
{
AssignCommand(oPC, ClearAllActions(TRUE));
SetPersistantLocalInt(oPC, "ForsakerBoostCheck", nLvlCheck);
DelayCommand(3.5f, StartDynamicConversation("prc_forsake_abil", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC));
break;
}
}
}
}
else if(nValue == DYNCONV_ABORTED)
{
// This section should never be run, since aborting this conversation should
// always be forbidden and as such, any attempts to abort the conversation
// should be handled transparently by the system
if(DEBUG) DoDebug("ft_vowpoverty_ab: ERROR: Conversation abort section run");
}
// Handle PC response
else
{
int nChoice = GetChoice(oPC);
if(nStage == STAGE_SELECT_ABIL)
{
SetPersistantLocalInt(oPC, "VoPBoost"+IntToString(nLevel),(nChoice+10)); //Register the boost has been given
DeletePersistantLocalInt(oPC,"VoPBoostCheck");
// And we're all done
AllowExit(DYNCONV_EXIT_FORCE_EXIT);
// Executing to apply new stat bonuses
ExecuteScript("ft_vowofpoverty", oPC);
}
if(DEBUG) DoDebug("ft_vowpoverty_ab: New stage: " + IntToString(nStage));
// Store the stage value. If it has been changed, this clears out the choices
SetStage(nStage, oPC);
}
}