View Single Post
  #1  
Old 07-31-2014, 12:26 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default Question about npc pl files and NPC movement.

Ok, I'm basically rewriting this question.. Ignore the previous version if you read it.

I have the following pl file.

The intent of personalpause for each instance of this mob (there are 6) to spawn and pick one of the points on his grid waypoints (0-42) as his "hangout"

The intent of delay is so each instance starts the grid at a different time after he spawns.

I added the write() stuff, as it seemed to do what I expected while I was in the zone to observe, but when I left and came back a day later, the NPCs are all bundled up.

What i noticed from my write() calls, is that the event spawn stuff spits out as soon as I boot the zone, but I don't see any WP arrivals until I zone in. Then they start coming out.

So my question: Is no npc movement happening while no one is in the zone?

Code:
my  $personalpause=0;

sub EVENT_SPAWN
    {
    $personalpause=plugin::RandomRange(0,42);
    $delay=plugin::RandomRange(0,300);
    quest::write("/tmp/madmen", "spawned pause($personalpause) delay($delay)");
    quest::settimer("movetimer",$delay);
    }

sub EVENT_WAYPOINT_ARRIVE
    {
    quest::write("/tmp/madmen", "arrived pause($personalpause) delay($delay)");
    if ($wp == $personalpause)
        {
        $pauselen=plugin::RandomRange(60,150);
        quest::pause($pauselen);
        }
    }

sub EVENT_TIMER
    {
    if ($timer eq "movetimer")
        {
        quest::stoptimer("movetimer");
        quest::start(62);
        }
    }
Reply With Quote