Here is the code for my healer. I'm trying to get her to whisper to anyone who enters her proximity AND is <= 70% health AND has Realm faction. If someone is ally, he is called "citizen." If someone is less than ally buut greater than amiable, he is called "friend." The script works in part; she whispers, but she does so to anyone whose health is <= 70%, no matter what faction. Any suggestions?
Code:
sub EVENT_ENTER
{
my $player = $entity_list->GetClientByID($userid);
my $get_player = $player->CastToClient();
my $player_hps = $get_player->GetHPRatio();
if ($player_hps <= 70)
{
$npc->SetAppearance(1);
$factioncheck = $client->GetCharacterFactionLevel(484);
{
if ($factioncheck >= 1101)
{
$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.' ");
}
if ($factioncheck >= 101)
{
$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.' ");
}
}
}
}