Files
PRC8/nwn/nwnprc/trunk/spells/nw_s1_aurafeara.nss
Jaysyn904 48ca4b8acf 2026/01/21 Update
Swapped Disciple of Asmodeus' Summon Glabrezu for Summon Pit Fiend.  Glabrezu aren't devils.
Wisplings can qualify for Warsling Sniper.
Added Maeluth planetouched racialtype.
Maeluth can qualify for Dwarven Defender. Ollam and Ironsoul Forgemaster.
Added Mechanatrix planetouched racialtype.
Updated creature aura scripts to use PRCEffectDamage(), SPApplyEffectToObject() & PRCMySavingThrow().
2026-01-21 16:35:43 -05:00

48 lines
1.9 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Aura of Fear On Enter
//:: NW_S1_AuraFearA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be struck with fear because
of the creatures presence.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eFear = EffectFrightened();
effect eLink = EffectLinkEffects(eFear, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
int nHD = GetHitDice(GetAreaOfEffectCreator());
int nDC = 10 + GetHitDice(GetAreaOfEffectCreator())/3;
int nDuration = PRCGetScaledDuration(nHD, oTarget);
string sVar = "FearAoE_"+ObjectToString(GetAreaOfEffectCreator());
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator())
&& !GetLocalInt(oTarget, sVar))
{
SetLocalInt(oTarget, sVar, TRUE);
AssignCommand(oTarget, DelayCommand(HoursToSeconds(24), DeleteLocalInt(oTarget, sVar)));
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_FEAR));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the VFX impact and effects
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}