Forsaker / Saint / Vow of Poverty interaction fixes

Forsaker / Saint / Vow of Poverty interaction fixes.  Renamed Pyro Conflagration constant.  Removed depreciated PRC4 archive.  Updated release archive.
This commit is contained in:
Jaysyn904
2025-01-04 23:33:07 -05:00
parent a8c707e987
commit b6cc854fab
13 changed files with 71 additions and 54 deletions

View File

@@ -13,6 +13,7 @@
#include "prc_alterations"
#include "NW_I0_GENERIC"
#include "nw_i0_spells"
#include "inc_persist_loca"
effect VoPDamage(int nTotalEnhancement) //Just for unarmed, so just bludgeoning
{
@@ -46,7 +47,7 @@ void main()
object oSkin = GetPCSkin(oPC);
int nSlot;
int nEvent = GetCurrentlyRunningEvent();
int nLevel = GetCharacterLevel(oPC);
int nLevel = GetCharacterLevel(oPC)-GetPersistantLocalInt(oPC,"VoPLevel1")+1;
int nLevelCheck;
int nACArmor = 4+nLevel/3;
int nACDeflection = nLevel/6;
@@ -65,6 +66,7 @@ void main()
else nTotalEnhancement = nExaltedStrike;
// We aren't being called from any event, instead from EvalPRCFeats
if(nEvent == FALSE)
{
//Check if level up bonus has already been chosen and given for any of past Forsaker levels
@@ -120,52 +122,44 @@ void main()
//True Seeing at 18th
if (nLevel>=18) IPSafeAddItemProperty(oSkin, ItemPropertyTrueSeeing(), 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, TRUE, TRUE);
// Enhacement bonus - only applies to weapons (or unarmed)
if(GetIsUnarmed(oPC)) //If it is unarmed, give enhancement bonus to self
// Exalted Strike - only applies to weapons or unarmed
effect eEffect1 = EffectAttackIncrease(nTotalEnhancement);
effect eEffect2 = VoPDamage(nTotalEnhancement);
effect eLink = EffectLinkEffects(eEffect1,eEffect2);
eLink = SupernaturalEffect(eLink);
eLink = TagEffect(eLink, "EffectExaltedStrike");
//Remove any prior bonus to avoid duplication
effect eCheckEffect = GetFirstEffect(oPC);
while (GetIsEffectValid(eCheckEffect))
{
RemoveSpecificEffect(EFFECT_TYPE_ATTACK_INCREASE, oPC); //Remove any prior bonus to avoid duplication
RemoveSpecificEffect(EFFECT_TYPE_DAMAGE_INCREASE, oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAttackIncrease(nTotalEnhancement), oPC); //Then set the bonus again
ApplyEffectToObject(DURATION_TYPE_PERMANENT, VoPDamage(nTotalEnhancement), oPC);
}
else
{
object oItemR = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
object oItemL = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
if(IPGetIsMeleeWeapon(oItemR) || GetWeaponRanged(oItemR))
{
RemoveSpecificEffect(EFFECT_TYPE_ATTACK_INCREASE, oPC);
RemoveSpecificEffect(EFFECT_TYPE_DAMAGE_INCREASE, oPC);
IPSafeAddItemProperty(oItemR, ItemPropertyEnhancementBonus(nTotalEnhancement));
}
else if(IPGetIsMeleeWeapon(oItemL) || GetWeaponRanged(oItemL))
{
RemoveSpecificEffect(EFFECT_TYPE_ATTACK_INCREASE, oPC);
RemoveSpecificEffect(EFFECT_TYPE_DAMAGE_INCREASE, oPC);
IPSafeAddItemProperty(oItemL, ItemPropertyEnhancementBonus(nTotalEnhancement));
}
if(GetEffectTag(eCheckEffect) == "EffectExaltedStrike") RemoveEffect(oPC, eCheckEffect);
eCheckEffect = GetNextEffect(oPC);
}
//Give player the bonus, regardless of the weapon
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
// For some reason, EVENT_ONPLAYEREQUIPITEM just works with weapons, so it is better to check all other items for magic elsewhere
for (nSlot=0; nSlot < 13; nSlot++) //All but creatures slots
{
oItem=GetItemInSlot(nSlot, oPC);
if((GetIsItemPropertyValid(GetFirstItemProperty(oItem)) && !(nSlot == 4 || nSlot == 5)) //Check if it is magical (all items but on the hands)
|| (nSlot == 1 && GetBaseAC(oItem) >= 1) //Check if it is an armor (AC>0)
|| (nSlot == 5 && GetBaseItemType(oItem) == BASE_ITEM_SMALLSHIELD || //Check if it is a shield
GetBaseItemType(oItem) == BASE_ITEM_LARGESHIELD ||
GetBaseItemType(oItem) == BASE_ITEM_TOWERSHIELD))
if((GetIsItemPropertyValid(GetFirstItemProperty(oItem)) && !(GetItemPropertyTag(GetFirstItemProperty(oItem)) == "Tag_PRC_OnHitKeeper")
&& !(nSlot == 4 || nSlot == 5)) //Check if it is magical (all items but on the hands)
|| (nSlot == 1 && GetBaseAC(oItem) >= 1) //Check if it is an armor (AC>0)
|| (nSlot == 5 && GetBaseItemType(oItem) == BASE_ITEM_SMALLSHIELD || //Check if it is a shield
GetBaseItemType(oItem) == BASE_ITEM_LARGESHIELD ||
GetBaseItemType(oItem) == BASE_ITEM_TOWERSHIELD))
{
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionUnequipItem(oItem));
FloatingTextStringOnCreature(GetName(oItem)+" would break your vow!", oPC, FALSE);
}
}
//Remove bonus from unequiped weapons
oItem = GetPCItemLastUnequipped();
if((IPGetIsMeleeWeapon(oItem) || GetWeaponRanged(oItem)))
{
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT); //Remove bonus from unequiped weapons
}
if((IPGetIsMeleeWeapon(oItem) || GetWeaponRanged(oItem))) IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);
AddEventScript(oPC, EVENT_SCRIPT_MODULE_ON_EQUIP_ITEM, "ft_vowofpoverty", TRUE, FALSE);
}

