LoT_PRC8/_module/nss/trap_sonc_avg.nss
Jaysyn904 ec287507a1 Initial upload
Initial upload.
2023-09-25 21:32:17 -04:00

57 lines
2.2 KiB
Plaintext

void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE);
//::///////////////////////////////////////////////
//:: Average Sonic Trap
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Will save or the creature is stunned
//:: for 1 round and 1d4 damage
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 18, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
object oTarget;
int nDamage;
effect eDam;
effect eStun = EffectStunned();
effect eFNF = EffectVisualEffect(VFX_FNF_SOUND_BURST);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eStun, eMind);
//effect eDam;
//Apply the FNF to the spell location
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eFNF, GetLocation(GetEnteringObject()));
//Get the first target in the spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM,GetLocation(GetEnteringObject()));
while (GetIsObjectValid(oTarget))
{
//Roll damage
nDamage = d4(3);
//Make a Will roll to avoid being stunned
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, 14, SAVING_THROW_TYPE_SONIC))
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2));
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
//Apply the VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam,oTarget);
//Get the next target in the spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM,GetLocation(GetEnteringObject()));
}
//respawn trap
DelayCommand(598.0, CreateObject2(GetObjectType(OBJECT_SELF), GetResRef(OBJECT_SELF), GetLocation(OBJECT_SELF)));
DelayCommand(600.0, DestroyObject(OBJECT_SELF));
}
void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE)
{
CreateObject(nObjectType, sTemplate, lLocation, bUseAppearAnimation);
return;
}