Select( 'SELECT i.id AS itemId, i.name_loc0, i.name_loc2, i.name_loc3, i.name_loc6, i.name_loc8, IF (i.id < 36000 OR i.itemLevel < 70, 1 , 2) AS expansion, i.quality, ic.iconString AS icon, i.gemEnchantmentId AS enchId, i.gemColorMask AS colors FROM ?_items i JOIN ?_icons ic ON ic.id = -i.displayId WHERE i.gemEnchantmentId <> 0 ORDER BY i.id DESC'); $success = true; // check directory-structure foreach (Util::$localeStrings as $dir) if (!CLISetup::writeDir('datasets/'.$dir)) $success = false; $enchIds = []; foreach ($gems as $pop) $enchIds[] = $pop['enchId']; $enchMisc = []; $enchJSON = Util::parseItemEnchantment($enchIds, false, $enchMisc); foreach (CLISetup::$localeIds as $lId) { set_time_limit(5); User::useLocale($lId); Lang::load(Util::$localeStrings[$lId]); $gemsOut = []; foreach ($gems as $pop) { $gemsOut[$pop['itemId']] = array( 'name' => Util::localizedString($pop, 'name'), 'quality' => $pop['quality'], 'icon' => strToLower($pop['icon']), 'enchantment' => Util::localizedString(@$enchMisc[$pop['enchId']]['text'] ?: [], 'text'), 'jsonequip' => @$enchJSON[$pop['enchId']] ?: [], 'colors' => $pop['colors'], 'expansion' => $pop['expansion'] ); } $toFile = "var g_gems = ".Util::toJSON($gemsOut).";"; $file = 'datasets/'.User::$localeString.'/gems'; if (!CLISetup::writeFile($file, $toFile)) $success = false; } return $success; } ?>