PDA

View Full Version : Connecting a quest to an NPC


rmanders
12-05-2006, 05:26 PM
How do you tie a quest to a specific NPC? I get that you need to place the .pl file in the EQEMU/Quests/<zone>/ folder. However I can't seem to get the quest to work with the NPC.

For Example:

I created a new NPC named Tiiana_Moonwulf and placed it in the cshome zone. Next, I created a Tiiana_Moonwulf.pl file and placed it in the EQEMU\quests\cshome\ directory. The perl file contents are:


sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Greetings traveller. What brings you here?");
}

#END of FILE Zone:cshome -- Tiiana_Moonwulf



When I load up the game, and zone into cshome, the NPC is there, but no quest responses.

Based on the other quests in the folder, I assumed the quest.pl file needs to have the name of the NPC it's tied too (obviously this didn't work). I skimmed the quest lexicons but I didn't pick up anything about how to tie the quest to an NPC.

cavedude
12-05-2006, 05:58 PM
You are missing a closing bracket. It should look like this:


sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Greetings traveller. What brings you here?");}
}

#END of FILE Zone:cshome -- Tiiana_Moonwulf

rmanders
12-06-2006, 02:58 AM
Ahh that did the trick. Thanks ;)

sfisque
12-07-2006, 10:29 AM
a good practice to get into, when you finish a given quest perl file is do the following from a commandline:

perl [name of file] [return]

basically run the script against the REAL perl interpreter. if you have a syntax error, perl will complain and you can go and fix it. the problem you faced here is that the server, being written to be as fault tolerant as possible merely gives up if it cannot parse the perl script properly. i had this same issue and banged my head for a day, then finally i said, i wonder if its a syntax issue. ran the script against perl, and voila, my answer appeared in the nice error message spat out by the interpreter.

hope this helps in the future for you.

== sfisque

Wizardanim
12-09-2006, 06:56 PM
Just some info: A great ingame command I use is #reloadquest. This reloads all quests for the current zone, and any changes you have made... That way you never really have to leave the game while writing them, givin you know your way around perl a lil'. I find if its not working, i start from the beginning, trying seperate sections at once to see where the issue is. But building from the beginning testing as you go removes some of the fault in the script itself.

-wiz