EffectHeal(int)

Creates a healing effect.

effect EffectHeal(
    int nDamageToHeal
);

Parameters

nDamageToHeal

Hit points to heal.


Description

Returns a heal effect that will heal an object nDamageToHeal hit points. This should be applied as an instantaneous effect.
Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nDamageToHeal < 0.

EffectHeal doesn't damage undead. Special undead race checks are used for healing spells to damage them, while Harm and similar spells actually heal undead. EffectHeal doesn't take into account anything special.



Remarks

EffectHeal is a way to remove EffectHitPointChangeWhenDying() on a dying PC, and also stops the Wounding caused by the special creature properties.

EffectHeal has no effect when applied to placeables and doors. To the authors' knowledge, there is no way to restore a door's or a placeable's hitpoints.


Version

1.62

Example

// oUser = object that last used the calling object
// used it in the below example to fire an OnUsed event on a
// placeable, useable object (a shaft of light)
void main()
{
     object oUser = GetLastUsedBy();
     effect eHeal = EffectHeal(10);
     if (GetIsObjectValid(oUser))
     {
          // heal the user
          ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oUser);
     }
}

See Also

categories: Effects Functions
constants: EFFECT_TYPE_* Constants


 author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Jorian Night, Jasperre, D.W. Fite, Lilac Soul
 Send comments on this topic.