This will leash Dozekar to his room, as it's supposed to be. What I did was simply to set the x/y coordinates to not let him go past the doors before leashing back to spawn.
Note: He will
not wipe aggro with this script.
Code:
sub EVENT_SPAWN {
$SpawnX = $x;
$SpawnY = $y;
$SpawnZ = $z;
$SpawnH = $h;
}
sub EVENT_TIMER {
$LeashedID = $entity_list->GetMobByNpcTypeID(124037);
if ($timer eq "CheckLeash") {
quest::stoptimer("CheckLeash");
if($x > -1100 || $y > -950 || $y < -1200) {
$LeashedID->GMMove($SpawnX, $SpawnY, $SpawnZ, $SpawnH);
}
quest::settimer("CheckLeash",1);
}
}
sub EVENT_AGGRO {
quest::settimer("CheckLeash", 1);
}
sub EVENT_DEATH_COMPLETE {
quest::stoptimer("CheckLeash");
}