$row) { foreach ($row as &$r) $r = str_pad($r, 5, " ", STR_PAD_LEFT); $buff[] = str_pad($id, 7, " ", STR_PAD_LEFT).": [".implode(', ', $row)."]"; } return "{\r\n".implode(",\r\n", $buff)."\r\n}"; } function itemScalingRB() { $ratings = array( 12 => 1, // ITEM_MOD_DEFENSE_SKILL_RATING => CR_DEFENSE_SKILL 13 => 2, // ITEM_MOD_DODGE_RATING => CR_DODGE 14 => 3, // ITEM_MOD_PARRY_RATING => CR_PARRY 15 => 4, // ITEM_MOD_BLOCK_RATING => CR_BLOCK 16 => 5, // ITEM_MOD_HIT_MELEE_RATING => CR_HIT_MELEE 17 => 6, // ITEM_MOD_HIT_RANGED_RATING => CR_HIT_RANGED 18 => 7, // ITEM_MOD_HIT_SPELL_RATING => CR_HIT_SPELL 19 => 8, // ITEM_MOD_CRIT_MELEE_RATING => CR_CRIT_MELEE 20 => 9, // ITEM_MOD_CRIT_RANGED_RATING => CR_CRIT_RANGED 21 => 10, // ITEM_MOD_CRIT_SPELL_RATING => CR_CRIT_SPELL 22 => 11, // ITEM_MOD_HIT_TAKEN_MELEE_RATING => CR_HIT_TAKEN_MELEE 23 => 12, // ITEM_MOD_HIT_TAKEN_RANGED_RATING => CR_HIT_TAKEN_RANGED 24 => 13, // ITEM_MOD_HIT_TAKEN_SPELL_RATING => CR_HIT_TAKEN_SPELL 25 => 14, // ITEM_MOD_CRIT_TAKEN_MELEE_RATING => CR_CRIT_TAKEN_MELEE [may be forced 0] 26 => 15, // ITEM_MOD_CRIT_TAKEN_RANGED_RATING => CR_CRIT_TAKEN_RANGED [may be forced 0] 27 => 16, // ITEM_MOD_CRIT_TAKEN_SPELL_RATING => CR_CRIT_TAKEN_SPELL [may be forced 0] 28 => 17, // ITEM_MOD_HASTE_MELEE_RATING => CR_HASTE_MELEE 29 => 18, // ITEM_MOD_HASTE_RANGED_RATING => CR_HASTE_RANGED 30 => 19, // ITEM_MOD_HASTE_SPELL_RATING => CR_HASTE_SPELL 31 => 5, // ITEM_MOD_HIT_RATING => [backRef] 32 => 8, // ITEM_MOD_CRIT_RATING => [backRef] 33 => 11, // ITEM_MOD_HIT_TAKEN_RATING => [backRef] [may be forced 0] 34 => 14, // ITEM_MOD_CRIT_TAKEN_RATING => [backRef] [may be forced 0] 35 => 14, // ITEM_MOD_RESILIENCE_RATING => [backRef] 36 => 17, // ITEM_MOD_HASTE_RATING => [backRef] 37 => 23, // ITEM_MOD_EXPERTISE_RATING => CR_EXPERTISE 44 => 24 // ITEM_MOD_ARMOR_PENETRATION_RATING => CR_ARMOR_PENETRATION ); $data = $ratings; $offsets = array_map(function ($v) { // LookupEntry(cr*GT_MAX_LEVEL+level-1) return $v * 100 + 60 - 1; }, $ratings); $base = DB::Aowow()->selectCol('SELECT CAST((idx + 1 - 60) / 100 AS UNSIGNED) AS ARRAY_KEY, ratio FROM dbc_gtcombatratings WHERE idx IN (?a)', $offsets); $offsets = array_map(function ($v) { // LookupEntry((getClass()-1)*GT_MAX_RATING+cr+1) return (CLASS_WARRIOR - 1) * 32 + $v + 1; }, $ratings); $mods = DB::Aowow()->selectCol('SELECT idx - 1 AS ARRAY_KEY, ratio FROM dbc_gtoctclasscombatratingscalar WHERE idx IN (?a)', $offsets); foreach ($data as $itemMod => &$val) $val = CFG_DEBUG ? $base[$val].' / '.$mods[$val] : $base[$val] / $mods[$val]; if (!CFG_DEBUG) return Util::toJSON($data); $buff = []; foreach ($data as $k => $v) $buff[] = $k.': '.$v; return "{\r\n ".implode(",\r\n ", $buff)."\r\n}"; } function itemScalingSV() { $data = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM dbc_scalingstatvalues'); foreach ($data as &$row) { $row = array_values($row); array_splice($row, 0, 1); } return CFG_DEBUG ? debugify($data) : Util::toJSON($data); } function itemScalingSD() { $data = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM dbc_scalingstatdistribution'); foreach ($data as &$row) { $row = array_values($row); array_splice($row, 0, 1); } return CFG_DEBUG ? debugify($data) : Util::toJSON($data); } ?>