Quote:
Originally Posted by narcberry
I have 2 questions.
1) After using the movepc function, will the quest keep executing? IE, can 1 quest port someone to nexus, then later port them to pok?
2) What is the best method to move an npc around. Not make them walk to a point, but have them instantly teleport to a position?
|
A little later, but here is somethhing I used for teleporting npcs around. This is an old script that can definitely be written much much better now. Nevertheless, it still gets the job done. You'll want to notice the stuns in there. This was used because npcs would move a little as soon as they were moved. So, it gives time to update. Another alternative to use the stuns is to set npc's run speed very very low if possible. Either will do the trick, but of course you may need to keep run speed up.
Code:
my $location = 0; #startingpoint
sub EVENT_SPAWN {
$location = 0;
}
sub EVENT_SAY {
if($text=~/Hail/i){
if ($location == 1) { #I'm at my new destination
quest::say("You want me to leave this mansion? bummer!");
quest::settimer("moveme",1);
}
else { #I'm at my starting point
quest::say("I am not too happy with my hut");
quest::settimer("moveme",1);
}
}
}
sub EVENT_TIMER {
if ($timer eq "moveme") { #This timer is used for moving. It triggers updateguard
quest::stoptimer("moveme");
quest::settimer("updateguard",1);
if ($location == 1) { #I call this when I need to go back to starting location
$npc->Gate();
$npc->Stun(2000);
$location = 0;
}
else { #I call for this when I'm leaving my original spot
$npc->SendTo(260, 353, 0);
$npc->Stun(2000);
$location = 1;
}
}
if ($timer eq "updateguard") { #I call this to update guard spot
quest::stoptimer("updateguard");
$npc->SaveGuardSpot(0);
}
}