Initial Upload
Initial Upload
This commit is contained in:
65
_module/nss/barrel_ondeath.nss
Normal file
65
_module/nss/barrel_ondeath.nss
Normal file
@@ -0,0 +1,65 @@
|
||||
#include "NW_O2_CONINCLUDE"
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void explode()
|
||||
{
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_FIRE);
|
||||
effect eExplode2 = EffectVisualEffect(VFX_FNF_FIREBALL);
|
||||
effect eExplode3 = EffectVisualEffect(VFX_FNF_SOUND_BURST );
|
||||
int nDamage;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_FIRE);
|
||||
effect eDam;
|
||||
float fDelay;
|
||||
location lHere = GetLocation(OBJECT_SELF);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lHere);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode2, lHere);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode3, lHere);
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lHere, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (oTarget != OBJECT_SELF)
|
||||
{
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Roll damage for each target
|
||||
nDamage = d6(3);
|
||||
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
|
||||
//Set the damage effect
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
fDelay = GetDistanceToObject(oTarget)/20;
|
||||
if(nDamage > 0)
|
||||
{
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
//This visual effect is applied to the target object not the location as above. This visual effect
|
||||
//represents the flame that erupts on the target not on the ground.
|
||||
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lHere, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
|
||||
DelayCommand(0.1,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(100,DAMAGE_TYPE_BLUDGEONING),OBJECT_SELF));
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!GetLocalInt(OBJECT_SELF,"exploding"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"exploding",TRUE);
|
||||
DelayCommand(0.1,explode());
|
||||
}
|
||||
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)return;
|
||||
|
||||
object oLastOpener = GetLastOpener();
|
||||
GenerateBossTreasure(oLastOpener, OBJECT_SELF);
|
||||
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
|
||||
ShoutDisturbed();
|
||||
|
||||
}
|
Reference in New Issue
Block a user