Below is the complete script for each NPC. I backed-up the originals and removed all but the relevant script from each to do this testing. I also rewrote the Watcher script per Caryatis:
Watcher
Code:
## 999281, Watcher
my $EventStart = 0;
sub EVENT_SPAWN {
$EventStart = 0;
quest::depopall(999228);
}
sub EVENT_WAYPOINT
{
if ($EventStart == 0)
{
$EventStart = 1;
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(999228,0,0,$x+1,$y+1,$z,$h);
quest::shout("Wanderer spawned");
}
}
Wanderer
Quote:
##Wanderer, npcid 999228
sub EVENT_SPAWN
{
quest::shout("Hi");
}
|
Here is the in-game chatbox text:
Quote:
You say '#reloadquest'
Clearing quest memory cache.
You say '#repop'
Zone depoped. Repoping now.
watcher shouts 'Wanderer spawned'
watcher shouts 'Hi'
|
Now, when I remove the commented out script name at the top of each file . . .
Code:
my $EventStart = 0;
sub EVENT_SPAWN {
$EventStart = 0;
quest::depopall(999228);
}
sub EVENT_WAYPOINT
{
if ($EventStart == 0)
{
$EventStart = 1;
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(999228,0,0,$x+1,$y+1,$z,$h);
quest::shout("Wanderer spawned");
}
}
and . . .
Code:
sub EVENT_SPAWN
{
quest::shout("Hi");
}
. . . the resulting in-game chatbox text reads:
Quote:
You say '#reloadquest'
Clearing quest memory cache.
You say '#repop'
Zone depoped. Repoping now.
watcher shouts 'Wanderer spawned'
wanderer shouts 'Hi'
|
So the script works when the title lines are deleted but not when they are present.
By the way, both WAYPOINT_ARRIVE and WAYPOINT_DEPART (per joligario) break the script (I have an older version of the server code and it may not have the ability to do these functions).
The larger question is, why would a commented-out line impact the script? I am using Notepad++, and I have ensured there are no extra spaces in the commented-out line nor in the blank line below it. This has never been an issue before. Any ideas why it would respond this way?