View Single Post
Old 12-13-12, 12:51 PM   #11
d07.RiV
A Defias Bandit
Join Date: Jun 2011
Posts: 3
Hi,
I'm using a workaround that is pretty crude but is accurate except for rounding issues. Its simply scaling stats proportional to spellpower on caster weapons; I wonder if the actual scales used in the game are anywhere in client data.

lua Code:
  1. local spTable = {
  2.   [458] = 4914,
  3.   [463] = 5152,
  4.   [466] = 5293,
  5.   [470] = 5496,
  6.   [471] = 5550,
  7.   [474] = 5704,
  8.   [476] = 5812,
  9.   [478] = 5920,
  10.   [480] = 6032,
  11.   [483] = 6206,
  12.   [484] = 6261,
  13.   [487] = 6441,
  14.   [489] = 6564,
  15.   [490] = 6628,
  16.   [491] = 6685,
  17.   [493] = 6812,
  18.   [494] = 6879,
  19.   [496] = 7007,
  20.   [497] = 7071,
  21.   [498] = 7140,
  22.   [500] = 7272,
  23.   [501] = 7337,
  24.   [502] = 7408,
  25.   [503] = 7478,
  26.   [504] = 7548,
  27.   [505] = 7619,
  28.   [506] = 7688,
  29.   [507] = 7761,
  30.   [508] = 7836,
  31.   [509] = 7907,
  32.   [510] = 7980,
  33.   [511] = 8054,
  34.   [512] = 8132,
  35.   [513] = 8206,
  36.   [514] = 8286,
  37.   [515] = 8364,
  38.   [516] = 8441,
  39.   [517] = 8518,
  40.   [518] = 8603,
  41.   [519] = 8680,
  42.   [520] = 8761,
  43.   [521] = 8841,
  44.   [524] = 9093,
  45.   [525] = 9179,
  46.   [528] = 9439,
  47.   [532] = 9797,
  48. }
  49. local upTable = {
  50.   [1]   =  8, -- 1/1
  51.   [373] =  4, -- 1/2
  52.   [374] =  8, -- 2/2
  53.   [375] =  4, -- 1/3
  54.   [376] =  4, -- 2/3
  55.   [377] =  4, -- 3/3
  56.   [379] =  4, -- 1/2
  57.   [380] =  4, -- 2/2
  58.   [445] =  0, -- 0/2
  59.   [446] =  4, -- 1/2
  60.   [447] =  8, -- 2/2
  61.   [451] =  0, -- 0/1
  62.   [452] =  8, -- 1/1
  63.   [453] =  0, -- 0/2
  64.   [454] =  4, -- 1/2
  65.   [455] =  8, -- 2/2
  66.   [456] =  0, -- 0/1
  67.   [457] =  8, -- 1/1
  68.   [458] =  0, -- 0/4
  69.   [459] =  4, -- 1/4
  70.   [460] =  8, -- 2/4
  71.   [461] = 12, -- 3/4
  72.   [462] = 16, -- 4/4
  73. }
  74. function GetItemStatsUp(link, table)
  75.   local result = GetItemStats(link, table)
  76.   if not result then
  77.     return result
  78.   end
  79.   local id = tonumber (link:match ("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:%d+:(%d+)"))
  80.   local _, _, _, iLvl = GetItemInfo(link)
  81.   iLvl = iLvl or 0
  82.   if iLvl >= 458 and upTable[id] then
  83.     local iLvl2 = iLvl + upTable[id]
  84.     if iLvl2 > iLvl and spTable[iLvl] and spTable[iLvl2] then
  85.       for k, v in pairs(result) do
  86.         if tonumber(v) then
  87.           result[k] = math.floor(tonumber(v) * spTable[iLvl2] / spTable[iLvl] + 0.5)
  88.         end
  89.       end
  90.     end
  91.   end
  92.   return result
  93. end
d07.RiV is offline   Reply With Quote