Rune_PRC8/_module/nss/fear2_aura1.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

35 lines
1008 B
Plaintext

#include "nw_i0_spells"
#include "prc_inc_spells"
void main()
{
object oTarget = GetEnteringObject();
object oCaster = GetAreaOfEffectCreator();
int nLevel = GetHitDice(oCaster);
int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster);
if ( nLevel > 20 )
nLevel = 20;
float fDuration = RoundsToSeconds(d4());
if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster )
return;
effect eFear = EffectParalyze();
effect eImp = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eFear,eVis);
eLink = EffectLinkEffects(eLink,eDur);
if ( !PRCMySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_FEAR,oCaster) )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration);
}
}