Well, I was finally able to get it working with the hash properly! But, for some reason, I can't get the return items plugin working properly for it. The code below works perfectly if you turn in the correct items, but if you turn in the wrong items, it will just eat them. I commented out the return plugin section because it was breaking the script. Basically with the return items plugin set to be used, it causes the return text to be said 3 times and then just returns the item you turned in. This is the case for the first 2 items, but the 3rd (last) item in the hash will actually still turn in properly for some reason.
Code:
sub EVENT_ITEM {
my %turn_ins = (2667 => 3233, 2664 => 3230, 2662 => 3227);
for my $turn_ins (sort keys %turn_ins) {
if(defined($turn_ins)) {
if (plugin::check_handin(\%itemcount, $turn_ins => 1)) {
quest::say("I see you have turned in item $turn_ins");
if(defined($turn_ins{$turn_ins})) {
quest::say("Your reward is item $turn_ins{$turn_ins}");
quest::summonitem($turn_ins{$turn_ins});
}
}
# else {
# plugin::return_items(\%itemcount);
# quest::say ("I have no use for this item, $name.");
# }
}
}
}
Anyone know how to get the return plugin working properly for this? I am guessing that it has something to do with it checking the has with the sort once for each item in the hash and then failing some of the checks to it skips straight to the else before it finishes checking all of the keys in the hash for the turn in item ID.