I have been using the same global quest scripts for certain npcs since I figured out how to do them several years ago, But for some reason they are no longer working, and I am getting a lot of anomalies with their paired-down versions. One is for my wandering npc who travels from zone to zone; the other is for my global watcher npc who activates the spawn for the wanderer. The paired-down scripts are below:
Watcher Script (NPCID 999281 )
Code:
my $EventStart;
my $x;
my $y;
my $z;
my $h;
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();
sub EVENT_SPAWN {
$EventStart = 0;
quest::depopall(999228);
}
sub EVENT_WAYPOINT
{
if ($EventStart == 0)
{
$EventStart = 1;
quest::spawn2(999228,0,0,$x+1,$y+1,$z,$h);
quest::shout("Wanderer spawned");
}
}
Wanderer Script (NPCID 999228 )
Code:
sub EVENT_SPAWN
{
quest::shout("Hi");
}
I have necessarily abbreviated both scripts because the rest of each script should be irrelevant to this issue (I've commented out (##) all the other lines for testing purposes to mirror the abbreviations above). Here are the issues:
First of all, the Watcher script is supposed to spawn the Wanderer right next to the Watcher. Instead, the Wanderer spawns at the zone entrance point, which is quite a distance from the Watcher. Second, once the Wanderer spawns, he is supposed to shout "Hi." Instead, it is the Watcher that ends up shouting "Hi." The chat box in game displays the following text:
Quote:
You say '#reloadquest'
Clearing quest memory cache.
You say '#repop'
Zone depoped. Repoping now.
watcher shouts 'Wanderer spawned'
watcher shouts 'Hi'
|
I should mention that I have a grid with two waypoints for the Watcher, and both waypoints are set at a 5-second pause. Again, this is how I have always created them and they have always worked in the past. I should also mention that all NPCs involved have their gquest settings set to 1 in the DB. I cannot figure out why it is doing this. Any suggestions?