Thread: Quest question.
View Single Post
  #9  
Old 05-01-2015, 11:32 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

It's not a very elegant way to do it and it is certainly untested (not even sure the NPC hasn't already cleared the hate list before the EVENT_DEATH call or not -- would need to look at the source) but, it may give you an idea:

Code:
sub EVENT_DEATH {
	my @hate_list = $npc->GetHateList();
	my $hate_count = @hate_list;
	if ($hate_count > 0) {
		foreach $ent (@hate_list) {
			$hate_entity = $ent->GetEnt();
			$hate_client = $hate_entity->CastToClient();
			if (($hate_entity->IsClient()) && (!$hate_client->IsBecomeNPC())) {
				$hate_client->SetEXP($hate_client->GetEXP(),($hate_client->GetAAExp()+1000));
			}
		}
	}
}
If the hate list is clear by the time EVENT_DEATH is called, then, well, even more coding will be necessary but, I'm not quite up to that tonight (have a few projects piling up).

Last edited by ghanja; 05-02-2015 at 09:04 PM.. Reason: case sensativity sucks
Reply With Quote