Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2008, 11:10 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default New Quest Command quest::clearspawntimers()

Discussion: http://eqemulator.net/forums/showthread.php?t=26295

This command should work similar to the "#repop force" command which will reset the spawn timers for the zone and repop everything including anything that was down due to having a timer left on it. I haven't tested this code yet, but I am going to test it tonight and verify it works. I basically just looked at the code for quest::repopzone() and for the command #repop and combined the 2, so I think it should work. I will report back later after I get the chance to test it.


questmgr.cpp
Code:
void QuestManager::clearspawntimers() {
	if(zone)  {
		char errbuf[MYSQL_ERRMSG_SIZE];
		char *query = 0;
		database.RunQuery(query, MakeAnyLenString(&query, "UPDATE spawn2 SET timeleft=0 WHERE zone='%s'",zone->GetShortName()), errbuf);
		safe_delete_array(query);
	}
}
questmgr.h
Code:
	void clearspawntimers();

perlparser.cpp
Code:
XS(XS__clearspawntimers);
XS(XS__clearspawntimers)
{
	dXSARGS;
	if (items != 0)
		Perl_croak(aTHX_ "Usage: clearspawntimers()");

	quest_manager.clearspawntimers();

	XSRETURN_EMPTY;
}
Code:
		newXS(strcpy(buf, "clearspawntimers"), XS__clearspawntimers, file);
If this doesn't work, I will keep messing with it until I can get it working unless someone else feels like making some suggestions.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by cavedude; 09-24-2008 at 09:45 PM..
Reply With Quote
 


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 12:53 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