View Single Post
  #4  
Old 05-27-2009, 01:33 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

Ok, now I'm trying to add a timed check because the script fires slowly. I expect if several people rush the proximity at the same time the boss would lose count. Using the following code he still keeps count and tells you he's over his limit, but the second MovePC won't fire. I'm guessing this is because he doesn't know which PC to move? Can I have him move a random PC if this is the case?


Code:
sub EVENT_SPAWN {
	my $x = $npc->GetX();
	my $y = $npc->GetY();
	quest::set_proximity($x - 15, $x + 15, $y - 15, $y + 15);
	quest::settimer("count",5);

	$enter_count = 0;
}


sub EVENT_ENTER {

	$enter_count = $enter_count + 1;
	quest::shout("1");

	if ($enter_count > 1) {
	quest::shout("No more than 1 at a time may do this encounter.");
	quest::movepc(241, 0, 0, 20);
	}
}


sub EVENT_TIMER {
	if (($timer eq "count") && ($enter_count > 1)) {
		quest::shout("No more than 1 at a time may do this encounter. Part 2");
		quest::movepc(241, 0, 0, 20);
		quest::stoptimer("count");
		quest::settimer("count",5);
		}
}
  
  
sub EVENT_EXIT {

$enter_count = $enter_count - 1;
quest::shout("2");

}
Reply With Quote