I made a healer who can heal, cure, and resurrect. The problem is, the code is very 'clunky' and I'm basically having to do seperate code stuff for each potential companion. For example, to heal Iolo, my code checks to see if Iolo is there in the party, checks his health, if needing healed you pay the gold and heal him. here is an example of what I'm talking about:
Code: Select all
iolohealth = UI_get_npc_prop(IOLO, HEALTH);
iolostr = UI_get_npc_prop(IOLO, STRENGTH);
iolofullhealth = (iolostr - iolohealth);
var healoptions = ["yourself", "no one"];
if (isNearby(IOLO)) healoptions = healoptions & "Iolo";
converse(healoptions)
{
case "Iolo"(remove):
if (iolohealth < iolostr)
{
say("@I see thy injury, Iolo. It will cost you 30 gold, interested?@");
if (askYesNo())
{
if (hasGold(30))
{
say("Dezana approaches Iolo and binds the wounds.");
chargeGold(30);
UI_set_npc_prop(IOLO, HEALTH, iolofullhealth);
}
else say ("@You must pay before I can heal you.@");
}
else say("@Very well.@");
}
else say("@You look fine to me.@");
}