2025/05/02 Update

Updated Foresight to use EffectBonusFeat.
Updated PRCRemoveProtections to not dispel extraordinary & supernatural effects.
Expanded DAMAGE_BONUS cap to 50.
Expanded various functions to use new DAMAGE_BONUS cap.
This commit is contained in:
Jaysyn904
2025-05-02 14:38:26 -04:00
parent 9815ea91a1
commit 880d0e5527
14 changed files with 619 additions and 89 deletions

View File

@@ -194,9 +194,9 @@ void spellsDispelAoEMod(object oTargetAoE, object oCaster, int nCasterLevel)
void DispelMagicBestMod(object oTarget, int nCasterLevel)
{
/// I *really* want to rewrite this one so that it simply dispels the most useful effect
/// instead of just the one with the highest caster level.
/// Sure hate to dispel mage armor on somebody who's immune to necromancy. Difficult Decision, these.
// I *really* want to rewrite this one so that it simply dispels the most useful effect
// instead of just the one with the highest caster level.
// Sure hate to dispel mage armor on somebody who's immune to necromancy. Difficult Decision, these.
//:: calls a function to determine whether infestation of maggots is in effect
@@ -897,6 +897,47 @@ int PRCGetSpellBreachProtection(int nLastChecked)
}
int PRCRemoveProtections(int nSpell_ID, object oTarget, int nCount)
{
// Declare major variables
effect eProtection;
int nCnt = 0;
// Check if the target has any effects from the specified spell ID
if (GetHasSpellEffect(nSpell_ID, oTarget))
{
// Start looping through all effects on the target
eProtection = GetFirstEffect(oTarget);
while (GetIsEffectValid(eProtection))
{
// Only remove effects that:
// - Match the given spell ID
// - Are Magical (to comply with Breach spell behavior)
if (GetEffectSpellId(eProtection) == nSpell_ID &&
GetEffectSubType(eProtection) == SUBTYPE_MAGICAL)
{
RemoveEffect(oTarget, eProtection);
nCnt++;
}
// Move to the next effect
eProtection = GetNextEffect(oTarget);
}
}
// Return 1 if any effects were removed, otherwise 0
if (nCnt > 0)
{
return 1;
}
else
{
return 0;
}
}
// This was dispelling Extraordinary, Supernatural & Unyielding effects -Jaysyn
/* int PRCRemoveProtections(int nSpell_ID, object oTarget, int nCount)
{
//Declare major variables
effect eProtection;
@@ -926,7 +967,7 @@ int PRCRemoveProtections(int nSpell_ID, object oTarget, int nCount)
{
return 0;
}
}
} */
//------------------------------------------------------------------------------
// Attempts a dispel on one target, with all safety checks put in.

View File

