Battledale_PRC8/_removed/nw_s1_pulsdrwn.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

139 lines
4.3 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Pulse Drown
//:: NW_S1_PulsDrwn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Allows a water elemental to fill an enemies
lungs with water drowning them over the next
several rounds.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watmaniuk
//:: Created On: April 15, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
void RunDrownImpact(int nSecondsRemaining, object oTarget);
void spritepulse();
void spriteimpact(int nSecondsRemaining, object oTarget);
void main ()
{
if (GetTag(OBJECT_SELF)=="jw_water_sprite")
{
spritepulse();
return;
}
//Declare major variables
object oTarget;
int bSave = FALSE;
int nCnt = GetHitDice(OBJECT_SELF)/4;
int nIdx;
//Make a touch attack
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WATER);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget) && nIdx <= nCnt)
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DROWN));
nCnt = nCnt * 6;
DelayCommand(6.0, RunDrownImpact(nCnt, oTarget));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}
void RunDrownImpact(int nSecondsRemaining, object oTarget)
{
int nCount = GetHitDice(OBJECT_SELF) + 10;
int nDice = nCount/4;
if (GetIsDead(oTarget) == FALSE)
{
if (nSecondsRemaining % 6 == 0)
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nCount))
{
//Roll damage
int nDamage = d4(nDice);
//check for metamagic
effect eDam = EffectDamage(nDamage);
effect eVis = EffectVisualEffect(VFX_IMP_POISON_S);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
nSecondsRemaining = 0;
}
}
--nSecondsRemaining;
if (nSecondsRemaining > 0)
{
DelayCommand(1.0f,RunDrownImpact(nSecondsRemaining,oTarget));
}
}
}
void spritepulse ()
{
//Declare major variables
object oTarget;
int bSave = FALSE;
int nCnt = 2;
int nIdx;
//Make a touch attack
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WATER);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget) && nIdx <= nCnt)
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DROWN));
nCnt = nCnt * 6;
DelayCommand(6.0, spriteimpact(6, oTarget));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}
void spriteimpact(int nSecondsRemaining, object oTarget)
{
int nCount = 4;
int nDice = 2;
if (GetIsDead(oTarget) == FALSE)
{
if (nSecondsRemaining % 6 == 0)
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, 15))
{
//Roll damage
int nDamage = d3();
//check for metamagic
effect eDam = EffectDamage(nDamage);
effect eVis = EffectVisualEffect(VFX_IMP_POISON_S);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
nSecondsRemaining = 0;
}
}
--nSecondsRemaining;
if (nSecondsRemaining > 0)
{
DelayCommand(1.0f,RunDrownImpact(nSecondsRemaining,oTarget));
}
}
}