EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Problem with my quest. (https://www.eqemulator.org/forums/showthread.php?t=31809)

Bellos 08-08-2010 02:43 PM

Problem with my quest.
 
The first task works. However once its complete and you hail him, he doesnt start the second conversation. Also completed tasks is coming up as -1 in the database even though record completed tasks is set to true

Code:

#Saylinks#

#Task 500 Explore the Orc Camp
my $awake = quest::saylink("Awake....What happened to me?", 0, "Awake");
my $activity = quest::saylink("Orc Activity?", 0, "Activity");
my $rituals = quest::saylink("Rituals?", 0, "Rituals?");
my $investigate = quest::saylink("As you wish", 0, "Investigate");

#Task 501 Speak to Elrond of Rivendell
my $troubling = quest::saylink("Troubling?", 0, "Troubling?");
my $elrond = quest::saylink("Lord Elrond?", 0, "Lord Elrond?");
my $inform = quest::saylink("I will inform Lord Elrond", 0, "Inform");

sub EVENT_SAY {
       
        if(!quest::istaskcompleted(500)) {
       
                #Player Hasnt Recieve Task 500 Yet
                if($text=~/Hail/i) {
                quest::say("Welcome , $name. Im glad to see you [$awake].");
                }
       
                if($text=~/Awake....What happened to me?/i) {
                quest::say("You were ambushed by orcs. I dont know why you would wander alone in the wild with all of the recent orc [$activity] going on.");
                }
       
                if($text=~/Orc Activity?/i) {
                quest::say("Yes, for some reason the orcs have been moving further in to the realm of Eriador. However, Our scouts have obtained information that leads us to believe the orcs performing strange [$rituals] in woods just outside of our camp.");
                }
       
                if($text=~/Rituals?/i) {
                quest::say("We dont know what they are up to but if your feeling better you could go [$investigate] for us.");
                }
               
                        #Give Player Task 500 Explore The Orc Camp
                if($text=~/As you wish/i) {
                        quest::say("Yes each trial is designed to test your abilities to their maximum.  As you improve, I will have more trials available to you.  After successfully completing a trial, I will give you a note that you may pass along to your Guildmaster for your reward.");
                        @tasklist =(500);
                        $tasksoffered = "";
                        foreach $task(@tasklist) {
                                if(!quest::istaskactive($task)) {
                                        if($tasksoffered eq "") {
                                                $tasksoffered = $tasksoffered . $task;
                                        }
                                        else {
                                                $tasksoffered = $tasksoffered . "," . $task;
                                        }
                                }
                        }       
                }
               
                if($tasksoffered ne "") {
                        quest::taskselector(eval($tasksoffered));
                }
       
               
               
                #Task 500 Explore Orc Camp In Jaggedpine
                if(istaskactive(500)) {
                        if($text=~/Hail/i) {
                                quest::say("Well $name, did you find anything out yet?");
                        }
                }
        }
        #Task 500 Is Completed Conversation For The Next Task
        if(istaskcompleted(500)) {
               
                if($text=~/Hail/i) {
                        quest::say("This is most [$troubling]. Never have I heard of Orcs possessing this type of foul magic!");
                }
       
                if($text=~/Troubling?/i) {
                        quest::say("Yes, you will need to inform [$elrond] of this immediately!");
                }
               
                if($text=~/Lord Elrond?/i) {
                quest::say("Lord Elrond is one of the few remaining High Elf lords left in Middle Earth! He dwells in Rivendell.");
                quest::say("Now make haste and [$inform] Lord Elrond!");
                }
               
                #Give Player Task 501 Speak To Lord Elrond
                if($text=~/I will inform Lord Elrond/i) {
                        quest::say("Good Luck!");
                        @tasklist =(501);
                        $tasksoffered = "";
                        foreach $task(@tasklist) {
                                if(!quest::istaskactive($task)) {
                                        if($tasksoffered eq "") {
                                        $tasksoffered = $tasksoffered . $task;
                                        }
                                        else {
                                        $tasksoffered = $tasksoffered . "," . $task;
                                        }
                                }
                        }
                }       
                if($tasksoffered ne "") {
                        quest::taskselector(eval($tasksoffered));
                }
         
        }
       
       
 
}
 #if task is accepted and you need to give the player somthing or do somthing for the task do it here
sub EVENT_TASKACCEPTED {
        quest::say("You accepted task $task_id");
}


Derision 08-08-2010 03:05 PM

Code:

    if(istaskcompleted(500)) {
should be:

Code:

    if(quest::istaskcompleted(500)) {

Bellos 08-08-2010 03:14 PM

thank you lol

trevius 08-08-2010 04:18 PM

Also, it is generally a good idea to put quest::saylink() inside the sub EVENT, instead of outside of it like you have them. If it works as you have it though, probably no need to change it.

Bellos 08-08-2010 04:23 PM

Quote:

Originally Posted by trevius (Post 190548)
Also, it is generally a good idea to put quest::saylink() inside the sub EVENT, instead of outside of it like you have them. If it works as you have it though, probably no need to change it.

yeah it works. I just wanted to keep my script organized as best i could. I could probably seperate it in to functions huh? and have the function called. I may try that, im sure that would be needed for larger scripts

Bellos 08-08-2010 05:04 PM

question, This isnt working. I cant find any good item turn in quest examples.

The NPC does nothing when he is handed the item.

Code:

sub EVENT_ITEM {

        if (plugin::check_handin(\%itemcount, 1391 => 1)) {
        quest::say("It seems the orcs are trying to summon an Ancient Demon. Please go and stop them before its to late!!");
        }

        else {
            plugin::return_items(\%itemcount);
            quest::say("I have no use for this item, $name.  Take it back.");
        } 
}


Bellos 08-08-2010 05:16 PM

figured it out, it was in the wrong folder by default

Derision 08-08-2010 05:18 PM

The plugins probably need to be copied from your eqemu\quests\plugins folder to the eqemu\plugins folder.

i.e. the folder that has your world.exe, zone.exe etc, in it should have a subfolder called 'plugins' with these in it:

Code:

entwisd@rama ~/eqemu $ dir plugins
check_handin.pl  commands.pl        default.pl  guildmasters.pl  plugin.pl      worldui.pl
check_hasitem.pl  default-actions.pl  globals.pl  npc_tools.pl    soulbinders.pl  zone_tools.pl

EDIT: The PEQ quest repo (including the plugins) is here: http://code.google.com/p/projecteqqu...ource/checkout


All times are GMT -4. The time now is 08:35 PM.

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