EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Quest not working. (https://www.eqemulator.org/forums/showthread.php?t=36004)

Trackye 11-17-2012 10:35 AM

Quest not working.
 
I am having this problem with this script.

If i limit the quest to 1 set of turn ins and remove the rest. It works. once i add in the rest it does not.

I have looked at the extra lines being added in and cannot myself seem to see where the error is.

Can anyone else take a look at it and point out where it is so i can know what my mistake was?

Code:

sub EVENT_SAY{
if ($text =~/Hail/i){
quest::say ("Hey there, $name. If you have a Thurgadin armor mold and your class Emblem. Hand them to me and I will see what I can do");
 }
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 24928 => 1, 16270 => 1))
{
quest::summonitem(31001);
}
elsif (plugin::check_handin(\%itemcount, 24933 => 1, 16270 => 1))
{
quest::summonitem(31000);
}
elsif (plugin::check_handin(\%itemcount, 24929 => 1, 16270 => 1))
{
quest::summonitem(31005);
}
elsif (plugin::check_handin(\%itemcount, 24931 => 1, 16270 => 1))
{
quest::summonitem(31006);
}
elsif (plugin::check_handin(\%itemcount, 24930 => 1, 16270 => 1))
{
quest::summonitem(31002);
}
elsif (plugin::check_handin(\%itemcount, 24932 => 1, 16270 => 1))
{
quest::summonitem(31003);
}
elsif (plugin::check_handin(\%itemcount, 24934 => 1, 16270 => 1))
{
quest::summonitem(31004);
}
elsif (plugin::check_handin(\%itemcount, 24935 => 1, 16274 => 1))
{
quest::summonitem(31008);
}
elsif (plugin::check_handin(\%itemcount, 24940 => 1, 16274 => 1))
{
quest::summonitem(31007);
}
elsif (plugin::check_handin(\%itemcount, 24936 => 1, 16274 => 1))
{
quest::summonitem(31012);
}
elsif (plugin::check_handin(\%itemcount, 24938 => 1, 16274 => 1))
{
quest::summonitem(31013);
}
elsif (plugin::check_handin(\%itemcount, 24937 => 1, 16274 => 1))
{
quest::summonitem(31009);
}
elsif (plugin::check_handin(\%itemcount, 24939 => 1, 16274 => 1))
{
quest::summonitem(31010);
}
elsif (plugin::check_handin(\%itemcount, 24941 => 1, 16274 => 1))
{
quest::summonitem(31011);
}
elsif (plugin::check_handin(\%itemcount, 24928 => 1, 16271 => 1))
{
quest::summonitem(31043);
}
elsif (plugin::check_handin(\%itemcount, 24933 => 1, 16271 => 1))
{
quest::summonitem(31042);
}
elsif (plugin::check_handin(\%itemcount, 24929 => 1, 16271 => 1))
{
quest::summonitem(31047);
}
elsif (plugin::check_handin(\%itemcount, 24931 => 1, 16271 => 1))
{
quest::summonitem(31048);
}
elsif (plugin::check_handin(\%itemcount, 24930 => 1, 16271 => 1))
{
quest::summonitem(31044);
}
elsif (plugin::check_handin(\%itemcount, 24932 => 1, 16271 => 1))
{
quest::summonitem(31045);
}
elsif (plugin::check_handin(\%itemcount, 24934 => 1, 16271 => 1))
{
quest::summonitem(31046);
}
elsif (plugin::check_handin(\%itemcount, 24928 => 1, 16269 => 1))
{
quest::summonitem(31022);
}
elsif (plugin::check_handin(\%itemcount, 24933 => 1, 16269 => 1))
{
quest::summonitem(31021);
}
elsif (plugin::check_handin(\%itemcount, 24929 => 1, 16269 => 1))
{
quest::summonitem(31026);
}
elsif (plugin::check_handin(\%itemcount, 24931 => 1, 16269 => 1))
{
quest::summonitem(31027);
}
elsif (plugin::check_handin(\%itemcount, 24930 => 1, 16269 => 1))
{
quest::summonitem(31023);
}
elsif (plugin::check_handin(\%itemcount, 24932 => 1, 16269 => 1))
{
quest::summonitem(31024);
}
elsif (plugin::check_handin(\%itemcount, 24934 => 1, 16269 => 1))
{
quest::summonitem(31025);
}
elsif (plugin::check_handin(\%itemcount, 24928 => 1, 16267 => 1))
{
quest::summonitem(31085);
}
elsif (plugin::check_handin(\%itemcount, 24933 => 1, 16267 => 1))
{
quest::summonitem(31084);
}
elsif (plugin::check_handin(\%itemcount, 24929 => 1, 16267 => 1))
{
quest::summonitem(31089);
}
elsif (plugin::check_handin(\%itemcount, 24931 => 1, 16267 => 1))
{
quest::summonitem(31090);
}
elsif (plugin::check_handin(\%itemcount, 24930 => 1, 16267 => 1))
{
quest::summonitem(31086);
}
elsif (plugin::check_handin(\%itemcount, 24932 => 1, 16267 => 1))
{
quest::summonitem(31087);
}
elsif (plugin::check_handin(\%itemcount, 24934 => 1, 16267 => 1))
{
quest::summonitem(31088);
}
elsif (plugin::check_handin(\%itemcount, 24928 => 1, 16268 => 1))
{
quest::summonitem(31036);
}
elsif (plugin::check_handin(\%itemcount, 24933 => 1, 16268 => 1))
{
quest::summonitem(31035);
}
elsif (plugin::check_handin(\%itemcount, 24929 => 1, 16268 => 1))
{
quest::summonitem(31040);
}
elsif (plugin::check_handin(\%itemcount, 24931 => 1, 16268 => 1))
{
quest::summonitem(31041);
}
elsif (plugin::check_handin(\%itemcount, 24930 => 1, 16268 => 1))
{
quest::summonitem(31037);
}
elsif (plugin::check_handin(\%itemcount, 24932 => 1, 16268 => 1))
{
quest::summonitem(31038);
}
elsif (plugin::check_handin(\%itemcount, 24934 => 1, 16268 => 1))
{
quest::summonitem(31039);
}
elsif (plugin::check_handin(\%itemcount, 24942 => 1, 16276 => 1))
{
quest::summonitem(31050);
}
elsif (plugin::check_handin(\%itemcount, 24947 => 1, 16276 => 1))
{
quest::summonitem(31049);
}
elsif (plugin::check_handin(\%itemcount, 24943 => 1, 16276 => 1))
{
quest::summonitem(31054);
}
elsif (plugin::check_handin(\%itemcount, 24945 => 1, 16276 => 1))
{
quest::summonitem(31055);
}
elsif (plugin::check_handin(\%itemcount, 24944 => 1, 16276 => 1))
{
quest::summonitem(31051);
}
elsif (plugin::check_handin(\%itemcount, 24946 => 1, 16276 => 1))
{
quest::summonitem(31052);
}
elsif (plugin::check_handin(\%itemcount, 24948 => 1, 16276 => 1))
{
quest::summonitem(31053);
}
elsif (plugin::check_handin(\%itemcount, 24942 => 1, 16275 => 1))
{
quest::summonitem(31092);
}
elsif (plugin::check_handin(\%itemcount, 24947 => 1, 16275 => 1))
{
quest::summonitem(31091);
}
elsif (plugin::check_handin(\%itemcount, 24943 => 1, 16275 => 1))
{
quest::summonitem(31096);
}
elsif (plugin::check_handin(\%itemcount, 24945 => 1, 16275 => 1))
{
quest::summonitem(31097);
}
elsif (plugin::check_handin(\%itemcount, 24944 => 1, 16275 => 1))
{
quest::summonitem(31093);
}
elsif (plugin::check_handin(\%itemcount, 24946 => 1, 16275 => 1))
{
quest::summonitem(31094);
}
elsif (plugin::check_handin(\%itemcount, 24948 => 1, 16275 => 1))
{
quest::summonitem(31095);
}
elsif (plugin::check_handin(\%itemcount, 24942 => 1, 16277 => 1))
{
quest::summonitem(5454);
}
elsif (plugin::check_handin(\%itemcount, 24947 => 1, 16277 => 1))
{
quest::summonitem(5453);
}
elsif (plugin::check_handin(\%itemcount, 24943 => 1, 16277 => 1))
{
quest::summonitem(5458);
}
elsif (plugin::check_handin(\%itemcount, 24945 => 1, 16277 => 1))
{
quest::summonitem(5459);
}
elsif (plugin::check_handin(\%itemcount, 24944 => 1, 16277 => 1))
{
quest::summonitem(5455);
}
elsif (plugin::check_handin(\%itemcount, 24946 => 1, 16277 => 1))
{
quest::summonitem(5456);
}
elsif (plugin::check_handin(\%itemcount, 24948 => 1, 16277 => 1))
{
quest::summonitem(5457);
}
elsif (plugin::check_handin(\%itemcount, 24935 => 1, 32000 => 1))
{
quest::summonitem(55318);
}
elsif (plugin::check_handin(\%itemcount, 24940 => 1, 32000 => 1))
{
quest::summonitem(55317);
}
elsif (plugin::check_handin(\%itemcount, 24936 => 1, 32000 => 1))
{
quest::summonitem(55322);
}
elsif (plugin::check_handin(\%itemcount, 24938 => 1, 32000 => 1))
{
quest::summonitem(55323);
}
elsif (plugin::check_handin(\%itemcount, 24937 => 1, 32000 => 1))
{
quest::summonitem(55319);
}
elsif (plugin::check_handin(\%itemcount, 24939 => 1, 32000 => 1))
{
quest::summonitem(55320);
}
elsif (plugin::check_handin(\%itemcount, 24941 => 1, 32000 => 1))
{
quest::summonitem(55321);
}
elsif (plugin::check_handin(\%itemcount, 24935 => 1, 16273 => 1))
{
quest::summonitem(31029);
}
elsif (plugin::check_handin(\%itemcount, 24940 => 1, 16273 => 1))
{
quest::summonitem(31028);
}
elsif (plugin::check_handin(\%itemcount, 24936 => 1, 16273 => 1))
{
quest::summonitem(31033);
}
elsif (plugin::check_handin(\%itemcount, 24938 => 1, 16273 => 1))
{
quest::summonitem(31034);
}
elsif (plugin::check_handin(\%itemcount, 24937 => 1, 16273 => 1))
{
quest::summonitem(31030);
}
elsif (plugin::check_handin(\%itemcount, 24939 => 1, 16273 => 1))
{
quest::summonitem(31031);
}
elsif (plugin::check_handin(\%itemcount, 24941 => 1, 16273 => 1))
{
quest::summonitem(31032);
}
elsif (plugin::check_handin(\%itemcount, 24935 => 1, 16272 => 1))
{
quest::summonitem(31015);
}
elsif (plugin::check_handin(\%itemcount, 24940 => 1, 16272 => 1))
{
quest::summonitem(31014);
}
elsif (plugin::check_handin(\%itemcount, 24936 => 1, 16272 => 1))
{
quest::summonitem(31019);
}
elsif (plugin::check_handin(\%itemcount, 24938 => 1, 16272 => 1))
{
quest::summonitem(31020);
}
elsif (plugin::check_handin(\%itemcount, 24937 => 1, 16272 => 1))
{
quest::summonitem(31016);
}
elsif (plugin::check_handin(\%itemcount, 24939 => 1, 16272 => 1))
{
quest::summonitem(31017);
}
elsif (plugin::check_handin(\%itemcount, 24941 => 1, 16272 => 1))
{
quest::summonitem(31018);
}
elsif (plugin::check_handin(\%itemcount, 24949 => 1, 16279 => 1))
{
quest::summonitem(31057);
}
elsif (plugin::check_handin(\%itemcount, 24954 => 1, 16279 => 1))
{
quest::summonitem(31056);
}
elsif (plugin::check_handin(\%itemcount, 24950 => 1, 16279 => 1))
{
quest::summonitem(31061);
}
elsif (plugin::check_handin(\%itemcount, 24952 => 1, 16279 => 1))
{
quest::summonitem(31062);
}
elsif (plugin::check_handin(\%itemcount, 24951 => 1, 16279 => 1))
{
quest::summonitem(31058);
}
elsif (plugin::check_handin(\%itemcount, 24953 => 1, 16279 => 1))
{
quest::summonitem(31059);
}
elsif (plugin::check_handin(\%itemcount, 24955 => 1, 16279 => 1))
{
quest::summonitem(31060);
}
elsif (plugin::check_handin(\%itemcount, 24949 => 1, 16278 => 1))
{
quest::summonitem(31064);
}
elsif (plugin::check_handin(\%itemcount, 24954 => 1, 16278 => 1))
{
quest::summonitem(31063);
}
elsif (plugin::check_handin(\%itemcount, 24950 => 1, 16278 => 1))
{
quest::summonitem(31068);
}
elsif (plugin::check_handin(\%itemcount, 24952 => 1, 16278 => 1))
{
quest::summonitem(31069);
}
elsif (plugin::check_handin(\%itemcount, 24951 => 1, 16278 => 1))
{
quest::summonitem(31065);
}
elsif (plugin::check_handin(\%itemcount, 24953 => 1, 16278 => 1))
{
quest::summonitem(31066);
}
elsif (plugin::check_handin(\%itemcount, 24955 => 1, 16278 => 1))
{
quest::summonitem(31067);
}
elsif (plugin::check_handin(\%itemcount, 24949 => 1, 16280 => 1))
{
quest::summonitem(31071;
}
elsif (plugin::check_handin(\%itemcount, 24954 => 1, 16280 => 1))
{
quest::summonitem(31070);
}
elsif (plugin::check_handin(\%itemcount, 24950 => 1, 16280 => 1))
{
quest::summonitem(31075);
}
elsif (plugin::check_handin(\%itemcount, 24952 => 1, 16280 => 1))
{
quest::summonitem(31076);
}
elsif (plugin::check_handin(\%itemcount, 24951 => 1, 16280 => 1))
{
quest::summonitem(31072);
}
elsif (plugin::check_handin(\%itemcount, 24953 => 1, 16280 => 1))
{
quest::summonitem(31073);
}
elsif (plugin::check_handin(\%itemcount, 24955 => 1, 16280 => 1))
{
quest::summonitem(31074);
}
elsif (plugin::check_handin(\%itemcount, 24949 => 1, 16281 => 1))
{
quest::summonitem(31078);
}
elsif (plugin::check_handin(\%itemcount, 24954 => 1, 16281 => 1))
{
quest::summonitem(31077);
}
elsif (plugin::check_handin(\%itemcount, 24950 => 1, 16281 => 1))
{
quest::summonitem(31082);
}
elsif (plugin::check_handin(\%itemcount, 24952 => 1, 16281 => 1))
{
quest::summonitem(31083);
}
elsif (plugin::check_handin(\%itemcount, 24951 => 1, 16281 => 1))
{
quest::summonitem(31079);
}
elsif (plugin::check_handin(\%itemcount, 24953 => 1, 16281 => 1))
{
quest::summonitem(31080);
}
elsif (plugin::check_handin(\%itemcount, 24955 => 1, 16281 => 1))
{
quest::summonitem(31081);
}
  else {
    quest::say("This does not interest me, $name.");
    plugin::return_items(\%itemcount);
  }
}


