PRC8/nwn/nwnprc/trunk/newspellbook/shd_myst_echospl.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

59 lines
2.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
16/02/19 by Stratovarius
Echo Spell
Initiate, Black Magic
Level/School: 5th/Universal
Range: Close (25 ft. + 5 ft./2 levels)
Effect: Repeat a previously cast spell or mystery
Duration: See text
Saving Throw: See text Spell
Resistance: See text
Even as you recoil from your enemys spell, you reach into the Plane of Shadow and draw forth the spiritual reflection of that spell.
With a grin, you manifest it in the physical world and hurl it back at him.
You can “echo” a mystery or spell cast by anyone other than yourself, causing it to remanifest under your control. Both the caster
and the effect must have been within echo spells range, and the entire casting must have occurred in the previous round. You choose
the mystery or spells target, and make any other choices involved in casting it. You cast the mystery or spell using your mystery
user level (use your Cha modifier to determine the mystery or spells DC; its duration, saves, and the like are as normal for that
spell). You cannot echo a mystery or spell of a higher level than the highest-level mystery you can cast, and you can never echo a
mystery or a spell of higher than 4th level.
*/
#include "shd_inc_shdfunc"
#include "shd_mysthook"
void main()
{
object oShadow = OBJECT_SELF;
int nMyst = PRCGetSpellId();
if(DEBUG) DoDebug("shd_myst_echospl: nMyst "+IntToString(nMyst));
if (GetLocalInt(oShadow, "EchoedSpell"))
{
int nSpellId = GetLocalInt(oShadow, "EchoedSpell");
int nDC = 10 + StringToInt(Get2DACache("spells", "Innate", nSpellId)) + GetAbilityModifier(ABILITY_CHARISMA, oShadow);
if(DEBUG) DoDebug("shd_myst_echospl: Echo SpellId "+IntToString(nSpellId)+" at DC "+IntToString(nDC));
AssignCommand(oShadow, ActionCastSpell(nSpellId, GetShadowcasterLevel(oShadow), 0, nDC));
}
else
{
if(DEBUG) DoDebug("shd_myst_echospl: MYST_ECHO_SPELL");
if(!ShadPreMystCastCode()) return;
object oTarget = PRCGetSpellTargetObject();
struct mystery myst = EvaluateMystery(oShadow, oTarget, METASHADOW_NONE);
if(myst.bCanMyst)
{
if(DEBUG) DoDebug("shd_myst_echospl: MYST_ECHO_SPELL bCanMyst");
SetLocalInt(oTarget, "EchoSpell", TRUE);
SetLocalObject(oTarget, "EchoSpell", oShadow);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIMENSIONANCHOR), oTarget);
}
}
}