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.