View Single Post
  #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!
Reply With Quote