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 05-22-2009, 06:04 PM
Lillu
Hill Giant
 
Join Date: Sep 2008
Posts: 204
Default quest::istaskcompleted(taskID) help.

Can anyone please post a working Task related perl Quest code?
I tried to use quest::istaskcompleted(taskID) but no luck. Tasks are working great, but I would like the task giver npc to respond properly depending if the player has or already done the task. any hint on the syntax would be nice.

Thank you,
Lillu
Reply With Quote
  #2  
Old 05-22-2009, 06:51 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

An example of it's use is:
Code:
if(quest::istaskcompleted(2004)) {
	quest::say("You have completed task 2004");
}
There is a rule, TaskSystem:RecordCompletedTasks which if set to false, would cause this to not work, however the default value is true.
Reply With Quote
  #3  
Old 05-23-2009, 02:58 PM
Lillu
Hill Giant
 
Join Date: Sep 2008
Posts: 204
Default

Thanks Derision. This works great, besides I don't fully understand how can quest::istaskcompleted(Task_ID) be once a value, once a boolean? :p I might miss something though. But afterall, I got it now, thanks!

Code:
sub EVENT_SAY 
{
if ($text =~/Hail/i) 
	{
if (quest::istaskcompleted(20)) {
		quest::say ("Hurray, $name the Orc Slayer!"); }
if (quest::istaskcompleted(20)==0) {
quest::say ("Good day adventurer.. If you are bored enough..I might have a [task] for 

you.");
$client->Message(6, "Foolin grins evilly."); }
	}	

if ($text =~/Task/i && quest::istaskcompleted(20)==0) {
quest::say ("There are too many orcs out there, and it just isn't right. Agree? All you 

have to do is kill some of em, [will] ya?");}
if ($text =~/will/i  && quest::istaskcompleted(20)==0) {
	quest::say ("Good luck. I'll wait for you here.");
	quest::assigntask(20); }

}
Reply With Quote
  #4  
Old 05-23-2009, 03:08 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I may be misunderstanding your comment, but quest::istaskcompleted() returns 0 for false and 1 for true, so:
Code:
if(quest::istaskcompleted(20)) {
    // do something
}
is the same as:
Code:
if(quest::istaskcompleted(20) != 0) {
    // do something
}
The first form is just shorthand.
Reply With Quote
  #5  
Old 05-23-2009, 03:41 PM
Lillu
Hill Giant
 
Join Date: Sep 2008
Posts: 204
Default

thanks a lot, all clear now.
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 12:35 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3