Okay, one more time. The subsequent "if" statements were wrong. Here is the full corrected code for anyone who wants it:
Code:
#Heal bot
sub EVENT_SAY
{
if($text=~/hail/i)
{
$npc->SetAppearance(0); #healer stands#
quest::say("Hail, $name. You have done well to come to me. I am a daughter of the Realm, but have within me the bloodline of the Healers. Alas, this craft has passed out of all memory of men in this age. But I know it well; and if you wish, I will use it to heal your wounds. The ingredients I need are not easily obtained. I have spent all I possess to gain the meager amount you see before you. I ask only for enough money to secure more so that I may continue to help the people of the Realm. One platinum piece is all I ask. In return, your wounds will be fully healed.");
}
}
sub EVENT_SPAWN
{
$x = $npc->GetX();
$y = $npc->GetY();
quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
}
sub EVENT_ENTER
{
my $player = $entity_list->GetClientByID($userid);
my $get_player = $player->CastToClient();
my $player_hps = $get_player->GetHPRatio();
if ($player_hps <= 70)
{
my $factioncheck = undef;
$npc->SetAppearance(1); # healer sits#
$factioncheck = $client->GetCharacterFactionLevel(484); #faction ID of the Realm#
{
if ($factioncheck >= 1101) #ally status#
{
$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, citizen of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
}
elsif ($factioncheck >= 101) # amiably, kindly, warmly #
{
$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, friend of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
}
else
{#do nothing
}
}
}
}
sub EVENT_ITEM
{
if (($platinum>=1))
{
$npc->SetAppearance(0); #healer stands#
quest::selfcast(13);
quest::say("Many thanks to you, $name. You have aided the armies of the realm more than you know. Be well, and may the blessings of the free peoples go with you.");
$npc->SetAppearance(1); #healer sits#
}
else
{
plugin::return_items(\%itemcount);
quest::say("I'm very sorry, $name, but that isn't enough. I require one platinum piece.");
$npc->SetAppearance(1); #healer sits#
}
}