PDA

View Full Version : Tasks Questions


RichardoX
03-07-2010, 08:40 PM
Are there any tasks quests (in the repository) that I can reference to get an idea of how to make a decent task quest?

trevius
03-08-2010, 05:50 AM
Yeah, just check the PEQ task related tables and you should see enough to help you get started. Also, you can see this wiki page for tons of info (thanks to Derision for his amazing documentation!):

http://www.eqemulator.net/wiki/wikka.php?wakka=CategoryTaskSystem

And, you also may want to check out the TaskMaster tool that KLS wrote, which makes creating and editing tasks considerably easier as long as you can understand the basics of tasks:

http://code.google.com/p/projecteqemu/downloads/list

Get the download named "tm_1_0_8.zip ".

RichardoX
03-15-2010, 03:00 PM
Hey Trevius, I was able to properly assign a task but I am having trouble understanding the methods of using a lot of these commands in perl. Is there a quest I could look at that shares a good example on a decent task? For example, in the task list in the PEQ Database there is a task called "Example 1" and I would love to see the perl script behind that task. Where is it?

Akkadius
03-15-2010, 03:26 PM
You can simply assign a certain activity type to be (999) Custom and simply update it through your unique feature, I use it all the time.

So let's say you want the player to hail a trapped citizen for a (save)

The task is 'Lock and Load' from the Goblin Invasion theme on my server yet to be seen live obviously...

An_Imprisoned_Citizen.pl

sub EVENT_SPAWN
{
quest::settimer(stand,1);
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
quest::set_proximity($x - 5, $x + 5, $y - 5, $y + 5, $z - 4, $z + 4);
}

sub EVENT_TIMER {
if($timer eq "stand") {
quest::stoptimer(stand);
$npc->SetAppearance(0);
}
}

sub EVENT_ENTER {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
my $key = plugin::check_hasitem($client, 2656);
if ($text=~/Hail/i && $key)
{
quest::doanim(29);
quest::say("Ohh! Are you here to save us! Thank you Henry!");
}
}

