Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2011, 08:44 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default Task System

I found my way into tasks, but I am undergoing and issue when it comes to setting it up to allow when a user approaches the task npc, it checks to see where they are at and it keep count if they have done it or not and also allows them have the next task in line.

I followed this guide here:

Code:
http://www.eqemulator.net/wiki/wikka.php?wakka=TaskSystemTaskSets
Here is what I have written up so far. Could someone please look this over and tell me where I am wrong?

Code:
######
#Name: Task
#Author: Kingmen
######

sub EVENT_SAY
{
 #Saylinks
 my $job = quest::saylink("job");
  
  if($text=~/Hail/i) {
      quest::say("Hi $name, I have a [$job] for you."); }
      elsif($text=~/job/i) {
   
  if(!quest::istaskcompleted(quest::lasttaskinset(500))) {
    if(quest::enabledtaskcount(500) == 0) {
      plugin::Whisper("I haven't seen you before!");
      quest::enabletask(quest::firsttaskinset(500));
    }
    elsif {
      $task = quest::activespeaktask();
      if($task != 0) {
        $activity = quest::activespeakactivity($task);
        quest::ipdatetaskactivity($task, $activity);
        plugin::Whisper("Well Done!");
        if(!quest::istaskactive($task)) {
           quest::disabletask($task);
           if($task != quest::lasttaskinset(500)) {
              plugin::Whisper("Well done, I ahve another task if you are willing.");
              quest::enabletask(quest::nexttaskinset(500, $task));
              
            }
            elsif {
                      plugin::Whisper("Thank you for all your work.");
                   }
             }
           }
           elsif {
           }
         }
         if(quest::activetaskinset(500) == 0) {
            quest::tasksetselector(500);
         }
       }
      elsif {
                plugin::Whisper("Hail, Conqueror!");
             }
    }
}
The tasks themselves work. I tested them BEFORE I composed this.

Also I created a "TaskSet" in the taskset table using:

Code:
INSERT INTO `taskset` (`id`, `taskid`) VALUES (500, 500);
INSERT INTO `taskset` (`id`, `taskid`) VALUES (500, 501);
From what I understand on this, the first column (id) refers to the ID of the taskset you wish to denote it and the second column (taskid) refers to the actual task(s) themselves (In this case 500 and 501 for my tasks).

Like I said, they work just fine...... individually, but if I were to try and pair them up and make them sequential, then I get nowhere.

Any and all help on this would be great.

Thank you,
Kingmen
Reply With Quote
  #2  
Old 08-06-2011, 11:34 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Just glancing over the code... elsif what?
Reply With Quote
  #3  
Old 08-07-2011, 01:46 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

I just followed what he had done. What part of the code are you referring to with "elsif"....
Reply With Quote
  #4  
Old 08-07-2011, 02:23 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

An elsif requires a logic statement just like an if
Reply With Quote
  #5  
Old 08-07-2011, 02:34 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Code:
quest::ipdatetaskactivity($task, $activity);
Is one error that jumps out at me.
Reply With Quote
  #6  
Old 08-07-2011, 03:32 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

This should work better:
Code:
######
#Name: Task
#Author: Kingmen
######

sub EVENT_SAY
{
 #Saylinks
        my $job = quest::saylink("job");

        if($text=~/Hail/i) {
                quest::say("Hi $name, I have a [$job] for you.");
        }
        elsif($text=~/job/i)
        {
                if(!quest::istaskcompleted(quest::lasttaskinset(1)))
                {
                        if(quest::enabledtaskcount(1) == 0)
                        {
                                plugin::Whisper("I haven't seen you before!");
                                quest::enabletask(quest::firsttaskinset(1));
                        }
                        else
                        {
                                $task = quest::activespeaktask();
                                if($task != 0)
                                {
                                        $activity = quest::activespeakactivity($task);
                                        quest::updatetaskactivity($task, $activity);
                                        plugin::Whisper("Well Done!");
                                        if(!quest::istaskactive($task))
                                        {
                                                quest::disabletask($task);
                                                if($task != quest::lasttaskinset(1))
                                                {
                                                        plugin::Whisper("Well done, I ahve another task if you are willing.");
                                                        quest::enabletask(quest::nexttaskinset(1, $task));

                                                }
                                                else
                                                {
                                                        plugin::Whisper("Thank you for all your work.");
                                                }
                                        }
                                }
                                else
                                {
                                }
                        }
                        if(quest::activetasksinset(1) == 0)
                        {
                                quest::tasksetselector(1);
                        }
                }
                else
                {
                        plugin::Whisper("Hail, Conqueror!");
                }
        }
}
I replaced your elseifs with else where appropriate, fixed the typo I mentioned above, and also you had activetaskinset instead of activetasksinset.

I changed the taskset number from 500 to 1, since I already had a taskset 1 I could use for testing, so you will need to change them back to 500. I tested as far as completing the first task and getting assigned the next one.
Reply With Quote
  #7  
Old 08-07-2011, 05:00 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Thank you very much Derision, I will give this a test run and see if it I can't use this sometime in the future. I really enjoy the way you have this set up as well, it is VERY clean, and allows me to look at what you have done and could potentially open a lot of doors for me.

Thanks to all that gave me responses as they were all informative as well =)
Reply With Quote
  #8  
Old 08-07-2011, 09:20 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

I was looking at this, and I changed ALL of them to reflect my taskSET ID in my DB, but when I complete the first task, she just keeps offering it to me. Now if I have the task, she won't offer it to me, she will just "ignore" me.

How do I make it go to the next task?

*EDIT* It works just fine (The last part) on my character that I tested the quests with.

*EDIT* I tested it out with the Cleansing of Qeynos Hills task, but it keeps returning Part 1 when I want Part 2 to come up.

(Sorry for all these questions, I am sure it is something that I am simply missing, or not doing, but that is why I am here asking, to learn it )
Reply With Quote
  #9  
Old 08-08-2011, 01:37 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I tested the whole of the Cleaning Qeynos Hills task chain just now with the script I posted above. The only way I can get it to fail in the manner you describe is if I have a syntax error, or other error with the quest::enabletask command after the 'Well done, I have another task if you are interested.

i.e.
Code:
plugin::Whisper("Well done, I ahve another task if you are willing.");
quest::enabletask(quest::nexttaskinset(1, $task));    <--- Check you have the correct task set and no errors on this line
If you are sure the line is correct, take a look in your character_enabledtasks right after you finish the first task to see if the second task is getting enabled.
Reply With Quote
  #10  
Old 08-08-2011, 06:05 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Okay, well I checked this, and I even copied and pasted your script directly to the NPC task, and it is still not working. When I checked the character_enabledtasks table, it shows it as 11, 7 (11 being my chars' ID and 7 being the quest.) I have completed it several times, and it keeps giving me the SAME task, over and over again.

I tested it against my main char RIGHT NOW (He has yet to attempt this line of tasks) and he was able to complete it just fine, but when he returned to my task NPC, all she does it repeat:

Code:
Hi $name, I have a [job] for you.
I checked the character_enabledtasks window and it didn't update from 1, 7 to 1, 8(I am presuming this is the next one in the line-up based on tasks table).

How do I make it update the character_enabledtasks table? I am doing everything that I know with no effect =\
Reply With Quote
  #11  
Old 08-16-2011, 12:56 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

*Bump* Sorry to bump this post, I was just wondering if anyone had anything that might help me in my endeavor.

Thanks for any posts.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

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


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3