Files
PRC8/nwn/nwnprc/trunk/newspellbook/inv_dra_dfnroar.nss
Jaysyn904 2caeb8941c 2025/05/13 Update
Updated TF Shadowlord's prereq 2da.
Fixed CW Samurai's TWF levelup issue.
Added CW Samurai's skill 2DA back in.
Cleaned up ECL 2DA.
Fixed prereq bug with Imp Crit Eagle Claw.
Added Ability Focus feats for all Shapes, Essences & Invocations with DCs.
Fixed bug with 6th slot of crafting spells prereqs.
Added Reth Dekala HD to Initiator total.
Removed Dark Sun race files.
Updated all racial outsiders, monstrous humanoids, aberrations, giants, humanoids and fey to have the correct weapon & armor profs.
2025-05-13 23:05:31 -04:00

67 lines
2.4 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Deafening Roar
//:: FileName inv_dra_dfnroar.nss
//::///////////////////////////////////////////////
/*
Least Invocation
2nd Level Spell
You utter a loud roar within a 30' cone. Those
within must make a Fortitude save or be deafened
for 1 hour.
*/
//::///////////////////////////////////////////////
#include "inv_inc_invfunc"
#include "inv_invokehook"
void main()
{
if(!PreInvocationCastCode()) return;
//Declare major variables
object oCaster = OBJECT_SELF;
location lTarget = PRCGetSpellTargetLocation();
int CasterLvl = GetInvokerLevel(oCaster, GetInvokingClass());
int nPenetr = CasterLvl + SPGetPenetr();
int nDC = GetInvocationSaveDC(oTarget, oCaster);
if (GetHasFeat(FEAT_ABFOC_DEAFENING_ROAR, oCaster)) nDC += 2;
float fDelay;
effect eDeaf = EffectDeaf();
effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link the deafened effects
effect eLink = EffectLinkEffects(eDeaf, eDur);
//Get first target in the spell cone
object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, FeetToMeters(30.0), lTarget, TRUE, OBJECT_TYPE_CREATURE, GetPosition(oCaster));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oCaster && !GetIsReactionTypeFriendly(oTarget))
{
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, INVOKE_DEAFENING_ROAR));
//Make SR Check
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
{
//Make a fort save
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (GetInvocationSaveDC(oTarget, oCaster)), SAVING_THROW_TYPE_SONIC, oCaster, fDelay))
{
//Apply the linked effects and the VFX impact
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 6.0,TRUE,-1,CasterLvl));
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in the spell cone
oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, FeetToMeters(30.0), lTarget, TRUE, OBJECT_TYPE_CREATURE, GetPosition(oCaster));
}
}