Awesome thanks KLS. The NPC can now actually pick me up as the random hate target, and cast a spell on me. The level function is still not working though, I don't think it knows who to cast it on.
Here's code:
Code:
sub EVENT_TIMER{
if ($timer == 1){
my $hate_target = $npc->GetHateRandom();
my $hate_name = $hate_target->GetName();
my $hate_id = $hate_target->GetID();
quest::shout("My hate target is $hate_name");
$npc->CastSpell(1588, $hate_id);
$client->SetLevel(1, 0);
}
Anyone have any ideas? If not I may just make the NPC cast some spell that would produce the same sort of end result, but I'd really like it to actually delevel if possible.