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-09-2008, 03:52 PM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default NPC Spawning

Quick question, When a certain mob dies in crushbone is there a way to make a spawn pop in say oasis?
Reply With Quote
  #2  
Old 08-09-2008, 11:52 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Anything is possible

You should be able to do something like this:
  • Mob gets killed in Crushbone
  • In sub EVENT_DEATH, define a Global Variable
  • An invisible "watcher mob" in Oasis keeps checking to see if the Global Variable is set
  • Once the watcher mob sees the variable has been set, spawn the next mob
  • Have the spawned mob delete the Global Variable (unless you want to increment it, to have separate stages)

Hope this helps point you in the right direction
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 08-10-2008, 07:56 AM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

thanks =) i'll see if i can get something working =D
Reply With Quote
  #4  
Old 08-10-2008, 09:15 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Can also use the player.pl to check the global upon zoning in so you don't have to create a new NPC.
Reply With Quote
  #5  
Old 08-11-2008, 08:14 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Do let us know if you get it working. I need to do something very similar.
Reply With Quote
  #6  
Old 08-11-2008, 10:26 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

You might want to look at our boat scripts (ax_classic db), things need to happen across the zones like that.
One thing you need to keep in mind is, if the zone has no players, then Perl does not work. So anything you do, scripts are on hold, tell someone zones in. Lets say you want to spawn a mob in 'zone b' and you are in 'zone a', by killing another mob;
Mob is killed in zone a, that trips a global from '0' (off) to '1' (on). We'll call it '$test'.
$test is now 1, but no spawn tell there's a PC in the zone -
How to keep a check on the global in zone b;
Take or make one NPC in the zone, either invisible or one you're sure that's not going to get killed by a PC. Spawn him, and make him a two-point grid, in the same spot he was spawned (in other words, all x,y,z coords on the spawn and waypoints are the same). put a 5 second delay on the grids. Now you can script him to watch for that global change with EVENT_WAYPOINT. This is lag free and doesn't 'ghost' like pop/depop does.
This EVENT_WAYPOINT opens up a ton of possibilities; here's some of my insanity, you could use for example to what you want;
This is and invisible skiff that sits in Timorous zin from butcher; when you zone in from butcher skiff, it holds you for that 'split second' tell the Perl scripts wake up and pop the visible skiff (the variable was already pre-set as the butcher skiff approached the zoneline to Timorous). This boat is a hair higher than the real boat, so when it de-pops, you drop on the real boat (barely noticable);
Code:
##################################\
## Zone: Timorous
## Invisible Capt Skiff (uses grid 27)
## Qadar
## Angelox
#################################

sub EVENT_WAYPOINT{
if (($skiffa >=75) && ($skiffa <=80)){quest::depop();}
 if (($skiffa >=41) && ($skiffa <=43)){quest::depop();}
  if ($skiffa ==0){quest::signal(96320);}
   if(($debugpl2==40) && ($skiffa <=42)){quest::shout("skiffa is set at $skiffa");}
    if($skiffa==40){
     quest::signal(96320);
     quest::spawn2(96320,25,0,-2110.9,-2123.4,-4.5,143);
     quest::spawn2(96320,26,0,-2092.5,-2130.5,-4.5,143);
     quest::delglobal("skiffa");
     quest::setglobal("skiffa",41,7,"F");
     $skiffa = undef;
     quest::depop();}}
That's just 'the tip of the iceburg'


Heres and invisible NPC that watches for different boat movements in Timorous;
Code:
#############
## Watches skiffs status, starts the Island Shuttle movement, Maidens Voyage, and rouge roamer boats
## Zone: Timorous
## AngeloX
#############
sub EVENT_SPAWN{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
    if (($skiffa >=40) && ($skiffa <=80)){
     quest::delglobal("skiffa");
     quest::setglobal("skiffa",40,7,"F");
     $skiffa=undef;}}

sub EVENT_WAYPOINT {
   if (($skiffc ==1) && ($skiffa >=0) && ($skiffa <=40)){
      quest::settimer("skwt2",100);       #wait for some grid movement.
      quest::delglobal("skiffc");
      quest::setglobal("skiffc",$skiffa,7,"F");#Testing for activity, set to current $skiffa
      $skiffc=undef;}
   if (($shuta < 40) && ($shutc ==1) && ($maidna==8)){
      quest::settimer("skwt3",150); #wait for some grid movement.
      quest::delglobal("shutb");
      quest::setglobal("shutb",$shuta,7,"F");#Testing for activity, set to current $shuta.
      $shutb=undef;
      quest::delglobal("shutc");
      quest::setglobal("shutc",3,7,"F");#Set timer variable 3 for check
      $shutc=undef;}
   if (($maidna <=39) && ($maidnc ==1)){
      # quest::shout("Timer Set!");
      quest::settimer("skwt4",410); #wait for some grid movement.
      quest::delglobal("maidnb");
      quest::setglobal("maidnb",$maidna,7,"F");#Testing for activity, set to current $maidna.
      $maidnb=undef;
      quest::delglobal("maidnc");
      quest::setglobal("maidnc",3,7,"F");#Set timer variable to 3 for check
      $maidnc=undef;}}

