View Single Post
  #1  
Old 09-26-2009, 01:29 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default Fish out of water? No longer! I think!

Code:
sub EVENT_COMBAT {
	if ($Combat_State == 1) {
	quest::settimer("Water",1);
	}
	
	if ($Combat_State == 0) {
	quest::stoptimer("Water");
	}
}

sub EVENT_TIMER {
	my $z = $npc->GetZ();
		if ($z>=VARBYZONE) {
		$npc->WipeHateList();
		$mob->sethp($mob->GetMaxHP());
		quest::stoptimer("Water");
                $
		}
}
I haven't tested this as of yet, I just finished the code, but this should work and also have a minimal impact on server performance. Basically, when a fish is aggro'd it will start a timer. As that timer ticks away it will continually check it's Z, once that Z breaks the plane of the water in a zone it will wipe the mobs hate list, sending it home and full heal it. Change the VARBYZONE to match the Z water line in the zone you are working with.

If anyone can offer some improvements to the code, feel free.
__________________
Retired EMarr
Project1999 Developer
Reply With Quote