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 10-09-2012, 06:57 PM
chrismed0
Sarnak
 
Join Date: Aug 2010
Location: USA
Posts: 75
Default Waypoint Spawning

I'm not sure exactly how to do this. I did some looking around and tried a few things but none so far seemed to work. Still trying to get the hang of writting these perl quests.

I am trying to get a NPC to spawn in another zone on a grid when an NPC in another zone hits a certain waypoint in another zone.

This is what I got so far from reading but not sure what the missing component is.

Code:
sub EVENT_WAYPOINT_ARRIVE {
    if ($wp==32) {
         (not sure what goes here, thought maybe quest::spawn() but doesn't work)
    }
}
Thanks

~Edit~
Ok found a couple of posts. Looks like it has something to with globals but don't understand how globals work or how to set one up.

~Edit~
Just for additional information. Both zones are static. Both NPC are up and on on grids I completed. The one npc which is suppose to trigger the one is suppose to stay up and moves on a circular grid. The other one is not suppose to be up until it's triggered.
Reply With Quote
  #2  
Old 10-09-2012, 09:01 PM
chrismed0
Sarnak
 
Join Date: Aug 2010
Location: USA
Posts: 75
Default

Hmm,
I found information here:
http://www.eqemulator.org/forums/sho...d.php?p=175707

here:
http://www.eqemulator.net/wiki/wikka...=QuestTutorial

Here:
http://www.eqemulator.org/forums/showthread.php?t=28964

But it isn't enough. I have the information just not how to use it or set it up. There is a part where it says you have to define something in the database to allow it to use global. Not sure if you place the quest.pl in the folder of that zone or you have to place it someplace else. I have the pieces of the puzzle just not sure how they fit together.

If there is any way someone can post a walk through of how to set up or how a global works so that I may understand how to write one I would appriciaite it.
Reply With Quote
  #3  
Old 10-09-2012, 10:16 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

i don't exactly know how this suppose to work but put some simple quest::say inside of it and see if it triggers at all

sub EVENT_WAYPOINT_ARRIVE {
if ($wp==32) {
quest::say("BOO!");

quest::spawn2(npcID, 0, 0, someX, someY, someZ, 0);
}
}

P.S. missed the part about "the other zone" but see if the thing above works at all
Reply With Quote
  #4  
Old 10-09-2012, 10:17 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i don't think you can use a global in zone to directly spawn an npc in another. you'd have to have a script in the zone you want the npc to spawn in to check the value of the global being used. you could, for example, use a timer in the target zone's player.pl to periodically check for the value required to spawn the npc.
Reply With Quote
  #5  
Old 10-09-2012, 10:51 PM
chrismed0
Sarnak
 
Join Date: Aug 2010
Location: USA
Posts: 75
Default

Ok I found this stuff here. It is probably what I'm looking for.

quest::spawn_condition(zone_short, condition_id, value) - uses variables in the spawn_conditions∞ table for spawning, despawning chosen npc's in a given zone. See SampleQuests.

quest::get_spawn_condition(zone_short, condition_id) - Get the value of a spawn condition

quest::toggle_spawn_event(event_id,enable,reset_ba se) - Toggle a spawn event. See the SpawnConditions page for details on usage.

I see in the DB under spawn_conditions and each condition has:

"zone" "ID" "value" "onchange" "name"


I'm assuming from what I'm reading you can make a quest of an NPC check the value and if is "x" value then that is the condition to make NPC "A" spawn in say "freporte". I have a quest written for the npc in freporte that when it reaches ($wp eq 4) it quest::depop() and this works. (tested by repoping the zone and watched it's follow through, zone is static)

looks like the conditions are linked to the spawn2 table so fixing to take a look at it and see how it's set up.

If I can figure out how to write it it looks like all I have to do is do a:

"code for OOT NPC"
Code:
sub EVENT_WAYPOINT_ARRIVE {
    if ($wp eq 35) 
        {
            #what ever is suppose to be here to check and spawn the NPC in freporte then reset the condition value??? 
             quest::spawn_condition(zone_short, condition_id, value)????
        }
}
"code for freporte NPC"
Code:
sub EVENT_WAYPOINT_ARRIVE {
    if ($wp eq 5)
        {
            #once spawned will continue on it's grid it's assigned to untill....
            quest::depop();
            #maybe change value of the spawn condition here?
        }
}
I'm assuming that is sorta how it works. There are other things I will add to the scripts but they are alot easier then this part considering I'm trying to figure out how this works.
Reply With Quote
  #6  
Old 10-09-2012, 11:04 PM
chrismed0
Sarnak
 
Join Date: Aug 2010
Location: USA
Posts: 75
Default

Ok so looking at the spawn2 table.
I notice it has:

"id" "spawngroupID" "zone" "version" "x" "y" "z" "heading" "respawntime" "_condition" "_condition value" "enable"

~edit~

I had typed a theory about the spawn2 table, but got to thinking about it and it really didn't make sence. So, backon track here.

Ok I assume that with an npc entered into this table you can set some value for the condition.
Then enter a condition into the "spawn_conditions" table and if the values match then it causes the spawn of the NPC in the zone specified by the Spawn2.
You can use a quest to alter the values of the condition to match the spawn2 and make the npc spawn. Is this correct? and if it is.. now I just have to figure out how you would write it.
Reply With Quote
  #7  
Old 10-10-2012, 04:59 PM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Quote:
Originally Posted by chrismed0 View Post
I'm not sure exactly how to do this. I did some looking around and tried a few things but none so far seemed to work. Still trying to get the hang of writting these perl quests.

I am trying to get a NPC to spawn in another zone on a grid when an NPC in another zone hits a certain waypoint in another zone.

This is what I got so far from reading but not sure what the missing component is.

Code:
sub EVENT_WAYPOINT_ARRIVE {
    if ($wp==32) {
         (not sure what goes here, thought maybe quest::spawn() but doesn't work)
    }
}
Thanks

~Edit~
Ok found a couple of posts. Looks like it has something to with globals but don't understand how globals work or how to set one up.

~Edit~
Just for additional information. Both zones are static. Both NPC are up and on on grids I completed. The one npc which is suppose to trigger the one is suppose to stay up and moves on a circular grid. The other one is not suppose to be up until it's triggered.
Did you try using - sub EVENT_WAYPOINT_ARRIVE
Reply With Quote
Reply


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 10:31 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