View Single Post
  #1  
Old 04-01-2004, 06:23 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default 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.
Reply With Quote