@@ -4351,6 +4351,67 @@ int GetDamageByConstant(int iDamageConst, int iItemProp)
return d3(1);
case IP_CONST_DAMAGEBONUS_4d3:
return d3(4);
case IP_CONST_DAMAGEBONUS_21:
return 21;
case IP_CONST_DAMAGEBONUS_22:
return 22;
case IP_CONST_DAMAGEBONUS_23:
return 23;
case IP_CONST_DAMAGEBONUS_24:
return 24;
case IP_CONST_DAMAGEBONUS_25:
return 25;
case IP_CONST_DAMAGEBONUS_26:
return 26;
case IP_CONST_DAMAGEBONUS_27:
return 27;
case IP_CONST_DAMAGEBONUS_28:
return 28;
case IP_CONST_DAMAGEBONUS_29:
return 29;
case IP_CONST_DAMAGEBONUS_30:
return 30;
case IP_CONST_DAMAGEBONUS_31:
return 31;
case IP_CONST_DAMAGEBONUS_32:
return 32;
case IP_CONST_DAMAGEBONUS_33:
return 33;
case IP_CONST_DAMAGEBONUS_34:
return 34;
case IP_CONST_DAMAGEBONUS_35:
return 35;
case IP_CONST_DAMAGEBONUS_36:
return 36;
case IP_CONST_DAMAGEBONUS_37:
return 37;
case IP_CONST_DAMAGEBONUS_38:
return 38;
case IP_CONST_DAMAGEBONUS_39:
return 39;
case IP_CONST_DAMAGEBONUS_40:
return 40;
case IP_CONST_DAMAGEBONUS_41:
return 41;
case IP_CONST_DAMAGEBONUS_42:
return 42;
case IP_CONST_DAMAGEBONUS_43:
return 43;
case IP_CONST_DAMAGEBONUS_44:
return 44;
case IP_CONST_DAMAGEBONUS_45:
return 45;
case IP_CONST_DAMAGEBONUS_46:
return 46;
case IP_CONST_DAMAGEBONUS_47:
return 47;
case IP_CONST_DAMAGEBONUS_48:
return 48;
case IP_CONST_DAMAGEBONUS_49:
return 49;
case IP_CONST_DAMAGEBONUS_50:
return 50;
}
}
else
@@ -4417,6 +4478,66 @@ int GetDamageByConstant(int iDamageConst, int iItemProp)
return d10(2);
case DAMAGE_BONUS_2d12:
return d12(2);
case DAMAGE_BONUS_21:
return 21;
case DAMAGE_BONUS_22:
return 22;
case DAMAGE_BONUS_23:
return 23;
case DAMAGE_BONUS_24:
return 24;
case DAMAGE_BONUS_25:
return 25;
case DAMAGE_BONUS_26:
return 26;
case DAMAGE_BONUS_27:
return 27;
case DAMAGE_BONUS_28:
return 28;
case DAMAGE_BONUS_29:
return 29;
case DAMAGE_BONUS_30:
return 30;
case DAMAGE_BONUS_31:
return 31;
case DAMAGE_BONUS_32:
return 32;
case DAMAGE_BONUS_33:
return 33;
case DAMAGE_BONUS_34:
return 34;
case DAMAGE_BONUS_35:
return 35;
case DAMAGE_BONUS_36:
return 36;
case DAMAGE_BONUS_37:
return 37;
case DAMAGE_BONUS_38:
return 38;
case DAMAGE_BONUS_39:
return 39;
case DAMAGE_BONUS_40:
return 40;
case DAMAGE_BONUS_41:
return 41;
case DAMAGE_BONUS_42:
return 42;
case DAMAGE_BONUS_43:
return 43;
case DAMAGE_BONUS_44:
return 44;
case DAMAGE_BONUS_45:
return 45;
case DAMAGE_BONUS_46:
return 46;
case DAMAGE_BONUS_47:
return 47;
case DAMAGE_BONUS_48:
return 48;
case DAMAGE_BONUS_49:
return 49;
case DAMAGE_BONUS_50:
return 50;
}
}
return 0;

View File

