2026/01/14 Update
Added 3 starting packages for Crusaders. Fixed Identify, Psionic. Added PRC switch to show SR roll info in the combat log. Soul Eater's wights keep their original appearance and portrait.
This commit is contained in:
@@ -892,6 +892,7 @@ void CreateSwitchNameArray()
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_CREATE_INFUSION_OPTIONAL_HERBS);
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_CRAFT_SCEPTER_CASTER_LEVEL);
|
||||
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_SHOW_SR_CHECK_DETAILS);
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_MATERIAL_COMPONENTS);
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_DISABLE_COMPONENTS_SHOP);
|
||||
array_set_string(oWP, "Switch_Name", array_get_size(oWP, "Switch_Name"), PRC_PNP_TRUESEEING);
|
||||
|
||||
@@ -86,6 +86,13 @@
|
||||
* Spell switches *
|
||||
\******************************************************************************/
|
||||
|
||||
/**
|
||||
* Show detailed spell resistance check information to the caster
|
||||
* When enabled, displays the roll vs SR values when checking spell resistance
|
||||
*/
|
||||
const string PRC_SHOW_SR_CHECK_DETAILS = "PRC_SHOW_SR_CHECK_DETAILS";
|
||||
|
||||
|
||||
/** Material Components
|
||||
* Set switch to 1 to activate this
|
||||
* This allows material components in NWN through the materialcomp.2da
|
||||
|
||||
@@ -304,10 +304,31 @@ int PRCDoResistSpell(object oCaster, object oTarget, int nEffCasterLvl=0, float
|
||||
}
|
||||
}
|
||||
|
||||
//:: A tie favors the caster.
|
||||
int nSRValue = PRCGetSpellResistance(oTarget, oCaster);
|
||||
int nD20Roll = d20(1);
|
||||
int nCasterTotal = nEffCasterLvl + nD20Roll + iWeav;
|
||||
|
||||
if (nCasterTotal < nSRValue)
|
||||
nResist = SPELL_RESIST_PASS;
|
||||
|
||||
//:: Optional Detailed SR check to caster
|
||||
if (GetIsPC(oCaster) && nResist != SPELL_RESIST_MANTLE && nResist != SPELL_RESIST_GLOBE && nSRValue > 0 && GetPRCSwitch(PRC_SHOW_SR_CHECK_DETAILS))
|
||||
{
|
||||
string message = nResist == SPELL_RESIST_FAIL ?
|
||||
"Target affected. Roll: " + IntToString(nCasterTotal) + " vs SR: " + IntToString(nSRValue) :
|
||||
"Target resisted. Roll: " + IntToString(nCasterTotal) + " vs SR: " + IntToString(nSRValue) +
|
||||
" (missed by " + IntToString(nSRValue - nCasterTotal) + ")";
|
||||
SendMessageToPC(oCaster, message);
|
||||
}
|
||||
|
||||
//:: Basic pass/fail messages
|
||||
PRCShowSpellResist(oCaster, oTarget, nResist, fDelay);
|
||||
|
||||
// A tie favors the caster.
|
||||
|
||||
/* // A tie favors the caster.
|
||||
if ((nEffCasterLvl + d20(1)+iWeav) < PRCGetSpellResistance(oTarget, oCaster))
|
||||
nResist = SPELL_RESIST_PASS;
|
||||
nResist = SPELL_RESIST_PASS; */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,4 +419,6 @@ int CheckSpellfire(object oCaster, object oTarget, int bFriendly = FALSE)
|
||||
|
||||
//absorbed
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//:; void main(){}
|
||||
Reference in New Issue
Block a user