PDA

View Full Version : Dozekar the Cursed - Temple of Veeshan (leashing script)


N0ctrnl
09-05-2016, 01:15 PM
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.


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");
}

DanCanDo
09-05-2016, 10:37 PM
I'm one person who can say Thank You for this. I'm still running around checking npc
functions, for as many as I have time for, aside from other priorities, but something
like this is very much appreciated, since it cuts another corner for me. :)

N0ctrnl
09-05-2016, 11:50 PM
If it helps at all, I keep all my quests on github. You can browse them if you'd like. I have done a ton of work on them over the last 18 months and you're more than welcome.

https://github.com/N0ctrnl/VAQuests

DanCanDo
09-06-2016, 12:54 AM
WoW, seriously. I just woke up on Christmas morning and ran down the stairs to see
what's under the tree. That is very generous of you Noctrnl !!!! Thank you for sharing.
I still have several regular npc scripts to check, but I just got finished working on a mile
long custom script over the last two days and scrounging for time.
You most certainly have a heart sir :)

Shin Noir
01-13-2017, 02:17 PM
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 (!$LeashedID || $LeashedID->IsCorpse()) { #if the mob isn't up

return;
}

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");
}

this fix will stop a zone crash if you #repop the zone while doze is aggro'd.

N0ctrnl
01-15-2017, 03:56 PM
Nice! Thanks man :)