Initial upload
Initial upload.
This commit is contained in:
51
_module/nss/trap_sonc_minor.nss
Normal file
51
_module/nss/trap_sonc_minor.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE);
|
||||
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Minor Sonic Trap
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the creature is stunned
|
||||
//:: for 2 rounds.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 16, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
object oTarget;
|
||||
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 = EffectDamage(d4(2), DAMAGE_TYPE_SONIC);
|
||||
//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))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
//Make a Will roll to avoid being stunned
|
||||
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, 12, SAVING_THROW_TYPE_SONIC))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2));
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user