PRC8/nwn/nwnprc/trunk/scripts/prc_reservheal.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

47 lines
1.3 KiB
Plaintext

//Spell script for reserve feat touch of healing
//prc_reservheal
//by ebonfowl
//Dedicated to Edgar, the real Ebonfowl
#include "prc_sp_func"
void main()
{
object oPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nSpellID = PRCGetSpellId();
int nHealing = GetLocalInt(oPC, "TouchOfHealingBonus")*3;
int nMaxHP = GetMaxHitPoints(oTarget)/2;
int nCurrentHP = GetCurrentHitPoints(oTarget);
int nMaxHealing;
effect eEffect;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_S);
if (nHealing == 0)
{
FloatingTextStringOnCreature("You do not have a spell available of adequate level or type", oPC, FALSE);
return;
}
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
if (nCurrentHP < nMaxHP)
{
//Get max healing amount
nMaxHealing = nMaxHP - nCurrentHP;
if (nHealing > nMaxHealing) nHealing = nMaxHealing;
eEffect = EffectHeal(nHealing);
eEffect = SupernaturalEffect(eEffect);
//Heal and apply vfx
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget);
}
else
{
SendMessageToPC(oPC, "This creature has more than half hit points");
return;
}
}
}