Initial upload
Initial upload.
This commit is contained in:
80
_module/nss/trap_fire_minor.nss
Normal file
80
_module/nss/trap_fire_minor.nss
Normal file
@@ -0,0 +1,80 @@
|
||||
void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE);
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Minor Fire Trap
|
||||
//:: NW_T1_FireMinoC
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Does 5d6 damage to all within 5 ft.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 4th, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 27, 2001
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
int bValid;
|
||||
object oTarget = GetEnteringObject();
|
||||
location lTarget = GetLocation(oTarget);
|
||||
int nDamage;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
int nSaveDC = 18;
|
||||
//Get first object in the target area
|
||||
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget);
|
||||
//Cycle through the target area until all object have been targeted
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Roll damage
|
||||
nDamage = d6(5);
|
||||
//Adjust the trap damage based on the feats of the target
|
||||
if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_FIRE))
|
||||
{
|
||||
if (GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
|
||||
{
|
||||
nDamage /= 2;
|
||||
}
|
||||
}
|
||||
else if (GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
|
||||
{
|
||||
nDamage = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
nDamage /= 2;
|
||||
}
|
||||
if (nDamage > 0)
|
||||
{
|
||||
//Set the damage effect
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
if (nDamage > 0)
|
||||
{
|
||||
//Apply effects to the target.
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user