Try this I wrote this today for an encounter.
Code:
sub EVENT_SPAWN{
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
#$h = $npc->GetH();
quest::set_proximity($x - 70, $x + 70, $y - 70, $y + 70);
$zoneid = $npc->GetZoneID();
quest::setnexthpevent(90);
}
sub EVENT_ENTER {
my $n = $client->GetName();
quest::emote("you dare challenge me $n?");
quest::attack($n);
quest::movepc($zoneid, $x, $y, $z); #summons player to him on agro
}