Check_handin
Greetings!
I'm having trouble with this quest. I cannot get check_handin to function as I see it in other peoples quests. First, here is my quest code... Code:
################################## Code:
elsif ((plugin::check_handin(\%itemcount, 1378 => 1))) Code:
elsif (plugin::check_handin(\%itemcount, 25832 => 3, 24934 => 1)) Also, I can not get this section of the code to work properly... Code:
elsif ((plugin::check_handin(\%itemcount, 1377 =>1))) Any help would be appreciated. Don't mind my horrible quest writing creativity. Got to start somewhere :) Have fun! |
the call to return_items should be outside of any conditional and located at the bottom of EVENT_ITEMS so as to return any unused items.
if you make a call to check_handin before you check other requirements, you'll have to summon the item if you want to return it, because check_handin will always consume the items sent as parameters, deleting them from %itemcount. either that or add the item to %itemcount and allow return_items to handle it at the bottom of the event. |
Was just about to crash for the night.
Code:
elsif (($ulevel <= 5) && (!defined $qglobals{jep_knife})) ## If this quest line done why go any farther? That will cause the hiccup as well as not returning the item.. because you're telling it item 1377 in a quantity of 1 is a valid item, with the check_handin, so it is removing that item from the hash, thus, won't return it even with the return_items call. Hope the above fixes the issue, if not it should at least get you started, am to "wake up" in two hours due to a forgotten appointment. Got to run. Good luck. |
Bleh had I known c0ncrete was on I would have crashed instead of bothering.. frickin Perl ninja he is. :p
|
i'd do something like this, but i'm extremely picky... :)
Code:
elsif ( # consume knife only if |
Thanks for all the responses. c0ncrete, I'm not sure I understand your code. I know you even took the time to add notes, but this one is beyond me. I'll tinker around with it. I think you just use functions I am not familiar with.
Have fun! |
if it helps any, it is intended to replace the bottom part of your EVENT_ITEM subroutine, starting at (and including) your check for the hand in of the knife. if you have any specific questions, i'd be more than happy to answer them.
|
[QUOTE=c0ncrete;218378]i'd do something like this, but i'm extremely picky... :)
Code:
elsif ( # consume knife only if |
he says the return text for the knife as well as for any additional item(s) that are returned? if so, it's because that's what it is supposed to do.
sprintf info found here: http://perldoc.perl.org/functions/sprintf.html %itemcount is a hash that is populated by the server when you hand in items. the keys are item numbers, and the values are the count of that item that was turned in. things may end up changing when the inventory system is reworked. |
$return_count is the (explicit) size of the hash %itemcount less the value of $knife_back, which is 0 unless the qglobal and the itemcount hash contains item 1377 (which itself is the list, more less, of what you handed the npc) in which case it equals 1
|
... alright then, need to start using two instances of FF constantly refreshing on one while writing replies on the other. :p
|
oops. i misread the question. he was asking about $return_count, not %itemcount. what he said.
|
c0ncrete,
When JUST the knife is returned he says the text Code:
my $knife_back = 0; Code:
if ( $return_count > 1 ) { |
Sorry for double post. Is he supposed to say he doesn't want the item twice?
|
no, that wasn't intended. lemme wake up a bit more before i try to fix it or i'll probably just make it worse. :)
|
oops. i double posted as well. sheesh....
|
this should fix it.
Code:
my $return_count = ( ( scalar keys %itemcount ) - $knife_back ); |
Just a comment: glancing at the work above, it seems it is getting way more complicated than it should be.
|
sure, he could very easily have chosen to use generic text (or none at all) when handing the unused items back, but that's pretty boring.
|
Sorry for delayed response. Been so busy. I'll take a look at this and let ya know.
|
Finally got to test it. I still get this response:
Quote:
|
it's the superfluous 'my' before setting $knife_back to 1. that causes $knife_back to have a value of 1 only inside of that block (it's a completely separate instance of the variable, actually). total newbie mistake on my part.
|
All times are GMT -4. The time now is 01:03 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.