Code:
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount,8161=>1)) {
quest::say("You have won! Take this as a reward. Defeat the Skeletal Lord within an hour for one of five random item rewards.");
quest::summonitem(7967); #2h reward
}
if (plugin::check_handin(\%itemcount,8162=>3)) {
if (plugin::check_hasitem($client, 68752) && plugin::check_hasitem($client, 68752) && plugin::check_hasitem($client, 68752) && plugin::check_hasitem($client, 68752) && plugin::check_hasitem($client, 68752)) { #check ownership of all 5 rewards
quest::say("You possess all 5 possible rewards for the 1-hour event.");
}
else {
quest::say("You have defeated the Skeletal Lord! Take this as a reward. Defeat the Skeletal Lord within half an hour for a powerful permanent version of the Soul-Caged Rapier.");
for (1..2) {
my $reward = quest::ChooseRandom(68752,68754,68756,68758,68768); #1h reward list
redo if (plugin::check_hasitem($client, $reward)); #check ownership of chosen lore reward
quest::summonitem($reward);
last;
}
}
}
if (plugin::check_handin(\%itemcount,8163=>3)) {
quest::say("You are quite efficient at defeating the Lord of Undeath. Take this as a reward.");
quest::summonitem(8164); #30m reward
}
else {
plugin::return_items(\%itemcount);
}
}
This is the solution I've come up with, putting a pre-loop check for possession of all 5 possible rewards, but perhaps someone more experienced in Perl can construct something more efficient and/or concise.