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
Code:
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
Quote:
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.
|
Quote:
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) { -
|