Files
PRC8/nwn/nwnprc/trunk/spells/sp_moral_undn.nss
Jaysyn904 c437270cd1 2026/05/28 Afternoon update
Updated damagtypes.2da for CEP3 reserved rows.
Added and setup Darkvision icon.
Added and setup Ultravision icon.
Added spell icon for Thicket of Blades.
Fixed Blacklight, Cloud of the Archeai, Darkness, Deeper Darkness, Damning Darkness, Utterdark, Grasping Shadows, Dawn and Dusk and Child of Shadow and Light for Telflammar Shadowlord's Shadow Blur and Shadow Sight abilities.
Updated Blacklight's TLK entry.
Created a constant for Shadow Discorporation.
Fixed Shadow Time never ending on the targets.
Updated prc_inc_combat to use monk iterative progression if warranted.
Updated PRCGetIsRealSpellKnownByClass() to handle Sublime Chord better. (@Lightbeard)
Added class heartbeat script for Shadowlord to handle Shadow Blur and Shadow Sight.
Added ShadowlordEffects() to prc_inc_spells.
Added constants for new damagetypes.
Completely rewrote Verminlord's Vermin Domination.
Fixed duration for Empathic Feedback.
Fixed Morality Undone to not break characters over a server reset.
2026-05-28 16:27:19 -04:00

95 lines
3.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Morality Undone
//:: FileName sp_moral_undn.nss
//:://////////////////////////////////////////////
/**@file Morality Undone
Enchantment [Evil, Mind-Affecting]
Level: Brd 5, Clr 5, Corruption 4, Mortal Hunter 4
Components: V, S, M/DF
Casting Time: 1 action
Range: Close (25 ft. + 5 ft./2 levels)
Target: One non-evil creature
Duration: 10 minutes/level
Saving Throw: Will negates
Spell Resistance: Yes
The caster turns one creature evil. The
chaotic/neutral/lawful component of the subject's
alignment is unchanged. The subject retains whatever
outlook, allegiances, and outlooks it had before,
so long as they do not conflict with the new
alignment. Otherwise, it acts with its new selfish,
bloodthirsty, cruel outlook on all things.
For example, a wizard might not immediately turn on
her fighter companion for no apparent reason,
particularly in the middle of a combat when they're
fighting on the same side. But she might try to steal
the fighter's bag of gems, even using applicable
spells (charm person, suggestion, and invisibility,
for instance) against her friend. She might even
eventually decide to betray or attack her friend if
there is some potential gain involved.
Using this spell in conjunction with a spell such as
dominate person or suggestion is particularly useful,
because it changes what acts are against a subject's
nature.
Arcane Material Component: A powdered holy symbol.
Author: Tenjac
Created:
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
object oPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nGoodEvil = GetGoodEvilValue(oTarget);
int nCasterLvl = PRCGetCasterLevel(oPC);
int nDC = PRCGetSaveDC(oTarget, oPC);
float fDur = (600.0f * nCasterLvl);
//Spellhook
if(!X2PreSpellCastCode()) return;
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
PRCSignalSpellEvent(oTarget,TRUE, SPELL_MORALITY_UNDONE, oPC);
//Spell Resist
if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr()))
{
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_EVIL))
{
//Poor, poor paladin. It's pathetic that you didn't make your save.
AdjustAlignment(oTarget, ALIGNMENT_EVIL, (100 + nGoodEvil), FALSE);
// Store expiration time and shift amount using persistent locals
SetPersistantLocalInt(oTarget, "MoralityUndone_Expire", FloatToInt(GetTimeSecond() + fDur));
SetPersistantLocalInt(oTarget, "MoralityUndone_ShiftAmount", (100 + nGoodEvil));
}
/* //Saving Throw
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_EVIL))
{
//Poor, poor paladin. It's pathetic that you didn't make your save.
AdjustAlignment(oTarget, ALIGNMENT_EVIL, (100 + nGoodEvil), FALSE);
//Schedule restoration. This might be a problem if they were 100 before and
//improved their alignment any while evil. They might be restored to 85 instead.
DelayCommand(fDur, AdjustAlignment(oTarget, ALIGNMENT_GOOD, (100 + nGoodEvil), FALSE));
} */
}
//SPEvilShift(oPC);
PRCSetSchool();
}