|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
04-13-2008, 05:13 AM
|
Fire Beetle
|
|
Join Date: Jul 2006
Posts: 20
|
|
Item Turn in triggering ALL rewards.
OK this is the first time i've come accross this happening and no matter what i do... i can NOT get it to work properly... not sure if it is a server issue, because i have 2 scripts doing the same thing. . .
whenever i turn in ANY item... including ones not used in the code..... it triggers ALL of these rewards...
Quote:
sub EVENT_ITEM
{
if($itemcount{812} => 1 && $itemcount{813} => 1 && $itemcount{814} => 1 && $itemcount{815} => 1)
{ #Fire Trash
quest::summonitem(816,1);
quest::say("Excellent, Excellent.");
quest::emote("tinkers with the items for awhile before handing you A Living Fragment of Fire.");
}
if($itemcount{804} => 1 && $itemcount{805} => 1 && $itemcount{806} => 1 && $itemcount{807} => 1)
{ #Water Trash
quest::summonitem(818,1);
quest::say("Excellent, Excellent.");
quest::emote("tinkers with the items for awhile before handing you A Living Fragment of Water.");
}
if($itemcount{800} => 1 && $itemcount{801} => 1 && $itemcount{802} => 1 && $itemcount{803} => 1)
{ #Earth Trash
quest::summonitem(819,1);
quest::say("Excellent, Excellent.");
quest::emote("tinkers with the items for awhile before handing you A Living Fragment of Earth.");
}
if($itemcount{808} => 1 && $itemcount{809} => 1 && $itemcount{810} => 1 && $itemcount{811} => 1)
{ #Air Trash
quest::summonitem(817,1);
quest::say("Excellent, Excellent.");
quest::emote("tinkers with the items for awhile before handing you A Living Fragment of Air.");
}
if($itemcount{824} => 1)
{ #Fake Summoning
quest::setglobal('MageEpicDone','1','7','Y30');
quest::say("YES! YES! YES!");
quest::emote("places the four Living Fragments you gathered for him into the staff. As she does so the staff glows with new power. 'Here you go.'");
quest::shout2("Congratulation $name The Master of Pure Elementals on his new weapons. SUMMONING!");
quest::summonitem(108020,1);
}
if($itemcount{816} => 1 && !defined $mageepicuse)
{ #Fire Master
quest::setglobal('FireMaster','1','7','H1');
quest::say("OK. Here we go. The Master of Fire will await you in the plane of Elemental Power. Return to me once you have all 4 Elemental Mastery Robes.");
quest::movegrp(185, -1274, -836, -207.3);
}
if($itemcount{818} => 1 && !defined $mageepicuse)
{ #Water Master
quest::setglobal('WaterMaster','1','7','H1');
quest::say("OK. Here we go. The Master of Water will await you in the plane of Elemental Power. Return to me once you have all 4 Elemental Mastery Robes.");
quest::movegrp(185, -1274, -836, -207.3);
}
if($itemcount{819} => 1 && !defined $mageepicuse)
{ #Earth Master
quest::setglobal('EarthMaster','1','7','H1');
quest::say("OK. Here we go. The Master of Fire will await you in the plane of Elemental Power. Return to me once you have all 4 Elemental Mastery Robes.");
quest::movegrp(185, -1274, -836, -207.3);
}
if($itemcount{817} => 1 && !defined $mageepicuse)
{ #Air Master
quest::setglobal('AirMaster','1','7','H1');
quest::say("OK. Here we go. The Master of Fire will await you in the plane of Elemental Power. Return to me once you have all 4 Elemental Mastery Robes.");
quest::movegrp(185, -1274, -836, -207.3);
}
if($itemcount{820} => 1 && $itemcount{821} => 1 && $itemcount{822} => 1 && $itemcount{823} => 1 && !defined $mageepicuse)
{ #Pure Elemental Master
quest::setglobal('PEMaster','1','7','H1');
quest::say("OK. Here we go. The Master of Pure Elements will await you in the plane of Elemental Power. Return to me once you retrieve his staff.");
quest::movegrp(185, -1274, -836, -207.3);
}
}
|
So when i change the ifs to elsif ... i get an error that any item turn in... will trigger the first reward (A Living Fragment of Fire).
|
|
|
|
04-13-2008, 05:38 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I have had this problem before. Your quest format is way different from what I normally use though.
Try it the way I wrote it below. Note, there were many small changes I made to how you had it. One of the major ones being all of the single quotes you were using. I think this should work:
Code:
sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 812 => 1, 813 => 1,814 => 1,815 => 1))
{ #Fire Trash
quest::summonitem(816);
quest::say("Excellent, Excellent.");
quest::emote("tinkers with the items for awhile before handing you A Living Fragment of Fire.");
}
if (plugin::check_handin(\%itemcount, 816 => 1) && $mageepicuse == undef)
{ #Fire Master
quest::setglobal("FireMaster", 1, 7, "H1");
quest::say("OK. Here we go. The Master of Fire will await you in the plane of Elemental Power. Return to me once you have all 4 Elemental Mastery Robes.");
quest::movegrp(185, -1274, -836, -207.3);
}
|
|
|
|
04-13-2008, 06:06 AM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
I'm pretty sure the issue is the syntax. If I'm not mistaken, => defines a value in an array (or something like that). Since Perl is executing storing it correctly, it's always coming back as a true value. If you change all of the =>'s to ==, you should be good to go.
|
04-13-2008, 07:40 AM
|
Hill Giant
|
|
Join Date: Jan 2008
Posts: 102
|
|
Indeed, "$itemcount{812} => 1" may be creating a map, which is an object hence not null. So it can be interpreted as a TRUE. I am far from an expert in Perl but I have seen such things on other languages (like C, Java) which do interpret many non-nul values to true.
Have you tried using the regular >= instead of => ? For a compiler they are absolutely not the same beasts.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:25 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|