ChaosSlayerZ 11-17-2012 11:21 AM

um I don't have my server files handy, but I think I always used just IF instead of elseif for the item turn-ins.

Trackye 11-17-2012 11:26 AM

Hmm ok i tried changing all the of elsifs to Ifs but script still non functional. Thanks for the suggestion though.

ChaosSlayerZ 11-17-2012 11:31 AM

yeah according to logic elseif should be fine..but...
sorry I just waked up... can't think clearly. :(
I am looking at the script and can't concentrate...
time for breakfast :D

Trackye 11-17-2012 12:04 PM

Yeah its weird. When i add all of the options the NPC still responds to Hails correctly. If i only put the first option in he will exchange the items like his is supposed to. so i know theres no broken coding there. Once i add more than one it doesnt work. I have another script with Elsif I wrote and it works fine and this one is more or less just a redo of that one with different items.

sorvani 11-17-2012 12:22 PM

elsif is better to use so that once one condition is met the rest of the elsif blocks are skipped. otherwise every single check is made for every single hand in.

This is not breaking your script, but you are using the return items incorrectly. You need to call it at the end of the EVENT_ITEM sub outside of any if/else block. That is a common misunderstanding and a lot of quests are wrote incorrectly even in the PEQ SVN.

Code:

}
  else {
    quest::say("This does not interest me, $name.");
  }
  plugin::return_items(\%itemcount);
}


sorvani 11-17-2012 12:28 PM

perl test.pl -c
syntax error at test.pl line 402, near "31071;"

you missed a )

Trackye 11-17-2012 12:49 PM

Wow. i feel dumb now.. Thanks for that:P How would i go about running that test myself next time?

c0ncrete 11-17-2012 01:25 PM

run your script in perl (not in the emulator) from a command prompt like this:

perl scriptname.pl

you'll need to either be in the directory where the script is or supply perl with the full path to the script.

the -c option tells perl to only run a syntax check.

Trackye 11-21-2012 12:05 AM

Thank you so much that has already been extremely useful for me.


All times are GMT -4. The time now is 05:31 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.