View File

@@ -16,6 +16,7 @@
#include "inc_dynconv"
#include "prc_inc_function"
#include "NW_I0_GENERIC"
#include "inc_persist_loca"
//////////////////////////////////////////////////
/* Constant defintions */
@@ -98,7 +99,7 @@ void main()
if(nStage == STAGE_SELECT_ABIL)
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,UnyieldingEffect(EffectAbilityIncrease(nChoice,2)),oPC); //Give the boost for the chosen option
SetPersistantLocalInt(oPC, "VoPBoost"+IntToString(GetCharacterLevel(oPC)),(nChoice+10)); //Register the boost has been given
SetPersistantLocalInt(oPC, "VoPBoost"+IntToString(nLevel),(nChoice+10)); //Register the boost has been given
//Give the boost for the ones chosen before
for(i = 0; i < nLevel; i++)

View File

@@ -694,6 +694,9 @@ void PRCFeat_AddBonusFeats(object oPC, object oSkin)
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
#include "NW_I0_GENERIC"
#include "inc_persist_loca"
void PRCFeat_AddCompositeBonuses(object oPC, object oSkin)
{
int nAlignmentGoodEvil = GetAlignmentGoodEvil(oPC);
@@ -707,7 +710,11 @@ void PRCFeat_AddCompositeBonuses(object oPC, object oSkin)
if(GetHasFeat(FEAT_SAC_VOW, oPC))
SetCompositeBonus(oSkin, "SacredPer", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE);
if(GetHasFeat(FEAT_VOWOFPOVERTY, oPC)) ExecuteScript("ft_vowofpoverty", oPC);
if(GetHasFeat(FEAT_VOWOFPOVERTY, oPC))
{
if(!GetPersistantLocalInt(oPC,"VoPLevel1")) SetPersistantLocalInt(oPC,"VoPLevel1",GetCharacterLevel(oPC));
ExecuteScript("ft_vowofpoverty", oPC);
}
if(nAlignmentLawChaos == ALIGNMENT_LAWFUL)
{

View File

@@ -61,7 +61,8 @@ void main()
for (nSlot=0; nSlot < 13; nSlot++) //All but creatures slots
{
oItem=GetItemInSlot(nSlot, oPC);
if(GetIsItemPropertyValid(GetFirstItemProperty(oItem))) //Check if it is magical (all items but on the hands))
//Check if it is magical
if(GetIsItemPropertyValid(GetFirstItemProperty(oItem)) && !(GetItemPropertyTag(GetFirstItemProperty(oItem)) == "Tag_PRC_OnHitKeeper"))
{
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionUnequipItem(oItem));
@@ -85,7 +86,6 @@ void main()
}
// Hook in the events
//PostString(oPC, "prc_forsaker: Adding eventhooks", 0, 0, SCREEN_ANCHOR_TOP_LEFT, 20.0, 0xFF0000FF, 0x00000000);
AddEventScript(oPC, EVENT_SCRIPT_MODULE_ON_EQUIP_ITEM, "prc_forsaker", TRUE, FALSE);
}

View File

@@ -49,8 +49,9 @@ void AddProperty(object oItem)
}
// Add the itemproperty
IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1),
0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
itemproperty ipNewOH = ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1);
ipNewOH = TagItemProperty(ipNewOH, "Tag_PRC_OnHitKeeper");
IPSafeAddItemProperty(oItem, ipNewOH, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);
// Add a marker to note that the item has been handled
SetLocalInt(oItem, "PRC_OnHitKeeper_Marker", TRUE);
@@ -64,11 +65,19 @@ void main()
// OnEquip event
if(nEvent == EVENT_ONPLAYEREQUIPITEM)
{
object oItem = GetItemLastEquipped();
object oEquipper = GetItemLastEquippedBy();
if(GetItemInSlot(INVENTORY_SLOT_CHEST, oEquipper) == oItem)
AddProperty(oItem);
}
object oItem = GetItemLastEquipped();
object oEquipper = GetItemLastEquippedBy();
object oSkin = GetPCSkin(oEquipper);
if(GetItemInSlot(INVENTORY_SLOT_CHEST, oEquipper) == oItem)
{
AddProperty(oItem);
}
else
{
AddProperty(oSkin);
}
}
// OnUnEquip event
else if(nEvent == EVENT_ONPLAYERUNEQUIPITEM)
{
@@ -119,7 +128,9 @@ void main()
AddProperty(oSkin);
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oCreature);
if(GetIsObjectValid(oArmor))
if(GetIsObjectValid(oArmor))
{
AddProperty(oArmor);
}
}
}

View File

@@ -72,10 +72,14 @@ void main()
}
//:: Declare major variables
int iHD = GetHitDice(oPC);
int iWISb = GetAbilityModifier(ABILITY_WISDOM, oPC);
int bVowPoverty = GetHasFeat(FEAT_VOWOFPOVERTY, oPC);
int bForsaker = GetLevelByClass(CLASS_TYPE_FORSAKER, oPC);
int iHD = GetHitDice(oPC);
int iWISb = GetAbilityModifier(ABILITY_WISDOM, oPC);
object oItem;
object oSkin = GetPCSkin(oPC);
itemproperty ipIP;
//:: Setup HD based Fast Healing
@@ -205,7 +209,7 @@ void main()
//:: Setup Holy Touch anti-evil damage shield.
itemproperty iHolyTouch = (ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1));
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
if (GetIsObjectValid(oArmor))
if (GetIsObjectValid(oArmor) && !bForsaker && !bVowPoverty)
{
//:: Add item prop with DURATION_TYPE_PERMANENT
IPSafeAddItemProperty(oArmor, iHolyTouch, 0.0f, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);