PDA

View Full Version : Player.PL signals to NPC issue


Figback65
03-16-2014, 01:56 PM
Herro,


Well here is another issue I am having that I graciously need some advice on.

I noticed in logs that it is saying unable to read perl file player_v0.pl I know there is a coded hierarchy for the global_player > player and so on. I am wondering if that is my issue. I do have a global_player.pl in place in the templates.

Or I noticed in the task information that is you manually assign a task with assigntask then it calls $taskid and if the task is selected by PC then its called with $task_id. If I understood this correctly. I have tried both.

I have also tried both EVENT_TASK_STAGE_COMPLETE and EVENT_TASK_COMPLETE

So what I am trying to accomplish is quest chain npcs for my expansion. Upon completing task 281 I am trying to use player.pl to signal my NPC to continue on. The reason I am doing this is because the task requires 20 turn ins and I could not get it to advance the script because you can only trade non stack items to NPC and the npc did not remember how many I turned in to accomplish a total of 20 to continue the script.

Here are my 2 scripts. Everything works properly and in order besides the Signal part in the my npc script.


player.pl
sub EVENT_TASK_COMPLETE {
if ($task_id == 281){
quest::updatetaskactivity(286, 2);
quest::signalwith(999267,1,1);
}
}


Thed.pl
#Thed Creggle Task order
#Hail and asks if i know you
#Say master thaedus sent me
#Say I am worthy varlink
#Assigned Drake Task
#Turn in drake task
#Flagged for Jones and Happy Tree to talk by istaskcomplete
#Recieve Materials Task
#Loot materials and turn in materials
#update task 286 zone quest
#Summon Stack of Potions
#Inform to visit Dwight at next post
#

sub EVENT_SAY {
my $Worthy = quest::saylink("worthy?");

#Flagged from proving thaedus sent you
if ((defined $qglobals{"Moors_Open"}) && ($qglobals{"Moors_Open"} == 2)) {
if (quest::istaskactivityactive(280,1)){
plugin::Whisper("Great Job. Now onto something to give your life meaning. We are collecting materials for potions to cure our sick scouts. Talk to Josh and the Happy tree, I am sure they need something.");
quest::assigntask(281);
}

#if material task active suggest need more materials
elsif (quest::istaskactive(281)){
plugin::Whisper("We need those materials so we can make those potions. Help us.");
}

#if material task commpleted and hail target he retells you to take potions to dwight, failsafe
elsif (quest::istaskcompleted(281)){
if($text=~/hail/i){
plugin::Whisper("Excellent, with these we will save many lives! Take them to Dwight Root, follow the road back east to the Moors Post.");
#quest::summonitem(132584);
}
}

#Hail after flag to get drake task if bugged, failsafe
elsif($text=~/hail/i){
plugin::Whisper("So what do you say? Do you think you are $Worthy");
}
#Varlink to assign drake task
if($text=~/worthy?/i){
quest::assigntask(280);
plugin::Whisper("I am waiting....");
}
#End global bracket
}


#proving who you are for flag to open up chain
elsif($text=~/master thaedus/i){
plugin::Whisper("You are lucky little one, Josh Jones almost ate your face! First you must prove your worth to me, do a little dirty work and only then will I grant you access to Moors Post. So what do you say? Do you think you are $Worthy");
quest::updatetaskactivity(286, 1);
quest::setglobal("Moors_Open",2,5,'F');
}

#initial hail to start chain
elsif($text=~/hail/i){
plugin::Whisper("Do I know you? Maybe you should go back to Master Thaedus before I slay you.");
}

}


sub EVENT_SIGNAL {
#signal recieved from player.pl after material task completed to have thed talk summon potions update
#master quest and tell you to advance to next post
if($signal == 1) {
plugin::Whisper("These will save many lives. Thank you so much. Take these to my assistant Dwight Root at the Moors Post, you can find it dead west down the path from here.");
quest::summonitem(132584);
quest::updatetaskactivity(286, 2);
}
}


sub EVENT_ITEM {



}







Thanks!!!

joligario
03-16-2014, 04:38 PM
The player info won't pass with the signal. Why don't you just move all that signal code inside the player.pl?

Figback65
03-16-2014, 05:06 PM
I moved the taskupdate to player and it worked, still need the npc to respond to assign new task but, I dunno why I didn't think about it. Ill just add it as a step in task and receive the summonitem as reward :/ durr!

Thanks joligario

Township EQ
03-17-2014, 01:13 AM
Here are two working examples of those events you couldn't get to work.. hope this helps you a bit.

On task complete you can set that signal.


sub EVENT_TASK_STAGE_COMPLETE {
if($instanceversion == 2) {
if(($task_id == 210) && ($activity_id == 3)) {
#quest::enabletitle(30);
$client->SetTitleSuffix(", Voice of the Oppressed", 1); #gayest title
$client->Message(15, "You have been given a special title for your act of kindness and bravery.");
}
}
}


sub EVENT_TASK_COMPLETE {
if($task_id == 210) { # rescue seiya
$client->AddAlternateCurrencyValue(14, 25); #25 faycitum boiii
$client->Message(15, "You have been awarded 25 " .quest::varlink(100941). " for completing 'Rescue Seiya!'.");
$client->UpdateTaskActivity(212,0,1);
quest::assigntask(213);
plugin::MM("You have been assigned the task 'Unmasking the Chapel'.");
}
}

Figback65
03-18-2014, 07:45 AM
sweet thanks man! I will work on it when I get back from work.