Initial commit. Updated release archive.
This commit is contained in:
23
_module/nss/ro_i_object_heal.nss
Normal file
23
_module/nss/ro_i_object_heal.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
//Begin healing script
|
||||
//Use this in OnUsed of your object
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC;
|
||||
oPC = GetLastUsedBy();
|
||||
|
||||
effect eHeal;
|
||||
effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_S);
|
||||
int nCurrentHitPoints, nMaxHitPoints, nVisualEffectId;
|
||||
|
||||
nMaxHitPoints = GetMaxHitPoints(oPC);
|
||||
nCurrentHitPoints = GetCurrentHitPoints(oPC);
|
||||
if ( nCurrentHitPoints < nMaxHitPoints )
|
||||
{
|
||||
eHeal = EffectHeal(nMaxHitPoints - nCurrentHitPoints);
|
||||
ApplyEffectToObject( DURATION_TYPE_INSTANT, eHeal, oPC );
|
||||
ApplyEffectToObject( DURATION_TYPE_INSTANT, eHealVis, oPC );
|
||||
|
||||
SpeakString("You have been healed.");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user