View Single Post
  #6  
Old 08-16-2013, 09:45 AM
lumiya
Fire Beetle
 
Join Date: Jun 2010
Posts: 12
Default

This is what I have so far.

Code:
sub EVENT_AGGRO {
  # a 1 second leash timer.
  quest::settimer(1,1);
}

sub EVENT_TIMER {
  if ($timer == 1) {
    quest::say("timer set");
    my @hate_list = $npc->GetHateList();
	my $hate_count = @hate_list;
	if ($hate_count > 0) {
	quest::say("hate count >0");
      foreach $ent (@hate_list) {
            my $h_ent = $ent->GetEnt();
	    my $h_dmg = $ent->GetDamage();
	    my $h_hate = $ent->GetHate();
        if ($h_ent->IsClient()) {
		quest::say("Is Client named $h_ent hate list is $hate_count ");
          if ($h_ent->GetCharacterFactionLevel(GetNPCFaction()) > 1) {
            quest::ze(0,"You are not my enemy! ");
            $h_ent->CastToClient()->MovePC(34,823.3,1373.4,10.33,0);
             }
           }
	  }
    } else {
      WIPE_AGGRO();
	}
  }
}

sub WIPE_AGGRO {

  quest::stoptimer(1);
}
I've getting the callbacks up to
quest;;say("Is Client named $h_ent hate list is $hate_count ");

so what I am having issue with is
if ($h_ent->GetCharacterFactionLevel(GetNPCFaction()) > 1) {

It is this the correct way to full the PC who is on the hatelist's faction with the NPC?
Reply With Quote