trevius
09-21-2008, 11:10 PM
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
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
void clearspawntimers();
perlparser.cpp
XS(XS__clearspawntimers);
XS(XS__clearspawntimers)
{
dXSARGS;
if (items != 0)
Perl_croak(aTHX_ "Usage: clearspawntimers()");
quest_manager.clearspawntimers();
XSRETURN_EMPTY;
}
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.
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
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
void clearspawntimers();
perlparser.cpp
XS(XS__clearspawntimers);
XS(XS__clearspawntimers)
{
dXSARGS;
if (items != 0)
Perl_croak(aTHX_ "Usage: clearspawntimers()");
quest_manager.clearspawntimers();
XSRETURN_EMPTY;
}
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.