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 07-29-2009, 09:17 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default Problem with multiple spawns

I have a global that is set to spawn npcs in rows at a castle when the global flag is set to 1. A watcher in the zone checks the flag and spawns the npcs when a pc enters the zone. The watcher is on a two-point grid with a 5-sec pause. The problem is, a new mob spawns at each spawn point every time the watcher moves to the next grid point, and the npcs continue to pile up on top of each other. The watcher is there to control other globals I use as well. How do I write this script so that only one instance of spawning occurs? Do I need to use a second watcher for this? Watcher code is below and the npcs in question are the 999151 group:

Code:
sub EVENT_WAYPOINT
	{
	if (defined($qglobals{lord})) 
		{
		if ($qglobals{lord} == 4)
			{	
			quest::signal(999247);
			}
		}

	elsif (defined($qglobals{kingdomfaction})) 
		{
		if ($qglobals{kingdomfaction} == 1)
			{	
			#spawns lvl 65 guards in Hall
, west facing
			quest::spawn2(999151,0,0,1722.50,1556.52,231.25,190);
			quest::spawn2(999151,0,0,1722.50,1593.45,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1655.94,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1694.96,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1755.84,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1795.59,228.75,190);

			#spawns lvl 65 guards in Hall
, east facing
			quest::spawn2(999151,0,0,1674.43,1556.52,231.25,60);
			quest::spawn2(999151,0,0,1674.43,1593.45,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1655.94,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1694.96,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1755.84,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1795.59,228.75,60);
			#spawns lvl 65 guards outside Hall
, north facing
			quest::spawn2(999151,0,0,1795,1880,227.25,0);
			quest::spawn2(999151,0,0,1605,1880,227.25,0);
			quest::spawn2(999151,0,0,1680,1880,227.25,0);
			quest::spawn2(999151,0,0,1718,1880,227.25,0);
			quest::spawn2(999151,0,0,1755,1838,227.25,0);
			quest::spawn2(999151,0,0,1645,1838,227.25,0);	
			quest::spawn2(999151,0,0,1605,1838,227.25,0);
			quest::spawn2(999151,0,0,1795,1838,227.25,0);
			}
		}
	}
Reply With Quote
  #2  
Old 07-29-2009, 10:12 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

You could have it clear the flag after it does a set of spawns.
Reply With Quote
  #3  
Old 07-29-2009, 10:14 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Unless something is changing between each time the NPC gets to another WP, it will just keep doing the same thing every WP. You need to either have it set something to stop it, or one of your qglobals that are being checked needs to change before the next WP is reached.

You could simply do something like this (additions colored in RED):
Code:
my $EventStart;

sub EVENT_SPAWN {

	$EventStart = 0;
	quest::depopall(999151);
}

sub EVENT_WAYPOINT
	{
	if (defined($qglobals{lord})) 
		{
		if ($qglobals{lord} == 4)
			{	
			quest::signal(999247);
			}
		}

	elsif (defined($qglobals{kingdomfaction})) 
		{
		if ($qglobals{kingdomfaction} == 1 && $EventStart == 0)
			{

			#Stop further spawnings
			$EventStart = 1;

			#spawns lvl 65 guards in Hall
, west facing
			quest::spawn2(999151,0,0,1722.50,1556.52,231.25,190);
			quest::spawn2(999151,0,0,1722.50,1593.45,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1655.94,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1694.96,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1755.84,228.75,190);
			quest::spawn2(999151,0,0,1722.50,1795.59,228.75,190);

			#spawns lvl 65 guards in Hall
, east facing
			quest::spawn2(999151,0,0,1674.43,1556.52,231.25,60);
			quest::spawn2(999151,0,0,1674.43,1593.45,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1655.94,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1694.96,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1755.84,228.75,60);
			quest::spawn2(999151,0,0,1674.43,1795.59,228.75,60);
			#spawns lvl 65 guards outside Hall
, north facing
			quest::spawn2(999151,0,0,1795,1880,227.25,0);
			quest::spawn2(999151,0,0,1605,1880,227.25,0);
			quest::spawn2(999151,0,0,1680,1880,227.25,0);
			quest::spawn2(999151,0,0,1718,1880,227.25,0);
			quest::spawn2(999151,0,0,1755,1838,227.25,0);
			quest::spawn2(999151,0,0,1645,1838,227.25,0);	
			quest::spawn2(999151,0,0,1605,1838,227.25,0);
			quest::spawn2(999151,0,0,1795,1838,227.25,0);
			}
		}
	}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 07-29-2009, 11:11 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Perfect. Trevius, you're a genius.
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:07 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3