Evening all.
Playtesting a character idea, I noticed something, or at least I think I did.
I created a level 20 Cleric; gave him the Protection Domain, even took GSF: Abjuration. He had a max WIS score of 32, and a max CHR of 30. Yet, when I cast Sanctuary, the save DC was 26. Looking at NWN Wiki, the Protection Domain grants an improved form of Sanctuary, with a save calculated as follows:
Divine Protection - The cleric is able to cast an improved form of sanctuary that sets the save DC at 10 + charisma modifier + clerical level. The effect has a duration of 1 round per caster level + charisma modifier.
Given all my stats, I should have had a save DC of 44.
So, I went digging.
'> It appears that Sanctuary (nw_s0_sanctuary) does not reference at all the enhanced form granted by the Protection Domain. That code is found at nw_s2_divprot. So, what I did was simply add an if statement to the original sanctuary spell ...
if (GetHasFeat(FEAT_PROTECTION_DOMAIN_POWER))
...then, append the code found at nw_s2_divprot to my original and voila, it gave me a DC of 40.
But wait, it should be 44...and here is my question.
I took GSF: Abjuration. But somehow, the save DC does not take that into account. Now, since creatures have to make a will save against the spell, I assume this is an adverse affect to them; e.g. it should be no different than if I cast a fireball at them with GSF: Evocation; the DC rises.
Can anyone tell me why this would be?
And, if possible, how would I repair that oversight on the part of Bioware?
Attached below is the new code for the original Sanctuary spell for you viewing pleasure.
'>
//::///////////////////////////////////////////////
//:: Sanctuary
//:: NW_S0_Sanctuary.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Makes the target creature invisible to hostile
creatures unless they make a Will Save to ignore
the Sanctuary Effect
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
if (GetHasFeat(FEAT_PROTECTION_DOMAIN_POWER))
{
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
int nDC = 10 + GetAbilityModifier(ABILITY_CHARISMA) + GetLevelByclass(class_TYPE_CLERIC);
effect eSanc = EffectSanctuary(nDC);
effect eLink = EffectLinkEffects(eVis, eSanc);
eLink = EffectLinkEffects(eLink, eDur);
//Fire cast spell at event for the specified target
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_DIVINE_PROTECTION, FALSE));
int nDuration = GetCasterLevel(OBJECT_SELF) + GetAbilityModifier(ABILITY_CHARISMA);
if ( nDuration < 1 )
{
nDuration = 1;
}
//Enter Metamagic conditions
int nMetaMagic = GetMetaMagicFeat();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}
else
{
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eSanc = EffectSanctuary(GetSpellSaveDC());
effect eLink = EffectLinkEffects(eVis, eSanc);
eLink = EffectLinkEffects(eLink, eDur);
int nDuration = GetCasterLevel(OBJECT_SELF);
//Enter Metamagic conditions
int nMetaMagic = GetMetaMagicFeat();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SANCTUARY, FALSE));
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}
}