not trying to one up you, but this is a bit more of a easier way of doing what you were trying to do...
Code:
sub EVENT_ITEM_CLICK {
%ItemDB = (
#Plate #Chest #Legs #Feet #Hands
"Warrior" => {135056 => 135015 , 135052 => 135018, 135050 => 135019, 135055 => 135020},
"Cleric" => {135056 => 135015 , 135052 => 135018, 135050 => 135019, 135055 => 135020},
"Shadowknight" => {135056 => 135015 , 135052 => 135018, 135050 => 135019, 135055 => 135020},
"Bard" => {135056 => 135015 , 135052 => 135018, 135050 => 135019, 135055 => 135020},
#Chain
"Ranger" => {135056 => 135008 , 135052 => 135011, 135050 => 135012, 135055 => 135013},
"Rogue" => {135056 => 135008 , 135052 => 135011, 135050 => 135012, 135055 => 135013},
"Shaman" => {135056 => 135008 , 135052 => 135011, 135050 => 135012, 135055 => 135013},
"Berserker" => {135056 => 135008 , 135052 => 135011, 135050 => 135012, 135055 => 135013},
#Leather
"Druid" => {135056 => 135022 , 135052 => 135025, 135050 => 135026, 135055 => 135027},
"Beastlord" => {135056 => 135022 , 135052 => 135025, 135050 => 135026, 135055 => 135027},
"Monk" => {135056 => 135029 , 135052 => 135032, 135050 => 135033, 135055 => 135034}, #Monks use a completely diffrent set than anyone else... no clue..
#Cloth
"Necromancer" => {135056 => 135001 , 135052 => 135004, 135050 => 135005, 135055 => 135006},
"Wizard" => {135056 => 135001 , 135052 => 135004, 135050 => 135005, 135055 => 135006},
"Magician" => {135056 => 135001 , 135052 => 135004, 135050 => 135005, 135055 => 135006},
"Enchanter" => {135056 => 135001 , 135052 => 135004, 135050 => 135005, 135055 => 135006}
);
$ItemToSummon = $ItemDB{$class}{$itemid};
$client->Message(15, "Armor DEBUG: " . $ItemToSummon . "");
if(plugin::check_hasitem($client,$ItemToSummon)) {
$client->Message(15, "ERROR: Claiming this item would result in a lore item.");
$client->SummonItem($itemid, 1);
}
else {
$client->SummonItem($ItemToSummon, 1);
}
}