Aschbourne_PRC8/_module/nss/nw_s1_pulscold.nss
Jaysyn904 5d27edafba Major update
Fixed CCOH, Fixed starting GP, Fixed DMFI languages, Fix cep weapon appearances, Fixed new player start up system.  Added PC deleter.  Added ACP 4.1.  Full compile.  Updated release archive.
2024-09-16 23:40:48 -04:00

69 lines
2.3 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Pulse: Cold
//:: NW_S1_PulsCold
//:: 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 "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = d6(nHD);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_COLD));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}