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

53 lines
1.9 KiB
Plaintext

void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE);
//::///////////////////////////////////////////////
//:: Minor Tangle Trap
//:: NW_T1_TangMinoC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Targets within 5ft of the entering character
are slowed unless they make a reflex save with
a DC of 20. Effect lasts for 3 Rounds
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
void main()
{
//Declare major variables
int nDuration = 3;
object oTarget = GetEnteringObject();
location lTarget = GetLocation(oTarget);
effect eSlow = EffectSlow();
effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
//Find first target in the size
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget);
//Cycle through the objects in the radius
while (GetIsObjectValid(oTarget))
{
if(! MySavingThrow(SAVING_THROW_REFLEX, oTarget, 20, SAVING_THROW_TYPE_NONE))
{
//Apply slow effect and slow effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oTarget, RoundsToSeconds(nDuration));
}
//Get next target in the shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget);
}
//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;
}