Files
PRC8/nwn/nwnprc/trunk/spells/nw_s0_stormvenc.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

118 lines
5.5 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Storm of Vengeance: Heartbeat
//:: NW_S0_StormVenC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates an AOE that decimates the enemies of
the cleric over a 30ft radius around the caster
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 8, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
//:: Elemental Damage note: Only made the lightning aspect variable, the acid aspect is always acid.
//:: the Lightning part seemed like the better of the 2 to go with because it accounts for more
//:: of the total damage than the acid does.
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
//Declare major variables
object aoeCreator = GetAreaOfEffectCreator();
effect eStun = EffectStunned();
effect eVisAcid = EffectVisualEffect(VFX_IMP_ACID_S);
effect eVisElec = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eVisStun = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eStun, eVisStun);
eLink = EffectLinkEffects(eLink, eDur);
float fDelay;
int CasterLvl = PRCGetCasterLevel(aoeCreator);
int nPenetr = SPGetPenetrAOE(aoeCreator, CasterLvl);
//Get first target in spell area
object oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
{
// 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_STORM_OF_VENGEANCE)))
{
SetLocalInt(OBJECT_SELF, "ExtraordinarySpellAim_" + sTargetID, TRUE);
// Target is excluded, skip to next
oTarget = GetNextInPersistentObject(OBJECT_SELF, OBJECT_TYPE_CREATURE);
continue;
}
}
}
}
int nDamage = d6(6);
nDamage += SpellDamagePerDice(aoeCreator, 6);
effect eElec = PRCEffectDamage(oTarget, nDamage, ChangedElementalDamage(aoeCreator, DAMAGE_TYPE_ELECTRICAL));
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, aoeCreator))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_STORM_OF_VENGEANCE));
//Make an SR Check
fDelay = PRCGetRandomDelay(0.5, 2.0);
if(PRCDoResistSpell(aoeCreator, oTarget,nPenetr, fDelay) == 0)
{
int nDC = PRCGetSaveDC(oTarget, aoeCreator);
int nAcid = d6(3);
nAcid += SpellDamagePerDice(aoeCreator, 3);
// Acid Sheath adds +1 damage per die to acid descriptor spells
if (GetHasDescriptor(SPELL_STORM_OF_VENGEANCE, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, aoeCreator))
nAcid += 3;
effect eAcid = PRCEffectDamage(oTarget, nAcid, DAMAGE_TYPE_ACID);
//Make a saving throw check
// * if the saving throw is made they still suffer acid damage.
// * if they fail the saving throw, they suffer Electrical damage too
if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (nDC), SAVING_THROW_TYPE_ELECTRICITY, aoeCreator, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
if (d2()==1)
{
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget));
}
}
else
{
//Apply the VFX impact and effects
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
//Apply the VFX impact and effects
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eElec, oTarget));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)));
}
}
}
//Get next target in spell area
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}