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

35 lines
1.1 KiB
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 ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster )
return;
effect eDeath = EffectDeath();
eDeath = SupernaturalEffect(eDeath);
effect eImp = EffectVisualEffect(VFX_IMP_DEATH);
// Protection from evil wards against effect
if ( GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR) ||
GetIsImmune(oTarget,IMMUNITY_TYPE_MIND_SPELLS) ||
GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oTarget) ||
GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL,oTarget) ||
GetHasSpellEffect(SPELL_HOLY_AURA,oTarget) )
return;
if ( !PRCMySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget);
}
}