EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   New Quest Command quest::clearspawntimers() (https://www.eqemulator.org/forums/showthread.php?t=26261)

trevius 09-21-2008 11:10 PM

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.


All times are GMT -4. The time now is 06:43 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.