Files
PRC8/nwn/nwnprc/trunk/spells/nw_s0_cloudkillc.nss
Jaysyn904 a62073c871 2026/04/29 Early update
Fixed targeting for Claws of the Savage.
Updated VFX for Landshark Boots.
Made GetTotalUsableEssentia respect Incandescent Overload.
Added the rest of the old CEP2 weapons to prc_x2_itemprop.
Fixed DoCone() to allow skipping SR checks.
Fixed Blast of Flame to not have an SR check.
Fixed Lightining Guantlet's Hand bind to add electrical damage to melee weapon, once per round.
Vow of Poverty now allows Shield of Thought.
Cloudkill now obeys poison immunity
True Resurrection should work on any PC as well as any NPC in your party.
2026-04-29 00:41:13 -04:00

133 lines
5.0 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
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
//:: modified by Ornedan Dec 22, 2004 to PnP rules
//:: Fixed poison immunity bypass 2026-04-28
#include "prc_inc_spells"
#include "prc_add_spell_dc"
#include "prcsp_archmaginc"
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 nMetaMagic = PRCGetMetaMagicFeat();
int nDamage = d4();
//effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
object oTarget;
int nHD;
float fDelay;
//Enter Metamagic conditions
if(nMetaMagic & METAMAGIC_MAXIMIZE)
{
nDamage = 4;//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;
}
object aoeCreator = GetAreaOfEffectCreator();
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
//Set damage effect
//Get the first object in the persistant AOE
oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{
fDelay = PRCGetRandomDelay();
if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE , aoeCreator) )
{
if(CheckMasteryOfShapes(aoeCreator, oTarget))
{
// Target is protected by Mastery of Shaping, skip damage
oTarget = GetNextInPersistentObject();
continue;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL));
nHD = GetHitDice(oTarget);
//Apply VFX impact and damage
//Creatures with less than 6 HD take full damage automatically
//Any with more than 6 get to save (Fortitued) for half
if (nHD < 6)
{
// Check for poison immunity before applying damage
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_POISON))
{
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
else
{
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,aoeCreator)), SAVING_THROW_TYPE_SPELL, OBJECT_SELF))
{
// Check for poison immunity before applying damage
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_POISON))
{
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
else
{
if (GetHasMettle(oTarget, SAVING_THROW_FORT))
// This script does nothing if it has Mettle, bail
nDamage = 0;
// Check for poison immunity before applying damage
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_POISON))
{
// Halve the damage on succesfull save.
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage / 2, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}
//Get the next target in the AOE
oTarget = GetNextInPersistentObject();
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}