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

32 lines
978 B
Plaintext

#include "NW_I0_SPELLS"
#include "prc_inc_spells"
void DoChaDamage(object oTarget,object oOrigin)
{
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_S);
int nDam = d6();
effect eRot = EffectAbilityDecrease(ABILITY_CHARISMA,nDam);
effect eHeal = EffectHeal(5);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eRot,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oOrigin);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oOrigin);
}
void main()
{
object oOrigin = OBJECT_SELF ; // Where the spell came from
object oTarget = PRCGetSpellTargetObject(); // What the spell is aimed at
if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) )
return;
if ( PRCMySavingThrow(SAVING_THROW_FORT,oTarget,18) )
return;
DelayCommand(0.1,DoChaDamage(oTarget,oOrigin));
}