Battledale_PRC8/_removed/nw_s0_cloudkillc.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

76 lines
2.4 KiB
Plaintext

///::///////////////////////////////////////////////
//:: Cloudkill: Heartbeat
//:: NW_S0_CloudKillC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All creatures with 3 or less HD die, those with
4 to 6 HD must make a save Fortitude Save or die.
Those with more than 6 HD take 1d10 Poison damage
every round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage = d10();
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
object oTarget;
float fDelay;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 10;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
//Get the first object in the persistant AOE
oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay();
if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE , GetAreaOfEffectCreator()) )
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL));
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
//Apply VFX impact and damage
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get the next target in the AOE
oTarget = GetNextInPersistentObject();
}
}