Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2009, 09:50 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default My Example

Create an NPC (we'll say Wanderer) with whatever stats you want, but enable qglobals.
In spawn2 table, set a spawn at 100% at the zone-in location from the previous zones (each of which, we'll call 1, 2, and 3). For example, zone2 spawn point would be where Wanderer would have zoned in from zone1. Zone3 spawn would be from the zone line of zone2, and zone1 would be from the zone line of zone3.
Create waypoints (we'll say id of 100) in our zones. Use full pause and ensure that the last waypoint has a decent pause time for the x/y check.

All 3 script files will look almost identical. Items in red will be the difference between the files. The first one is the starting zone.

quests\1\Wanderer.pl
Code:
my $ZoneOutX = 1111;
my $ZoneOutY = 1111;

sub EVENT_SPAWN {
  if (!defined($qglobals{Wanderer}) {
    quest::setglobal("Wanderer",1,7,"F");
  }
  if (defined($qglobals{Wanderer}) && ($qglobals{Wanderer} == 1)) {
    quest::start(100);
  }
  else {
    depop();
  }
}

sub EVENT_DEATH {
  quest::delglobal("Wanderer");
}

sub EVENT_WAYPOINT {
  if (($x == $ZoneOutX) && ($y == $ZoneOutY)) {
    quest::stop();
    quest::setglobal("Wanderer",2,7,"F");
    quest::depop();
  }
}
quests\2\Wanderer.pl
Code:
my $ZoneOutX = 2222;
my $ZoneOutY = 2222;

sub EVENT_SPAWN {
  if (defined($qglobals{Wanderer}) && ($qglobals{Wanderer} == 2)) {
    quest::start(100);
  }
  else {
    depop();
  }
}

sub EVENT_DEATH {
  quest::delglobal("Wanderer");
}

sub EVENT_WAYPOINT {
  if (($x == $ZoneOutX) && ($y == $ZoneOutY)) {
    quest::stop();
    quest::setglobal("Wanderer",3,7,"F");
    quest::depop();
  }
}
quests\3\Wanderer.pl
Code:
my $ZoneOutX = 3333;
my $ZoneOutY = 3333;

sub EVENT_SPAWN {
  if (defined($qglobals{Wanderer}) && ($qglobals{Wanderer} == 3)) {
    quest::start(100);
  }
  else {
    depop();
  }
}

sub EVENT_DEATH {
  quest::delglobal("Wanderer");
}

sub EVENT_WAYPOINT {
  if (($x == $ZoneOutX) && ($y == $ZoneOutY)) {
    quest::stop();
    quest::setglobal("Wanderer",1,7,"F");
    quest::depop();
  }
}
Reply With Quote
  #2  
Old 08-02-2009, 09:55 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

I've tested each part of this script, and this part of it is broken:

if (!defined($qglobals{Wanderer}) {
quest::setglobal("Wanderer",1,7,"F");
}

The rest of it works fine. Any reason this part doesn't work? Is the ! being used correctly?
Reply With Quote
  #3  
Old 08-02-2009, 10:05 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Yeah, I missed a close parenthesis.

Code:
if (!defined($qglobals{Wanderer})) {
That's what I get for writing code "on the fly" instead of testing it first.
Reply With Quote
  #4  
Old 08-02-2009, 10:22 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Bah! I'm ashamed I missed that! It appears to be working now. Just need to revamp the 2d and 3d script and try the whole sequence. I'll let you know how it goes. Thanks.
Reply With Quote
  #5  
Old 08-03-2009, 12:18 AM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Okay, the following part is not working:

Code:
sub EVENT_WAYPOINT 
	{
 	if (($x == $ZoneOutX) && ($y == $ZoneOutY)) 
		{
    		quest::stop();
		quest::delglobal("wanderer");
   		quest::setglobal("wanderer",2,7,"F");
    		quest::depop();
  		}
	}
The npc is not responding to anything in this event. I assumed I should change the previously defined ZoneOuts from 1111 to the actual xy coords of the final waypoint, like so:

my $ZoneOutX = -15972.6;
my $ZoneOutY = 632.1;

Is this correct?
Reply With Quote
  #6  
Old 08-03-2009, 08:27 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Yes.

Now, in the database, do you have that exact location in the grid_entries as the last grid for his path in that zone? If so, there might be a possibility that he triggers the waypoint before he gets to that exact coordinate. Also, just in case, are you sure the x/y y/x is correct?
Reply With Quote
  #7  
Old 08-03-2009, 09:31 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

It is the exact location as in grid_entries. And I used #loc on the npc when he was paused at the final waypoint to verify the coords (x comes first using #). Those values are in the definition:

my $ZoneOutX = -15972.6;
my $ZoneOutY = 632.1;

The zone is Qey2hh1 and is on the dirt path right before the zone line with northkarana.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:47 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3