Alangara_PRC8/_removed/NW_T1_COLDAVGC.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

75 lines
2.4 KiB
Plaintext

//:://////////////////////////////////////////////
//:: Average Frost Trap :://
//:://////////////////////////////////////////////
//:: NEW FROST TRAP DESIGN BY TARASHON :://
//:://////////////////////////////////////////////
#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_FROST_L);
effect eParal = EffectPetrify();
effect eFreeze = EffectVisualEffect(VFX_DUR_BLUR);
effect eLink = EffectLinkEffects(eParal, eFreeze);
effect eDam;
// *** DC for saves *** //
int nSaveDC = 25;
//Get first object in the target area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
//Cycle through the target area until all object have been targeted
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Roll damage
nDamage = d4(20);
//Adjust the trap damage based on the feats of the target
if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_TRAP))
{
if (GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage /= 2;
}
}
else if (GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamage /= 2;
// nDamage = 0;
}
else
{
nDamage /= 2;
}
if (nDamage > 0)
{
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, 25, SAVING_THROW_TYPE_TRAP))
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(6));
}
//Apply effects to the target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
//Get next target in shape
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
}
}