Files
PRC8/nwn/nwnprc/trunk/spells/nw_s1_bltcold.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

55 lines
1.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Bolt: Cold
//:: NW_S1_BltCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "prc_inc_sp_tch"
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(OBJECT_SELF);
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eBolt;
int nDC = 10 + (nHD/2);
int nCount = nHD /2;
if (nCount == 0)
{
nCount = 1;
}
int nDamage = d6(nCount);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_COLD));
//Make a ranged touch attack
int nTouch = PRCDoRangedTouchAttack(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}