Files
PRC8/nwn/nwnprc/trunk/spells/nw_s0_crpdoomc.nss
Jaysyn904 1ea0b03976 2026/05/07 Update
Hospitaler had incorrect epic bonus feat progression
Hospitaler had incorrect bonus feat list.
Hospitaler was missing Ride from its skill list.
Runecaster had incorrect epic bonus feat progression
Runecaster had incorrect bonus feat list.
Warmage Edge should work with magic staves.
Added PRC_RETH_DEKALA_AURA_HOSTILE_ONLY switch and modified Vilefire aura to use it.
Spells that use DoCone() should now respect Mastery of Shaping.
Removed Hospitaler from list of classes that use the Fighter Bonus Feat list.
ExtraordinarySpellAim() now handles persistent AoEs
Acid Fog, Blade Barrier, Creeping Doom, Grease, Incindiary Cloud, Wall of Fire, Wall of Frost, Prismatic Wall, Prismatic Sphere, Sleet Storm and Spike Growth now respect Extraordinary Spell Aim.
2026-05-07 13:42:22 -04:00

107 lines
3.8 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Creeping Doom: Heartbeat
//:: NW_S0_CrpDoomC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature caught in the swarm take an initial
damage of 1d20, but there after they take
1d6 per swarm counter on the AOE.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
#include "prc_inc_spells"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
//Declare major variables
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
object aoeCreator = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
string sConstant1 = "NW_SPELL_CONSTANT_CREEPING_DOOM1" + ObjectToString(GetAreaOfEffectCreator());
string sConstant2 = "NW_SPELL_CONSTANT_CREEPING_DOOM2" + ObjectToString(GetAreaOfEffectCreator());
int nSwarm = GetLocalInt(OBJECT_SELF, sConstant1);
int nDamCount = GetLocalInt(OBJECT_SELF, sConstant2);
float fDelay;
if(nSwarm < 1)
{
nSwarm = 1;
}
//--------------------------------------------------------------------------
// 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(aoeCreator))
{
DestroyObject(OBJECT_SELF);
return;
}
//Get first target in spell area
oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget) && nDamCount < 1000)
{
// Check Extraordinary Spell Aim
if(GetIsObjectValid(aoeCreator) && GetHasFeat(FEAT_EXTRAORDINARY_SPELL_AIM, aoeCreator))
{
string sTargetID = ObjectToString(oTarget);
if(!GetLocalInt(OBJECT_SELF, "ExtraordinarySpellAim_" + sTargetID))
{
if(GetIsFriend(oTarget, aoeCreator))
{
if(GetIsSkillSuccessful(aoeCreator, SKILL_SPELLCRAFT, 25 + PRCGetSpellLevel(aoeCreator, SPELL_CREEPING_DOOM)))
{
SetLocalInt(OBJECT_SELF, "ExtraordinarySpellAim_" + sTargetID, TRUE);
// Target is excluded, skip to next
oTarget = GetNextInPersistentObject(OBJECT_SELF, OBJECT_TYPE_CREATURE);
continue;
}
}
}
}
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
{
fDelay = PRCGetRandomDelay(1.0, 2.2);
SignalEvent(oTarget,EventSpellCastAt(aoeCreator, SPELL_CREEPING_DOOM, FALSE));
//Roll Damage
nDamage = d6(nSwarm);
nDamage += SpellDamagePerDice(aoeCreator, nSwarm);
//Set Damage Effect with the modified damage
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_PIERCING);
//Apply damage and visuals
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
nDamCount = nDamCount + nDamage;
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
if(nDamCount >= 1000)
{
DestroyObject(OBJECT_SELF, 1.0);
}
else
{
nSwarm++;
SetLocalInt(OBJECT_SELF, sConstant1, nSwarm);
SetLocalInt(OBJECT_SELF, sConstant2, nDamCount);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}