|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

11-08-2011, 05:32 PM
|
Hill Giant
|
|
Join Date: Oct 2006
Posts: 179
|
|
Why this doesn't work
From the Lief Faladim NPC in Kithicor. THere are three hand ins and two work. The one that requires money doesn't and I don't see anything wrong (comparing to other quests).
Perhaps the $gold doesn't work properly? I summoned the exact items specified and handed in 2000 gold pieces at the same time. I get back the items but not the gold.
Code:
sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount, 12321 => 1, 12320 => 1)) {
quest::summonitem(3190);
}
if (plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1, $gold >= 2000)) {
quest::say("Here are your boots.");
quest::summonitem(3192);
}
if (plugin::check_handin(\%itemcount, 10059 => 1, 12328 => 1)) {
quest::say("Here are your leggings.");
quest::summonitem(3191);
}
else {
plugin::return_items(\%itemcount);
return 1;
}
|

11-08-2011, 08:16 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
I can't answer your gold question, but your script has the same problem that many others do. If you're checking for a series of items with the intent to return anything not used at the end you must use if/elsif/else, otherwise the last else only applies to the last if.
|

11-08-2011, 08:22 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I didn't test this, but it should work:
Code:
sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount, 12321 => 1, 12320 => 1))
{
quest::summonitem(3190);
}
if ($gold >= 2000 && plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1))
{
quest::say("Here are your boots.");
quest::summonitem(3192);
}
else
{
if($gold)
{
$client->AddMoneyToPP(0, 0, $gold, 0, 1);
quest::say("That is not the required amount!");
$gold = undef;
}
}
if (plugin::check_handin(\%itemcount, 10059 => 1, 12328 => 1))
{
quest::say("Here are your leggings.");
quest::summonitem(3191);
}
plugin::return_items(\%itemcount);
}
Your main issue is that $gold >= 2000 can not be passed into the check_handin plugin.
|
 |
|
 |

11-08-2011, 08:28 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Quote:
Originally Posted by lerxst2112
I can't answer your gold question, but your script has the same problem that many others do. If you're checking for a series of items with the intent to return anything not used at the end you must use if/elsif/else, otherwise the last else only applies to the last if.
|
I think most people misunderstand how to us the return_items plugin properly. Of course, it works in most cases as an else to the last if for most scenarios. The way I use it is out in the open at the end of the EVENT_ITEM sub (as shown in the example in my last post). Based on how the check_handin and return_items plugins work, you will only be returned items that weren't used by the check_handin plugin. So, leaving it out in the open at the end of the sub just makes sure any left over items will get returned.
One case where adding it as an else to the last if won't work is if someone turns in the needed item(s) for the last turn in, but also turns in an extra item. They will get the reward, but will not get their extra item back.
The main case in which you might need an if/elsif/else, is if you also want to give a return items say message if the turn in was incorrect.
Last edited by trevius; 11-09-2011 at 12:35 AM..
|
 |
|
 |

11-09-2011, 08:56 PM
|
Hill Giant
|
|
Join Date: Oct 2006
Posts: 179
|
|
I think I see. The original quest script has the $gold as an input to the plugin
if (plugin::check_handin(\%itemcount, 12305 => 1, 12306 => 1, $gold >= 2000)) {
And the plugin doesn't understand it so it returns false and hands back the items it understood without completing the transaction. The modified script by Trevius has the $gold conditional outside the plugin inputs so it's evaluated correctly. I'll make the changes and test it out.
Thanks muchly! I'll report any others in the quest bugs area. Seems not too many people are playing rangers, or perhaps just not doing class quests in the lower levels so these go unreported.
|

11-11-2011, 08:57 AM
|
Hill Giant
|
|
Join Date: Oct 2006
Posts: 179
|
|
I can't seem to find a description for AddMoneyToPP() anywhere. Its not in the wiki or in the pearl lexicon that I could find. Is there anywhere it's described?
|

11-11-2011, 05:28 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
|

11-11-2011, 05:52 PM
|
Hill Giant
|
|
Join Date: Oct 2006
Posts: 179
|
|
Awesome thanks! Lots to look at and experiment with.
|
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 08:36 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |