Files
PRC8/nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss
Jaysyn904 68ca3a56ca 2026/01/22 Update 2
Mechanatrixes always fail saves vs elecricity.
Incorporated most creature ability scripts into the PRC8 & updated them to use PRCEffect(), SPApplyEffectToObject(), etc.
Updated prc_inc_breath to use PRCEffectDamage()
Updated several spell scripts to use PRCEffectDamage().
2026-01-23 00:03:47 -05:00

52 lines
1.9 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Pulse: Level Drain
//:: NW_S1_PulsLvlDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
float fDelay;
int nHD = GetHitDice(OBJECT_SELF);
int nDC = 10 + nHD;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(OBJECT_SELF));
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
fDelay = GetSpellEffectDelay(GetLocation(OBJECT_SELF), oTarget)/20;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
{
//Apply the VFX impact and effects
eHowl = EffectNegativeLevel(1);
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}