55 lines
1.3 KiB
Plaintext
55 lines
1.3 KiB
Plaintext
|
//::
|
||
|
//:: paralyze_onhit.nss
|
||
|
//::
|
||
|
//:: Modified by: Jaysyn 20221215
|
||
|
//::
|
||
|
|
||
|
#include "NW_I0_GENERIC"
|
||
|
#include "nw_i0_spells"
|
||
|
#include "nw_i0_plot"
|
||
|
#include "prc_inc_racial"
|
||
|
|
||
|
|
||
|
void DoParalyze(object oTarget, object oCaster)
|
||
|
{
|
||
|
//:: Setup Paralysis
|
||
|
effect eVis2 = EffectVisualEffect(VFX_IMP_NIGHTMARE_HEAD_HIT);
|
||
|
effect ePara = EffectParalyze();
|
||
|
ePara = SupernaturalEffect(ePara);
|
||
|
|
||
|
//:: Apply Paralysis
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePara, oTarget, TurnsToSeconds(d4()));
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
//:: Declare major variables
|
||
|
object oCaster = OBJECT_SELF ; //:: Where the spell came from
|
||
|
object oTarget = GetSpellTargetObject(); //:: What the spell is aimed at
|
||
|
|
||
|
int nRaceType = MyPRCGetRacialType(oTarget);
|
||
|
int nChaMod = GetAbilityModifier(5, oCaster);
|
||
|
int nMobHD = GetHitDice(oCaster);
|
||
|
int nDC = 10 + (nMobHD / 2) + nChaMod;
|
||
|
int nSave = FortitudeSave( oTarget, nDC );
|
||
|
|
||
|
//:: Check for Paralysis Immunity
|
||
|
if ( GetIsImmune(oTarget, IMMUNITY_TYPE_PARALYSIS) )
|
||
|
{
|
||
|
SendMessageToPC(oTarget, "Immune to paralysis.");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
//:: Saving throw
|
||
|
if ( nSave )
|
||
|
return;
|
||
|
|
||
|
//:: if you got this far, you're paralyzed.
|
||
|
|
||
|
DelayCommand(0.1, DoParalyze(oTarget, oCaster));
|
||
|
|
||
|
}
|
||
|
|