I've fallen and I can't get up! Heal me!
Posted: Thu Jun 27, 2002 1:50 am
// 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);
}
}
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);
}
}