sub EVENT_TIMER{
   if (($timer eq "skwt3") && ($shuta <=40) && ($shuta==$shutb)){
      quest::delglobal("shuta");
      quest::setglobal("shuta",1,7,"F"); #No activity, so ready Shuttle.
      $shuta=undef;
      quest::spawn2(96075,20,0,-2380,-3963,-4,103.6);
      quest::delglobal("shutc");
      quest::setglobal("shutc",0,7,"F");#Set timer variable to 0 for re-check
      quest::stoptimer("skwt3");
      $shutc=undef;}
     if ($timer eq "skwt3"){
       quest::delglobal("shutc");
       quest::setglobal("shutc",0,7,"F");#Set timer variable to 0 for re-check
       quest::stoptimer("skwt3");
       $shutc=undef;}
   if (($timer eq "skwt4") && ($maidna <=40) && ($maidna==$maidnb)){
      # quest::shout("Supposed to spawn!");
      quest::delglobal("maidna");
      quest::setglobal("maidna",1,7,"F"); #No activity, so start MaidenVoyage.
      $maidna=undef;
      quest::spawn2(96301,30,0,-2930,-1435,-20,118.25);
      quest::stoptimer("skwt4");
      quest::delglobal("maidnc");
      quest::setglobal("maidnc",0,7,"F");#Set timer variable to 0 for re-check
      $maidnc=undef;}
     if ($timer eq "skwt4"){
       # quest::shout("In zone timer off!");
       quest::stoptimer("skwt4");
       quest::delglobal("maidnc");
       quest::setglobal("maidnc",0,7,"F");#Set timer variable to 0 for re-check
       $maidnc=undef;}
   if (($timer eq "skwt2") && ($skiffa >=0) && ($skiffa <=39) && ($skiffc==$skiffa)){
      quest::delglobal("skiffc");
      quest::setglobal("skiffc",0,7,"F"); #No activity, so start Skiff in Timorous (Set to 0).
      $skiffc=undef;
      quest::delglobal("skiffa");
      quest::setglobal("skiffa",40,7,"F");
      quest::stoptimer("skwt2");
      $skiffa=undef;}
   else{
      quest::delglobal("skiffc");
      quest::setglobal("skiffc",1,7,"F"); #Skiff must be in here, but set to 1 for a recheck
      quest::stoptimer("skwt2");
      $skiffc=undef;}}
      
  sub EVENT_ENTER{
   if (($skiffc ==0) || ($skiffa >=0) && ($skiffa <=39)){
    quest::delglobal("skiffc");
    quest::setglobal("skiffc",1,7,"F");
    $skiffc=undef;}}

So as not make to much crap going on in the zone, , nothing happens tell you run up the pier and look for the boat (where Deela stands, Deela sets the global that sets off the watcher);
Code:
sub EVENT_SPAWN{
   $x = $npc->GetX();
   $y = $npc->GetY();
   quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
   quest::delglobal("shutc");
   quest::setglobal("shutc",0,7,"F");
   $shutc=undef;
   quest::delglobal("maidnc");
   quest::setglobal("maidnc",0,7,"F");
   $maidnc=undef;}

sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Hello there. The ships are working again, my work here is done and I'm waiting for my ride home.");}
 {quest::say("If you want want to know more about transportation to [Overthere], [Oasis], [Firiona], or [Butcherblock], I can give you directions.");}
if ($text=~/butcher/i){quest::say("The Captains Skiffs should arrive here soon, you might have to wait a while ...") }
if ($text=~/overthere/i){quest::say("The Bloated Belly docks at the ogre camp"); }
if ($text=~/oasis/i){quest::say("Take the raft north of the ogre camp"); }
if ($text=~/firiona/i){quest::say("Take the Island Shuttle to Firiona Vie"); }}

sub EVENT_ENTER{
if (($shuta==40) && ($maidna==8) && ($shutc==0)){ # Shuttle made it's run, is idle, and MaidenV is there
   quest::delglobal("shuta");
   quest::setglobal("shuta",1,7,"F");
   $shuta=undef;
   quest::spawn2(96075,20,0,-2380,-3963,-4,103.6); #spawn the Island Shuttle
   quest::delglobal("shutb");
   quest::setglobal("shutb",40,7,"F");
   $shutb=undef;}
if (($shuta < 40)&&($shutc==0)){ #Shuttle (shuta) not at 40 so we need to check
   quest::delglobal("shutc");
   quest::setglobal("shutc",1,7,"F");
   $shutc=undef;}
if (($maidna==40)&&($maidnc==0)) {  #MaidenV (maidna) is at 40, so not in use, spawn incoming
   quest::spawn2(96301,30,0,-2930,-1435,-20,118.25);
   # quest::shout("Deela spawn!");
   quest::delglobal("maidna");
   quest::setglobal("maidna",1,7,"F");
   $maidna=undef;}
  if (($maidna < 40)&&($maidnc==0)){ #MaidenV (maidna) not at 40 so we need to check
     $maidna=undef;
     quest::delglobal("maidnc");
     quest::setglobal("maidnc",1,7,"F");
     $maidnc=undef;}
if (($skiffc ==0) || ($skiffa >=0) && ($skiffa <=39)){  #Captains Skiffs
   quest::delglobal("skiffc");
   quest::setglobal("skiffc",1,7,"F");
   $skiffc=undef;}}
I still have a lot more work in Timorous, but right now I'm in 'Bot heaven'.
I was going to do AC like this - you know AC spawns in 4 different zones, but only one instance. Just need a 'watcher' in each zone, and a global with 4 settings, when you kill a mob and AC is up for a spawn, this EVENT_DEATH would signal the watcher who can either check and see if he's spawned elsewhere or random set the global for one of the 4 zones.
Reply With Quote
  #7  
Old 08-12-2008, 08:08 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

I understood about half that, Angelox, but I think it's enough to get started In any case, it looks like it opens a world of options for things I need to do. This is going in my favorites; Thanks!
Reply With Quote
  #8  
Old 08-12-2008, 08:13 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Post what you want to do, and I'll try and help out.
Reply With Quote
  #9  
Old 08-13-2008, 11:15 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
Post what you want to do, and I'll try and help out.
Thanks, Angelox, I will take you up on that just as soon as I return home from a business trip.
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 11:30 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3