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

51 lines
1.8 KiB
Plaintext

#include "NW_I0_SPELLS"
#include "prc_inc_spells"
void main()
{
//Declare major variables
object oCaster = GetAreaOfEffectCreator();
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID);
effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH);
effect eDrain = EffectNegativeLevel(2);
effect eDeath = EffectDeath();
effect eBoost = EffectTurnResistanceIncrease(4);
eBoost = EffectLinkEffects(eBoost,EffectRegenerate(5,6.0));
object oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget))
{
if ( GetLocalInt(oTarget,"NEAura") )
{
oTarget = GetNextInPersistentObject();
break;
}
int nRace = MyPRCGetRacialType(oTarget);
if(GetIsEnemy(oTarget, oCaster))
{
if ( nRace != RACIAL_TYPE_UNDEAD )
{
if ( GetHitDice(oTarget) <= 2 )
{
location lWight = GetLocation(oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget);
CreateObject(OBJECT_TYPE_CREATURE,"nw_wight",lWight);
}
else
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
}
}
}
if ( nRace == RACIAL_TYPE_UNDEAD )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBoost,oTarget);
}
SetLocalInt(oTarget,"NEAura",1);
oTarget = GetNextInPersistentObject();
}
}