Perl quest problem
I am learning a lot about perl quests but I seem to be stuck on making multiple items turn in for a reward. Does anyone see something wrong with this coding? When I turn in these 4 items I get no response from the npc.
sub EVENT_ITEM { if( ($itemcount{5018} ==1) && ($itemcount{5019} ==1) && ($itemcount{5020} ==1) && ($itemcount{1179} ==1) ) { quest::summonitem(5021); } } |
Are those really & 's or did something about your paste or the forum mangle those?
|
something along these lines
Code:
sub EVENT_ITEM { Code:
sub EVENT_ITEM { |
Code:
sub EVENT_ITEM { Code:
sub EVENT_ITEM edit: Code:
sub EVENT_ITEM { Code:
sub EVNET_ITEM |
bah knew i was missing something in that first code but tiredness kicked in :P.
|
thanks
Quote:
|
hm
If I turn in item 5019 with 5020 in this situation I get my reward 5030, but I also get 5022 ,as I have satisfied that first condition as well. Is there any easy way to tell it ONLY to reward the first when a single 5019 is turned in with nothing else?
sub EVENT_ITEM { if(($itemcount{5019} == 1)) {quest::summonitem(5022); } if(($itemcount{5019} == 1) && ($itemcount{5020} == 1)) {quest::summonitem(5030); } if(($itemcount{5018} == 1) && ($itemcount{5019} == 1) && ($itemcount{5020} == 1) && ($itemcount{1179} == 1)) {quest::summonitem(5021); } } |
This may work. can give it a try.
Code:
sub EVENT_ITEM |
thanks
Ah yeah that works great. That is exactly what I tried but I did it in reverse order :)
Much appreciated. |
...
I'm stuck with two quests, I've tried like 10 different things and can't seem to get multiple "if" conditions to work. Im a perl noob so pardon me if what I am doing makes little sense. Tried to copy the format we used above to get two if conditions to trigger a result...
1st: sub EVENT_SAY{ if(($class == 8) && ($text=~/hail/i)) {quest::say("xxx"); } elsif(($class != 8) && ($text=~/hail/i)) {quest::say("xxx");} } **** and this one sub EVENT_ITEM{ if(($item1 == 5) && ($ulevel < 4)) { quest::say("xxx"); quest::summonitem(6); quest::say("xxx"); } if($item1 == 6) { quest::setallskill(0); quest::permaclass(8); } } In the first one it triggers the second (elsif) condition regardless of my class. In the second it seems to be broken period, so I guess something is tripping it up in the format. Any have an idea? |
change the item id #'s to what you want to use and change the level check to whatever you wanted. all i saw was <
Code:
sub EVENT_SAY { |
re
Thank you very much
|
wonderin
What is the difference?
sub EVENT_SAY { if ($text=~/hail/i) { if ($class eq "Bard") { quest::say("you're a bard"); } else { quest::say("you're not a bard"); } } } ###### sub EVENT_SAY { if ($text=~/hail/i && $class eq "Bard") { quest::say("you're a bard"); } else { quest::say("you're not a bard"); } } The second one's else is a little vague? Also where did you find the format for - $class eq "Bard" |
All times are GMT -4. The time now is 05:53 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.