PRC8/nwn/trunk/newspellbook/shd_myst_shrpshd.nss
Jaysyn904 5914ed2ab5 Updated Release Archive
Updated Release Archive.  Fixed Mage-killer prereqs.  Removed old LETO & ConvoCC related files.  Added organized spell scroll store.  Fixed Gloura spellbook. Various TLK fixes.  Reorganized Repo.  Removed invalid user folders. Added DocGen back in.
2023-08-22 10:00:21 -04:00

70 lines
2.8 KiB
Plaintext
Raw 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.

/*
13/02/19 by Stratovarius
Sharp Shadows
Apprentice, Cloak of Shadows
Level/School: 3rd/Abjuration
Range: Personal
Target: You
Duration: 1 minute/level
You cloak yourself in sharp spikes of darkness. Although they are weightless and do nothing to impede you, your foes soon discover that theyre not so lucky.
A creature striking you takes 1d6 points of piercing damage +1 point per caster level (maximum +15). Damage from sharp shadows is not considered magical for the purpose of overcoming damage reduction.
*/
#include "shd_inc_shdfunc"
#include "shd_mysthook"
void main()
{
int nEvent = GetRunningEvent();
object oShadow = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
object oItem;
// We aren't being called from any event, instead being cast
if(nEvent == FALSE)
{
if(!ShadPreMystCastCode()) return;
struct mystery myst = EvaluateMystery(oShadow, oTarget, (METASHADOW_EXTEND | METASHADOW_EMPOWER | METASHADOW_MAXIMIZE));
if(myst.bCanMyst)
{
myst.fDur = 60.0 * myst.nShadowcasterLevel;
if(myst.bExtend) myst.fDur *= 2;
// Duration Effects
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CHILL_SHIELD), oTarget, myst.fDur, TRUE, myst.nMystId, myst.nShadowcasterLevel);
// Add eventhook to the armor
oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oShadow);
IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), myst.fDur, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
AddEventScript(oItem, EVENT_ITEM_ONHIT, "shd_myst_shrpshd", TRUE, FALSE);
DelayCommand(myst.fDur, RemoveEventScript(oItem, EVENT_ITEM_ONHIT, "shd_myst_shrpshd", TRUE, FALSE));
if(myst.bEmpower)
{
SetLocalInt(oShadow, "SharpShadEmp", TRUE);
DelayCommand(myst.fDur, DeleteLocalInt(oShadow, "SharpShadEmp"));
}
if(myst.bMaximize)
{
SetLocalInt(oShadow, "SharpShadMax", TRUE);
DelayCommand(myst.fDur, DeleteLocalInt(oShadow, "SharpShadMax"));
}
}
}
else if(nEvent == EVENT_ITEM_ONHIT)
{
if(GetIsInMeleeRange(oTarget, oShadow))
{
int nDam = d6();
if (GetLocalInt(oShadow, "SharpShadMax")) nDam = 6;
if (GetLocalInt(oShadow, "SharpShadEmp")) nDam += nDam/2;
nDam += min(15, GetShadowcasterLevel(oShadow, CLASS_TYPE_SHADOWCASTER));
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGMAG), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, DAMAGE_TYPE_PIERCING), oTarget);
}
}
}