DELIMITER $$

DROP FUNCTION IF EXISTS `GetRaceToken`;

-- This function converts a numeric race id to a string label based on server code designations
--
-- example:
-- SELECT `id`, `name`, GetRaceToken(`race`) FROM `npc_types` WHERE `id` IN ('644', '105153', '261131');
CREATE FUNCTION `GetRaceToken` (`race_id` INT(11)) RETURNS VARCHAR(64)
BEGIN
	DECLARE `token` VARCHAR(64) DEFAULT '';
	
	CASE `race_id`
		WHEN '0' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '1' THEN SET `token` = 'Human';
		WHEN '2' THEN SET `token` = 'Barbarian';
		WHEN '3' THEN SET `token` = 'Erudite';
		WHEN '4' THEN SET `token` = 'Wood Elf';
		WHEN '5' THEN SET `token` = 'High Elf';
		WHEN '6' THEN SET `token` = 'Dark Elf';
		WHEN '7' THEN SET `token` = 'Half Elf';
		WHEN '8' THEN SET `token` = 'Dwarf';
		WHEN '9' THEN SET `token` = 'Troll';
		WHEN '10' THEN SET `token` = 'Ogre';
		WHEN '11' THEN SET `token` = 'Halfling';
		WHEN '12' THEN SET `token` = 'Gnome';
		WHEN '13' THEN SET `token` = 'Aviak';
		WHEN '14' THEN SET `token` = 'Werewolf';
		WHEN '15' THEN SET `token` = 'Brownie';
		WHEN '16' THEN SET `token` = 'Centaur';
		WHEN '17' THEN SET `token` = 'Golem';
		WHEN '18' THEN SET `token` = 'Giant';
		WHEN '19' THEN SET `token` = 'Trakanon';
		WHEN '20' THEN SET `token` = 'Venril Sathir';
		WHEN '21' THEN SET `token` = 'Evil Eye';
		WHEN '22' THEN SET `token` = 'Beetle';
		WHEN '23' THEN SET `token` = 'Kerran';
		WHEN '24' THEN SET `token` = 'Fish';
		WHEN '25' THEN SET `token` = 'Fairy';
		WHEN '26' THEN SET `token` = 'Froglok';
		WHEN '27' THEN SET `token` = 'Froglok';
		WHEN '28' THEN SET `token` = 'Fungusman';
		WHEN '29' THEN SET `token` = 'Gargoyle';
		WHEN '30' THEN SET `token` = 'Gasbag';
		WHEN '31' THEN SET `token` = 'Gelatinous Cube';
		WHEN '32' THEN SET `token` = 'Ghost';
		WHEN '33' THEN SET `token` = 'Ghoul';
		WHEN '34' THEN SET `token` = 'Bat';
		WHEN '35' THEN SET `token` = 'Eel';
		WHEN '36' THEN SET `token` = 'Rat';
		WHEN '37' THEN SET `token` = 'Snake';
		WHEN '38' THEN SET `token` = 'Spider';
		WHEN '39' THEN SET `token` = 'Gnoll';
		WHEN '40' THEN SET `token` = 'Goblin';
		WHEN '41' THEN SET `token` = 'Gorilla';
		WHEN '42' THEN SET `token` = 'Wolf';
		WHEN '43' THEN SET `token` = 'Bear';
		WHEN '44' THEN SET `token` = 'Guard';
		WHEN '45' THEN SET `token` = 'Demi Lich';
		WHEN '46' THEN SET `token` = 'Imp';
		WHEN '47' THEN SET `token` = 'Griffin';
		WHEN '48' THEN SET `token` = 'Kobold';
		WHEN '49' THEN SET `token` = 'Dragon';
		WHEN '50' THEN SET `token` = 'Lion';
		WHEN '51' THEN SET `token` = 'Lizard Man';
		WHEN '52' THEN SET `token` = 'Mimic';
		WHEN '53' THEN SET `token` = 'Minotaur';
		WHEN '54' THEN SET `token` = 'Orc';
		WHEN '55' THEN SET `token` = 'Beggar';
		WHEN '56' THEN SET `token` = 'Pixie';
		WHEN '57' THEN SET `token` = 'Drachnid';
		WHEN '58' THEN SET `token` = 'Solusek Ro';
		WHEN '59' THEN SET `token` = 'Goblin';
		WHEN '60' THEN SET `token` = 'Skeleton';
		WHEN '61' THEN SET `token` = 'Shark';
		WHEN '62' THEN SET `token` = 'Tunare';
		WHEN '63' THEN SET `token` = 'Tiger';
		WHEN '64' THEN SET `token` = 'Treant';
		WHEN '65' THEN SET `token` = 'Vampire';
		WHEN '66' THEN SET `token` = 'Rallos Zek';
		WHEN '67' THEN SET `token` = 'Human';
		WHEN '68' THEN SET `token` = 'Tentacle Terror';
		WHEN '69' THEN SET `token` = 'Will-O-Wisp';
		WHEN '70' THEN SET `token` = 'Zombie';
		WHEN '71' THEN SET `token` = 'Human';
		WHEN '72' THEN SET `token` = 'Ship';
		WHEN '73' THEN SET `token` = 'Launch';
		WHEN '74' THEN SET `token` = 'Piranha';
		WHEN '75' THEN SET `token` = 'Elemental';
		WHEN '76' THEN SET `token` = 'Puma';
		WHEN '77' THEN SET `token` = 'Dark Elf';
		WHEN '78' THEN SET `token` = 'Erudite';
		WHEN '79' THEN SET `token` = 'Bixie';
		WHEN '80' THEN SET `token` = 'Reanimated Hand';
		WHEN '81' THEN SET `token` = 'Halfling';
		WHEN '82' THEN SET `token` = 'Scarecrow';
		WHEN '83' THEN SET `token` = 'Skunk';
		WHEN '84' THEN SET `token` = 'Snake Elemental';
		WHEN '85' THEN SET `token` = 'Spectre';
		WHEN '86' THEN SET `token` = 'Sphinx';
		WHEN '87' THEN SET `token` = 'Armadillo';
		WHEN '88' THEN SET `token` = 'Clockwork Gnome';
		WHEN '89' THEN SET `token` = 'Drake';
		WHEN '90' THEN SET `token` = 'Barbarian';
		WHEN '91' THEN SET `token` = 'Alligator';
		WHEN '92' THEN SET `token` = 'Troll';
		WHEN '93' THEN SET `token` = 'Ogre';
		WHEN '94' THEN SET `token` = 'Dwarf';
		WHEN '95' THEN SET `token` = 'Cazic Thule';
		WHEN '96' THEN SET `token` = 'Cockatrice';
		WHEN '97' THEN SET `token` = 'Daisy Man';
		WHEN '98' THEN SET `token` = 'Vampire';
		WHEN '99' THEN SET `token` = 'Amygdalan';
		WHEN '100' THEN SET `token` = 'Dervish';
		WHEN '101' THEN SET `token` = 'Efreeti';
		WHEN '102' THEN SET `token` = 'Tadpole';
		WHEN '103' THEN SET `token` = 'Kedge';
		WHEN '104' THEN SET `token` = 'Leech';
		WHEN '105' THEN SET `token` = 'Swordfish';
		WHEN '106' THEN SET `token` = 'Guard';
		WHEN '107' THEN SET `token` = 'Mammoth';
		WHEN '108' THEN SET `token` = 'Eye';
		WHEN '109' THEN SET `token` = 'Wasp';
		WHEN '110' THEN SET `token` = 'Mermaid';
		WHEN '111' THEN SET `token` = 'Harpy';
		WHEN '112' THEN SET `token` = 'Guard';
		WHEN '113' THEN SET `token` = 'Drixie';
		WHEN '114' THEN SET `token` = 'Ghost Ship';
		WHEN '115' THEN SET `token` = 'Clam';
		WHEN '116' THEN SET `token` = 'Seahorse';
		WHEN '117' THEN SET `token` = 'Ghost';
		WHEN '118' THEN SET `token` = 'Ghost';
		WHEN '119' THEN SET `token` = 'Saber-toothed Cat';
		WHEN '120' THEN SET `token` = 'Wolf';
		WHEN '121' THEN SET `token` = 'Gorgon';
		WHEN '122' THEN SET `token` = 'Dragon';
		WHEN '123' THEN SET `token` = 'Innoruuk';
		WHEN '124' THEN SET `token` = 'Unicorn';
		WHEN '125' THEN SET `token` = 'Pegasus';
		WHEN '126' THEN SET `token` = 'Djinn';
		WHEN '127' THEN SET `token` = 'Invisible Man';
		WHEN '128' THEN SET `token` = 'Iksar';
		WHEN '129' THEN SET `token` = 'Scorpion';
		WHEN '130' THEN SET `token` = 'Vah Shir';
		WHEN '131' THEN SET `token` = 'Sarnak';
		WHEN '132' THEN SET `token` = 'Draglock';
		WHEN '133' THEN SET `token` = 'Drolvarg';
		WHEN '134' THEN SET `token` = 'Mosquito';
		WHEN '135' THEN SET `token` = 'Rhinoceros';
		WHEN '136' THEN SET `token` = 'Xalgoz';
		WHEN '137' THEN SET `token` = 'Goblin';
		WHEN '138' THEN SET `token` = 'Yeti';
		WHEN '139' THEN SET `token` = 'Iksar';
		WHEN '140' THEN SET `token` = 'Giant';
		WHEN '141' THEN SET `token` = 'Boat';
		WHEN '142' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '143' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '144' THEN SET `token` = 'Burynai';
		WHEN '145' THEN SET `token` = 'Goo';
		WHEN '146' THEN SET `token` = 'Sarnak Spirit';
		WHEN '147' THEN SET `token` = 'Iksar Spirit';
		WHEN '148' THEN SET `token` = 'Fish';
		WHEN '149' THEN SET `token` = 'Scorpion';
		WHEN '150' THEN SET `token` = 'Erollisi';
		WHEN '151' THEN SET `token` = 'Tribunal';
		WHEN '152' THEN SET `token` = 'Bertoxxulous';
		WHEN '153' THEN SET `token` = 'Bristlebane';
		WHEN '154' THEN SET `token` = 'Fay Drake';
		WHEN '155' THEN SET `token` = 'Undead Sarnak';
		WHEN '156' THEN SET `token` = 'Ratman';
		WHEN '157' THEN SET `token` = 'Wyvern';
		WHEN '158' THEN SET `token` = 'Wurm';
		WHEN '159' THEN SET `token` = 'Devourer';
		WHEN '160' THEN SET `token` = 'Iksar Golem';
		WHEN '161' THEN SET `token` = 'Undead Iksar';
		WHEN '162' THEN SET `token` = 'Man-Eating Plant';
		WHEN '163' THEN SET `token` = 'Raptor';
		WHEN '164' THEN SET `token` = 'Sarnak Golem';
		WHEN '165' THEN SET `token` = 'Dragon';
		WHEN '166' THEN SET `token` = 'Animated Hand';
		WHEN '167' THEN SET `token` = 'Succulent';
		WHEN '168' THEN SET `token` = 'Holgresh';
		WHEN '169' THEN SET `token` = 'Brontotherium';
		WHEN '170' THEN SET `token` = 'Snow Dervish';
		WHEN '171' THEN SET `token` = 'Dire Wolf';
		WHEN '172' THEN SET `token` = 'Manticore';
		WHEN '173' THEN SET `token` = 'Totem';
		WHEN '174' THEN SET `token` = 'Ice Spectre';
		WHEN '175' THEN SET `token` = 'Enchanted Armor';
		WHEN '176' THEN SET `token` = 'Snow Rabbit';
		WHEN '177' THEN SET `token` = 'Walrus';
		WHEN '178' THEN SET `token` = 'Geonid';
		WHEN '179' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '180' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '181' THEN SET `token` = 'Yakkar';
		WHEN '182' THEN SET `token` = 'Faun';
		WHEN '183' THEN SET `token` = 'Coldain';
		WHEN '184' THEN SET `token` = 'Dragon';
		WHEN '185' THEN SET `token` = 'Hag';
		WHEN '186' THEN SET `token` = 'Hippogriff';
		WHEN '187' THEN SET `token` = 'Siren';
		WHEN '188' THEN SET `token` = 'Giant';
		WHEN '189' THEN SET `token` = 'Giant';
		WHEN '190' THEN SET `token` = 'Othmir';
		WHEN '191' THEN SET `token` = 'Ulthork';
		WHEN '192' THEN SET `token` = 'Dragon';
		WHEN '193' THEN SET `token` = 'Abhorrent';
		WHEN '194' THEN SET `token` = 'Sea Turtle';
		WHEN '195' THEN SET `token` = 'Dragon';
		WHEN '196' THEN SET `token` = 'Dragon';
		WHEN '197' THEN SET `token` = 'Ronnie Test';
		WHEN '198' THEN SET `token` = 'Dragon';
		WHEN '199' THEN SET `token` = 'Shik\'Nar';
		WHEN '200' THEN SET `token` = 'Rockhopper';
		WHEN '201' THEN SET `token` = 'Underbulk';
		WHEN '202' THEN SET `token` = 'Grimling';
		WHEN '203' THEN SET `token` = 'Worm';
		WHEN '204' THEN SET `token` = 'Evan Test';
		WHEN '205' THEN SET `token` = 'Shadel';
		WHEN '206' THEN SET `token` = 'Owlbear';
		WHEN '207' THEN SET `token` = 'Rhino Beetle';
		WHEN '208' THEN SET `token` = 'Vampire';
		WHEN '209' THEN SET `token` = 'Earth Elemental';
		WHEN '210' THEN SET `token` = 'Air Elemental';
		WHEN '211' THEN SET `token` = 'Water Elemental';
		WHEN '212' THEN SET `token` = 'Fire Elemental';
		WHEN '213' THEN SET `token` = 'Wetfang Minnow';
		WHEN '214' THEN SET `token` = 'Thought Horror';
		WHEN '215' THEN SET `token` = 'Tegi';
		WHEN '216' THEN SET `token` = 'Horse';
		WHEN '217' THEN SET `token` = 'Shissar';
		WHEN '218' THEN SET `token` = 'Fungal Fiend';
		WHEN '219' THEN SET `token` = 'Vampire';
		WHEN '220' THEN SET `token` = 'Stonegrabber';
		WHEN '221' THEN SET `token` = 'Scarlet Cheetah';
		WHEN '222' THEN SET `token` = 'Zelniak';
		WHEN '223' THEN SET `token` = 'Lightcrawler';
		WHEN '224' THEN SET `token` = 'Shade';
		WHEN '225' THEN SET `token` = 'Sunflower';
		WHEN '226' THEN SET `token` = 'Sun Revenant';
		WHEN '227' THEN SET `token` = 'Shrieker';
		WHEN '228' THEN SET `token` = 'Galorian';
		WHEN '229' THEN SET `token` = 'Netherbian';
		WHEN '230' THEN SET `token` = 'Akheva';
		WHEN '231' THEN SET `token` = 'Grieg Veneficus';
		WHEN '232' THEN SET `token` = 'Sonic Wolf';
		WHEN '233' THEN SET `token` = 'Ground Shaker';
		WHEN '234' THEN SET `token` = 'Vah Shir Skeleton';
		WHEN '235' THEN SET `token` = 'Wretch';
		WHEN '236' THEN SET `token` = 'Seru';
		WHEN '237' THEN SET `token` = 'Recuso';
		WHEN '238' THEN SET `token` = 'Vah Shir';
		WHEN '239' THEN SET `token` = 'Guard';
		WHEN '240' THEN SET `token` = 'Teleport Man';
		WHEN '241' THEN SET `token` = 'Werewolf';
		WHEN '242' THEN SET `token` = 'Nymph';
		WHEN '243' THEN SET `token` = 'Dryad';
		WHEN '244' THEN SET `token` = 'Treant';
		WHEN '245' THEN SET `token` = 'Fly';
		WHEN '246' THEN SET `token` = 'Tarew Marr';
		WHEN '247' THEN SET `token` = 'Solusek Ro';
		WHEN '248' THEN SET `token` = 'Clockwork Golem';
		WHEN '249' THEN SET `token` = 'Clockwork Brain';
		WHEN '250' THEN SET `token` = 'Banshee';
		WHEN '251' THEN SET `token` = 'Guard of Justice';
		WHEN '252' THEN SET `token` = 'Mini POM';
		WHEN '253' THEN SET `token` = 'Diseased Fiend';
		WHEN '254' THEN SET `token` = 'Solusek Ro Guard';
		WHEN '255' THEN SET `token` = 'Bertoxxulous';
		WHEN '256' THEN SET `token` = 'The Tribunal';
		WHEN '257' THEN SET `token` = 'Terris Thule';
		WHEN '258' THEN SET `token` = 'Vegerog';
		WHEN '259' THEN SET `token` = 'Crocodile';
		WHEN '260' THEN SET `token` = 'Bat';
		WHEN '261' THEN SET `token` = 'Hraquis';
		WHEN '262' THEN SET `token` = 'Tranquilion';
		WHEN '263' THEN SET `token` = 'Tin Soldier';
		WHEN '264' THEN SET `token` = 'Nightmare Wraith';
		WHEN '265' THEN SET `token` = 'Malarian';
		WHEN '266' THEN SET `token` = 'Knight of Pestilence';
		WHEN '267' THEN SET `token` = 'Lepertoloth';
		WHEN '268' THEN SET `token` = 'Bubonian';
		WHEN '269' THEN SET `token` = 'Bubonian Underling';
		WHEN '270' THEN SET `token` = 'Pusling';
		WHEN '271' THEN SET `token` = 'Water Mephit';
		WHEN '272' THEN SET `token` = 'Stormrider';
		WHEN '273' THEN SET `token` = 'Junk Beast';
		WHEN '274' THEN SET `token` = 'Broken Clockwork';
		WHEN '275' THEN SET `token` = 'Giant Clockwork';
		WHEN '276' THEN SET `token` = 'Clockwork Beetle';
		WHEN '277' THEN SET `token` = 'Nightmare Goblin';
		WHEN '278' THEN SET `token` = 'Karana';
		WHEN '279' THEN SET `token` = 'Blood Raven';
		WHEN '280' THEN SET `token` = 'Nightmare Gargoyle';
		WHEN '281' THEN SET `token` = 'Mouth of Insanity';
		WHEN '282' THEN SET `token` = 'Skeletal Horse';
		WHEN '283' THEN SET `token` = 'Saryrn';
		WHEN '284' THEN SET `token` = 'Fennin Ro';
		WHEN '285' THEN SET `token` = 'Tormentor';
		WHEN '286' THEN SET `token` = 'Soul Devourer';
		WHEN '287' THEN SET `token` = 'Nightmare';
		WHEN '288' THEN SET `token` = 'Rallos Zek';
		WHEN '289' THEN SET `token` = 'Vallon Zek';
		WHEN '290' THEN SET `token` = 'Tallon Zek';
		WHEN '291' THEN SET `token` = 'Air Mephit';
		WHEN '292' THEN SET `token` = 'Earth Mephit';
		WHEN '293' THEN SET `token` = 'Fire Mephit';
		WHEN '294' THEN SET `token` = 'Nightmare Mephit';
		WHEN '295' THEN SET `token` = 'Zebuxoruk';
		WHEN '296' THEN SET `token` = 'Mithaniel Marr';
		WHEN '297' THEN SET `token` = 'Undead Knight';
		WHEN '298' THEN SET `token` = 'The Rathe';
		WHEN '299' THEN SET `token` = 'Xegony';
		WHEN '300' THEN SET `token` = 'Fiend';
		WHEN '301' THEN SET `token` = 'Test Object';
		WHEN '302' THEN SET `token` = 'Crab';
		WHEN '303' THEN SET `token` = 'Phoenix';
		WHEN '304' THEN SET `token` = 'Dragon';
		WHEN '305' THEN SET `token` = 'Bear';
		WHEN '306' THEN SET `token` = 'Giant';
		WHEN '307' THEN SET `token` = 'Giant';
		WHEN '308' THEN SET `token` = 'Giant';
		WHEN '309' THEN SET `token` = 'Giant';
		WHEN '310' THEN SET `token` = 'Giant';
		WHEN '311' THEN SET `token` = 'Giant';
		WHEN '312' THEN SET `token` = 'Giant';
		WHEN '313' THEN SET `token` = 'War Wraith';
		WHEN '314' THEN SET `token` = 'Wrulon';
		WHEN '315' THEN SET `token` = 'Kraken';
		WHEN '316' THEN SET `token` = 'Poison Frog';
		WHEN '317' THEN SET `token` = 'Nilborien';
		WHEN '318' THEN SET `token` = 'Valorian';
		WHEN '319' THEN SET `token` = 'War Boar';
		WHEN '320' THEN SET `token` = 'Efreeti';
		WHEN '321' THEN SET `token` = 'War Boar';
		WHEN '322' THEN SET `token` = 'Valorian';
		WHEN '323' THEN SET `token` = 'Animated Armor';
		WHEN '324' THEN SET `token` = 'Undead Footman';
		WHEN '325' THEN SET `token` = 'Rallos Zek Minion';
		WHEN '326' THEN SET `token` = 'Arachnid';
		WHEN '327' THEN SET `token` = 'Crystal Spider';
		WHEN '328' THEN SET `token` = 'Zebuxoruk\'s Cage';
		WHEN '329' THEN SET `token` = 'BoT Portal';
		WHEN '330' THEN SET `token` = 'Froglok';
		WHEN '331' THEN SET `token` = 'Troll';
		WHEN '332' THEN SET `token` = 'Troll';
		WHEN '333' THEN SET `token` = 'Troll';
		WHEN '334' THEN SET `token` = 'Ghost';
		WHEN '335' THEN SET `token` = 'Pirate';
		WHEN '336' THEN SET `token` = 'Pirate';
		WHEN '337' THEN SET `token` = 'Pirate';
		WHEN '338' THEN SET `token` = 'Pirate';
		WHEN '339' THEN SET `token` = 'Pirate';
		WHEN '340' THEN SET `token` = 'Pirate';
		WHEN '341' THEN SET `token` = 'Pirate';
		WHEN '342' THEN SET `token` = 'Pirate';
		WHEN '343' THEN SET `token` = 'Frog';
		WHEN '344' THEN SET `token` = 'Troll Zombie';
		WHEN '345' THEN SET `token` = 'Luggald';
		WHEN '346' THEN SET `token` = 'Luggald';
		WHEN '347' THEN SET `token` = 'Luggalds';
		WHEN '348' THEN SET `token` = 'Drogmore';
		WHEN '349' THEN SET `token` = 'Froglok Skeleton';
		WHEN '350' THEN SET `token` = 'Undead Froglok';
		WHEN '351' THEN SET `token` = 'Knight of Hate';
		WHEN '352' THEN SET `token` = 'Arcanist of Hate';
		WHEN '353' THEN SET `token` = 'Veksar';
		WHEN '354' THEN SET `token` = 'Veksar';
		WHEN '355' THEN SET `token` = 'Veksar';
		WHEN '356' THEN SET `token` = 'Chokidai';
		WHEN '357' THEN SET `token` = 'Undead Chokidai';
		WHEN '358' THEN SET `token` = 'Undead Veksar';
		WHEN '359' THEN SET `token` = 'Vampire';
		WHEN '360' THEN SET `token` = 'Vampire';
		WHEN '361' THEN SET `token` = 'Rujarkian Orc';
		WHEN '362' THEN SET `token` = 'Bone Golem';
		WHEN '363' THEN SET `token` = 'Synarcana';
		WHEN '364' THEN SET `token` = 'Sand Elf';
		WHEN '365' THEN SET `token` = 'Vampire';
		WHEN '366' THEN SET `token` = 'Rujarkian Orc';
		WHEN '367' THEN SET `token` = 'Skeleton';
		WHEN '368' THEN SET `token` = 'Mummy';
		WHEN '369' THEN SET `token` = 'Goblin';
		WHEN '370' THEN SET `token` = 'Insect';
		WHEN '371' THEN SET `token` = 'Froglok Ghost';
		WHEN '372' THEN SET `token` = 'Dervish';
		WHEN '373' THEN SET `token` = 'Shade';
		WHEN '374' THEN SET `token` = 'Golem';
		WHEN '375' THEN SET `token` = 'Evil Eye';
		WHEN '376' THEN SET `token` = 'Box';
		WHEN '377' THEN SET `token` = 'Barrel';
		WHEN '378' THEN SET `token` = 'Chest';
		WHEN '379' THEN SET `token` = 'Vase';
		WHEN '380' THEN SET `token` = 'Table';
		WHEN '381' THEN SET `token` = 'Weapon Rack';
		WHEN '382' THEN SET `token` = 'Coffin';
		WHEN '383' THEN SET `token` = 'Bones';
		WHEN '384' THEN SET `token` = 'Jokester';
		WHEN '385' THEN SET `token` = 'Nihil';
		WHEN '386' THEN SET `token` = 'Trusik';
		WHEN '387' THEN SET `token` = 'Stone Worker';
		WHEN '388' THEN SET `token` = 'Hynid';
		WHEN '389' THEN SET `token` = 'Turepta';
		WHEN '390' THEN SET `token` = 'Cragbeast';
		WHEN '391' THEN SET `token` = 'Stonemite';
		WHEN '392' THEN SET `token` = 'Ukun';
		WHEN '393' THEN SET `token` = 'Ixt';
		WHEN '394' THEN SET `token` = 'Ikaav';
		WHEN '395' THEN SET `token` = 'Aneuk';
		WHEN '396' THEN SET `token` = 'Kyv';
		WHEN '397' THEN SET `token` = 'Noc';
		WHEN '398' THEN SET `token` = 'Ra`tuk';
		WHEN '399' THEN SET `token` = 'Taneth';
		WHEN '400' THEN SET `token` = 'Huvul';
		WHEN '401' THEN SET `token` = 'Mutna';
		WHEN '402' THEN SET `token` = 'Mastruq';
		WHEN '403' THEN SET `token` = 'Taelosian';
		WHEN '404' THEN SET `token` = 'Discord Ship';
		WHEN '405' THEN SET `token` = 'Stone Worker';
		WHEN '406' THEN SET `token` = 'Mata Muram';
		WHEN '407' THEN SET `token` = 'Lightning Warrior';
		WHEN '408' THEN SET `token` = 'Succubus';
		WHEN '409' THEN SET `token` = 'Bazu';
		WHEN '410' THEN SET `token` = 'Feran';
		WHEN '411' THEN SET `token` = 'Pyrilen';
		WHEN '412' THEN SET `token` = 'Chimera';
		WHEN '413' THEN SET `token` = 'Dragorn';
		WHEN '414' THEN SET `token` = 'Murkglider';
		WHEN '415' THEN SET `token` = 'Rat';
		WHEN '416' THEN SET `token` = 'Bat';
		WHEN '417' THEN SET `token` = 'Gelidran';
		WHEN '418' THEN SET `token` = 'Discordling';
		WHEN '419' THEN SET `token` = 'Girplan';
		WHEN '420' THEN SET `token` = 'Minotaur';
		WHEN '421' THEN SET `token` = 'Dragorn Box';
		WHEN '422' THEN SET `token` = 'Runed Orb';
		WHEN '423' THEN SET `token` = 'Dragon Bones';
		WHEN '424' THEN SET `token` = 'Muramite Armor Pile';
		WHEN '425' THEN SET `token` = 'Crystal Shard';
		WHEN '426' THEN SET `token` = 'Portal';
		WHEN '427' THEN SET `token` = 'Coin Purse';
		WHEN '428' THEN SET `token` = 'Rock Pile';
		WHEN '429' THEN SET `token` = 'Murkglider Egg Sac';
		WHEN '430' THEN SET `token` = 'Drake';
		WHEN '431' THEN SET `token` = 'Dervish';
		WHEN '432' THEN SET `token` = 'Drake';
		WHEN '433' THEN SET `token` = 'Goblin';
		WHEN '434' THEN SET `token` = 'Kirin';
		WHEN '435' THEN SET `token` = 'Dragon';
		WHEN '436' THEN SET `token` = 'Basilisk';
		WHEN '437' THEN SET `token` = 'Dragon';
		WHEN '438' THEN SET `token` = 'Dragon';
		WHEN '439' THEN SET `token` = 'Puma';
		WHEN '440' THEN SET `token` = 'Spider';
		WHEN '441' THEN SET `token` = 'Spider Queen';
		WHEN '442' THEN SET `token` = 'Animated Statue';
		WHEN '443' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '444' THEN SET `token` = 'UNKNOWN RACE';
		WHEN '445' THEN SET `token` = 'Dragon Egg';
		WHEN '446' THEN SET `token` = 'Dragon Statue';
		WHEN '447' THEN SET `token` = 'Lava Rock';
		WHEN '448' THEN SET `token` = 'Animated Statue';
		WHEN '449' THEN SET `token` = 'Spider Egg Sack';
		WHEN '450' THEN SET `token` = 'Lava Spider';
		WHEN '451' THEN SET `token` = 'Lava Spider Queen';
		WHEN '452' THEN SET `token` = 'Dragon';
		WHEN '453' THEN SET `token` = 'Giant';
		WHEN '454' THEN SET `token` = 'Werewolf';
		WHEN '455' THEN SET `token` = 'Kobold';
		WHEN '456' THEN SET `token` = 'Sporali';
		WHEN '457' THEN SET `token` = 'Gnomework';
		WHEN '458' THEN SET `token` = 'Orc';
		WHEN '459' THEN SET `token` = 'Corathus';
		WHEN '460' THEN SET `token` = 'Coral';
		WHEN '461' THEN SET `token` = 'Drachnid';
		WHEN '462' THEN SET `token` = 'Drachnid Cocoon';
		WHEN '463' THEN SET `token` = 'Fungus Patch';
		WHEN '464' THEN SET `token` = 'Gargoyle';
		WHEN '465' THEN SET `token` = 'Witheran';
		WHEN '466' THEN SET `token` = 'Dark Lord';
		WHEN '467' THEN SET `token` = 'Shiliskin';
		WHEN '468' THEN SET `token` = 'Snake';
		WHEN '469' THEN SET `token` = 'Evil Eye';
		WHEN '470' THEN SET `token` = 'Minotaur';
		WHEN '471' THEN SET `token` = 'Zombie';
		WHEN '472' THEN SET `token` = 'Clockwork Boar';
		WHEN '473' THEN SET `token` = 'Fairy';
		WHEN '474' THEN SET `token` = 'Witheran';
		WHEN '475' THEN SET `token` = 'Air Elemental';
		WHEN '476' THEN SET `token` = 'Earth Elemental';
		WHEN '477' THEN SET `token` = 'Fire Elemental';
		WHEN '478' THEN SET `token` = 'Water Elemental';
		WHEN '479' THEN SET `token` = 'Alligator';
		WHEN '480' THEN SET `token` = 'Bear';
		WHEN '481' THEN SET `token` = 'Scaled Wolf';
		WHEN '482' THEN SET `token` = 'Wolf';
		WHEN '483' THEN SET `token` = 'Spirit Wolf';
		WHEN '484' THEN SET `token` = 'Skeleton';
		WHEN '485' THEN SET `token` = 'Spectre';
		WHEN '486' THEN SET `token` = 'Bolvirk';
		WHEN '487' THEN SET `token` = 'Banshee';
		WHEN '488' THEN SET `token` = 'Banshee';
		WHEN '489' THEN SET `token` = 'Elddar';
		WHEN '490' THEN SET `token` = 'Forest Giant';
		WHEN '491' THEN SET `token` = 'Bone Golem';
		WHEN '492' THEN SET `token` = 'Horse';
		WHEN '493' THEN SET `token` = 'Pegasus';
		WHEN '494' THEN SET `token` = 'Shambling Mound';
		WHEN '495' THEN SET `token` = 'Scrykin';
		WHEN '496' THEN SET `token` = 'Treant';
		WHEN '497' THEN SET `token` = 'Vampire';
		WHEN '498' THEN SET `token` = 'Ayonae Ro';
		WHEN '499' THEN SET `token` = 'Sullon Zek';
		WHEN '500' THEN SET `token` = 'Banner';
		WHEN '501' THEN SET `token` = 'Flag';
		WHEN '502' THEN SET `token` = 'Rowboat';
		WHEN '503' THEN SET `token` = 'Bear Trap';
		WHEN '504' THEN SET `token` = 'Clockwork Bomb';
		WHEN '505' THEN SET `token` = 'Dynamite Keg';
		WHEN '506' THEN SET `token` = 'Pressure Plate';
		WHEN '507' THEN SET `token` = 'Puffer Spore';
		WHEN '508' THEN SET `token` = 'Stone Ring';
		WHEN '509' THEN SET `token` = 'Root Tentacle';
		WHEN '510' THEN SET `token` = 'Runic Symbol';
		WHEN '511' THEN SET `token` = 'Saltpetter Bomb';
		WHEN '512' THEN SET `token` = 'Floating Skull';
		WHEN '513' THEN SET `token` = 'Spike Trap';
		WHEN '514' THEN SET `token` = 'Totem';
		WHEN '515' THEN SET `token` = 'Web';
		WHEN '516' THEN SET `token` = 'Wicker Basket';
		WHEN '517' THEN SET `token` = 'Nightmare/Unicorn';
		WHEN '518' THEN SET `token` = 'Horse';
		WHEN '519' THEN SET `token` = 'Nightmare/Unicorn';
		WHEN '520' THEN SET `token` = 'Bixie';
		WHEN '521' THEN SET `token` = 'Centaur';
		WHEN '522' THEN SET `token` = 'Drakkin';
		WHEN '523' THEN SET `token` = 'Giant';
		WHEN '524' THEN SET `token` = 'Gnoll';
		WHEN '525' THEN SET `token` = 'Griffin';
		WHEN '526' THEN SET `token` = 'Giant Shade';
		WHEN '527' THEN SET `token` = 'Harpy';
		WHEN '528' THEN SET `token` = 'Mammoth';
		WHEN '529' THEN SET `token` = 'Satyr';
		WHEN '530' THEN SET `token` = 'Dragon';
		WHEN '531' THEN SET `token` = 'Dragon';
		WHEN '532' THEN SET `token` = 'Dyn\'Leth';
		WHEN '533' THEN SET `token` = 'Boat';
		WHEN '534' THEN SET `token` = 'Weapon Rack';
		WHEN '535' THEN SET `token` = 'Armor Rack';
		WHEN '536' THEN SET `token` = 'Honey Pot';
		WHEN '537' THEN SET `token` = 'Jum Jum Bucket';
		WHEN '538' THEN SET `token` = 'Toolbox';
		WHEN '539' THEN SET `token` = 'Stone Jug';
		WHEN '540' THEN SET `token` = 'Small Plant';
		WHEN '541' THEN SET `token` = 'Medium Plant';
		WHEN '542' THEN SET `token` = 'Tall Plant';
		WHEN '543' THEN SET `token` = 'Wine Cask';
		WHEN '544' THEN SET `token` = 'Elven Boat';
		WHEN '545' THEN SET `token` = 'Gnomish Boat';
		WHEN '546' THEN SET `token` = 'Barrel Barge Ship';
		WHEN '547' THEN SET `token` = 'Goo';
		WHEN '548' THEN SET `token` = 'Goo';
		WHEN '549' THEN SET `token` = 'Goo';
		WHEN '550' THEN SET `token` = 'Merchant Ship';
		WHEN '551' THEN SET `token` = 'Pirate Ship';
		WHEN '552' THEN SET `token` = 'Ghost Ship';
		WHEN '553' THEN SET `token` = 'Banner';
		WHEN '554' THEN SET `token` = 'Banner';
		WHEN '555' THEN SET `token` = 'Banner';
		WHEN '556' THEN SET `token` = 'Banner';
		WHEN '557' THEN SET `token` = 'Banner';
		WHEN '558' THEN SET `token` = 'Aviak';
		WHEN '559' THEN SET `token` = 'Beetle';
		WHEN '560' THEN SET `token` = 'Gorilla';
		WHEN '561' THEN SET `token` = 'Kedge';
		WHEN '562' THEN SET `token` = 'Kerran';
		WHEN '563' THEN SET `token` = 'Shissar';
		WHEN '564' THEN SET `token` = 'Siren';
		WHEN '565' THEN SET `token` = 'Sphinx';
		WHEN '566' THEN SET `token` = 'Human';
		WHEN '567' THEN SET `token` = 'Campfire';
		WHEN '568' THEN SET `token` = 'Brownie';
		WHEN '569' THEN SET `token` = 'Dragon';
		WHEN '570' THEN SET `token` = 'Exoskeleton';
		WHEN '571' THEN SET `token` = 'Ghoul';
		WHEN '572' THEN SET `token` = 'Clockwork Guardian';
		WHEN '573' THEN SET `token` = 'Mantrap';
		WHEN '574' THEN SET `token` = 'Minotaur';
		WHEN '575' THEN SET `token` = 'Scarecrow';
		WHEN '576' THEN SET `token` = 'Shade';
		WHEN '577' THEN SET `token` = 'Rotocopter';
		WHEN '578' THEN SET `token` = 'Tentacle Terror';
		WHEN '579' THEN SET `token` = 'Wereorc';
		WHEN '580' THEN SET `token` = 'Worg';
		WHEN '581' THEN SET `token` = 'Wyvern';
		WHEN '582' THEN SET `token` = 'Chimera';
		WHEN '583' THEN SET `token` = 'Kirin';
		WHEN '584' THEN SET `token` = 'Puma';
		WHEN '585' THEN SET `token` = 'Boulder';
		WHEN '586' THEN SET `token` = 'Banner';
		WHEN '587' THEN SET `token` = 'Elven Ghost';
		WHEN '588' THEN SET `token` = 'Human Ghost';
		WHEN '589' THEN SET `token` = 'Chest';
		WHEN '590' THEN SET `token` = 'Chest';
		WHEN '591' THEN SET `token` = 'Crystal';
		WHEN '592' THEN SET `token` = 'Coffin';
		WHEN '593' THEN SET `token` = 'Guardian CPU';
		WHEN '594' THEN SET `token` = 'Worg';
		WHEN '595' THEN SET `token` = 'Mansion';
		WHEN '596' THEN SET `token` = 'Floating Island';
		WHEN '597' THEN SET `token` = 'Cragslither';
		WHEN '598' THEN SET `token` = 'Wrulon';
		WHEN '599' THEN SET `token` = 'Spell Particle 1';
		WHEN '600' THEN SET `token` = 'Invisible Man of Zomm';
		WHEN '601' THEN SET `token` = 'Robocopter of Zomm';
		WHEN '602' THEN SET `token` = 'Burynai';
		WHEN '603' THEN SET `token` = 'Frog';
		WHEN '604' THEN SET `token` = 'Dracolich';
		WHEN '605' THEN SET `token` = 'Iksar Ghost';
		WHEN '606' THEN SET `token` = 'Iksar Skeleton';
		WHEN '607' THEN SET `token` = 'Mephit';
		WHEN '608' THEN SET `token` = 'Muddite';
		WHEN '609' THEN SET `token` = 'Raptor';
		WHEN '610' THEN SET `token` = 'Sarnak';
		WHEN '611' THEN SET `token` = 'Scorpion';
		WHEN '612' THEN SET `token` = 'T THEN SET sian';
		WHEN '613' THEN SET `token` = 'Wurm';
		WHEN '614' THEN SET `token` = 'Nekhon';
		WHEN '615' THEN SET `token` = 'Hydra Crystal';
		WHEN '616' THEN SET `token` = 'Crystal Sphere';
		WHEN '617' THEN SET `token` = 'Gnoll';
		WHEN '618' THEN SET `token` = 'Sokokar';
		WHEN '619' THEN SET `token` = 'Stone Pylon';
		WHEN '620' THEN SET `token` = 'Demon Vulture';
		WHEN '621' THEN SET `token` = 'Wagon';
		WHEN '622' THEN SET `token` = 'God of Discord';
		WHEN '623' THEN SET `token` = 'Feran Mount';
		WHEN '624' THEN SET `token` = 'Ogre NPC - Male';
		WHEN '625' THEN SET `token` = 'Sokokar Mount';
		WHEN '626' THEN SET `token` = 'Giant (Rallosian mats)';
		WHEN '627' THEN SET `token` = 'Sokokar (w saddle)';
		WHEN '628' THEN SET `token` = '10th Anniversary Banner';
		WHEN '629' THEN SET `token` = '10th Anniversary Cake';
		WHEN '630' THEN SET `token` = 'Wine Cask';
		WHEN '631' THEN SET `token` = 'Hydra Mount';
		WHEN '632' THEN SET `token` = 'Hydra NPC';
		WHEN '633' THEN SET `token` = 'Wedding Flowers';
		WHEN '634' THEN SET `token` = 'Wedding Arbor';
		WHEN '635' THEN SET `token` = 'Wedding Altar';
		WHEN '636' THEN SET `token` = 'Powder Keg';
		WHEN '637' THEN SET `token` = 'Apexus';
		WHEN '638' THEN SET `token` = 'Bellikos';
		WHEN '639' THEN SET `token` = 'Brell\'s First Creation';
		WHEN '640' THEN SET `token` = 'Brell';
		WHEN '641' THEN SET `token` = 'Crystalskin Ambuloid';
		WHEN '642' THEN SET `token` = 'Cliknar Queen';
		WHEN '643' THEN SET `token` = 'Cliknar Soldier';
		WHEN '644' THEN SET `token` = 'Cliknar Worker';
		WHEN '645' THEN SET `token` = 'Coldain';
		WHEN '646' THEN SET `token` = 'Coldain';
		WHEN '647' THEN SET `token` = 'Crystalskin Sessiloid';
		WHEN '648' THEN SET `token` = 'Genari';
		WHEN '649' THEN SET `token` = 'Gigyn';
		WHEN '650' THEN SET `token` = 'Greken - Young Adult';
		WHEN '651' THEN SET `token` = 'Greken - Young';
		WHEN '652' THEN SET `token` = 'Cliknar Mount';
		WHEN '653' THEN SET `token` = 'Telmira';
		WHEN '654' THEN SET `token` = 'Spider Mount';
		WHEN '655' THEN SET `token` = 'Bear Mount';
		WHEN '656' THEN SET `token` = 'Rat Mount';
		WHEN '657' THEN SET `token` = 'Sessiloid Mount';
		WHEN '658' THEN SET `token` = 'Morell Thule';
		WHEN '659' THEN SET `token` = 'Marionette';
		WHEN '660' THEN SET `token` = 'Book Dervish';
		WHEN '661' THEN SET `token` = 'Topiary Lion';
		WHEN '662' THEN SET `token` = 'Rotdog';
		WHEN '663' THEN SET `token` = 'Amygdalan';
		WHEN '664' THEN SET `token` = 'Sandman';
		WHEN '665' THEN SET `token` = 'Grandfather Clock';
		WHEN '666' THEN SET `token` = 'Gingerbread Man';
		WHEN '667' THEN SET `token` = 'Royal Guard';
		WHEN '668' THEN SET `token` = 'Rabbit';
		WHEN '669' THEN SET `token` = 'Blind Dreamer';
		WHEN '670' THEN SET `token` = 'Cazic Thule';
		WHEN '671' THEN SET `token` = 'Topiary Lion Mount';
		WHEN '672' THEN SET `token` = 'Rot Dog Mount';
		WHEN '673' THEN SET `token` = 'Goral Mount';
		WHEN '674' THEN SET `token` = 'Selyrah Mount';
		WHEN '675' THEN SET `token` = 'Sclera Mount';
		WHEN '676' THEN SET `token` = 'Braxi Mount';
		WHEN '677' THEN SET `token` = 'Kangon Mount';
		WHEN '678' THEN SET `token` = 'Erudite';
		WHEN '679' THEN SET `token` = 'Wurm Mount';
		WHEN '680' THEN SET `token` = 'Raptor Mount';
		WHEN '681' THEN SET `token` = 'Invisible Man';
		WHEN '682' THEN SET `token` = 'Whirligig';
		WHEN '683' THEN SET `token` = 'Gnomish Balloon';
		WHEN '684' THEN SET `token` = 'Gnomish Rocket Pack';
		WHEN '685' THEN SET `token` = 'Gnomish Hovering Transport';
		WHEN '686' THEN SET `token` = 'Selyrah';
		WHEN '687' THEN SET `token` = 'Goral';
		WHEN '688' THEN SET `token` = 'Braxi';
		WHEN '689' THEN SET `token` = 'Kangon';
		WHEN '690' THEN SET `token` = 'Invisible Man';
		WHEN '691' THEN SET `token` = 'Floating Tower';
		WHEN '692' THEN SET `token` = 'Explosive Cart';
		WHEN '693' THEN SET `token` = 'Blimp Ship';
		WHEN '694' THEN SET `token` = 'Tumbleweed';
		WHEN '695' THEN SET `token` = 'Alaran';
		WHEN '696' THEN SET `token` = 'Swinetor';
		WHEN '697' THEN SET `token` = 'Triumvirate';
		WHEN '698' THEN SET `token` = 'Hadal';
		WHEN '699' THEN SET `token` = 'Hovering Platform';
		WHEN '700' THEN SET `token` = 'Parasitic Scavenger';
		WHEN '701' THEN SET `token` = 'Grendlaen';
		WHEN '702' THEN SET `token` = 'Ship in a Bottle';
		WHEN '703' THEN SET `token` = 'Alaran Sentry Stone';
		WHEN '704' THEN SET `token` = 'Dervish';
		WHEN '705' THEN SET `token` = 'Regeneration Pool';
		WHEN '706' THEN SET `token` = 'Teleportation Stand';
		WHEN '707' THEN SET `token` = 'Relic Case';
		WHEN '708' THEN SET `token` = 'Alaran Ghost';
		WHEN '709' THEN SET `token` = 'Skystrider';
		WHEN '710' THEN SET `token` = 'Water Spout';
		WHEN '711' THEN SET `token` = 'Aviak Pull Along';
		WHEN '712' THEN SET `token` = 'Gelatinous Cube';
		WHEN '713' THEN SET `token` = 'Cat';
		WHEN '714' THEN SET `token` = 'Elk Head';
		WHEN '715' THEN SET `token` = 'Holgresh';
		WHEN '716' THEN SET `token` = 'Beetle';
		WHEN '717' THEN SET `token` = 'Vine Maw';
		WHEN '718' THEN SET `token` = 'Ratman';
		WHEN '719' THEN SET `token` = 'Fallen Knight';
		WHEN '720' THEN SET `token` = 'Flying Carpet';
		WHEN '721' THEN SET `token` = 'Carrier Hand';
		WHEN '722' THEN SET `token` = 'Akheva';
		WHEN '723' THEN SET `token` = 'Servant of Shadow';
		WHEN '724' THEN SET `token` = 'Luclin';
		WHEN '725' THEN SET `token` = 'Xaric the Unspoken';
		WHEN '726' THEN SET `token` = 'Dervish (Ver. 5)';
		WHEN '727' THEN SET `token` = 'Dervish (Ver. 6)';
		WHEN '728' THEN SET `token` = 'God - Luclin (Ver. 2)';
		WHEN '729' THEN SET `token` = 'God - Luclin (Ver. 3)';
		WHEN '730' THEN SET `token` = 'Orb';
		WHEN '731' THEN SET `token` = 'God - Luclin (Ver. 4)';
		WHEN '732' THEN SET `token` = 'Pegasus';
		WHEN '2250' THEN SET `token` = 'Interactive Object';
		ELSE SET `token` = 'unk';
	END CASE;
	
	SET `token` = CONCAT(`token`, '(', `race_id`, ')');
	
	RETURN `token`;
END$$

DELIMITER ;
