I believe you are using else wrong for what you are trying to do. All but the first if should be elsif otherwise you would have to have the else statement after each if in order for the hand in to be returned properly.
Code:
sub EVENT_ITEM
{
#Hand in event AMBER & level check
if ((plugin::check_handin(\%itemcount, 10022 => 1)) && ($ulevel>=8))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(315,316,317)); #r2
}
#Hand in event PERIDOT & level check
elsif ((plugin::check_handin(\%itemcount, 10028 => 1)) && ($ulevel>=16))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(397,398,399,400)); #r3
}
#Hand in event fire opal & level check
elsif ((plugin::check_handin(\%itemcount, 10031 => 1)) && ($ulevel>=23))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(396,396)); #r5
}
#Hand in event fire emerald & level check
elsif ((plugin::check_handin(\%itemcount, 10033 => 1)) && ($ulevel>=30))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(570,571,572)); #r7
}
#Hand in event sapphire & level check
elsif ((plugin::check_handin(\%itemcount, 10034 => 1)) && ($ulevel>=37))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(573,574,575,576)); #r8
}
#Hand in event ruby & level check
elsif ((plugin::check_handin(\%itemcount, 10035 => 1)) && ($ulevel>=44))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(8184,8185)); #r9
}
#Hand in event diamond & level check
elsif ((plugin::check_handin(\%itemcount, 10037 => 1)) && ($ulevel>=51))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem, Come back when you are a more experienced for a more powerful companion!");
quest::selfcast(quest::ChooseRandom(628,629,630,631)); #r11
}
#Hand in event blue diamond & level check
elsif ((plugin::check_handin(\%itemcount, 22503 => 1)) && ($ulevel>=55))
{
quest::say("Ah, $name, this is perfect! thanks.. now let me get to work");
quest::emote("cups the gem in his hands as he begins to chant...");
plugin::Whisper("There you go, $name. I think that's what you wanted, right? If not, You can dismiss that one and try again with another gem. You have reached the most powerful companion I can summon.");
quest::selfcast(quest::ChooseRandom(632,633,634,635)); #r12
}
else {
quest::say("What Am I suppsoed to do with this...thing? This isn't what I need at all. Take it back!");
plugin::return_items(\%itemcount);
}
}
Also look at your level checks in sub EVENT_ITEM. If the character doing the hand in is above level 8 the first check will always be true which will likely cause it to stop right there.