#include "zcommon.acs"
#library "RETARD"

script 666 (int delay_hurt, int delay_healed) {
        if (CheckInventory("WeaponID4") <= 0) terminate;
		if (CheckInventory("HurtCount") == 1) terminate;
        int wait = delay_healed;
        int health = GetActorProperty(0, APROP_HEALTH);
		int prevhealth;
		Delay(35*10);
        while ((health > 0) && (health < 100))
				{
                prevhealth = health;
                delay(1);
                health = GetActorProperty(0, APROP_HEALTH);
                if (health < prevhealth) {
				wait = delay_hurt;
                }
				if (wait-- == 0) {
				HealThing(1);
				wait = delay_healed;
                }
        }
		TakeInventory("HurtCount", 1);
}
