Wikia

NWN2Wiki

EffectHealOnZeroHP

Talk0
3,772pages on
this wiki
///////////////////////////////////////////////////////////////////////////////
// EffectHealOnZeroHP
///////////////////////////////////////////////////////////////////////////////
// Created By:	Brock Heinz
// Created On:	09/02/2005
// Description: Creates a deferred heal effect that is applied to the target
//				when it reaches or falls below zero hit points
// Argument: oTarget - the target to add disintegrate effects to
// Argument: nDamageToHeal - the amount of damage to heal on the target
// Returns: effect - the newly created effect
///////////////////////////////////////////////////////////////////////////////
effect EffectHealOnZeroHP( object oTarget, int nDmgToHeal );

When using this effect in a module with a system of death and dying similar to that found in Storm of Zehir, it is important to note that this effect is very literal. If you set nDmgToHeal to 1, exactly one hit point will be healed which will not bring oTarget back to life if its hit points are at negative one or lower.

Another use of this function is to create a poor man's OnDeath event. Because this effect automatically ends when oTarget reaches zero hit points, it is possible to mimic the OnDeath module event without actually using or editing it. To do this you would start by assigning a unique spell ID with SetEffectSpellId to the effect, and then write a script which checks for an effect with that ID as often as you would like. I would recommend a recursive script as it is easier to adjust the timing of the check (see bard songs for examples of recursive scripts). When the check script does not find your effect, it can be then routed to fire another series of scripts (or the event you want to fire when oTarget reaches zero hp) and end the checks. The script which checks for the effect's ID must be called after the effect is placed on oTarget, otherwise it will fire prematurely.

Advertisement | Your ad here

Videos

Remove video
Are you sure you want to remove this video from the Videos list?
Please wait wile we are removing the video
Error occurred while loading data. Please recheck your connection and refesh the page.
3 Videos on this wiki
Add a video
1 of 1

Photos

Add a Photo
1,439photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki