EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Default perl quest for each zone (https://www.eqemulator.org/forums/showthread.php?t=12786)

m0oni9 04-01-2004 06:23 PM

Default perl quest for each zone
 
sandy was mentioning that he was having trouble with per-zone default quests. The following should enable the allowance of having multiple default quests, ie: quests/feerrott/default.pl, quests/nexus/default.pl, instead of _only_ quests/default.pl. Line numbers are approximate.

To start off, remove the old default quest loader.
zone/embperl.cpp, lines 25-32:
Code:

        //let's load the default script
        try { LoadScript(0, NULL); }
        catch(const char * err)
        {
                LogFile->write(EQEMuLog::Status, "Error loading default script: %s", err);
        }

Find the following code, and replace.
zone/embperl.cpp, lines 290-301:
Code:

        if(!npcid || !zone)
        {
                filename += DEFAULT_QUEST_PREFIX;
                filename += ".pl";
        }
        else
        {
                filename += zone;
                filename += "/";
                filename += itoa(npcid);
                filename += ".pl";
        }

with:
Code:

        if (zone)
        {
                filename += zone;
                filename += "/";
                if (npcid)
                        filename += itoa(npcid);
                else
                        filename += DEFAULT_QUEST_PREFIX;
        }
        else
                filename += DEFAULT_QUEST_PREFIX;

        filename += ".pl";

Finally, insert the following, which will load the default script when the zone initializes.
zone/zone.cpp, line 434
Code:

        parse->ClearCache();

#ifdef EMBPERL
        // Load the default quest file for zone
        try {((PerlembParser *)parse)->LoadScript(0, short_name); }
        catch(const char * err)
        {
                LogFile->write(EQEMuLog::Status,
                "Error loading default script: %s", err);
        }
#endif

        cout << ", timezone data";
        zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid));

This is the best place I could figure to add the last bit. Please report if there are problems or not.


All times are GMT -4. The time now is 12:28 PM.

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