From a668be703add1f5942e9afd49c06d2a5a1085c18 Mon Sep 17 00:00:00 2001 From: Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:48:29 -0400 Subject: [PATCH] 2025/06/07 Evening Update Fixed Opportunistic Piety & Turning. Fixed Midnight Augmentation. --- nwn/nwnprc/trunk/include/prc_inc_function.nss | 32 +++++++++++++- nwn/nwnprc/trunk/include/psi_inc_augment.nss | 43 +++++++++---------- .../trunk/newspellbook/moi_midnightcnv.nss | 3 +- nwn/nwnprc/trunk/scripts/prc_unequip.nss | 14 +++--- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/nwn/nwnprc/trunk/include/prc_inc_function.nss b/nwn/nwnprc/trunk/include/prc_inc_function.nss index dc2dffee..ae37a2c4 100644 --- a/nwn/nwnprc/trunk/include/prc_inc_function.nss +++ b/nwn/nwnprc/trunk/include/prc_inc_function.nss @@ -1335,7 +1335,7 @@ void DelayAddItemProperty(float fDelay, object oGenerationHolder, string sGenera * @see DecrementRemainingFeatUses() * @see IncrementRemainingFeatUses() */ - void FeatUsePerDay(object oPC, int iFeat, int iAbiMod = ABILITY_CHARISMA, int iMod = 0, int iMin = 1) +void FeatUsePerDay(object oPC, int iFeat, int iAbiMod = ABILITY_CHARISMA, int iMod = 0, int iMin = 1) { if(!GetHasFeat(iFeat,oPC)) return; @@ -2042,6 +2042,34 @@ void WildMage(object oPC) } */ void Factotum(object oPC) +{ + int nClass = GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC); + if(nClass > 0) + { + if (nClass >= 20) + { + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_TURN, ABILITY_WISDOM, 6); + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_HEAL, ABILITY_WISDOM, 6); + } + else if (nClass >= 15) + { + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_TURN, ABILITY_WISDOM, 5); + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_HEAL, ABILITY_WISDOM, 5); + } + else if (nClass >= 10) + { + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_TURN, ABILITY_WISDOM, 4); + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_HEAL, ABILITY_WISDOM, 4); + } + else + { + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_TURN, ABILITY_WISDOM, 3); + FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_HEAL, ABILITY_WISDOM, 3); + } + } +} + +/* void Factotum(object oPC) { int nClass = GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC); if(nClass > 0) @@ -2067,7 +2095,7 @@ void Factotum(object oPC) FeatUsePerDay(oPC, FEAT_OPPORTUNISTIC_PIETY_HEAL, ABILITY_WISDOM, 0, 3); } } -} +} */ void Sharess(object oPC) { diff --git a/nwn/nwnprc/trunk/include/psi_inc_augment.nss b/nwn/nwnprc/trunk/include/psi_inc_augment.nss index 8c283392..6bbac454 100644 --- a/nwn/nwnprc/trunk/include/psi_inc_augment.nss +++ b/nwn/nwnprc/trunk/include/psi_inc_augment.nss @@ -456,7 +456,7 @@ struct manifestation EvaluateAugmentation(struct manifestation manif, struct pow int nAugPPCostReductions = 0; int bMaxAugment = GetLocalInt(manif.oManifester, PRC_AUGMENT_MAXAUGMENT) && !GetLocalInt(manif.oManifester, PRC_AUGMENT_OVERRIDE); // Override profile also overrides max augment - + // Initialise the augmentation data in the manifestation structure to zero /* Probably unnecessary due to auto-init manif.nTimesAugOptUsed_1 = 0; @@ -545,27 +545,25 @@ struct manifestation EvaluateAugmentation(struct manifestation manif, struct pow nAugPPCostReductions += nSurge; // Midnight Augmentation feat from incarnum - if (GetHasFeat(FEAT_MIDNIGHT_AUGMENTATION, manif.oManifester)) - { - int nPower = GetLocalInt(manif.oManifester, "MidnightAugPower"); - if (manif.nSpellID == nPower) - { - int bUsedFocus = UsePsionicFocus(manif.oManifester); - if (bUsedFocus) - { - nAugPPCostReductions += GetEssentiaInvestedFeat(manif.oManifester, FEAT_MIDNIGHT_AUGMENTATION); - } - } - } - -/* // Midnight Augmentation feat from incarnum - if (GetHasFeat(FEAT_MIDNIGHT_AUGMENTATION, manif.oManifester)) + int bMidAug = GetLocalInt(manif.oManifester, "MidnightAugPower"); + int nMidnightAugReduction = 0; + //if (GetHasFeat(FEAT_MIDNIGHT_AUGMENTATION, manif.oManifester)) + if(bMidAug > 0) { - // Make sure the power is the correct one, and that you can expend your psionic focus + if(DEBUG) DoDebug("Checking Midnight Augumentation"); + int bMidAugInvestment = GetLocalInt(manif.oManifester, "MidnightAugPowerInvestment"); + + // Make sure the power is the correct one, and that you can expend your psionic focus if (manif.nSpellID == GetLocalInt(manif.oManifester, "MidnightAugPower") && UsePsionicFocus(manif.oManifester)) - nAugPPCostReductions += GetEssentiaInvestedFeat(manif.oManifester, FEAT_MIDNIGHT_AUGMENTATION); - } */ - + { + if(DEBUG) DoDebug("Midnight Augumentation power invested Essentia is: "+IntToString(bMidAugInvestment)+"."); + //nAugPPCostReductions = nAugPPCostReductions + bMidAugInvestment; + nMidnightAugReduction = bMidAugInvestment; + + if(DEBUG) DoDebug("Final Midnight Augumentation power adjustment "+IntToString(nMidnightAugReduction)+"."); + } + } + /*/ Various effects modifying the augmentation go above /*/ // Auto-distribution, if modifying effects provided more PP than has been used so far or @@ -701,10 +699,11 @@ struct manifestation EvaluateAugmentation(struct manifestation manif, struct pow } // Add in cost reduction - nAugPPCost = PRCMax(0, nAugPPCost - nAugPPCostReductions); - + //nAugPPCost = PRCMax(0, nAugPPCost - nAugPPCostReductions); + nAugPPCost = nAugPPCost - nAugPPCostReductions; // Store the PP cost increase manif.nPPCost += nAugPPCost; + manif.nPPCost -= nMidnightAugReduction; //:: Had to apply this directly, wouldn't work otherwise. -Jaysyn return manif; } diff --git a/nwn/nwnprc/trunk/newspellbook/moi_midnightcnv.nss b/nwn/nwnprc/trunk/newspellbook/moi_midnightcnv.nss index eba96d0c..9f779775 100644 --- a/nwn/nwnprc/trunk/newspellbook/moi_midnightcnv.nss +++ b/nwn/nwnprc/trunk/newspellbook/moi_midnightcnv.nss @@ -176,8 +176,6 @@ void main() if(sName != "") { - // Replace this with the correct check for whether oMeldshaper actually knows the power. - // Example using GetHasSpell: if (GetHasPower(i, oMeldshaper)) { if(SORT) AddToTempList(oMeldshaper, sName, i); @@ -296,6 +294,7 @@ void main() if (nChoice) { SetLocalInt(oMeldshaper, "MidnightAugPower", GetLocalInt(oMeldshaper, "nPower")); + SetLocalInt(oMeldshaper, "MidnightAugPowerInvestment", GetLocalInt(oMeldshaper, "nEssentia")); InvestEssentiaFeat(oMeldshaper, FEAT_MIDNIGHT_AUGMENTATION, GetLocalInt(oMeldshaper, "nEssentia")); DeleteLocalInt(oMeldshaper, "nPower"); DeleteLocalInt(oMeldshaper, "nEssentia"); diff --git a/nwn/nwnprc/trunk/scripts/prc_unequip.nss b/nwn/nwnprc/trunk/scripts/prc_unequip.nss index 21a4c3e9..d5c9e63e 100644 --- a/nwn/nwnprc/trunk/scripts/prc_unequip.nss +++ b/nwn/nwnprc/trunk/scripts/prc_unequip.nss @@ -61,13 +61,13 @@ void main() int nItemType = GetBaseItemType(oItem); - if(nItemType == BASE_ITEM_CBLUDGWEAPON - || BASE_ITEM_CPIERCWEAPON - || BASE_ITEM_CSLASHWEAPON - || BASE_ITEM_CSLSHPRCWEAP) - { - DestroyObject(oItem); - } + if(nItemType == BASE_ITEM_CBLUDGWEAPON + || nItemType == BASE_ITEM_CPIERCWEAPON + || nItemType == BASE_ITEM_CSLASHWEAPON + || nItemType == BASE_ITEM_CSLSHPRCWEAP) + { + DestroyObject(oItem); + } int nClaw = GetStringLeft(GetResRef(oItem), 12) == "prc_diaclaw_" ? TRUE : FALSE; if(nClaw)DestroyObject(oItem);