RATDOG/_module/nss/desecrating_aur1.nss
Jaysyn904 df709d33fc Horsefly Swamp update
Creatures & encounter tables to support Horsefly swamp expansion.
2023-08-13 17:21:44 -04:00

69 lines
2.2 KiB
Plaintext

#include "NW_I0_SPELLS"
#include "prc_inc_spells"
int GetHasEffect(object oObject, int nEffectType)
{
effect eEffect = GetFirstEffect(oObject);
while ( GetIsEffectValid(eEffect) )
{
if ( GetEffectType(eEffect) == nEffectType )
return TRUE;
eEffect = GetNextEffect(oObject);
}
return FALSE;
}
void main()
{
//Declare major variables
object oCaster = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nDC = 10 + GetHitDice(oCaster) /2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster);
effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID);
effect eVis = EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR);
effect eAttack = EffectAttackIncrease(2);
effect eDamage = EffectDamageIncrease(2);
effect eSaves1 = EffectSavingThrowIncrease(SAVING_THROW_WILL,2);
effect eSaves2 = EffectSavingThrowIncrease(SAVING_THROW_REFLEX,2);
effect eHP = EffectAbilityIncrease(ABILITY_CONSTITUTION,4);
effect eLink = EffectLinkEffects(eAttack,eDamage);
eLink = EffectLinkEffects(eLink,eSaves1);
eLink = EffectLinkEffects(eLink,eSaves2);
eLink = EffectLinkEffects(eLink,eHP);
eLink = EffectLinkEffects(eLink,eVis);
effect eFear = EffectParalyze();
effect eFearVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink2 = EffectLinkEffects(eFear,eFearVis);
eLink2 = EffectLinkEffects(eLink2,eDur);
// Fear Aura
if ( GetIsEnemy(oTarget,oCaster) && GetLocalInt(oCaster,"FEAR_AURA") )
{
if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR) )
{
if ( !PRCMySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_FEAR,oCaster) )
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink2,oTarget,RoundsToSeconds(d8()));
}
}
}
SetLocalInt(oTarget,"TurnPenalty",1);
// Descecrating Aura
if ( GetLocalInt(oTarget,"DEAura") )
return;
int nRace = GetRacialType(oTarget);
if ( nRace == RACIAL_TYPE_UNDEAD )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink,oTarget);
SetLocalInt(oTarget,"DEAura",1);
}
}