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 05-19-2008, 11:47 AM
Aonelyn's Avatar
Aonelyn
Hill Giant
 
Join Date: Jul 2005
Location: Felwithe
Posts: 192
Default Zone Repop script

Okay, another quest.

Once an npc is hailed, the entire zone will repop 45 minutes later.

is that even possible?
__________________
lol.
Reply With Quote
  #2  
Old 05-19-2008, 11:56 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

im not sure if there is any quest function that repops or depops the whole zone..
but it would go something like this..
Code:
sub EVENT_SAY
{
	if ($text=~/hail/i)
	{
		quest::say("Hail $name!");
		if (!defined($qglobals{$zonerepop}))
		{
			quest::say("zone will depop in 45 mins!");
			quest::settimer("zrepop",823421);
			quest::setglobal("zonerepop",1,0,M45);
		}

	}
}

sub EVENT_TIMER
{
	if ($timer eq "zrepop")
	{
		quest::ZONE_REPOP_COMMAND();
		quest::delglobal("zonerepop");
	}
}
note.. used the global var so the timer can only be triggered once while its timing.. not sure if it would be required but would be how i would have done it
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com

Last edited by Cripp; 05-26-2008 at 07:27 PM..
Reply With Quote
  #3  
Old 05-19-2008, 04:45 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Depoping & repoping of the zone was added in one of the more recent versions of the Emu. From the Wiki:
Quote:
quest::depopall(npcid) - Depops every instance of the npc in the zone (quest::depop(npcid)) only will do one NPC at a time.)
quest::depopzone(1 or 0) - Depops every npc in the zone. 0 disables the NPCs' spawn timers so they will not repop on their own. 1 allows them to spawn as normal once their timers are up. This argument is required!
quest::repopzone() - Repops the zone, in the same way the command #repop does. It will also re-enable spawn timers if disabled.
So just replace quest::ZONE_REPOP_COMMAND() with quest::repopzone() and you'll be good to go. The big thing to keep in mind, though (depending on what you're really trying to do) is the respawn timers for individual NPCs. For example, if a mob has a 3 day respawn timer & you repop the zone, it still won't respawn until after the 3 days is up.

On a side note, I went through and updated that Wiki entry about a week ago with all of the commands & descriptions from the 1108 source, so it should be fairly complete, especially compared to the somewhat outdated Lexicon (which I used to use).
__________________
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
  #4  
Old 05-19-2008, 05:10 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Actually, you don't need to worry about spawn timers with quest::repopzone(). That command doesn't touch timers at all, so any NPC that was up before the command was used will appear after. This is useful for stat changes, or to reset every NPC to their default positions. quest::depopzone(1) will reset all NPCs to an unspawned state, and in that case you'll have to wait for their timers to expire before they pop back up.
Reply With Quote
  #5  
Old 05-19-2008, 05:27 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by cavedude View Post
Actually, you don't need to worry about spawn timers with quest::repopzone(). That command doesn't touch timers at all, so any NPC that was up before the command was used will appear after. This is useful for stat changes, or to reset every NPC to their default positions. quest::depopzone(1) will reset all NPCs to an unspawned state, and in that case you'll have to wait for their timers to expire before they pop back up.
I think what I said may have been a little confusing. Let me rephrase...

Example 1 (what I was thinking):
Zone into the sleeper. Kill a regular mob, which has a 4 hour (14400 second) respawn as defined in spawn2 -> respawntime. Repop the zone, that mob won't respawn until the 4 hours is up (which is stored in spawn2 -> timeleft).

Example 2 (what you're describing):
Zone into fearplane. Wait ~3.25 days (281232 seconds) +- ~9 hours for Cazic Thule to spawn. Repop the zone, he'll still be up.

So, you are correct, it doesn't touch spawn timers, but it also doesn't touch respawn timers, which is the only problem I've had. I'm not sure if there's a way in-game to avoid example 1, so what I did as a workaround (while testing quests) is run this query against my database to clear the timers:
Code:
UPDATE spawn2 SET timeleft = 0 WHERE spawngroupID IN (???, ???, ???)
of course replacing the ???'s with the applicable spawngroup ID.

Hopefully that made more sense.
__________________
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
  #6  
Old 05-20-2008, 01:52 AM
Aonelyn's Avatar
Aonelyn
Hill Giant
 
Join Date: Jul 2005
Location: Felwithe
Posts: 192
Default

thanks for the help guys, so how exactly would i write this to make it basically #repop the zone, after 45 mins of hailing the npc?
__________________
lol.
Reply With Quote
  #7  
Old 05-20-2008, 10:09 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

Code:
sub EVENT_SAY
{
	if ($text=~/hail/i)
	{
		quest::say("Hail $name!");
		if (!defined($qglobals{$zonerepop}))
		{
			quest::say("zone will depop in 45 mins!");
			quest::settimer("zrepop",888888);
			quest::setglobal("zonerepop",1,0,M45);
		}

	}
}

sub EVENT_TIMER
{
	if ($timer eq "zrepop")
	{
		quest::repopzone();
		quest::delglobal("zonerepop");
	}
}
just change the 8888888 to whatever 45 minutes would be..
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com

Last edited by Cripp; 05-26-2008 at 07:27 PM..
Reply With Quote
  #8  
Old 05-20-2008, 11:08 AM
Aonelyn's Avatar
Aonelyn
Hill Giant
 
Join Date: Jul 2005
Location: Felwithe
Posts: 192
Default

Thanks for all the help!
__________________
lol.
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 05:18 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