View Single Post
  #1  
Old 11-29-2008, 09:03 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default Hatelist Aggro Issues

I'm trying to get four mobs in a zone to attack the client after acquiring an item from an NPC. The hate script is triggered by a timer associated with a SAY event. Here is the SAY, followed by the TIMER:

Code:
sub EVENT_SAY
	{
	if($text=~/accept/i)
		{
		quest::say("Very well, here it is. But have a care, $name, and treat it with caution. It has magical properties that can help or hinder the bearer. Go and practice your new skills.");
		quest::settimer("aggro",10);
		quest::summonitem(13732);
		$client->Message(257, "A strange, unsettled feeling falls upon you.");
		$client->Message(257, "You feel . . . heavy.");
		}
	}
I placed checkmark emotes throughout the following TIMER script to see where it is breaking, and it makes it to "ticking 5," then starts over.

Code:
sub EVENT_TIMER 
	{
	quest::emote("sees that his timer is ticking 1");
	if($timer eq "aggro")
		{
		quest::emote("sees that his timer is ticking 2");
		quest::rebind(183,21,36,8);

		my $guard_one = $entity_list->GetMobByNpcTypeID(999287);
		my $guard_two = $entity_list->GetMobByNpcTypeID(999288);
		my $guard_three = $entity_list->GetMobByNpcTypeID(999289);
		my $guard_four = $entity_list->GetMobByNpcTypeID(999290);
		quest::emote("sees that his timer is ticking 3");
					
		if ($guard_one) 
			{
			quest::emote("sees that his timer is ticking 4");
			my $hate_guard_one = $guard_one->CastToNPC();
			quest::emote("sees that his timer is ticking 5");
			$hate_guard_one->AddToHateList($client, 1);
			quest::emote("sees that his timer is ticking 6");
			}
		if ($guard_two) 
			{
			quest::emote("sees that his timer is ticking 7");
			my $hate_guard_two = $guard_two->CastToNPC();
			$hate_guard_two->AddToHateList($client, 1);
			}
		if ($guard_three) 
			{
			quest::emote("sees that his timer is ticking 8");
			my $hate_guard_three = $guard_three->CastToNPC();
			$hate_guard_three->AddToHateList($client, 1);
			}
		if ($guard_four) 
			{
			quest::emote("sees that his timer is ticking 9");
			my $hate_guard_four = $guard_four->CastToNPC();
			$hate_guard_four->AddToHateList($client, 1);
			}
		quest::emote("sees that his timer is ticking 10");
		quest::stoptimer("aggro");
		}
	}
Since it's not making it to "ticking 6," I assume the problem is with the object $hate_guard_one->AddToHateList($client, 1); . I have used this in its exact form in another quest script where it works just fine (in fact, I simply copied and pasted it), so I am at a loss as to why it is not working. The only difference is that the working script is a "player.pl" whereas the non-working one is an NPC script that references other mobs and the client. But this seems to be identical to the Cazic Thule and Tunare scripts (both of those add the client to third-party mob hatelists), so I don't understand why it's not working here.
Reply With Quote