sub EVENT_SAY
{
my $key = plugin::check_hasitem($client, 2656);
if ($text=~/Hail/i && $key)
{
quest::say(quest::ChooseRandom("Oh lord! I thought I'd never get out of here!","Thanks Henry! I get to go see my family!","I thought I would
never get to see the light of day again, thank you Henry!"));
$npc->SetAppearance(0);
$npc->CastToMob()->SendAppearanceEffect(129,0,0,0,0);
quest::updatetaskactivity(181,10,1); ### This signifies Task 181 Activity 10 and 1 count of updating
quest::depop();
}
elsif ($text=~/Hail/i)
{
quest::say("Please don't hurt me!!");
$npc->SetAppearance(0);
}
}

Forgive the sloppiness of the code as I whipped through this script pretty quick. But that is one example of perl updating that you can use for Tasks, and you can also measure the stage in their task through other commands via the Wiki.

Link to the wiki here (http://www.eqemulator.net/wiki/wikka.php?wakka=QuestCheatSheet)

sub EVENT_TASKACCEPTED - Triggers when the client accepts a new task. $task_id tracks which task ID was accepted.
sub EVENT_TASK_STAGE_COMPLETE - Triggers when the client completes a task stage. $task_id tracks which task ID was completed, and $activity_id for which activity of the task.

Client Task
void quest::taskselector(int taskcount, int *tasks) { -
void quest::enabletask(int taskcount, int *tasks) { -
void quest::disabletask(int taskcount, int *tasks) { -
bool quest::istaskenabled(int taskid) { -
void quest::tasksetselector(int tasksetid) { -
bool quest::istaskactive(int task) { -
bool quest::istaskactivityactive(int task, int activity) { -
void quest::updatetaskactivity(int task, int activity, int count) { -
void quest::taskexploredarea(int exploreid) { -
void quest::assigntask(int taskid) { -
void quest::failtask(int taskid) { -
int quest::tasktimeleft(int taskid) { -
int quest::enabledtaskcount(int taskset) { -
int quest::firsttaskinset(int taskset) { -
int quest::lasttaskinset(int taskset) { -
int quest::nexttaskinset(int taskset, int taskid) { -
int quest::activespeaktask() { -
int quest::activespeakactivity(int taskid) { -
int quest::istaskcompleted(int taskid) { -
int quest::activetasksinset(int taskset) { -
int quest::completedtasksinset(int taskset) { -
bool quest::istaskappropriate(int task) { -

Derision
03-15-2010, 03:30 PM
Tasks 1 to 11 in the PEQ database are samples that I did when the system was first implemented.

This is the Perl script that offered the first 6 tasks (V'Lynn Renloe in PoK):

#V'Lynn Renloe.pl


sub EVENT_SAY {
if(quest::istaskactivityactive(1,0)) {
quest::say("Activity 1 of Children of the Fay is in progress");
}
if($text=~/Hail/i) {
quest::say("Before you stands a being draped in more than the battle-weary armor adorning him. In a glance you are able to discern that he carries with him years of hard combat -- proudly worn scars earned from life-threatening wounds sporadically decorate his body. As you approach, his eyes seize down upon you, narrowing their stony gaze. All at once you feel as if your inner most secrets have been torn open for all to see. 'A new face to the Plane of Knowledge? Come to search for some lost secret of a forgotten god? Or perhaps you've come for the answer to an ancient riddle that plagues you? Hah, no! You're not one who is content merely spending their mortal life with their nose buried in scholarly ramblings. No, your heart seeks the path of a true adventurer and I just may know [something] about that.");
}
if($text=~/something/i) {
quest::say("Many lifetimes ago I was not the tired old man you see before you. No, I was in fact often called to prepare troops to defend the light. The last time I sent brave warriors off to fight was for the Battle of Kithicor. Though many were ready for that contest, very few returned. Near the end, as we were just about to seize victory, a curse was unleashed upon the forest as the Plane of Hate poured forth and smothered the area. Friend, foe, animal. . .it didn't matter. All had their souls torn from their body to satisfy the hunger of the Hate Lord.' He sighs deeply and seems to catch himself from wandering too far down the path of painful memories, 'But it seems fate has called upon me once more to set the righteous upon the path. Know that though age has proven to be the one enemy I could not best, I shall [aid] you as much as I can.");
}
if($text=~/aid/i) {
quest::say("Aye, aid you I shall for though your arm be strong, your mind sharp, and your heart made of iron, you are ill equipped to face the many dangers that lie in wait. Normally your city's Guildmaster would furnish you properly but during these times, resources are scarce and you are not likely to be afforded a wooden shoe much less implements fitting your needs. Yet fate has indeed brought us together for during my travels I have come to the aid of many, including your very own Guildmaster. Prove yourself worthy by passing the [trials] I lay before you and I will convince your Guildmaster to properly equip you. If you have a [group], however, there are even larger challenges I have for you.");
}
if($text=~/trials/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 =(1,2,3,4,5,6);
$tasksoffered = "";
foreach $task(@tasklist) {
if(!quest::istaskactive($task)) {
if($tasksoffered eq "") {
$tasksoffered = $tasksoffered . $task;
}
else {
$tasksoffered = $tasksoffered . "," . $task;
}
}
}
if($tasksoffered ne "") {
quest::say("I am offering you tasks $tasksoffered");
quest::taskselector(eval($tasksoffered));
}
}


}


sub EVENT_TASKACCEPTED {
quest::say("You accepted task $task_id");
if($task_id eq "1") {
quest::summonitem(36078);
}
}


When you say the word 'trials', it should bring up a task selector offering tasks 1 through 6 (if you have already accepted any of those 6 previously, they won't appear in the selector).

If you accept Example Task 1, then it will summon an 'Elven Bottle Of Wine' which you need to complete the first activity. This task is actually a copy of 'Children Of The Fay' from live, I just changed the name for Copyright reasons :)

RichardoX
03-15-2010, 03:31 PM
Thanks a lot for your help guys! I really appreciate it!