Page 1 of 1

I've fallen and I can't get up! Heal me!

PostPosted: Thu Jun 27, 2002 1:50 am
Author: Orleron
// Casts a heal spell at the PC which is appropriate to their wounds.

void main()
{
object oPC = GetPCSpeaker();
int iHitPointDifference = GetMaxHitPoints(oPC)- GetCurrentHitPoints(oPC);

if ( iHitPointDifference <= 10)
{
ActionCastSpellAtObject(SPELL_CURE_LIGHT_WOUNDS, oPC);
}
if ( iHitPointDifference <= 20)
{
ActionCastSpellAtObject(SPELL_CURE_SERIOUS_WOUNDS, oPC);
}
if ( iHitPointDifference <= 30)
{
ActionCastSpellAtObject(SPELL_CURE_MODERATE_WOUNDS, oPC);
}
if ( iHitPointDifference <= 40)
{
ActionCastSpellAtObject(SPELL_CURE_CRITICAL_WOUNDS, oPC);
}
}