@@ -123,10 +123,10 @@ void DoBullRush(object oPC, object oTarget, int nExtraBonus, int nGenerateAoO =
int DoTrip(object oPC, object oTarget, int nExtraBonus, int nGenerateAoO = TRUE, int nCounterTrip = TRUE, int nSkipTouch = FALSE, int nAbi = 0);
/**
* Will take an int and transform it into one of the DAMAGE_BONUS constants (From 1 to 20).
* Will take an int and transform it into one of the DAMAGE_BONUS constants (From 1 to 50).
*
* @param nCheck Int to convert
* @return DAMAGE_BONUS_1 to DAMAGE_BONUS_20
* @return DAMAGE_BONUS_1 to DAMAGE_BONUS_50
*/
int GetIntToDamage(int nCheck);
@@ -1343,6 +1343,36 @@ int GetIntToDamage(int nCheck)
case 18: return DAMAGE_BONUS_18;
case 19: return DAMAGE_BONUS_19;
case 20: return DAMAGE_BONUS_20;
case 21: return DAMAGE_BONUS_21;
case 22: return DAMAGE_BONUS_22;
case 23: return DAMAGE_BONUS_23;
case 24: return DAMAGE_BONUS_24;
case 25: return DAMAGE_BONUS_25;
case 26: return DAMAGE_BONUS_26;
case 27: return DAMAGE_BONUS_27;
case 28: return DAMAGE_BONUS_28;
case 29: return DAMAGE_BONUS_29;
case 30: return DAMAGE_BONUS_30;
case 31: return DAMAGE_BONUS_31;
case 32: return DAMAGE_BONUS_32;
case 33: return DAMAGE_BONUS_33;
case 34: return DAMAGE_BONUS_34;
case 35: return DAMAGE_BONUS_35;
case 36: return DAMAGE_BONUS_36;
case 37: return DAMAGE_BONUS_37;
case 38: return DAMAGE_BONUS_38;
case 39: return DAMAGE_BONUS_39;
case 40: return DAMAGE_BONUS_40;
case 41: return DAMAGE_BONUS_41;
case 42: return DAMAGE_BONUS_42;
case 43: return DAMAGE_BONUS_43;
case 44: return DAMAGE_BONUS_44;
case 45: return DAMAGE_BONUS_45;
case 46: return DAMAGE_BONUS_46;
case 47: return DAMAGE_BONUS_47;
case 48: return DAMAGE_BONUS_48;
case 49: return DAMAGE_BONUS_49;
case 50: return DAMAGE_BONUS_50;
}
return -1;
}

View File

@@ -713,8 +713,39 @@ const int IP_CONST_ONHIT_CASTSPELL_NIGHTSHADEPOISON = 201;
const int IP_CONST_ONHIT_CASTSPELL_LINGDMG = 202;
const int IP_CONST_CASTSPELL_ELDRITCH_GLAIVE_ONHIT = 205;
// IP_CONST_DAMAGEBONUS
//:: DAMAGE_BONUS_
const int DAMAGE_BONUS_21 = 73;
const int DAMAGE_BONUS_22 = 74;
const int DAMAGE_BONUS_23 = 75;
const int DAMAGE_BONUS_24 = 76;
const int DAMAGE_BONUS_25 = 77;
const int DAMAGE_BONUS_26 = 78;
const int DAMAGE_BONUS_27 = 79;
const int DAMAGE_BONUS_28 = 80;
const int DAMAGE_BONUS_29 = 81;
const int DAMAGE_BONUS_30 = 82;
const int DAMAGE_BONUS_31 = 83;
const int DAMAGE_BONUS_32 = 84;
const int DAMAGE_BONUS_33 = 85;
const int DAMAGE_BONUS_34 = 86;
const int DAMAGE_BONUS_35 = 87;
const int DAMAGE_BONUS_36 = 88;
const int DAMAGE_BONUS_37 = 89;
const int DAMAGE_BONUS_38 = 90;
const int DAMAGE_BONUS_39 = 91;
const int DAMAGE_BONUS_40 = 92;
const int DAMAGE_BONUS_41 = 93;
const int DAMAGE_BONUS_42 = 94;
const int DAMAGE_BONUS_43 = 95;
const int DAMAGE_BONUS_44 = 96;
const int DAMAGE_BONUS_45 = 97;
const int DAMAGE_BONUS_46 = 98;
const int DAMAGE_BONUS_47 = 99;
const int DAMAGE_BONUS_48 = 100;
const int DAMAGE_BONUS_49 = 101;
const int DAMAGE_BONUS_50 = 102;
//:: IP_CONST_DAMAGEBONUS
const int IP_CONST_DAMAGEBONUS_11 = 21;
const int IP_CONST_DAMAGEBONUS_12 = 22;
const int IP_CONST_DAMAGEBONUS_13 = 23;
@@ -767,6 +798,37 @@ const int IP_CONST_DAMAGEBONUS_9d12 = 69;
const int IP_CONST_DAMAGEBONUS_10d12 = 70;
const int IP_CONST_DAMAGEBONUS_1d3 = 71;
const int IP_CONST_DAMAGEBONUS_4d3 = 72;
const int IP_CONST_DAMAGEBONUS_21 = 73;
const int IP_CONST_DAMAGEBONUS_22 = 74;
const int IP_CONST_DAMAGEBONUS_23 = 75;
const int IP_CONST_DAMAGEBONUS_24 = 76;
const int IP_CONST_DAMAGEBONUS_25 = 77;
const int IP_CONST_DAMAGEBONUS_26 = 78;
const int IP_CONST_DAMAGEBONUS_27 = 79;
const int IP_CONST_DAMAGEBONUS_28 = 80;
const int IP_CONST_DAMAGEBONUS_29 = 81;
const int IP_CONST_DAMAGEBONUS_30 = 82;
const int IP_CONST_DAMAGEBONUS_31 = 83;
const int IP_CONST_DAMAGEBONUS_32 = 84;
const int IP_CONST_DAMAGEBONUS_33 = 85;
const int IP_CONST_DAMAGEBONUS_34 = 86;
const int IP_CONST_DAMAGEBONUS_35 = 87;
const int IP_CONST_DAMAGEBONUS_36 = 88;
const int IP_CONST_DAMAGEBONUS_37 = 89;
const int IP_CONST_DAMAGEBONUS_38 = 90;
const int IP_CONST_DAMAGEBONUS_39 = 91;
const int IP_CONST_DAMAGEBONUS_40 = 92;
const int IP_CONST_DAMAGEBONUS_41 = 93;
const int IP_CONST_DAMAGEBONUS_42 = 94;
const int IP_CONST_DAMAGEBONUS_43 = 95;
const int IP_CONST_DAMAGEBONUS_44 = 96;
const int IP_CONST_DAMAGEBONUS_45 = 97;
const int IP_CONST_DAMAGEBONUS_46 = 98;
const int IP_CONST_DAMAGEBONUS_47 = 99;
const int IP_CONST_DAMAGEBONUS_48 = 100;
const int IP_CONST_DAMAGEBONUS_49 = 101;
const int IP_CONST_DAMAGEBONUS_50 = 102;
// IP_CONST_IMMUNITYSPELL

