EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   0.5.0 Quests - Updated 20 November (https://www.eqemulator.org/forums/showthread.php?t=10300)

Darkrider 11-20-2003 02:01 AM

EQ live quests
 
I must ask, is this a project ment to copy EQ live's quests? If not is there such a project? Thank you for your time.

mollymillions 11-20-2003 02:41 AM

Yes, they are at least based on the live quests, some created by myself but mostly collected over time from other sources, bless em. Most are incomplete but add a live feel to a server.

I would encourage others to release the brilliant quests they have written, and i have many works in progress to add (mainly Freeport and Queynos quests at the moment).

Darkrider 11-20-2003 03:10 AM

Quest reaction tool
 
Just an idea. A simple form where you can input zone name and mobID, then have boxes for: When player says "" then Mob says / does "". When Player gives "" then mob says / does "". Also above those lines a few requirded status field check boxes. "must be" Race/Class/Level/Faction. Then after it is filled out it could save the quest file to the correct loaction/ file name. If I knew more about the quest file formation I would hammer one out in VB. Hrmmm I may download the quest pack and start working on that. Maybe even add the item list to it with a search function to make finding the item#'s faster. And the Long to short zone name list. With this tool opened and the allakhazam quest list a team might be able to code over all of the quests in short order ( less than 6 months). My coding is very rusty so I don't count that I'll get this tool working, but I'll give it a go and see if I can shock myself.

a_Guest03 11-20-2003 03:39 AM

What is needed first is a standard quest parsing system. The front end can come second. I also suggest NOT writing the entire thing in VB. If we do write it, it should be in a language that can be ported to Linux as well as Windows.

The quest code is currently being discussed and may be moving to perl. If this is the case, a graphical program could simply parse it. We could write one for Win32 binaries and one for linux/*bsd binaries.

If I could code, I'd write an input/output program that could be fed into a kde- or gnome-linked program as well as a Win32 (VB or whatever) program.

Eglin 11-25-2003 04:26 AM

Quote:

Originally Posted by Kroeg
On a few quest files, it left off the ';' before the '}' at the end of the line.. others added the ';' but didn't put a space between ';' and '}'.

Quote:

Originally Posted by mollymillions
it still wont handle more than one function per line though.

Attached is the perlscript that I've been using to convert scripts into perl. Even if you choose to continue using the native scripting engine, I think you may find this useful. It can be easily modified to suit your needs (if it doesn't already). If you don't already have Perl, I recommend getting the Activestate distribution. It is a small, free download.
Code:

#!/usr/bin/perl -w
#convert scripts from .qst to .pl
#usage: ./convert.pl [questdir]
use File::Find;
use strict;
sub convert
{
        my $infile = $_;
        (my $outfile = $infile)=~s/qst$/pl/;
        print "Converting file: $infile -> $outfile\n";
        if(!open IN, "$infile") {
                warn $!;
                return;
        }
        if(!open OUT, ">$outfile") {
                warn $!;
                return;
        }
        while(<IN>)
        {
                #remove stray backslashes
                s|\\|\?|;
                #change /yada yada yada/ comment lines to #yada yada
                s|^/(.*)/\s*$|#($1)|;
                #prefix each event block w/ "sub"
                s/^(EVENT_)/sub $1/;
                #change $1/$1- (etc) notation to instead match against $text
                s/\s*\$\d-?\s*=~\s*\"(.*?)\"/\$text=~\/$1\/i/;
                s/\$\d-?/\$text/;
                #change itemcount syntax
                s/if\(\$itemcount\(\"(\d+)\"\)\s*==/if\(\$itemcount\{$1\} && \$itemcount\{$1\} ==/;
                #change summonitem syntax to seperate args w/ commas
                s/summonitem\((.*?\")\s+(\".*?)\)/summonitem\($1, $2\)/;
                #change commands to have a quest:: prefix and be seperated by semi-colons (;)
                s/(say|emote|shout|spawn|echo|summonitem|castspell|depop|cumflag|flagnpc|flagclient|exp|level|safemove|rain|snow|givecash|pvp|doanim|addskill|me)(\(.*?\))/quest::$1$2;/g;
                print OUT $_;
        }
        close IN;
        close OUT;
}
@ARGV = qw(.) unless @ARGV;
find( sub {/^.*\.qst\z/s && convert("$_")}, @ARGV);

If you need to ensure that quests are using valid database references, you can use something like the following. I used ODBC here, but if you install the DBD::mysql module, you can go directly through mysql.
Code:

#! /usr/bin/perl -w
use strict;
use File::Find ();
use DBI;

my $dbh= DBI->connect("DBI:ODBC:yourdsnname","yourusername","yourpassword") or die "Got error $DBI::errstr when connecting to db\n";
#my $dbh= DBI->connect("DBI:mysql:yourdsnname","yourusername","yourpassword") or die "Got error $DBI::errstr when connecting to db\n";

# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, './quests');
exit;


sub wanted
{
    if(/^.*\.qst\z/s)
        {
                if(!open(SCRIPT, $_))
                {
                        warn $!;
                        return;
                }
                while(<SCRIPT>)
                {#summonitem("19629");
                        if(/summonitem\(\"(\d+)\"\)/)
                        {
                                my $rv = $dbh->do("select * from items where id = $1");
                                if(!$rv)
                                {
                                        warn  "Can't execute query: $dbh->errstr $!";
                                        return;
                                }
                                if($rv == 0E0)
                                {
                                        print "Error: summonning non-existant item (#$1) in $File::Find::name\n";
                                }
                        }
                }
                close SCRIPT;
        }
}

By using the techniques in these two scripts, you should be able to mold your quest scripts to whatever format you desire.

Kroeg 11-25-2003 11:38 AM

wow, thanks a lot eqlin.. I'm going to try this. :D

mollymillions 11-25-2003 07:46 PM

So can I assume that the Pearl scripting support is included in the 5.1 release - i didnt notice it mentioned in the changes (I haven't downloaded the source yet, but the last time I updated CVS the Pearl implementation seemed to be included as diff so I assumed it wasn't merged).
Keep up the good work Eglin, its been very stimulating reading your posts and the resultant discussions (I fear you will be absorbed into the dev team and will no longer need to post ideas on these pages and I will be back to reading the standard 1017, etc, error messages).

rockocool 12-04-2003 10:07 AM

These quests seem to be broken with 0.5.1. They work perfectly for 0.5.0, but not with 0.5.1. How can we make it work again?

mollymillions 12-04-2003 01:16 PM

The old quest system does not work with versions above 5.0 (on Win32 platform anyway, and i have not used 5.2). Any file with a .qst extension in the quest folders will cause the zone to crash.


All times are GMT -4. The time now is 07:14 PM.

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