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

95 lines
3.1 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Blade Barrier: On Enter
//:: NW_S0_BladeBarA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a wall 10m long and 2m thick of whirling
blades that hack and slice anything moving into
them. Anything caught in the blades takes
2d6 per caster level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 20, 2001
//:://////////////////////////////////////////////
//:: modified by mr_bumpkin Dec 4, 2003
#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_EVOCATION);
//Declare major variables
object oTarget = GetEnteringObject();
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
object aoeCreator = GetAreaOfEffectCreator();
int nMetaMagic = PRCGetMetaMagicFeat();
int nLevel = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
int CasterLvl = nLevel;
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
//Make level check
if (nLevel > 20)
{
nLevel = 20;
}
// Check Extraordinary Spell Aim
if(GetHasFeat(FEAT_EXTRAORDINARY_SPELL_AIM, aoeCreator)
&& GetIsFriend(oTarget, aoeCreator))
{
string sTargetID = ObjectToString(oTarget);
if(!GetLocalInt(OBJECT_SELF, "ExtraordinarySpellAim_" + sTargetID))
{
if(GetIsSkillSuccessful(aoeCreator, SKILL_SPELLCRAFT, 25 + PRCGetSpellLevel(aoeCreator, SPELL_BLADE_BARRIER)))
{
SetLocalInt(OBJECT_SELF, "ExtraordinarySpellAim_" + sTargetID, TRUE);
return; // Target excluded
}
}
}
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
{
//Fire spell cast at event
SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_BLADE_BARRIER));
//Roll Damage
int nDamage = d6(nLevel);
//Enter Metamagic conditions
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
{
nDamage = nLevel * 6;//Damage is at max
}
if ((nMetaMagic & METAMAGIC_EMPOWER))
{
nDamage = nDamage + (nDamage/2);
}
nDamage += SpellDamagePerDice(aoeCreator, nLevel);
//Make SR Check
if (!PRCDoResistSpell(aoeCreator, oTarget,nPenetr) )
{
// 1.69 change
//Adjust damage according to Reflex Save, Evasion or Improved Evasion
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget,aoeCreator),SAVING_THROW_TYPE_SPELL);
//Set damage effect
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SLASHING);
//Apply damage and VFX
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the local integer storing the spellschool name
}