View File

@@ -1564,11 +1564,42 @@ int IPGetDamageBonusConstantFromNumber(int nNumber)
case 18: return DAMAGE_BONUS_18;
case 19: return DAMAGE_BONUS_19;
case 20: return DAMAGE_BONUS_20;
case 21: return DAMAGE_BONUS_21;
case 22: return DAMAGE_BONUS_22;
case 23: return DAMAGE_BONUS_23;
case 24: return DAMAGE_BONUS_24;
case 25: return DAMAGE_BONUS_25;
case 26: return DAMAGE_BONUS_26;
case 27: return DAMAGE_BONUS_27;
case 28: return DAMAGE_BONUS_28;
case 29: return DAMAGE_BONUS_29;
case 30: return DAMAGE_BONUS_30;
case 31: return DAMAGE_BONUS_31;
case 32: return DAMAGE_BONUS_32;
case 33: return DAMAGE_BONUS_33;
case 34: return DAMAGE_BONUS_34;
case 35: return DAMAGE_BONUS_35;
case 36: return DAMAGE_BONUS_36;
case 37: return DAMAGE_BONUS_37;
case 38: return DAMAGE_BONUS_38;
case 39: return DAMAGE_BONUS_39;
case 40: return DAMAGE_BONUS_40;
case 41: return DAMAGE_BONUS_41;
case 42: return DAMAGE_BONUS_42;
case 43: return DAMAGE_BONUS_43;
case 44: return DAMAGE_BONUS_44;
case 45: return DAMAGE_BONUS_45;
case 46: return DAMAGE_BONUS_46;
case 47: return DAMAGE_BONUS_47;
case 48: return DAMAGE_BONUS_48;
case 49: return DAMAGE_BONUS_49;
case 50: return DAMAGE_BONUS_50;
}
if (nNumber>20)
if (nNumber>50)
{
return DAMAGE_BONUS_20;
return DAMAGE_BONUS_50;
}
else
{