WoTExtendedStat

Adds some usable fields for MMO game World of Tanks user's page

  1. // ==UserScript==
  2. // @author Elf__X
  3. // @name WoTExtendedStat
  4. // @namespace http://forum.worldoftanks.ru/index.php?/topic/717208-
  5. // @version 0.9.15.12
  6. // @description Adds some usable fields for MMO game World of Tanks user's page
  7. // @match http://worldoftanks.ru/*/accounts/*
  8. // @match http://worldoftanks.eu/*/accounts/*
  9. // @match http://worldoftanks.com/*/accounts/*
  10. // @match http://worldoftanks.asia/*/accounts/*
  11. // @match http://worldoftanks.kr/*/accounts/*
  12. // @include http://worldoftanks.ru/*/accounts/*
  13. // @include http://worldoftanks.eu/*/accounts/*
  14. // @include http://worldoftanks.com/*/accounts/*
  15. // @include http://worldoftanks.asia/*/accounts/*
  16. // @include http://worldoftanks.kr/*/accounts/*
  17. // @require http://code.jquery.com/jquery-1.11.1.min.js
  18. // @connect wnefficiency.net
  19. // @connect armor.kiev.ua
  20. // @connect noobmeter.com
  21. // @connect wot-noobs.ru
  22. // @connect bitbucket.org
  23. // @connect worldoftanks.ru
  24. // @connect worldoftanks.eu
  25. // @connect worldoftanks.com
  26. // @connect worldoftanks.asia
  27. // @connect worldoftanks.kr
  28. // @grant GM_xmlhttpRequest
  29. // ==/UserScript==
  30.  
  31. //try {
  32. if (typeof String.prototype.endsWith !== 'function') {
  33. String.prototype.endsWith = function (suffix) {
  34. return this.indexOf(suffix, this.length - suffix.length) !== -1;
  35. };
  36. }
  37.  
  38. if (typeof String.prototype.startsWith != 'function') {
  39. String.prototype.startsWith = function (str) {
  40. return this.indexOf(str) == 0;
  41. };
  42. }
  43.  
  44. if (typeof String.prototype.capitalize != 'function') {
  45. String.prototype.capitalize = function () {
  46. return this.charAt(0).toUpperCase() + this.slice(1);
  47. }
  48. }
  49. //Общие переменные
  50. var wesGeneral,
  51. wesAccount,
  52. wesSettings,
  53. wesApiKey,
  54. wesScriptVersion = '0.9.15.12',
  55. stTypeKeys = ['clan', 'company', 'stronghold_skirmish', 'stronghold_defense', 'team'],
  56. stStatKeys = ['battles', 'wins', 'damage_dealt', 'spotted', 'frags', 'capture_points', 'dropped_capture_points'];
  57.  
  58. //Локализация
  59. String.toLocaleString({
  60. 'en': {
  61. 'confirmDelete': 'Are you sure you want to delete the saved statistics of this player?',
  62. 'scriptVersion': " <a href='http://forum.worldoftanks.ru/index.php?/topic/717208-' " +
  63. "target='_blank'>Script</a> version " + wesScriptVersion,
  64. 'scriptName': 'WOT extended statistic script',
  65. 'localStorageIsFull': 'The localStorage is crowded. Deleting the saved data of one of the players, ' +
  66. 'or reduce the amount saved in the settings.',
  67. 'settings': 'Script settings',
  68. 'settingsText': 'Extended statistic script settings',
  69. 'error': 'Error',
  70. 'errorText': 'An error has occurred',
  71. 'save': 'Save',
  72. 'general': 'General',
  73. 'blocks': 'Blocks',
  74. 'players': 'Players',
  75. 'lsSize': 'In localStorage occupied',
  76. 'saveCount': 'Save count',
  77. 'graphs': 'Graphs',
  78. 'date': 'Date',
  79. 'battles': 'Battles',
  80. 'dntshow': "Don't show",
  81. 'player': "Player",
  82. 'me': "Me",
  83. 'saveStat': "Save statistic",
  84. 'delStat': "Delete statistic",
  85. 'lastBattle': "Last Battle:",
  86. 'lastUpdate': "Last Update:",
  87. 'maxDamage': 'Max. damage',
  88. 'maxFrags': 'Max. frags',
  89. 'maxXp': 'Max. Xp',
  90. 'treesCut': 'Trees Cut',
  91. 'wins': "Wins",
  92. 'saved': "Saved",
  93. 'showBlock': 'Show block',
  94. 'hideBlock': 'Hide block',
  95. 'deleteBlock': 'Delete block',
  96. 'blockEfRat': 'Eff. ratings',
  97. 'blockNewBat': 'New battles',
  98. 'blockCompStat': 'Compare stats',
  99. 'blockClan': 'Clans history',
  100. 'blockPers': 'Personal',
  101. 'blockSpeed': 'Speedometers',
  102. 'blockAchiev': 'Achievements',
  103. 'blockCommon': 'Common',
  104. 'blockDiagr': 'Diargams',
  105. 'blockRat': 'Ratings',
  106. 'blockVeh': 'Vehicles',
  107. 'blockHall': 'Hall of fame',
  108. 'efficiency': 'Efficiency',
  109. 'rEffXvm': 'Eff. rating xwm',
  110. 'rWn6Xvm': 'WN6 Rating xwm',
  111. 'rWn8Xvm': 'WN8 Rating xwm',
  112. 'rNagXvm': 'PR rating xvm',
  113. 'rNoobrating': 'Wot-noobs rating',
  114. 'rBattles': 'Battles',
  115. 'rExp': 'Exp. per battle',
  116. 'rDamage': 'Damage per battle',
  117. 'rFrag': 'Frags per battle',
  118. 'rSpot': 'Spotted per battle',
  119. 'rDeff': 'Deffs per battle',
  120. 'rCap': 'Caps per battle',
  121. 'rEff': 'Eff. rating',
  122. 'rWn6': 'WN6 Rating',
  123. 'rWn8': 'WN8 Rating',
  124. 'rNag': 'PR rating',
  125. 'rArmor': 'Eff. rating of BS',
  126. 'rKwg': 'Personal rating',
  127. 'rBatteDay': 'Battles per day',
  128. 'rMedLvl': 'Average level of tanks',
  129. 'rWin': 'Win %',
  130. 'rLoose': 'Defeat %',
  131. 'rSurv': 'Survived %',
  132. 'rHit': 'Hit ratio',
  133. 'globalMap': 'Clan battles',
  134. 'rota': 'Company battles',
  135. 'rGWin': 'Win',
  136. 'sWaitText': 'Please wait.',
  137. 'about': 'About',
  138. 'nWin': 'Win',
  139. 'new': 'New',
  140. 'hsaved': 'Saved',
  141. 'current': 'Current',
  142. 'historic': 'Historical battles',
  143. 'other': 'Other',
  144. 'graph': 'Graphs',
  145. 'rating': 'Ratings',
  146. 'statFrom': 'Statistic from',
  147. 'language': 'Language',
  148. 'donate': 'Please, give some money to support the author',
  149. 'noNewBattles': 'No new battles',
  150. 'medals': 'Medals'
  151. },
  152. 'ru': {
  153. 'confirmDelete': 'Вы действительно хотите удалить сохраненную статистику данного игрока?',
  154. 'scriptVersion': "Версия <a href='http://forum.worldoftanks.ru/index.php?/topic/717208-' " +
  155. "target='_blank'>скрипта </a> " + wesScriptVersion,
  156. 'scriptName': 'Скрипт расширенной статистики WOT',
  157. 'localStorageIsFull': 'Локальное хранилище переполнено. Пожалуйста, удалите сохраненные данные одного ' +
  158. 'из игроков, или уменьшите количество сохранений в настройках.',
  159. 'settings': 'Настройки скрипта',
  160. 'settingsText': 'Настройки скрипта расширенной статистики',
  161. 'error': 'Ошибка',
  162. 'errorText': 'Произошла ошибка:',
  163. 'save': 'Сохранить',
  164. 'general': 'Общие',
  165. 'blocks': 'Блоки',
  166. 'players': 'Игроки',
  167. 'lsSize': 'В локальном хранилище занято',
  168. 'saveCount': 'Количество сохранений',
  169. 'graphs': 'Графики',
  170. 'date': 'Дата',
  171. 'battles': 'Бои',
  172. 'dntshow': 'Не отображать',
  173. 'player': "Игрок",
  174. 'me': "Я",
  175. 'saveStat': "Сохранить статистику",
  176. 'delStat': "Удалить статистику",
  177. 'lastBattle': "Был в бою:",
  178. 'lastUpdate': "Обновлено:",
  179. 'maxDamage': 'Макс. урон',
  180. 'maxFrags': 'Макс. фрагов',
  181. 'maxXp': 'Макс. опыт',
  182. 'treesCut': 'Повалено деревьев',
  183. 'wins': "Победы",
  184. 'saved': "Сохранено",
  185. 'showBlock': 'Показать блок',
  186. 'hideBlock': 'Скрыть блок',
  187. 'deleteBlock': 'Удалить блок',
  188. 'blockEfRat': 'Рейтинги эффективности',
  189. 'blockNewBat': 'Новые бои',
  190. 'blockCompStat': 'Сравнение статистики',
  191. 'blockClan': 'История кланов',
  192. 'blockPers': 'Личные данные',
  193. 'blockSpeed': 'Спидометры',
  194. 'blockAchiev': 'Достижения',
  195. 'blockCommon': 'Общее',
  196. 'blockDiagr': 'Диаграммы',
  197. 'blockRat': 'Рейтинги',
  198. 'blockVeh': 'Техника',
  199. 'blockHall': 'Аллея славы',
  200. 'efficiency': 'Эффективность',
  201. 'rEffXvm': 'Эффективность xvm',
  202. 'rWn6Xvm': 'WN6 Рейтинг xvm',
  203. 'rWn8Xvm': 'WN8 Рейтинг xwm',
  204. 'rNagXvm': 'Рейтинг нагиба xvm',
  205. 'rNoobrating': 'Нубо-Рейтинг',
  206. 'rBattles': 'Боев',
  207. 'rExp': 'Опыт за бой',
  208. 'rDamage': 'Повреждений за бой',
  209. 'rFrag': 'Фрагов за бой',
  210. 'rSpot': 'Обнаружено за бой',
  211. 'rDeff': 'Очков защиты за бой',
  212. 'rCap': 'Очков захвата за бой',
  213. 'rEff': 'Эффективность',
  214. 'rWn6': 'WN6 Рейтинг',
  215. 'rWn8': 'WN8 Рейтинг',
  216. 'rNag': 'Рейтинг нагиба',
  217. 'rArmor': 'Эффективность БС',
  218. 'rKwg': 'Личный рейтинг',
  219. 'rBatteDay': 'Боев в день',
  220. 'rMedLvl': 'Средний уровень танков',
  221. 'rWin': '% побед',
  222. 'rLoose': '% поражений',
  223. 'rSurv': '% выживания',
  224. 'rHit': '% попадания',
  225. 'globalMap': 'Глобальная карта',
  226. 'rota': 'Ротные бои',
  227. 'rGWin': 'Побед',
  228. 'sWaitText': 'Пожалуйста подождите.',
  229. 'about': 'О скрипте',
  230. 'nWin': 'Побед',
  231. 'new': 'Новые',
  232. 'hsaved': 'Сохр. данные',
  233. 'current': 'Тек. данные',
  234. 'historic': 'Исторические бои',
  235. 'other': 'Прочее',
  236. 'graph': 'Графики',
  237. 'rating': 'Рейтинги',
  238. 'statFrom': 'Статистика с',
  239. 'language': 'Язык',
  240. 'donate': 'Поддержать автора скрипта',
  241. 'noNewBattles': 'Нет новых боев',
  242. 'medals': 'Медали'
  243. }
  244. });
  245. String.defaultLocale = 'en';
  246. var _ = function (str) {
  247. return str.toLocaleString();
  248. };
  249. //Тут общие методы и функции которые нужны на нескольких страницах сайта
  250. wesGeneral = {
  251. apiKey: {
  252. 'ru': '895d3dafdd87af03e1e515befcd83882',
  253. 'en': 'd0a293dc77667c9328783d489c8cef73',
  254. 'com': '16924c431c705523aae25b6f638c54dd',
  255. '': ''
  256. },
  257. defaultSettings: {
  258. locale: window.location.host.endsWith(".ru") ? 'ru' : 'en',
  259. version: 0,
  260. blocks: {
  261. 'efRat': 0,
  262. 'newBat': 0,
  263. 'compStat': 0,
  264. 'compStat1': 0,
  265. 'pers': 0,
  266. 'speed': 0,
  267. 'hall': 0,
  268. 'achiev': 0,
  269. 'common': 0,
  270. 'diagr': 0,
  271. 'rat': 0,
  272. 'veh': 0
  273. },
  274. myID: 0,
  275. graphs: 1,
  276. scount: 7,
  277. ncount: 2, // Кол-во символов для округления
  278. players: {}
  279. },
  280. styles: {
  281. 'default': '\
  282. .wes-progressbar {background-color: black; border-radius: 4px; padding: 2px;}\
  283. .wes-progressbar > div {width: 0%; height: 4px; border-radius: 2px;}\
  284. .wes-settings {display: none; z-index: 1005; width: 800px; height: 500px; max-height: 100%; margin: auto;\
  285. overflow: auto; position: fixed; top: 50px; left: 0; bottom: 0; right: 0; }\
  286. .wes-error {display: none; z-index: 1005; width: 500px; height: 500px; max-height: 100%; margin: auto;\
  287. overflow: auto; position: fixed; top: 50px; left: 0; bottom: 0; right: 0;}\
  288. .wes-wait {display: none; background: rgb(31, 31, 31); z-index: 1006; width: 500px; height: 300px; margin: auto;\
  289. overflow: auto; position: fixed; top: 50px; left: 0; bottom: 0; right: 0; text-align: center;}\
  290. .wes-title {color: #ffffff; border-radius: 2px 2px 0 0; font-family: "WarHeliosCondCBold",arial,sans-serif;\
  291. background: url("/static/3.20.0.2/portal/js/plugins/jquery-ui/css/images/bg-popup-title.jpg") no-repeat scroll 50% 0 #313134;\
  292. font-size: 21px; height: 49px;}\
  293. .wes-title-span {display: inline-block; padding: 12px 38px 0 19px;}\
  294. .wes-overlay {display: none; position: fixed; top: 0; left: 0; height: 100%; width: 100%; z-index: 1004;\
  295. background-color: rgba(0,0,0,0.5);}\
  296. .wes-close-titlebar {right: 8px; position: absolute; top: 50%; width: 33px; margin: -242px 0 0 0;\
  297. height: 32px;}\
  298. .wes-close-titlebar > span {background: url(/static/3.20.0.2/common/img/btn-popup-close.png) 0 0 no-repeat !important;\
  299. width: 33px !important; height: 33px !important; display: block; text-indent: -99999px; overflow: hidden;\
  300. background-repeat: no-repeat;}\
  301. .wes-error-text {background: rgb(31, 31, 31); height: 450px; margin-top: 15px;}\
  302. .wes-error-icon {display: block; width: 450px !important; height: 43px !important; text-indent: 42px;\
  303. background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAWgSURBVFiFrZdLiGRXGcd/331U1a1Hv2p6uoZ+6PRkxEeiSQghTnAhtgSF6Co4WlkZXIhkk42CBnQnuHLjRlEClooPGBGUgewUJApxYJoZodsZOulM9XR3dXdVz626t+6953NRt7qru6sfM5MDH/f1nfP/ne+c851zRVV52FITyQDTQAVoAatV1eZDNwTIWQBqIi6wIHAVeFltu5QtFoNsoWDiMJTQ9zNJEIgF/zLwa+BaVfX+hwJQE3lF4KelSqVwfn6+ODY3Z2VHRqDbxXS7iG0j2SzGGFqrq2yurLQ37txRjaKfK/yoqrrzSAA1kUsWXCtOTX10/oUXil6pRLy+TtxooO12Wlt6V1XEdbEnJnDKZbRQ4N6NG8Hq4mKkxrxeVX3roQBqIp8XkWuXr1wpnJuft8O7d4k3NpC+oMi+eL/021FF8nmyFy8SWxY3r1/3u63WLxTeqKqaUwFqIl+0MplrTy4s5L1cjuDWLTAGRHoAwyAGxFGl36ZbqeDMzfHft9/2m/X6X76h+vXDANYh8Y+JyJ+eWljI54whuHkTkmRI3OTE536konqd8PZtPrGwUPDGx1+uiXzvWICaiC3wt8svvljIuS7h8vJwsdNgDhXTbBIuLfGpl14qOJ73Zk3ks0MBgG+OTU+fL8/OWsGtW/tvT1umadhPKsnmJmxucvn55z0LfnYEoCaSF5EfX3zuuWK4vNwb89NED4sPQOgQqO7KCmMzM5KfmHiiJvLVAwDAKxOzs27GcYgbjaNCx4mf9O7wszFEKyt85Omnixa8eQDAglcnZ2dL0dra8eIDs3toBPbcjofo3r9P6cIFsO2naiITAFZNJGNEPjcyM0O8uXliIwoYVTT1OWKpz4H7weckQX2fsQsXIuBL/QjMZDwvsgDT7R5b2QyAHfE5DHQMBEDUajFSLheATwI4wHQml0tMEPScRJC00qeXlnjcsvjssySt1j54EODk81jwRD8C01nPs5J2e4/WDI73Y5bDkYiDANfzAOb6AO2429XDoTplIZ4dIG2zP3ewLEwUAbShNwQfdDsdsO29IdAeOu9eurSX6WQw452U/QbmyeB175vjED54gMLdPYAwDN3E94maTcRxENsG296/tyxUdR/ilOE5Ip4uV9NuI80mHd83Cv8DcKqqa78R8f2tLc9EEWZnyPnBsnoHD9ftQbnuvvUhB1dIf1dMEkwQoEFA0ulAHOPOzLDz3ntt4J/9CAD8sbW19a3R0VE78f2jAMagxkBv7E7u/QnfJJcjBkLfF+DvkGZChdr21lZbRkdRyzq6xs9gJrWTfNypKZrr67HAn6uqyR5AVfUfcRgutppN45TLjyR+mg/ZLFIqsVGvdxV+0I/K3nas8J2N9fUOIyOQy31ovVZARchMT7NZr4eaJG9VVe8eAaiq/sfE8e/W6vUHztQUOM5j93ov9JUKfhjqdqPR0oGd8ABAGoVvt9vt243t7dCZmgLXffRepz13zp8ncl3W7t3rrMNXqqqNQc0DAK+CU4PXtlqttfs7O4E9OYl43iP1GsfBrVToiOjq++8H76p+/w2oi0hhUPPAqVh6e/TEDMx8F35yLpN5cnJ0NOcYQ9xqoWdYhlgWTqmEVSyyvbubbLdanT/AD/8K7wANYFNVN44DGAUmgLIF5dfha8/A1YLnOWP5vOuIYMIQjaJeXkiP61gW4jjYuRzquvidjm7t7kYfGLP4S/jVci/tNoAtYFVV20MBUogR4BwwDoxPQuU1uPpx+IJt21Y+k3GyjmPZloWVpmijSpwk7Ha73SSK7A3VO7+H374Dt4EdYDsFuDcoPhQghbCAElAGRoGSBcUvw2eegSvjMOdBOQulGMIObO/CxhLcuA7/XuuJ+fT+nDeAhqoOSbFn+DlNYTKAB+RSy6bm0pubERAOWBvoqOqpk+b/JDuHWUtrBlIAAAAASUVORK5CYII=") 0 0 no-repeat !important;\
  304. overflow: hidden; margin-left: 30px;}\
  305. #wes-error-text {height: 350px; overflow: auto; padding-left: 25px; width: 90%;}\
  306. .wes-colored-button {background-position: 0 0; display: inline-block; height: 30px; margin-right: 35px;\
  307. background: url(/static/3.20.0.2/common/css/scss/form_elements/buttons/img/btn-bg.png) 0 -60px no-repeat;}\
  308. .wes-button-right {background-position: 100% 0; \
  309. background: url(/static/3.20.0.2/common/css/scss/form_elements/buttons/img/btn-bg.png) no-repeat 100% -60px;}\
  310. .wes-button-right input {background: none; border: medium none; color: #fff; cursor: pointer; float: left;\
  311. font: bold 13px Arial,"Helvetica CY",Helvetica,sans-serif; height: 31px; padding: 0 22px 1px; \
  312. text-align: center;}\
  313. .wes-tabs {padding-left: 10px; padding-top: 7px; width: 775px;} \
  314. .wes-tabs span { padding: 5px; border: 1px solid #aaa; line-height: 28px; cursor: pointer; \
  315. position: relative; bottom: 1px; z-index: 1007; background: rgb(31, 31, 31);}\
  316. .wes-tab-content {display: block; border: 1px solid #aaa; height: 370px; z-index: 1006; \
  317. margin: 3px 10px 7px 10px; overflow: auto; background: rgb(31, 31, 31);}\
  318. .wes-tab-content > div {margin: 10px; height: 90%; text-align: center; font-size: 12pt;}\
  319. .wes-active-tab {border-bottom: 1px solid rgb(31, 31, 31) !important;}\
  320. .wes-setting-half {width: 33%; text-align: center; float:left; padding-top: 20px;}\
  321. .wes-s-expander {clear: both; text-align: right;margin-bottom: 15px;}\
  322. .wes-s-expander a.b-vertical-arrow__open {margin-bottom: 0;}\
  323. .wes-s-expander.wes-s-expander__extra {margin-top: 20px;}\
  324. .wes-h-header {display: inline-block; width: 33%; text-align: right;}\
  325. .wes-h-header:first-child {width: 66%; text-align: left;}\
  326. .t-profile th.wes-r-header {cursor: pointer;cursor: hand;}\
  327. .t-profile th.wes-r-header__active {background-color: rgba(0, 0, 0, 0.5);color: #fefefe;text-shadow: 0 0 13px rgba(255, 255, 255, 0.13);}\
  328. .wes-sb-new {position: relative;}\
  329. .pluso-box {z-index: 2000 !important;}\
  330. span.wes-s-newcounter {vertical-align: super; font-size: 0.8em;}\
  331. .us-ratings {width: 109%; text-align: center;}\
  332. .us-ratings td {border: 1px solid #212123; padding: 3px 5px;}\
  333. .us-ratings-head {background-color: rgba(0, 0, 0, 0.5);}'
  334. },
  335. defaultValues: {
  336. 'wn8': '{"1":{"dmg":511.21,"def":1.06,"frag":1.04,"spot":1.46,"wRate":55.71},"17":{"dmg":544.32,"def":0.96,"frag":1.12,"spot":1.33,"wRate":55.45},"33":{"dmg":600.51,"def":1.17,"frag":1.26,"spot":1.59,"wRate":55.62},"49":{"dmg":1059.93,"def":0.89,"frag":0.87,"spot":1.69,"wRate":51.18},"81":{"dmg":232.98,"def":1.16,"frag":1.83,"spot":0.91,"wRate":58.3},"113":{"dmg":204.01,"def":0.97,"frag":1.55,"spot":0.81,"wRate":59.05},"257":{"dmg":577.37,"def":1.16,"frag":1.12,"spot":0.58,"wRate":54.46},"273":{"dmg":914.41,"def":1.17,"frag":1.03,"spot":0.08,"wRate":52.18},"289":{"dmg":249.1,"def":1.26,"frag":1.03,"spot":2.34,"wRate":56.56},"305":{"dmg":626.29,"def":0.63,"frag":0.57,"spot":2.29,"wRate":50.2},"321":{"dmg":285.38,"def":1.47,"frag":1.2,"spot":0.8,"wRate":57.96},"337":{"dmg":257.67,"def":1.17,"frag":1.5,"spot":0.92,"wRate":57.43},"353":{"dmg":231.07,"def":1.35,"frag":1.39,"spot":1.18,"wRate":57.43},"369":{"dmg":242.99,"def":1.56,"frag":1.32,"spot":1.43,"wRate":58.5},"513":{"dmg":1065.87,"def":0.78,"frag":1,"spot":1.05,"wRate":53.68},"529":{"dmg":1092.65,"def":0.98,"frag":0.96,"spot":1,"wRate":53.06},"545":{"dmg":196.48,"def":1.12,"frag":1.53,"spot":1.86,"wRate":57.13},"561":{"dmg":1056.54,"def":0.91,"frag":0.88,"spot":1.7,"wRate":50.94},"577":{"dmg":197.72,"def":1.49,"frag":1.45,"spot":1.15,"wRate":56.83},"593":{"dmg":251.27,"def":1.48,"frag":1.41,"spot":2.12,"wRate":58.86},"609":{"dmg":198.09,"def":1.57,"frag":1.58,"spot":1.08,"wRate":57.36},"625":{"dmg":313.45,"def":1.5,"frag":1.08,"spot":1.15,"wRate":58.63},"769":{"dmg":208.34,"def":0.98,"frag":0.81,"spot":2,"wRate":54.05},"785":{"dmg":261.29,"def":1.69,"frag":1.52,"spot":1.65,"wRate":58.69},"801":{"dmg":824.92,"def":0.85,"frag":1,"spot":1.07,"wRate":53.75},"817":{"dmg":1318.19,"def":0.76,"frag":0.99,"spot":1.33,"wRate":52.38},"833":{"dmg":244.88,"def":1.53,"frag":1.54,"spot":0.13,"wRate":57.79},"849":{"dmg":494.79,"def":1.64,"frag":1.27,"spot":0.86,"wRate":57.68},"865":{"dmg":257.68,"def":1.4,"frag":1.5,"spot":1.53,"wRate":58.56},"881":{"dmg":397.16,"def":1.31,"frag":1.05,"spot":1.19,"wRate":56.9},"1025":{"dmg":251.4,"def":1.29,"frag":1.43,"spot":1.93,"wRate":58.11},"1041":{"dmg":587.5,"def":1.26,"frag":1.13,"spot":0.76,"wRate":53.93},"1057":{"dmg":595.6,"def":1.05,"frag":1.24,"spot":1.51,"wRate":56.91},"1073":{"dmg":946.6,"def":0.94,"frag":0.94,"spot":1.51,"wRate":53.98},"1089":{"dmg":326.95,"def":1.27,"frag":0.99,"spot":1.03,"wRate":54.04},"1105":{"dmg":732.15,"def":0.95,"frag":1.05,"spot":2,"wRate":54.69},"1121":{"dmg":914.22,"def":1,"frag":0.89,"spot":1.04,"wRate":50.9},"1137":{"dmg":513.5,"def":1.03,"frag":0.91,"spot":1.51,"wRate":53.88},"1297":{"dmg":900.4,"def":1.13,"frag":0.87,"spot":1.25,"wRate":53.22},"1313":{"dmg":698.18,"def":1.02,"frag":0.99,"spot":1.49,"wRate":55.22},"1329":{"dmg":244.08,"def":1.56,"frag":1.85,"spot":1.26,"wRate":57.64},"1345":{"dmg":235.06,"def":1.98,"frag":1.39,"spot":1.21,"wRate":58.59},"1361":{"dmg":289.16,"def":1.35,"frag":1.14,"spot":1.79,"wRate":57.27},"1377":{"dmg":484.73,"def":0.99,"frag":0.92,"spot":1.21,"wRate":53.75},"1393":{"dmg":769.67,"def":1.03,"frag":0.99,"spot":1.51,"wRate":53.07},"1537":{"dmg":418.75,"def":0.97,"frag":1.09,"spot":1.29,"wRate":56.75},"1553":{"dmg":729.44,"def":1.11,"frag":1.02,"spot":0.77,"wRate":52.51},"1569":{"dmg":971.2,"def":1.01,"frag":0.95,"spot":1.65,"wRate":54.57},"1585":{"dmg":1011.45,"def":0.84,"frag":0.8,"spot":1.57,"wRate":50.34},"1601":{"dmg":226.85,"def":2.02,"frag":1.34,"spot":0.97,"wRate":57.26},"1617":{"dmg":358.25,"def":0.92,"frag":0.96,"spot":0.9,"wRate":53.53},"1633":{"dmg":367.67,"def":1.04,"frag":0.99,"spot":1.24,"wRate":55.59},"1649":{"dmg":1007.57,"def":0.94,"frag":0.97,"spot":1.28,"wRate":53.17},"1793":{"dmg":1197.46,"def":0.78,"frag":0.93,"spot":0.05,"wRate":52.01},"1809":{"dmg":444.65,"def":1.12,"frag":1.38,"spot":0.62,"wRate":56.09},"1825":{"dmg":251.59,"def":1.45,"frag":1.47,"spot":2.41,"wRate":59.08},"1841":{"dmg":1421.28,"def":0.69,"frag":0.88,"spot":1.43,"wRate":50.32},"1889":{"dmg":735.95,"def":1.04,"frag":0.96,"spot":1.09,"wRate":51.83},"1905":{"dmg":1114.15,"def":0.85,"frag":0.82,"spot":1.1,"wRate":50.72},"2049":{"dmg":299.25,"def":0.94,"frag":0.82,"spot":2.17,"wRate":55.96},"2065":{"dmg":249.58,"def":1.55,"frag":1.46,"spot":1.81,"wRate":58.25},"2081":{"dmg":252.88,"def":1.78,"frag":1.47,"spot":0.32,"wRate":57.01},"2097":{"dmg":1603.37,"def":0.63,"frag":0.89,"spot":1.26,"wRate":51.37},"2113":{"dmg":717.22,"def":1.6,"frag":1.4,"spot":0.12,"wRate":55.96},"2129":{"dmg":436.2,"def":1.03,"frag":0.91,"spot":1.72,"wRate":54.54},"2145":{"dmg":347.64,"def":1.32,"frag":1.39,"spot":1.21,"wRate":58.63},"2161":{"dmg":1804.9,"def":0.86,"frag":1.14,"spot":1.17,"wRate":52.66},"2305":{"dmg":1020.49,"def":0.78,"frag":1.02,"spot":0.53,"wRate":52.7},"2321":{"dmg":762.91,"def":1.02,"frag":1.01,"spot":1.15,"wRate":53.91},"2353":{"dmg":265.96,"def":1.4,"frag":1.57,"spot":1.35,"wRate":59.26},"2369":{"dmg":434.32,"def":1.64,"frag":1.73,"spot":1.23,"wRate":58.97},"2385":{"dmg":287.3,"def":1.15,"frag":1.13,"spot":0.95,"wRate":56.63},"2401":{"dmg":306.28,"def":1.36,"frag":1.25,"spot":1.65,"wRate":57.97},"2417":{"dmg":2119.58,"def":0.85,"frag":1.23,"spot":1.38,"wRate":50.39},"2561":{"dmg":734.12,"def":0.93,"frag":0.98,"spot":1.41,"wRate":54.8},"2577":{"dmg":645.63,"def":1.04,"frag":1.02,"spot":1.2,"wRate":53.75},"2593":{"dmg":1741.94,"def":0.62,"frag":0.98,"spot":0.72,"wRate":50.74},"2625":{"dmg":787.38,"def":0.79,"frag":0.9,"spot":0.92,"wRate":52.19},"2657":{"dmg":1151.44,"def":0.98,"frag":0.85,"spot":1.24,"wRate":51.05},"2817":{"dmg":855.53,"def":0.74,"frag":1.09,"spot":1.11,"wRate":54.17},"2833":{"dmg":372.32,"def":1.44,"frag":1.2,"spot":0.17,"wRate":56.55},"2849":{"dmg":1280.24,"def":0.69,"frag":0.82,"spot":0.83,"wRate":50.95},"2865":{"dmg":1273.22,"def":0.78,"frag":0.89,"spot":1.13,"wRate":52.26},"2881":{"dmg":225.92,"def":0.96,"frag":0.66,"spot":0.75,"wRate":52.79},"2897":{"dmg":611.27,"def":1.24,"frag":1.1,"spot":0.87,"wRate":54.76},"2913":{"dmg":416.67,"def":1.25,"frag":1.15,"spot":1.74,"wRate":57.48},"3073":{"dmg":253.74,"def":1.02,"frag":1.02,"spot":1.32,"wRate":55.64},"3089":{"dmg":252,"def":1.5,"frag":1.86,"spot":1.96,"wRate":59.11},"3105":{"dmg":327.52,"def":0.84,"frag":0.93,"spot":0.84,"wRate":54.22},"3121":{"dmg":329,"def":1.01,"frag":0.88,"spot":2.22,"wRate":54.97},"3137":{"dmg":1375.67,"def":0.93,"frag":1.07,"spot":0.96,"wRate":51.14},"3153":{"dmg":983.52,"def":1.11,"frag":0.89,"spot":0.85,"wRate":53.92},"3169":{"dmg":225.13,"def":1.4,"frag":1.27,"spot":1.23,"wRate":56.79},"3329":{"dmg":241.91,"def":1.51,"frag":1.85,"spot":1.28,"wRate":58.96},"3345":{"dmg":350.18,"def":1.41,"frag":1.45,"spot":1.42,"wRate":59.28},"3361":{"dmg":623.57,"def":1.13,"frag":1.16,"spot":1.15,"wRate":55.26},"3377":{"dmg":688.39,"def":0.62,"frag":0.6,"spot":2.25,"wRate":50.9},"3393":{"dmg":418.61,"def":1.48,"frag":1.26,"spot":0.16,"wRate":58.16},"3409":{"dmg":234.83,"def":1.31,"frag":0.91,"spot":0.14,"wRate":53.87},"3425":{"dmg":1557.06,"def":0.8,"frag":0.93,"spot":1.17,"wRate":50.36},"3585":{"dmg":852.84,"def":1.04,"frag":1.17,"spot":0.79,"wRate":54.65},"3601":{"dmg":326.16,"def":1.62,"frag":1.96,"spot":1.01,"wRate":59.88},"3617":{"dmg":463.35,"def":1.53,"frag":1.11,"spot":0.16,"wRate":55.35},"3633":{"dmg":1113.73,"def":0.8,"frag":1.03,"spot":1.11,"wRate":53.78},"3649":{"dmg":1869.91,"def":0.86,"frag":1.16,"spot":1.79,"wRate":48.73},"3665":{"dmg":806.94,"def":1.08,"frag":1.03,"spot":1.07,"wRate":53.13},"3681":{"dmg":1898.81,"def":0.81,"frag":1.03,"spot":1.39,"wRate":49.05},"3841":{"dmg":233.52,"def":1.32,"frag":1.44,"spot":0.11,"wRate":56.78},"3857":{"dmg":1068.76,"def":0.97,"frag":1.01,"spot":0.73,"wRate":52.61},"3873":{"dmg":1210.85,"def":0.97,"frag":1.06,"spot":1.11,"wRate":54.76},"3889":{"dmg":786.26,"def":0.58,"frag":0.58,"spot":2.38,"wRate":49.97},"3905":{"dmg":1610.8,"def":0.78,"frag":0.98,"spot":0.88,"wRate":49.66},"3921":{"dmg":1184.95,"def":0.89,"frag":0.78,"spot":1.08,"wRate":51.53},"3937":{"dmg":1864.25,"def":0.48,"frag":0.9,"spot":0.83,"wRate":50.42},"4097":{"dmg":1346.67,"def":0.66,"frag":0.92,"spot":0.03,"wRate":51.69},"4113":{"dmg":860.38,"def":0.97,"frag":0.92,"spot":1.54,"wRate":52.19},"4129":{"dmg":798.29,"def":1.35,"frag":1.07,"spot":0.09,"wRate":53.44},"4145":{"dmg":1762.87,"def":0.66,"frag":0.93,"spot":1.33,"wRate":48.14},"4161":{"dmg":597.94,"def":1.89,"frag":1.1,"spot":0.1,"wRate":52.9},"4193":{"dmg":1535.07,"def":0.54,"frag":0.85,"spot":0.64,"wRate":52.46},"4353":{"dmg":1011.77,"def":0.81,"frag":0.81,"spot":1.55,"wRate":52.6},"4369":{"dmg":328.24,"def":0.94,"frag":0.96,"spot":1.89,"wRate":56.07},"4385":{"dmg":1270.33,"def":0.88,"frag":0.89,"spot":1.19,"wRate":52.6},"4401":{"dmg":352.17,"def":1.41,"frag":1.42,"spot":1.27,"wRate":59.21},"4417":{"dmg":487.15,"def":0.89,"frag":1,"spot":1.23,"wRate":53.5},"4433":{"dmg":1604.13,"def":0.69,"frag":0.87,"spot":1.02,"wRate":50.86},"4449":{"dmg":378.51,"def":1.07,"frag":1.06,"spot":0.73,"wRate":53.91},"4609":{"dmg":269.68,"def":1.63,"frag":1.57,"spot":1.19,"wRate":59.05},"4625":{"dmg":432.25,"def":1.62,"frag":1.05,"spot":0.15,"wRate":55.13},"4641":{"dmg":384.14,"def":1.44,"frag":0.97,"spot":0.12,"wRate":53.8},"4657":{"dmg":494.15,"def":1.08,"frag":1.03,"spot":1.45,"wRate":53.77},"4673":{"dmg":961.32,"def":1.42,"frag":1.09,"spot":0.09,"wRate":53.15},"4689":{"dmg":740.41,"def":1.07,"frag":0.94,"spot":0.74,"wRate":53.03},"4705":{"dmg":345.7,"def":0.89,"frag":1.17,"spot":0.84,"wRate":56.3},"4865":{"dmg":619.79,"def":1.53,"frag":1.22,"spot":0.1,"wRate":55.75},"4881":{"dmg":271.37,"def":1.03,"frag":1.14,"spot":1.73,"wRate":57.43},"4897":{"dmg":302.61,"def":1.11,"frag":1.34,"spot":1.46,"wRate":57.22},"4913":{"dmg":433.93,"def":0.57,"frag":0.59,"spot":2.39,"wRate":51.55},"4929":{"dmg":840.62,"def":0.59,"frag":0.7,"spot":2.22,"wRate":50.73},"4945":{"dmg":325.57,"def":1.2,"frag":0.83,"spot":0.8,"wRate":54.54},"4961":{"dmg":1390.21,"def":0.73,"frag":0.94,"spot":0.86,"wRate":54.53},"5121":{"dmg":291.76,"def":1.43,"frag":1.71,"spot":0.42,"wRate":58.53},"5137":{"dmg":1227.7,"def":0.83,"frag":0.84,"spot":0.96,"wRate":51.04},"5153":{"dmg":260.36,"def":0.84,"frag":0.74,"spot":2.26,"wRate":55.44},"5169":{"dmg":687.24,"def":0.96,"frag":0.95,"spot":1.53,"wRate":52.85},"5185":{"dmg":613.95,"def":0.62,"frag":0.62,"spot":1.96,"wRate":51.12},"5201":{"dmg":308.33,"def":1.53,"frag":1.76,"spot":1.41,"wRate":59.41},"5217":{"dmg":1235.09,"def":0.78,"frag":1.08,"spot":1.07,"wRate":56.45},"5377":{"dmg":1339.67,"def":0.77,"frag":0.94,"spot":1.05,"wRate":52.37},"5393":{"dmg":365.9,"def":0.62,"frag":0.58,"spot":2.34,"wRate":52.96},"5409":{"dmg":421.86,"def":0.97,"frag":0.9,"spot":2.05,"wRate":55.37},"5425":{"dmg":1771.78,"def":0.63,"frag":0.86,"spot":1.32,"wRate":48.35},"5457":{"dmg":909.31,"def":1.04,"frag":0.97,"spot":1.69,"wRate":52.99},"5473":{"dmg":961.79,"def":0.75,"frag":1.2,"spot":0.9,"wRate":55.51},"5633":{"dmg":1016.01,"def":1.25,"frag":1.1,"spot":0.08,"wRate":53.76},"5649":{"dmg":640.53,"def":1.4,"frag":1.09,"spot":0.11,"wRate":53.4},"5665":{"dmg":251.53,"def":1.38,"frag":1.42,"spot":1.59,"wRate":58.15},"5697":{"dmg":1421.89,"def":0.79,"frag":0.96,"spot":1.3,"wRate":49.46},"5713":{"dmg":1561.71,"def":0.82,"frag":0.9,"spot":1.2,"wRate":50.94},"5729":{"dmg":837.47,"def":0.93,"frag":1.51,"spot":1.28,"wRate":56.4},"5889":{"dmg":1107.99,"def":0.79,"frag":1.02,"spot":0.83,"wRate":54.38},"5905":{"dmg":368.71,"def":1.48,"frag":1.13,"spot":0.14,"wRate":54.99},"5921":{"dmg":1124.96,"def":0.98,"frag":0.85,"spot":1.48,"wRate":52.02},"5953":{"dmg":214.75,"def":1.36,"frag":0.94,"spot":0.93,"wRate":57.2},"5969":{"dmg":1114.04,"def":0.87,"frag":0.79,"spot":1.26,"wRate":52.64},"5985":{"dmg":265.52,"def":1.19,"frag":1.61,"spot":1.23,"wRate":58.13},"6145":{"dmg":1898.6,"def":0.69,"frag":0.92,"spot":1.11,"wRate":49.61},"6161":{"dmg":339.51,"def":1,"frag":0.84,"spot":2.49,"wRate":56.62},"6177":{"dmg":288.84,"def":1.48,"frag":1.91,"spot":1.16,"wRate":57.44},"6209":{"dmg":1991.45,"def":0.78,"frag":1.07,"spot":0.99,"wRate":48.08},"6225":{"dmg":1913.65,"def":0.68,"frag":0.92,"spot":1.12,"wRate":48.71},"6401":{"dmg":398.05,"def":1.56,"frag":1.58,"spot":0.87,"wRate":58},"6417":{"dmg":413.68,"def":0.87,"frag":0.84,"spot":1.53,"wRate":53},"6433":{"dmg":345.82,"def":1.21,"frag":1.44,"spot":1.15,"wRate":57.3},"6465":{"dmg":526.59,"def":0.61,"frag":0.63,"spot":1.84,"wRate":52.02},"6481":{"dmg":351.25,"def":1.05,"frag":0.98,"spot":1.79,"wRate":56.7},"6657":{"dmg":872.72,"def":0.98,"frag":0.92,"spot":1.51,"wRate":54.23},"6673":{"dmg":398.69,"def":1.39,"frag":1.4,"spot":0.94,"wRate":58.89},"6721":{"dmg":629.89,"def":0.97,"frag":1.14,"spot":0.88,"wRate":54.02},"6913":{"dmg":564.02,"def":1.42,"frag":1.49,"spot":0.96,"wRate":58.41},"6929":{"dmg":1775.7,"def":0.61,"frag":0.86,"spot":0.86,"wRate":49.65},"6945":{"dmg":604.12,"def":1.31,"frag":1.19,"spot":1,"wRate":55.61},"6977":{"dmg":993.17,"def":0.9,"frag":0.84,"spot":0.94,"wRate":51.66},"6993":{"dmg":299.39,"def":1.02,"frag":1.32,"spot":0.96,"wRate":56.45},"7169":{"dmg":1794.19,"def":0.59,"frag":0.87,"spot":1.22,"wRate":49.14},"7185":{"dmg":685.21,"def":0.84,"frag":0.9,"spot":1.24,"wRate":53.01},"7201":{"dmg":834.35,"def":1.07,"frag":1.06,"spot":0.9,"wRate":54.82},"7233":{"dmg":1132.9,"def":1.22,"frag":0.94,"spot":0.07,"wRate":51.78},"7249":{"dmg":1874.93,"def":0.72,"frag":0.96,"spot":1.36,"wRate":50.17},"7425":{"dmg":1514.89,"def":0.77,"frag":1.12,"spot":0.54,"wRate":51.46},"7441":{"dmg":1561.36,"def":0.64,"frag":0.87,"spot":0.93,"wRate":51.35},"7457":{"dmg":1412.4,"def":0.8,"frag":0.97,"spot":0.05,"wRate":52.03},"7489":{"dmg":1324.46,"def":1.04,"frag":0.93,"spot":0.06,"wRate":50.83},"7505":{"dmg":344.99,"def":1.09,"frag":1.38,"spot":1.77,"wRate":58.87},"7681":{"dmg":427.1,"def":1.81,"frag":1.33,"spot":0.15,"wRate":54.94},"7697":{"dmg":1461.46,"def":0.94,"frag":1.05,"spot":0.6,"wRate":50.96},"7713":{"dmg":567.52,"def":1.5,"frag":1.48,"spot":1.1,"wRate":58.96},"7745":{"dmg":326.57,"def":1.69,"frag":1.95,"spot":0.76,"wRate":59.96},"7761":{"dmg":296.43,"def":1.32,"frag":1.69,"spot":1.99,"wRate":60.28},"7937":{"dmg":1416.7,"def":0.78,"frag":0.92,"spot":1.64,"wRate":51.19},"7953":{"dmg":1803.93,"def":0.8,"frag":1.04,"spot":0.63,"wRate":50.47},"7969":{"dmg":1157.11,"def":0.99,"frag":0.98,"spot":0.06,"wRate":52.57},"8017":{"dmg":367.96,"def":1.59,"frag":1.58,"spot":0.77,"wRate":57.88},"8193":{"dmg":1988.33,"def":0.81,"frag":1.18,"spot":0.65,"wRate":51.96},"8209":{"dmg":276.46,"def":0.98,"frag":0.76,"spot":1.85,"wRate":54.9},"8225":{"dmg":1352.42,"def":0.92,"frag":0.97,"spot":0.49,"wRate":51.22},"8257":{"dmg":357.41,"def":1.62,"frag":1.4,"spot":0.94,"wRate":59.02},"8273":{"dmg":282.41,"def":1.42,"frag":1.69,"spot":1.14,"wRate":58.03},"8449":{"dmg":1560.03,"def":0.69,"frag":0.92,"spot":0.03,"wRate":50.31},"8465":{"dmg":1079.15,"def":0.87,"frag":0.8,"spot":1.27,"wRate":52.13},"8481":{"dmg":1702.96,"def":0.6,"frag":0.86,"spot":0.04,"wRate":49.11},"8529":{"dmg":1388.37,"def":1.17,"frag":1,"spot":0.64,"wRate":52.62},"8705":{"dmg":1792.43,"def":0.74,"frag":0.96,"spot":0.04,"wRate":49.55},"8721":{"dmg":1473.02,"def":0.61,"frag":0.86,"spot":0.04,"wRate":49.3},"8737":{"dmg":1760.06,"def":0.68,"frag":1.04,"spot":0.46,"wRate":52.2},"8785":{"dmg":549.87,"def":1.58,"frag":1.11,"spot":0.76,"wRate":56.98},"8961":{"dmg":788.67,"def":0.91,"frag":0.85,"spot":1.47,"wRate":53.86},"8977":{"dmg":1179.13,"def":0.95,"frag":1,"spot":0.05,"wRate":51.68},"8993":{"dmg":1486.2,"def":0.75,"frag":0.91,"spot":1.46,"wRate":50.79},"9041":{"dmg":448.8,"def":1.37,"frag":1.23,"spot":1.27,"wRate":57.18},"9217":{"dmg":1403.32,"def":0.82,"frag":1.08,"spot":1.15,"wRate":53.63},"9233":{"dmg":1701.21,"def":0.55,"frag":0.89,"spot":0.04,"wRate":48.82},"9249":{"dmg":1062.78,"def":1.05,"frag":1.02,"spot":0.78,"wRate":53.42},"9297":{"dmg":2113.51,"def":0.53,"frag":1.1,"spot":0.55,"wRate":48.38},"9473":{"dmg":240.17,"def":0.66,"frag":0.62,"spot":2.54,"wRate":54.74},"9489":{"dmg":1931.54,"def":0.52,"frag":0.93,"spot":0.99,"wRate":49.73},"9505":{"dmg":1534.64,"def":0.67,"frag":0.85,"spot":1.08,"wRate":50.5},"9553":{"dmg":788.29,"def":1.36,"frag":1.04,"spot":0.67,"wRate":55.87},"9745":{"dmg":1566.14,"def":0.7,"frag":0.89,"spot":1.02,"wRate":51.05},"9761":{"dmg":456.21,"def":0.71,"frag":0.68,"spot":2.65,"wRate":54.61},"9793":{"dmg":384.76,"def":1.04,"frag":1.11,"spot":0.53,"wRate":55.04},"9809":{"dmg":677.77,"def":0.98,"frag":0.84,"spot":0.42,"wRate":51.48},"9985":{"dmg":1225.21,"def":0.94,"frag":0.95,"spot":0.87,"wRate":50.94},"10001":{"dmg":497.77,"def":0.56,"frag":0.6,"spot":2.34,"wRate":52.55},"10017":{"dmg":709.74,"def":1.05,"frag":0.98,"spot":1.19,"wRate":53.96},"10049":{"dmg":676.29,"def":1.35,"frag":1.3,"spot":0.79,"wRate":55.03},"10065":{"dmg":1190.78,"def":1.3,"frag":1.11,"spot":0.67,"wRate":56.19},"10241":{"dmg":1027.09,"def":1.11,"frag":1.01,"spot":0.82,"wRate":53.54},"10257":{"dmg":1528.52,"def":0.75,"frag":0.91,"spot":1.34,"wRate":50.48},"10273":{"dmg":473,"def":1.46,"frag":1.24,"spot":1.38,"wRate":57.91},"10497":{"dmg":862.17,"def":0.7,"frag":1.09,"spot":0.73,"wRate":54.5},"10513":{"dmg":1216.9,"def":0.84,"frag":0.86,"spot":1.19,"wRate":51.33},"10529":{"dmg":654.97,"def":1.41,"frag":1.3,"spot":1.63,"wRate":56.69},"10577":{"dmg":194.78,"def":1.21,"frag":1.3,"spot":0.23,"wRate":56.31},"10753":{"dmg":1645.19,"def":0.7,"frag":0.92,"spot":0.92,"wRate":52.72},"10769":{"dmg":1080.19,"def":1.01,"frag":0.93,"spot":0.95,"wRate":53.51},"10785":{"dmg":1888.88,"def":0.69,"frag":0.91,"spot":1.27,"wRate":48.75},"10817":{"dmg":951.66,"def":0.95,"frag":0.85,"spot":0.67,"wRate":51.47},"10833":{"dmg":331.15,"def":1.59,"frag":0.86,"spot":0.1,"wRate":52.84},"11009":{"dmg":1179.34,"def":0.73,"frag":0.81,"spot":0.81,"wRate":52.5},"11025":{"dmg":1016.32,"def":0.89,"frag":0.97,"spot":0.49,"wRate":49.87},"11041":{"dmg":969.7,"def":1.04,"frag":0.9,"spot":0.95,"wRate":52.63},"11073":{"dmg":1580.26,"def":0.84,"frag":0.93,"spot":0.94,"wRate":50.26},"11089":{"dmg":622.07,"def":1.51,"frag":1.15,"spot":0.11,"wRate":55.52},"11265":{"dmg":832.77,"def":0.82,"frag":1.04,"spot":0.91,"wRate":55.06},"11281":{"dmg":539.26,"def":1.47,"frag":1.4,"spot":0.9,"wRate":57.54},"11297":{"dmg":1379.16,"def":0.93,"frag":0.97,"spot":0.5,"wRate":51.3},"11345":{"dmg":917.59,"def":1.4,"frag":0.86,"spot":0.07,"wRate":51.5},"11521":{"dmg":1520.74,"def":0.66,"frag":0.86,"spot":1.14,"wRate":50.72},"11537":{"dmg":1487.92,"def":0.91,"frag":1.08,"spot":0.77,"wRate":51.31},"11553":{"dmg":850.23,"def":1.14,"frag":1.09,"spot":1.39,"wRate":54.38},"11585":{"dmg":709.44,"def":0.95,"frag":0.89,"spot":0.63,"wRate":50.86},"11601":{"dmg":1532.96,"def":0.71,"frag":0.9,"spot":0.03,"wRate":50.73},"11777":{"dmg":614.49,"def":1.08,"frag":1.15,"spot":0.84,"wRate":54.41},"11793":{"dmg":898.29,"def":1.15,"frag":1.11,"spot":0.62,"wRate":51.39},"11809":{"dmg":941.13,"def":1.28,"frag":1.1,"spot":1.74,"wRate":52.97},"11841":{"dmg":1760.24,"def":1.07,"frag":1.04,"spot":0.07,"wRate":49.98},"11857":{"dmg":776.46,"def":1.8,"frag":1,"spot":0.17,"wRate":53.78},"12033":{"dmg":1521.63,"def":0.83,"frag":0.96,"spot":0.83,"wRate":49.95},"12049":{"dmg":2092.41,"def":0.5,"frag":1.04,"spot":0.64,"wRate":49.36},"12097":{"dmg":1270.6,"def":0.91,"frag":0.91,"spot":0.78,"wRate":49.89},"12113":{"dmg":1197.01,"def":0.76,"frag":0.86,"spot":0.03,"wRate":50.8},"12289":{"dmg":678.69,"def":0.98,"frag":1,"spot":1.92,"wRate":54.07},"12305":{"dmg":1857.67,"def":0.73,"frag":0.94,"spot":1.38,"wRate":48.52},"12369":{"dmg":1895.91,"def":0.77,"frag":0.89,"spot":0.03,"wRate":50.98},"12545":{"dmg":933.04,"def":0.81,"frag":0.96,"spot":1.66,"wRate":53.35},"12561":{"dmg":238.12,"def":1.09,"frag":1.07,"spot":2.86,"wRate":55.76},"12577":{"dmg":553.07,"def":1.07,"frag":1.13,"spot":1.88,"wRate":56.94},"12817":{"dmg":184.55,"def":1.12,"frag":1.14,"spot":1.97,"wRate":56.56},"12881":{"dmg":558.52,"def":1.01,"frag":1.13,"spot":1.47,"wRate":56.49},"13073":{"dmg":270.46,"def":1.26,"frag":1,"spot":1.67,"wRate":58.44},"13089":{"dmg":2095.69,"def":0.57,"frag":1.01,"spot":0.81,"wRate":48.96},"13121":{"dmg":325.09,"def":1.44,"frag":1.26,"spot":1.09,"wRate":58.74},"13137":{"dmg":1691.6,"def":0.89,"frag":1.02,"spot":0.6,"wRate":50.44},"13313":{"dmg":1234.31,"def":0.91,"frag":0.98,"spot":1.35,"wRate":52.46},"13329":{"dmg":413.44,"def":1.18,"frag":1.18,"spot":1.03,"wRate":56.54},"13345":{"dmg":1149.19,"def":0.98,"frag":0.87,"spot":1.02,"wRate":51.54},"13393":{"dmg":621.19,"def":1.47,"frag":1.12,"spot":0.54,"wRate":54.56},"13569":{"dmg":2159.69,"def":0.7,"frag":1.08,"spot":0.8,"wRate":48.71},"13585":{"dmg":379.1,"def":1.16,"frag":1.11,"spot":1.62,"wRate":57.29},"13825":{"dmg":1770.76,"def":0.75,"frag":0.97,"spot":1.5,"wRate":48.56},"13841":{"dmg":1134.78,"def":0.95,"frag":0.83,"spot":1.21,"wRate":50.4},"13857":{"dmg":2214.02,"def":0.56,"frag":1.07,"spot":0.75,"wRate":51.04},"13889":{"dmg":2217.84,"def":0.7,"frag":1.17,"spot":0.86,"wRate":49.16},"13905":{"dmg":2052.2,"def":0.53,"frag":1.04,"spot":0.48,"wRate":47.26},"14097":{"dmg":717.8,"def":1.06,"frag":0.98,"spot":1.6,"wRate":54.17},"14113":{"dmg":1771.8,"def":0.7,"frag":0.92,"spot":1.42,"wRate":48.15},"14145":{"dmg":481.96,"def":0.77,"frag":0.68,"spot":2.43,"wRate":53.84},"14161":{"dmg":932.64,"def":1.21,"frag":0.93,"spot":0.92,"wRate":51.21},"14337":{"dmg":2095.36,"def":0.74,"frag":1.07,"spot":0.95,"wRate":50.18},"14353":{"dmg":673.84,"def":0.62,"frag":0.61,"spot":1.97,"wRate":51.02},"14401":{"dmg":1474.08,"def":0.9,"frag":0.9,"spot":0.04,"wRate":50.05},"14417":{"dmg":826.84,"def":1.25,"frag":1.05,"spot":0.94,"wRate":52.86},"14609":{"dmg":1841.88,"def":0.9,"frag":0.98,"spot":1.46,"wRate":47.86},"14625":{"dmg":1209.15,"def":0.99,"frag":0.97,"spot":1.31,"wRate":51.97},"14657":{"dmg":397.33,"def":1.44,"frag":1,"spot":0.11,"wRate":54.01},"14673":{"dmg":1464.99,"def":1.12,"frag":1.08,"spot":0.83,"wRate":52.32},"14865":{"dmg":1446.73,"def":0.84,"frag":0.86,"spot":1.28,"wRate":49.44},"14881":{"dmg":2067.63,"def":0.66,"frag":1.09,"spot":0.87,"wRate":48.77},"14913":{"dmg":400.29,"def":1.09,"frag":0.98,"spot":0.93,"wRate":55.39},"15105":{"dmg":323.79,"def":1.55,"frag":1.34,"spot":1.39,"wRate":57.65},"15121":{"dmg":157.11,"def":0.89,"frag":1.09,"spot":0.18,"wRate":53.57},"15137":{"dmg":480.16,"def":0.58,"frag":0.55,"spot":2.12,"wRate":52.61},"15169":{"dmg":215.47,"def":2.05,"frag":1.29,"spot":0.86,"wRate":58},"15185":{"dmg":1913.65,"def":0.68,"frag":0.92,"spot":1.12,"wRate":48.71},"15361":{"dmg":249.15,"def":1.73,"frag":1.45,"spot":1.37,"wRate":60.05},"15377":{"dmg":1198.98,"def":0.61,"frag":0.82,"spot":0.04,"wRate":50.11},"15393":{"dmg":1661.32,"def":0.78,"frag":1.1,"spot":1.01,"wRate":51.35},"15425":{"dmg":1854.8,"def":0.9,"frag":0.98,"spot":1.36,"wRate":48.47},"15441":{"dmg":1184.95,"def":0.89,"frag":0.78,"spot":1.08,"wRate":51.53},"15617":{"dmg":1988.35,"def":0.97,"frag":1.17,"spot":1.52,"wRate":51.95},"15633":{"dmg":438.98,"def":1.54,"frag":1.11,"spot":0.1,"wRate":55.31},"15649":{"dmg":716.35,"def":0.63,"frag":0.66,"spot":2.29,"wRate":51.7},"15681":{"dmg":1565.11,"def":0.82,"frag":0.95,"spot":1.32,"wRate":50.11},"15873":{"dmg":366.27,"def":1.29,"frag":1.04,"spot":1.5,"wRate":57.37},"15889":{"dmg":721.04,"def":0.99,"frag":0.95,"spot":1.38,"wRate":51.94},"15905":{"dmg":1821.91,"def":0.81,"frag":0.95,"spot":1.3,"wRate":48.56},"15937":{"dmg":235.06,"def":1.98,"frag":1.39,"spot":1.21,"wRate":58.59},"16129":{"dmg":982.98,"def":0.78,"frag":0.86,"spot":0.05,"wRate":51.95},"16145":{"dmg":615.04,"def":1.03,"frag":1.11,"spot":0.71,"wRate":52.5},"16161":{"dmg":1588.82,"def":0.79,"frag":0.92,"spot":0.04,"wRate":51.26},"16385":{"dmg":543.52,"def":1.09,"frag":0.95,"spot":0.09,"wRate":52.88},"16401":{"dmg":1840.85,"def":0.89,"frag":1.08,"spot":0.6,"wRate":50.49},"16417":{"dmg":795.97,"def":1.14,"frag":0.97,"spot":0.07,"wRate":53},"16641":{"dmg":427.11,"def":0.63,"frag":0.54,"spot":2.61,"wRate":52.59},"16657":{"dmg":1617.19,"def":1.02,"frag":1.19,"spot":0.54,"wRate":51.6},"16673":{"dmg":630.77,"def":0.82,"frag":0.71,"spot":2.25,"wRate":54.05},"16897":{"dmg":1873.31,"def":0.84,"frag":1.04,"spot":1.54,"wRate":49.19},"16913":{"dmg":2275.67,"def":0.75,"frag":1.33,"spot":0.49,"wRate":49.09},"17153":{"dmg":1817.73,"def":0.79,"frag":1.05,"spot":1.52,"wRate":50.23},"17169":{"dmg":312.16,"def":1.01,"frag":1.36,"spot":1.31,"wRate":58.51},"17425":{"dmg":427.76,"def":0.93,"frag":1.1,"spot":1.35,"wRate":56.78},"17665":{"dmg":1534.38,"def":0.83,"frag":1.02,"spot":1.45,"wRate":53.12},"17937":{"dmg":465.28,"def":1.18,"frag":1.34,"spot":0.84,"wRate":56.76},"17953":{"dmg":848.42,"def":0.8,"frag":0.81,"spot":2.46,"wRate":52.9},"18177":{"dmg":999.92,"def":0.68,"frag":0.73,"spot":2.22,"wRate":52.37},"18193":{"dmg":544.32,"def":0.96,"frag":1.12,"spot":1.33,"wRate":55.45},"18209":{"dmg":911.07,"def":0.57,"frag":0.62,"spot":1.87,"wRate":50.86},"18433":{"dmg":813.2,"def":0.82,"frag":0.76,"spot":2.56,"wRate":53.95},"18449":{"dmg":926.37,"def":0.67,"frag":0.68,"spot":2.29,"wRate":51.13},"18465":{"dmg":255.35,"def":1.64,"frag":0.91,"spot":0.1,"wRate":55.71},"18689":{"dmg":692.22,"def":1.06,"frag":1.3,"spot":1.34,"wRate":57.66},"18721":{"dmg":383.63,"def":1.19,"frag":0.95,"spot":0.13,"wRate":54.48},"18961":{"dmg":902.72,"def":0.75,"frag":0.78,"spot":1.89,"wRate":52.39},"19217":{"dmg":2275.67,"def":0.75,"frag":1.33,"spot":0.49,"wRate":49.09},"50689":{"dmg":2095.69,"def":0.57,"frag":1.01,"spot":0.81,"wRate":48.96},"50945":{"dmg":249.15,"def":1.73,"frag":1.45,"spot":1.37,"wRate":60.05},"50961":{"dmg":926.37,"def":0.67,"frag":0.68,"spot":2.29,"wRate":51.13},"51201":{"dmg":693.27,"def":1.3,"frag":1.43,"spot":1.41,"wRate":59.7},"51457":{"dmg":582.79,"def":1.38,"frag":1.31,"spot":1.19,"wRate":57.51},"51473":{"dmg":473.49,"def":0.78,"frag":0.68,"spot":1.57,"wRate":49.86},"51489":{"dmg":191.01,"def":0.96,"frag":1.06,"spot":2.55,"wRate":55.4},"51553":{"dmg":545.15,"def":1.1,"frag":1,"spot":1.13,"wRate":53.37},"51569":{"dmg":774.4,"def":0.84,"frag":1,"spot":1.42,"wRate":51.89},"51713":{"dmg":611.11,"def":1.3,"frag":1.22,"spot":1.22,"wRate":54.83},"51729":{"dmg":383.7,"def":2.32,"frag":1.95,"spot":1.66,"wRate":66.14},"51745":{"dmg":549.03,"def":1.13,"frag":1.16,"spot":1.51,"wRate":57.4},"51809":{"dmg":306.28,"def":1.36,"frag":1.25,"spot":1.65,"wRate":57.97},"51985":{"dmg":381.63,"def":1.62,"frag":1.61,"spot":1.5,"wRate":60.42},"52001":{"dmg":277.13,"def":1.33,"frag":1.12,"spot":2.65,"wRate":57.29},"52065":{"dmg":1166.66,"def":0.98,"frag":0.89,"spot":1.15,"wRate":50.69},"52225":{"dmg":355.63,"def":1.4,"frag":1.57,"spot":2.16,"wRate":57.95},"52241":{"dmg":535.42,"def":1.78,"frag":1.76,"spot":1.73,"wRate":60.82},"52257":{"dmg":445.44,"def":1.02,"frag":0.99,"spot":1.5,"wRate":53.99},"52321":{"dmg":832.49,"def":0.87,"frag":1.03,"spot":1.06,"wRate":54.12},"52481":{"dmg":431.56,"def":1.73,"frag":1.46,"spot":1.63,"wRate":57.68},"52497":{"dmg":343.02,"def":2.78,"frag":2.05,"spot":1.75,"wRate":56.35},"52513":{"dmg":1133.63,"def":0.82,"frag":0.86,"spot":1.15,"wRate":47.99},"52561":{"dmg":1748.14,"def":0.89,"frag":1.03,"spot":0.6,"wRate":51.7},"52737":{"dmg":230.42,"def":1.28,"frag":0.98,"spot":1.72,"wRate":53.42},"52769":{"dmg":277.13,"def":1.33,"frag":1.12,"spot":2.65,"wRate":57.29},"52817":{"dmg":416.67,"def":1.25,"frag":1.15,"spot":1.74,"wRate":57.48},"52993":{"dmg":288.58,"def":0.66,"frag":0.88,"spot":2.68,"wRate":53.31},"53249":{"dmg":1265.86,"def":0.88,"frag":0.99,"spot":1.08,"wRate":52.52},"53505":{"dmg":369.01,"def":1.69,"frag":1.68,"spot":1.78,"wRate":57.83},"53537":{"dmg":182.92,"def":0.89,"frag":1.01,"spot":1.56,"wRate":55.84},"53585":{"dmg":575.8,"def":1.51,"frag":1.2,"spot":0.84,"wRate":55.87},"53761":{"dmg":640.29,"def":1.4,"frag":1.34,"spot":0.89,"wRate":53.96},"53793":{"dmg":1142.92,"def":0.97,"frag":0.9,"spot":1.33,"wRate":53.42},"53841":{"dmg":862.59,"def":1.24,"frag":1.09,"spot":0.6,"wRate":52.83},"54017":{"dmg":693.27,"def":1.3,"frag":1.43,"spot":1.41,"wRate":59.7},"54033":{"dmg":473.49,"def":0.78,"frag":0.68,"spot":1.57,"wRate":49.86},"54097":{"dmg":1040.76,"def":1.21,"frag":1.04,"spot":0.77,"wRate":53.58},"54273":{"dmg":456.96,"def":1.62,"frag":2.15,"spot":1.01,"wRate":60.42},"54289":{"dmg":1241.5,"def":0.83,"frag":0.81,"spot":0.85,"wRate":50.08},"54353":{"dmg":635.75,"def":1.25,"frag":1.34,"spot":1.64,"wRate":56.69},"54529":{"dmg":267.5,"def":1.42,"frag":1.52,"spot":1.49,"wRate":58},"54545":{"dmg":569.96,"def":1.17,"frag":1.11,"spot":1.64,"wRate":55.53},"54609":{"dmg":288.88,"def":1.48,"frag":1.1,"spot":0.13,"wRate":55.36},"54785":{"dmg":882.34,"def":0.8,"frag":1.17,"spot":0.62,"wRate":54.83},"54801":{"dmg":263.73,"def":1.39,"frag":1.12,"spot":2.89,"wRate":59.12},"54865":{"dmg":187.09,"def":1.09,"frag":1.23,"spot":1.55,"wRate":55.94},"55057":{"dmg":588.01,"def":1.42,"frag":1.2,"spot":1.31,"wRate":53.54},"55073":{"dmg":173.77,"def":0.96,"frag":1.13,"spot":1.61,"wRate":56.76},"55121":{"dmg":1063.31,"def":1.06,"frag":1,"spot":1.17,"wRate":55.15},"55297":{"dmg":1143.08,"def":0.9,"frag":1.21,"spot":0.83,"wRate":54.51},"55313":{"dmg":1262.93,"def":1.06,"frag":0.92,"spot":0.76,"wRate":50.15},"55569":{"dmg":1045.28,"def":1.6,"frag":1.28,"spot":1.52,"wRate":51.3},"55633":{"dmg":1248.25,"def":0.96,"frag":0.88,"spot":1.05,"wRate":51.92},"55841":{"dmg":1816.67,"def":0.75,"frag":0.94,"spot":1.09,"wRate":48.85},"55889":{"dmg":859.33,"def":1.09,"frag":1.24,"spot":2.31,"wRate":57.46},"56097":{"dmg":717.98,"def":1.01,"frag":0.98,"spot":1.37,"wRate":54.45},"56145":{"dmg":806.94,"def":1.08,"frag":1.03,"spot":1.07,"wRate":53.13},"56353":{"dmg":1090.9,"def":1.27,"frag":1,"spot":0.78,"wRate":51.43},"56577":{"dmg":281.18,"def":1.42,"frag":1.25,"spot":1.36,"wRate":56.35},"56609":{"dmg":1117.47,"def":0.88,"frag":1.03,"spot":0.83,"wRate":54.49},"56833":{"dmg":1253.57,"def":0.83,"frag":1.2,"spot":1.19,"wRate":56.95},"56865":{"dmg":1771.8,"def":0.7,"frag":0.92,"spot":1.42,"wRate":48.15},"57089":{"dmg":788.67,"def":0.91,"frag":0.85,"spot":1.47,"wRate":53.86},"57105":{"dmg":854.09,"def":1.03,"frag":1.09,"spot":0.75,"wRate":52.29},"57121":{"dmg":1242.69,"def":0.93,"frag":0.91,"spot":1.31,"wRate":53.57},"57361":{"dmg":714.75,"def":1.15,"frag":0.92,"spot":1.06,"wRate":51.98},"57377":{"dmg":1220.02,"def":1.04,"frag":0.92,"spot":1.52,"wRate":50.97},"57617":{"dmg":863.49,"def":1.12,"frag":0.91,"spot":1.28,"wRate":52.21},"57633":{"dmg":716.35,"def":0.63,"frag":0.66,"spot":2.29,"wRate":51.7},"58113":{"dmg":723.55,"def":0.93,"frag":1,"spot":1.28,"wRate":56.04},"58369":{"dmg":2084.91,"def":0.74,"frag":1.02,"spot":1.42,"wRate":51.61},"58625":{"dmg":997.34,"def":0.78,"frag":0.78,"spot":0.71,"wRate":50.77},"58641":{"dmg":1972.39,"def":0.53,"frag":0.94,"spot":1.1,"wRate":50.48},"58881":{"dmg":1410.89,"def":0.75,"frag":1.01,"spot":1.11,"wRate":56.44},"59137":{"dmg":1253.57,"def":0.83,"frag":1.2,"spot":1.19,"wRate":56.95},"59393":{"dmg":872.73,"def":1.01,"frag":1.15,"spot":1.59,"wRate":56.8},"59649":{"dmg":1166.52,"def":0.89,"frag":1.22,"spot":0.66,"wRate":54.79},"59665":{"dmg":309.61,"def":1.09,"frag":1.29,"spot":1.47,"wRate":58.28},"59905":{"dmg":1176.25,"def":0.84,"frag":0.91,"spot":1.21,"wRate":52.72},"60161":{"dmg":832.49,"def":0.87,"frag":1.03,"spot":1.06,"wRate":54.12},"60177":{"dmg":1167.77,"def":0.94,"frag":0.87,"spot":1.13,"wRate":50.47},"60417":{"dmg":1390.42,"def":0.68,"frag":0.97,"spot":0.98,"wRate":54.5},"60433":{"dmg":201.57,"def":1.3,"frag":1.11,"spot":1.88,"wRate":57.79},"60673":{"dmg":1988.35,"def":0.97,"frag":1.17,"spot":1.52,"wRate":51.95},"60689":{"dmg":555.26,"def":1.46,"frag":1.15,"spot":0.69,"wRate":52.78},"60929":{"dmg":237.26,"def":0.78,"frag":0.95,"spot":1.88,"wRate":54.45},"60945":{"dmg":1617.78,"def":0.92,"frag":1.08,"spot":1.37,"wRate":52.23},"61185":{"dmg":1888.88,"def":0.69,"frag":0.91,"spot":1.27,"wRate":48.75},"61441":{"dmg":563.84,"def":1.16,"frag":1.43,"spot":1.2,"wRate":58.65},"61457":{"dmg":413.68,"def":0.87,"frag":0.84,"spot":1.53,"wRate":53},"61697":{"dmg":2294.69,"def":0.91,"frag":1.29,"spot":1.66,"wRate":58.27},"61713":{"dmg":1045.28,"def":1.6,"frag":1.28,"spot":1.52,"wRate":51.3},"61953":{"dmg":1011.77,"def":0.81,"frag":0.81,"spot":1.55,"wRate":52.6},"61969":{"dmg":1166.73,"def":1.28,"frag":0.94,"spot":0.94,"wRate":49.41},"62209":{"dmg":1225.21,"def":0.94,"frag":0.95,"spot":0.87,"wRate":50.94},"62225":{"dmg":1080.19,"def":1.01,"frag":0.93,"spot":0.95,"wRate":53.51},"62481":{"dmg":1617.19,"def":1.02,"frag":1.19,"spot":0.54,"wRate":51.6},"62529":{"dmg":1421.89,"def":0.79,"frag":0.96,"spot":1.3,"wRate":49.46},"62721":{"dmg":1410.89,"def":0.75,"frag":1.01,"spot":1.11,"wRate":56.44},"62737":{"dmg":1265.86,"def":0.88,"frag":0.99,"spot":1.08,"wRate":52.52},"62785":{"dmg":1184.95,"def":0.89,"frag":0.78,"spot":1.08,"wRate":51.53},"62977":{"dmg":1011.77,"def":0.81,"frag":0.81,"spot":1.55,"wRate":52.6},"62993":{"dmg":1080.19,"def":1.01,"frag":0.93,"spot":0.95,"wRate":53.51},"63041":{"dmg":1302.41,"def":0.85,"frag":0.93,"spot":0.85,"wRate":50.47},"63233":{"dmg":1179.34,"def":0.73,"frag":0.81,"spot":0.81,"wRate":52.5},"63249":{"dmg":484.73,"def":0.99,"frag":0.92,"spot":1.21,"wRate":53.75},"63297":{"dmg":693.2,"def":0.76,"frag":0.67,"spot":1.97,"wRate":50.71},"63505":{"dmg":231.11,"def":1.23,"frag":0.82,"spot":1.08,"wRate":59.82},"63537":{"dmg":1762.87,"def":0.66,"frag":0.93,"spot":1.33,"wRate":48.14},"63553":{"dmg":1220.02,"def":1.04,"frag":0.92,"spot":1.52,"wRate":50.97},"63761":{"dmg":1220.02,"def":1.04,"frag":0.92,"spot":1.52,"wRate":50.97},"63793":{"dmg":1105.73,"def":0.89,"frag":0.86,"spot":1.27,"wRate":50.76},"63809":{"dmg":693.2,"def":0.76,"frag":0.67,"spot":1.97,"wRate":50.71},"64017":{"dmg":926.37,"def":0.67,"frag":0.68,"spot":2.29,"wRate":51.13},"64049":{"dmg":1159.15,"def":0.77,"frag":0.93,"spot":1.45,"wRate":50.16},"64065":{"dmg":1254.74,"def":1.05,"frag":0.95,"spot":1.46,"wRate":50.46},"64273":{"dmg":1262.45,"def":1,"frag":0.93,"spot":1.38,"wRate":52.8},"64561":{"dmg":1219.52,"def":0.7,"frag":0.89,"spot":1.31,"wRate":51.45},"64817":{"dmg":584.05,"def":0.76,"frag":0.67,"spot":2.39,"wRate":52.2}}',
  337. 'bs' : '{"cv":8770.36,"cm":6378.85,"c1":4182.23,"c2":2811.21,"c3":2024.96,"d3":1289.15,"d2":797.98,"d1":253.94,"dm":0.03}',
  338. 'pr' : '{"1":550,"33":550,"49":1350,"81":100,"113":120,"257":550,"273":750,"289":350,"305":700,"321":350,"337":135,"353":200,"369":200,"513":1000,"529":1000,"545":120,"577":120,"593":175,"609":120,"625":350,"769":350,"785":200,"801":750,"817":1400,"833":200,"849":300,"865":200,"881":450,"1025":200,"1041":550,"1057":550,"1073":1050,"1089":450,"1105":750,"1121":1000,"1137":550,"1297":1000,"1313":750,"1329":125,"1345":200,"1361":200,"1377":550,"1393":750,"1537":450,"1553":750,"1569":1000,"1585":1350,"1601":200,"1617":450,"1633":450,"1649":1000,"1793":1000,"1809":450,"1825":200,"1841":1900,"1889":750,"1905":1400,"2049":450,"2065":200,"2081":170,"2097":2000,"2113":550,"2129":350,"2145":350,"2161":2000,"2305":1000,"2321":750,"2353":200,"2369":350,"2385":150,"2401":350,"2417":2300,"2561":750,"2577":550,"2593":2000,"2625":750,"2657":1400,"2817":800,"2833":350,"2849":1400,"2865":1600,"2881":450,"2897":525,"2913":450,"3073":350,"3089":120,"3105":450,"3121":250,"3137":1400,"3153":1300,"3169":200,"3329":120,"3345":350,"3361":550,"3377":725,"3393":350,"3409":250,"3425":2000,"3585":750,"3601":200,"3617":350,"3633":1300,"3649":2300,"3665":750,"3681":2300,"3841":200,"3857":1000,"3873":1000,"3889":900,"3905":2000,"3921":1500,"3937":2800,"4097":1400,"4113":1000,"4129":550,"4145":2200,"4161":550,"4193":2050,"4353":1400,"4369":450,"4385":1400,"4401":250,"4417":550,"4433":2000,"4449":430,"4609":200,"4625":450,"4641":450,"4657":500,"4673":750,"4689":800,"4705":250,"4865":450,"4881":350,"4897":350,"4913":350,"4929":1400,"4945":260,"4961":1700,"5121":200,"5137":1400,"5153":450,"5169":750,"5185":1000,"5201":145,"5217":1550,"5377":1400,"5393":550,"5409":550,"5425":2200,"5457":1000,"5473":970,"5633":750,"5649":550,"5665":200,"5697":2000,"5713":1900,"5729":700,"5889":1000,"5905":350,"5921":1400,"5953":350,"5969":1400,"5985":175,"6145":2300,"6161":450,"6177":200,"6209":2450,"6225":2300,"6401":350,"6417":550,"6433":400,"6465":750,"6481":220,"6657":1000,"6673":350,"6721":550,"6913":450,"6929":2300,"6945":550,"6977":1000,"6993":175,"7169":2300,"7185":750,"7201":750,"7233":1000,"7249":2300,"7425":1400,"7441":1000,"7457":1400,"7489":1400,"7505":165,"7681":350,"7697":1400,"7713":450,"7745":200,"7761":200,"7937":2000,"7953":2000,"7969":1000,"8017":300,"8193":2400,"8209":450,"8225":1400,"8257":350,"8273":180,"8449":2000,"8465":1400,"8481":2300,"8529":1850,"8705":2300,"8721":2000,"8737":2000,"8785":600,"8961":1000,"8977":1000,"8993":2000,"9041":350,"9217":1400,"9233":2300,"9249":1000,"9297":2500,"9473":450,"9489":2300,"9505":2000,"9553":950,"9745":2000,"9761":550,"9793":450,"9809":825,"9985":1400,"10001":750,"10017":750,"10049":550,"10065":1500,"10241":1000,"10257":2000,"10273":450,"10497":750,"10513":1400,"10529":550,"10577":200,"10753":2000,"10769":1000,"10785":2300,"10817":1000,"10833":400,"11009":1400,"11025":1000,"11041":1000,"11073":2000,"11089":750,"11265":750,"11281":450,"11297":1400,"11345":1500,"11521":2000,"11537":1400,"11553":750,"11585":750,"11601":1900,"11777":550,"11793":750,"11809":1000,"11841":2300,"11857":1200,"12033":2000,"12049":2300,"12097":1400,"12113":1750,"12289":750,"12305":2300,"12369":2200,"12545":1000,"12561":350,"12577":550,"12817":200,"12881":550,"13073":350,"13089":2300,"13121":350,"13137":2200,"13313":1400,"13329":450,"13345":1400,"13393":550,"13569":2300,"13585":450,"13825":2300,"13841":1400,"13857":2300,"13889":2300,"13905":2650,"14097":750,"14113":2300,"14145":550,"14161":1300,"14337":2300,"14353":1000,"14401":2000,"14417":850,"14609":2300,"14625":1400,"14657":450,"14673":1800,"14865":2000,"14881":2300,"14913":450,"15105":350,"15121":200,"15137":750,"15169":200,"15361":200,"15377":1400,"15393":2000,"15425":2200,"15441":1300,"15617":2300,"15633":450,"15649":1000,"15681":2000,"15873":450,"15889":750,"15905":2300,"15937":200,"16129":1000,"16145":550,"16161":2000,"16385":550,"16401":2000,"16417":750,"16641":750,"16657":1400,"16673":750,"16897":2300,"16913":2300,"17153":2300,"17169":350,"17425":450,"17665":2000,"17937":400,"17953":1000,"18177":900,"18193":550,"18209":1400,"18433":725,"18449":900,"18465":400,"18689":550,"18721":500,"18961":700,"19217":2300,"50193":1400,"50945":200,"50961":1000,"51201":550,"51457":550,"51473":550,"51489":200,"51553":550,"51569":700,"51713":550,"51729":350,"51745":550,"51985":350,"52065":1400,"52225":350,"52241":450,"52257":550,"52321":800,"52481":450,"52497":200,"52513":1400,"52561":2250,"52737":350,"52769":350,"52817":450,"52993":450,"53249":1400,"53505":350,"53537":200,"53585":575,"53761":550,"53793":1400,"53841":875,"54017":550,"54033":550,"54097":1200,"54273":350,"54289":1400,"54353":550,"54529":200,"54545":550,"54609":500,"54785":750,"54801":350,"54865":150,"55057":550,"55073":200,"55121":1300,"55297":1000,"55313":1400,"55569":1000,"55633":1300,"55841":2300,"55889":750,"56097":625,"56145":750,"56353":1300,"56577":350,"56609":1500,"56833":1000,"56865":2300,"57105":750,"57361":750,"57617":1000,"57633":1000,"58113":775,"58369":2500,"58625":1550,"58641":2300,"58881":1400,"59137":1300,"59393":775,"59649":1350,"59665":220,"59905":1350,"60161":750,"60177":1350,"60417":1400,"60433":175,"60689":700,"60929":150,"60945":1900,"61185":2300,"61441":450,"61457":550,"61697":2300,"61713":1000,"61953":1400,"61969":1800,"62209":1400,"62481":1400,"62737":1400,"62785":1400,"62977":1250,"63041":1400,"63249":550,"63297":725,"63505":230,"63553":1350,"63761":1400,"63793":1350,"63809":700,"64049":1300,"64065":1400,"64273":1300,"64561":1400,"64817":450}'
  339. },
  340. showError: function (erText) {
  341. $('.wes-overlay').show();
  342. $('#wes-error-text').html(erText);
  343. $('#wes-error').show();
  344. },
  345. getServ: function () {
  346. if (document.location.host.endsWith(".ru"))
  347. return 'ru';
  348. else if (document.location.host.endsWith(".eu"))
  349. return 'eu';
  350. else if (document.location.host.endsWith(".com"))
  351. return "com";
  352. else
  353. return '';
  354. },
  355. getApiKey: function () {
  356. return this.apiKey[this.getServ()];
  357. },
  358. lzw_encode: function (s) {
  359. var dict = {}, data = (s + "").split(""), out = [], currChar, phrase = data[0], code = 256, i;
  360. for (i = 1; i < data.length; i++) {
  361. currChar = data[i];
  362. if (dict[phrase + currChar] != null) {
  363. phrase += currChar;
  364. }
  365. else {
  366. out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
  367. dict[phrase + currChar] = code;
  368. code++;
  369. phrase = currChar;
  370. }
  371. }
  372. out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
  373. for (i = 0; i < out.length; i++) {
  374. out[i] = String.fromCharCode(out[i]);
  375. }
  376. return out.join("");
  377. },
  378. lzw_decode: function (s) {
  379. var dict = {}, data = (s + "").split(""), currChar = data[0], oldPhrase = currChar, out = [currChar],
  380. code = 256, phrase, i;
  381. for (i = 1; i < data.length; i++) {
  382. var currCode = data[i].charCodeAt(0);
  383. if (currCode < 256) {
  384. phrase = data[i];
  385. }
  386. else {
  387. phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar);
  388. }
  389. out.push(phrase);
  390. currChar = phrase.charAt(0);
  391. dict[code] = oldPhrase + currChar;
  392. code++;
  393. oldPhrase = phrase;
  394. }
  395. return out.join("");
  396. },
  397. newLSData: {
  398. 'wes-wn8': {
  399. 'get': function () {
  400. $.get("http://www.wnefficiency.net/exp/expected_tank_values_latest.json", this.set, "json");
  401. },
  402. 'set': function (resp) {
  403. var wn8Data = {}, i;
  404. for (i = 0; i < resp['data'].length; i++) {
  405. if (!wn8Data[resp['data'][i].IDNum]) {
  406. wn8Data[resp['data'][i].IDNum] = {
  407. 'dmg': resp['data'][i].expDamage,
  408. 'def': resp['data'][i].expDef,
  409. 'frag': resp['data'][i].expFrag,
  410. 'spot': resp['data'][i].expSpot,
  411. 'wRate': resp['data'][i].expWinRate
  412. };
  413. }
  414. }
  415. wesGeneral.setLSData('wes-wn8', wn8Data, (new Date().getTime() + 86400000));
  416. }
  417. },
  418. 'wes-bs': {
  419. 'get': function () {
  420. $.get("http://armor.kiev.ua/wot/api.php", this.set, "json");
  421. },
  422. 'set': function (resp) {
  423. wesGeneral.setLSData('wes-bs', resp['classRatings'], (new Date().getTime() + 86400000));
  424. }
  425. },
  426. 'wes-tanks': {
  427. 'get': function () {
  428. $.get("http://api." + document.location.host + "/wot/encyclopedia/vehicles/",
  429. {
  430. 'application_id': wesApiKey,
  431. 'fields': 'tier, is_premium, tag'
  432. }, this.set, "json");
  433. },
  434. 'set': function (resp) {
  435. var tanksArr = [], allTanks = {}, key, i, oKeys;
  436. if (resp.status == "ok") {
  437. oKeys = Object.keys(resp.data);
  438. for (i = 0; i < oKeys.length; i++) {
  439. key = oKeys[i];
  440. allTanks[key] = {'l': resp.data[key]["tier"]};
  441. if (resp.data[key]["is_premium"]) allTanks[key]['p'] = 1;
  442. allTanks[key]['tag'] = resp.data[key]['tag'];
  443. tanksArr.push(key)
  444. }
  445. }
  446. wesGeneral.setLSData('wes-tanks', allTanks, (new Date().getTime() + 86400000));
  447. }
  448. },
  449. 'wes-pr': {
  450. 'get': function () {
  451. $.get("http://www.noobmeter.com/tankListJson/elfx_133054", this.set, "json");
  452. },
  453. 'set': function (resp) {
  454. var tanksArr = wesGeneral.getLSData('wes-tanks'), i, prData = {}, tName;
  455. for (i = 0; i < resp.length; i++) {
  456. tName = resp[i]['id'];
  457. for (var tank in tanksArr) {
  458. if (typeof(tanksArr[tank]) !== 'undefined' && tName === tanksArr[tank]['tag']) {
  459. prData[tank] = resp[i]['nominalDamage'];
  460. }
  461. }
  462. }
  463. wesGeneral.setLSData('wes-pr', prData, (new Date().getTime() + 86400000));
  464. }
  465. }
  466. },
  467. getLSData: function (name, onRemoveFunction) {
  468. var stVal = localStorage.getItem(name);
  469. onRemoveFunction = onRemoveFunction || false;
  470. if (stVal) {
  471. if (name !== 'wesSettings') {
  472. stVal = decodeURIComponent(escape(this.lzw_decode(stVal)));
  473. }
  474. stVal = JSON.parse(stVal);
  475. if (parseInt(stVal['expireDate']) >= new Date().getTime()) {
  476. return stVal['data'];
  477. } else {
  478. if (onRemoveFunction) {
  479. onRemoveFunction();
  480. }
  481. else if (this.newLSData[name]){
  482. this.newLSData[name].get();
  483. }
  484. return stVal['data'];
  485. }
  486. } else {
  487. if (this.newLSData[name]) {
  488. this.newLSData[name].get();
  489. }
  490. return null;
  491. }
  492. },
  493. setLSData: function (name, value, expire) {
  494. expire = expire || new Date(2100, 0, 1).getTime();
  495. var stVal = JSON.stringify({
  496. 'expireDate': expire,
  497. 'data': value
  498. });
  499. if (name !== 'wesSettings') {
  500. stVal = this.lzw_encode(unescape(encodeURIComponent(stVal)));
  501. }
  502. try {
  503. localStorage.setItem(name, stVal);
  504. } catch (e) {
  505. if (e == QUOTA_EXCEEDED_ERR) {
  506. this.showError(_('localStorageIsFull'));
  507. }
  508. }
  509. },
  510. deleteLSData: function (name) {
  511. localStorage.removeItem(name);
  512. },
  513. setStyles: function () {
  514. var styleEl = document.createElement("style");
  515. styleEl.innerHTML = this.styles['default'];
  516. document.head.appendChild(styleEl);
  517. },
  518. setScripts: function () {
  519. var cnScr = document.createElement("script");
  520. cnScr.innerHTML = '(function() { if (window.pluso)if (typeof window.pluso.start == "function") return; ' +
  521. 'if (window.ifpluso==undefined) { window.ifpluso = 1; ' +
  522. 'var d = document, s = d.createElement("script"), g = "getElementsByTagName"; ' +
  523. 's.type = "text/javascript"; s.charset="UTF-8"; s.async = true; s.src = ("https:" == ' +
  524. 'window.location.protocol ? "https" : "http") + "://share.pluso.ru/pluso-like.js"; ' +
  525. 'var h=d[g]("body")[0]; h.appendChild(s);}})();';
  526. document.head.appendChild(cnScr);
  527. },
  528. createProgressBar: function (pId, color) {
  529. var pDiv1 = document.createElement("div"),
  530. pDiv2 = document.createElement("div");
  531. color = color || 'green';
  532. pDiv2.style.backgroundColor = color;
  533. pDiv1.setAttribute("id", "wes-" + pId);
  534. pDiv1.setAttribute("class", "wes-progressbar");
  535. pDiv1.appendChild(pDiv2);
  536. return pDiv1;
  537. },
  538. updateProgressBar: function (pId, curCount, allCount) {
  539. $('#wes-' + pId + ' > div').width(String(Math.round(curCount / allCount * 100)) + '%');
  540. },
  541. calculateCurrentLocalStorageSize: function () {
  542. var size = 0, i;
  543. for (i = 0; i < localStorage.length; i++)
  544. size += (localStorage[localStorage.key(i)].length * 2) / 1024;
  545. return Math.round(size);
  546. },
  547. createSettingsWindow: function () {
  548. var settingsDiv = document.createElement("div"),
  549. overlayDiv = document.createElement("div"), sHtml, key;
  550. settingsDiv.setAttribute("id", "wes-settings");
  551. settingsDiv.setAttribute("class", "wes-settings");
  552. overlayDiv.setAttribute("class", "wes-overlay");
  553. sHtml = '<div class="wes-title">' +
  554. '<span class="wes-title-span">' + _('settingsText') + '</span>' +
  555. '<a href="#" class="wes-close-titlebar" id="wes-close-settings"><span>close</span></a>' +
  556. '<div class="wes-error-text"><div class="wes-tabs">' +
  557. '<span class="wes-active-tab" tabId="1">' + _('general') + '</span>' +
  558. '<span tabId="2">' + _('blocks') + '</span>' +
  559. '<span tabId="3">' + _('players') + '</span>' +
  560. '<span tabId="4">' + _('about') + '</span></div>' +
  561.  
  562. '<div id="wes-tab-content-1" class="wes-tab-content"><div>' +
  563. '<p id="wes-ls-size-text">' + _('lsSize') + ' 0%</p>' +
  564. '<div class="wes-progressbar" id="wes-ls-size"><div style="background-color: orange;"></div></div>' +
  565. '<div class="wes-setting-half">' + _('saveCount') +
  566. ': <input style="width: 40px;" type="number" id="wes-settings-save-count" value="7" min="1" max="100" step="1"></div>' +
  567. '<div class="wes-setting-half">' + _('graphs') + ': <select id="wes-settings-graphs">' +
  568. '<option value="0">' + _('dntshow') + '</option>' +
  569. '<option value="1">' + _('battles') + '</option>' +
  570. '<option value="2">' + _('date') + '</option></select></div>' +
  571. '<div class="wes-setting-half">' + _('language') + ': <select id="wes-settings-lang">' +
  572. '<option value="ru">Русский</option>' +
  573. '<option value="en">English</option></select></div>' +
  574. '</div></div>' +
  575. '<div id="wes-tab-content-2" class="wes-tab-content" style="display: none;"><div><table>';
  576.  
  577. for (key in wesSettings.blocks) {
  578. sHtml += '<tr><td style="width: 70%;">' + _('block' + key.capitalize()) + ':</td><td><select style="margin-top: 2px;" id="wes-settings-block-' + key + '">' +
  579. '<option value="0">' + _('showBlock') + '</option>' +
  580. '<option value="1">' + _('hideBlock') + '</option>' +
  581. '<option value="2">' + _('deleteBlock') + '</option>' +
  582. '</select></td></tr>'
  583. }
  584.  
  585. sHtml += '</table></div></div>' +
  586. '<div id="wes-tab-content-3" class="wes-tab-content" style="display: none;"><div></div></div>' +
  587.  
  588. '<div id="wes-tab-content-4" class="wes-tab-content" style="display: none;"><div><div style="clear:both"></div>' +
  589. '<div data-description="' + _("scriptName") + '" data-title="' + _("scriptName") + '" ' +
  590. 'data-url="http://forum.worldoftanks.ru/index.php?/topic/717208-" class="pluso" data-background="none;" ' +
  591. 'data-options="medium,square,line,horizontal,counter,sepcounter=1,theme=14" ' +
  592. 'data-services="vkontakte,odnoklassniki,facebook,twitter,google,livejournal,moimir"></div>' +
  593. '<p>' + _('scriptVersion') + '<br></p>' +
  594. '<p>' + _('donate') + ': </p><p>' +
  595. '<span style="color: green;">WebMoney:</span><br>'
  596. + ' WMR: R135164502303<br>'
  597. + ' WMZ: Z127526962810<br>'
  598. + ' WME: E419926987074<br><br>'
  599. + '<span style="color: green;">Yandex:</span><br>'
  600. + ' 41001870448136<br></p>' +
  601. '</div></div>' +
  602.  
  603. '<fieldset><div>' +
  604. '<span class="wes-colored-button" style="margin-left: 320px;"><span class="wes-button-right">' +
  605. '<input type="button" value="' + _('save') + '" id="wes-settings-save"></span></span>' +
  606. '</div></fieldset></div>' +
  607. '</div>';
  608. settingsDiv.innerHTML = sHtml;
  609. document.body.appendChild(settingsDiv);
  610. document.body.appendChild(overlayDiv);
  611. },
  612. createErrorWindow: function () {
  613. var errorDiv = document.createElement("div");
  614. errorDiv.setAttribute("id", "wes-error");
  615. errorDiv.setAttribute("class", "wes-error");
  616. errorDiv.innerHTML = '<div class="wes-title">' +
  617. '<span class="wes-title-span">' + _('error') + '</span>' +
  618. '<a href="#" class="wes-close-titlebar" id="wes-close-error"><span>close</span></a>' +
  619. '<div class="wes-error-text"><div style="height:20px;"></div>' +
  620. '<span class="wes-error-icon">' + _('errorText') + '</span>' +
  621. '<div id="wes-error-text"></div><fieldset><div>' +
  622. '<span class="wes-colored-button" style="margin-left: 222px;"><span class="wes-button-right">' +
  623. '<input type="button" value="OK" id="wes-error-close"></span></span>' +
  624. '</div></fieldset></div>' +
  625. '</div>';
  626. document.body.appendChild(errorDiv);
  627. },
  628. createWaitWindow: function () {
  629. var waitDiv = document.createElement("div");
  630. waitDiv.setAttribute("id", "wes-wait");
  631. waitDiv.setAttribute("class", 'wes-wait');
  632. waitDiv.innerHTML = '<img src="/static/3.26.0.2/common/css/scss/content/spinners/img/death-wheel.gif"><br><span></span>';
  633. document.body.appendChild(waitDiv);
  634. },
  635. showWait: function (wText) {
  636. $('.wes-overlay').show();
  637. $('#wes-wait > span').html(wText);
  638. $('#wes-wait').show();
  639. },
  640. hideWait: function () {
  641. $('.wes-overlay').hide();
  642. $('#wes-wait').hide();
  643. },
  644. getCookie: function (check_name) {
  645. var a_all_cookies = document.cookie.split(';'), a_temp_cookie = '', cookie_name = '', cookie_value = '';
  646. for (var i = 0; i < a_all_cookies.length; i++) {
  647. a_temp_cookie = a_all_cookies[i].split('=');
  648. cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
  649. if (cookie_name == check_name) {
  650. if (a_temp_cookie.length > 1) {
  651. cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
  652. }
  653. return cookie_value;
  654. }
  655. }
  656. return null;
  657. },
  658. toFl: function (s) {
  659. var a = ("" + s).split("(")[0];
  660. a = a.indexOf(">") > 0 ? a.substr(0, a.indexOf(">")) : a;
  661. return (parseFloat(a.replace(/[\D\.]/g, "")));
  662. },
  663. getUserLastStat: function (uId) {
  664. var stat = this.getLSData('wes_' + uId);
  665. if (stat) return stat[stat.length - 1]; else return null;
  666. },
  667. formattedDate: function (ndate, isoFormat) {
  668. isoFormat = isoFormat || false;
  669. var day, month, year, hour, minutes, seconds;
  670. day = String(ndate.getDate());
  671. if (day.length == 1) day = '0' + day;
  672. month = String(ndate.getMonth() + 1);
  673. if (month.length == 1) month = '0' + month;
  674. year = String(ndate.getFullYear());
  675. hour = String(ndate.getHours());
  676. if (hour.length == 1) hour = '0' + hour;
  677. minutes = String(ndate.getMinutes());
  678. if (minutes.length == 1) minutes = '0' + minutes;
  679. seconds = String(ndate.getSeconds());
  680. if (seconds.length == 1) seconds = '0' + seconds;
  681. if (isoFormat)
  682. return year + '-' + month + '-' + day + 'T' + hour + ':' + minutes + ':' + seconds;
  683. else
  684. return day + '.' + month + '.' + year + ' ' + hour + ':' + minutes + ':' + seconds;
  685.  
  686. },
  687. migrateToNewVersion: {
  688. 'v1': function () {
  689. var steps = {
  690. step1: function () {
  691. var locFuncs = {
  692. 'setAllTanksInfo': function (resp) {
  693. var tanksArr = [], allTanks = {}, key, i, oKeys;
  694. if (resp.status == "ok") {
  695. oKeys = Object.keys(resp.data);
  696. for (i = 0; i < oKeys.length; i++) {
  697. key = oKeys[i];
  698. allTanks[key] = {'l': resp.data[key]["tier"]};
  699. if (resp.data[key]["is_premium"]) allTanks[key]['p'] = 1;
  700. allTanks[key]['tag'] = resp.data[key]["tag"];
  701. tanksArr.push(key)
  702. }
  703. }
  704. wesGeneral.setLSData('wes-tanks', allTanks, (new Date().getTime() + 86400000));
  705. }
  706. };
  707. wesGeneral.setLSData('wes-wn8', JSON.parse(wesGeneral.defaultValues['wn8']), (new Date().getTime() + 86400000));
  708. wesGeneral.setLSData('wes-bs', JSON.parse(wesGeneral.defaultValues['bs']), (new Date().getTime() + 86400000));
  709. $.when($.get("http://api." + document.location.host + "/wot/encyclopedia/vehicles/",
  710. {
  711. 'fields': "is_premium, tier, name, tank_id, tag, nation",
  712. 'language': 'ru',
  713. 'application_id': wesApiKey
  714. }
  715. , locFuncs.setAllTanksInfo, "json")
  716. ).done (function() {
  717. wesGeneral.setLSData('wes-pr', JSON.parse(wesGeneral.defaultValues['pr']), (new Date().getTime() + 86400000));
  718. steps.step2();
  719. wesGeneral.hideWait();
  720. $('#wes-wait').trigger('wesGeneralReady');
  721. });
  722. },
  723. step2: function () {
  724. var oldSettings = wesGeneral.getCookie('usSettings'), bsVals, i, key, pId, j,
  725. tanksArr = wesGeneral.getLSData('wes-tankId');
  726. if (oldSettings) {
  727. var setArr = oldSettings.split("|"),
  728. blSetArr = setArr[0].split("/"), bKey;
  729. for (i = 0; i < blSetArr.length; i++) {
  730. bsVals = blSetArr[i].split(';');
  731. if (wesGeneral.toFl(bsVals[2]) === 1)
  732. bKey = 2;
  733. else if (wesGeneral.toFl(bsVals[1]) === 1)
  734. bKey = 1;
  735. else
  736. bKey = 0;
  737. if (bsVals[0] in wesSettings.blocks) wesSettings.blocks[bsVals[0]] = bKey;
  738. }
  739. bsVals = setArr[1].split(';');
  740. if (wesGeneral.toFl(bsVals[0]) === 1)
  741. wesSettings.myID = parseInt(bsVals[1].match(/\/(\d+)/)[1]);
  742. if (setArr.length > 2) {
  743. if (setArr[2] === 'no') wesSettings.graphs = 0;
  744. else if (setArr[2] === 'date') wesSettings.graphs = 2;
  745. }
  746. if (setArr.length > 3) {
  747. var us_strs = setArr[3].split("/");
  748. for (i = 0; i < us_strs.length; i++) {
  749. var us_vals = us_strs[i].split(";");
  750. if (us_vals.length > 1) {
  751. wesSettings.players[us_vals[0]] = us_vals[1];
  752. }
  753. }
  754. }
  755. }
  756. for (i = 0; i < localStorage.length; i++) {
  757. key = localStorage.key(i);
  758. if (key.startsWith('daystat')) {
  759. pId = parseInt(key.split('_')[1]);
  760. if (!wesSettings.players[pId])
  761. wesSettings.players[pId] = _("player") + ' ' + String(pId);
  762. }
  763. }
  764. //localStorage.removeItem("flot");
  765. //localStorage.removeItem("flot_time");
  766. //localStorage.removeItem("AllTanksArr");
  767. //localStorage.removeItem("UsBsRangs");
  768. //localStorage.removeItem("UsStatData");
  769. //localStorage.removeItem("UsUnOfStat");
  770. //localStorage.removeItem("WN8Data");
  771. //localStorage.removeItem("compareStat");
  772. //localStorage.removeItem("nominalDamage");
  773. wesSettings.version = 1;
  774. wesSettings.ncount = 2;
  775. var uIds = Object.keys(wesSettings.players), statArr, stat, lsData;
  776. for (i = 0; i < uIds.length; i++) {
  777. statArr = [];
  778. for (j = 0; j < 7; j++) {
  779. lsData = localStorage.getItem('daystat_' + uIds[i] + '_' + j);
  780. if (lsData) {
  781. stat = {};
  782. var dsArr = lsData.split("||")[1].split("|"),
  783. strArray = dsArr[0].split("/"),
  784. str = strArray[0].split(";");
  785. stat['time'] = (new Date(str[0])).getTime();
  786. stat['battles'] = wesGeneral.toFl(str[12]);
  787. stat['wins'] = wesGeneral.toFl(str[10]);
  788. stat['xp'] = wesGeneral.toFl(str[24]);
  789. stat['damage_dealt'] = wesGeneral.toFl(str[16]);
  790. stat['frags'] = wesGeneral.toFl(str[20]);
  791. stat['spotted'] = wesGeneral.toFl(str[22]);
  792. stat['capture_points'] = wesGeneral.toFl(str[14]);
  793. stat['dropped_capture_points'] = wesGeneral.toFl(str[18]);
  794. stat['gold'] = wesGeneral.toFl(str[1]);
  795. stat['credit'] = wesGeneral.toFl(str[2]);
  796. stat['exp'] = wesGeneral.toFl(str[3]);
  797. stat['damage_received'] = 0;
  798. stat['draws'] = 0;
  799. stat['hits'] = 0;
  800. stat['shots'] = 0;
  801. stat['survived_battles'] = 0;
  802. stat['clan'] = {
  803. 'battles': 0,
  804. 'capture_points': 0,
  805. 'damage_dealt': 0,
  806. 'damage_received': 0,
  807. 'draws': 0,
  808. 'dropped_capture_points': 0,
  809. 'frags': 0,
  810. 'hits': 0,
  811. 'shots': 0,
  812. 'spotted': 0,
  813. 'wins': 0,
  814. 'survived_battles': 0,
  815. 'xp': 0,
  816. 'tanks': []
  817. };
  818. stat['company'] = {
  819. 'battles': 0,
  820. 'capture_points': 0,
  821. 'damage_dealt': 0,
  822. 'damage_received': 0,
  823. 'draws': 0,
  824. 'dropped_capture_points': 0,
  825. 'frags': 0,
  826. 'hits': 0,
  827. 'shots': 0,
  828. 'spotted': 0,
  829. 'wins': 0,
  830. 'survived_battles': 0,
  831. 'xp': 0,
  832. 'tanks': []
  833. };
  834. if (dsArr.length > 2) {
  835. var sData = JSON.parse(dsArr[2]);
  836. stat['damage_received'] = sData['all']['damage_received'];
  837. stat['draws'] = sData['all']['draws'];
  838. stat['hits'] = sData['all']['hits'];
  839. stat['shots'] = sData['all']['shots'];
  840. stat['survived_battles'] = sData['all']['survived_battles'];
  841.  
  842. stat['clan']['battles'] = sData['clan']['battles'];
  843. stat['clan']['capture_points'] = sData['clan']['capture_points'];
  844. stat['clan']['damage_dealt'] = sData['clan']['damage_dealt'];
  845. stat['clan']['damage_received'] = sData['clan']['damage_received'];
  846. stat['clan']['draws'] = sData['clan']['draws'];
  847. stat['clan']['dropped_capture_points'] = sData['clan']['dropped_capture_points'];
  848. stat['clan']['frags'] = sData['clan']['frags'];
  849. stat['clan']['hits'] = sData['clan']['hits'];
  850. stat['clan']['shots'] = sData['clan']['shots'];
  851. stat['clan']['spotted'] = sData['clan']['spotted'];
  852. stat['clan']['wins'] = sData['clan']['wins'];
  853. stat['clan']['survived_battles'] = sData['clan']['survived_battles'];
  854. stat['clan']['xp'] = sData['clan']['xp'];
  855.  
  856. stat['company']['battles'] = sData['company']['battles'];
  857. stat['company']['capture_points'] = sData['company']['capture_points'];
  858. stat['company']['damage_dealt'] = sData['company']['damage_dealt'];
  859. stat['company']['damage_received'] = sData['company']['damage_received'];
  860. stat['company']['draws'] = sData['company']['draws'];
  861. stat['company']['dropped_capture_points'] = sData['company']['dropped_capture_points'];
  862. stat['company']['frags'] = sData['company']['frags'];
  863. stat['company']['hits'] = sData['company']['hits'];
  864. stat['company']['shots'] = sData['company']['shots'];
  865. stat['company']['spotted'] = sData['company']['spotted'];
  866. stat['company']['wins'] = sData['company']['wins'];
  867. stat['company']['survived_battles'] = sData['company']['survived_battles'];
  868. stat['company']['xp'] = sData['company']['xp'];
  869. }
  870. if (dsArr.length > 3)
  871. stat['wgRating'] = wesGeneral.toFl(dsArr[3]);
  872. else
  873. stat['wgRating'] = 0;
  874. stat['medals'] = {};
  875. if (dsArr.length > 1) {
  876. var MedArr = dsArr[1].split("/");
  877. for (var k = 0; k < MedArr.length; k++) {
  878. var MedStr = MedArr[k].split(";");
  879. if (wesGeneral.toFl(MedStr[1]))
  880. stat['medals'][MedStr[0]] = wesGeneral.toFl(MedStr[1]);
  881. }
  882. }
  883. stat['tanks'] = {};
  884. for (k = 1; k < strArray.length; k++) {
  885. var tStr = strArray[k].split(";");
  886. var tName = tStr[0].toLowerCase();
  887. for (var tank in tanksArr) {
  888. if (typeof(tanksArr[tank]) !== 'undefined' && tName === tanksArr[tank]['tag']) {
  889. stat['tanks'][tanksArr[tank]] = {};
  890. stat['tanks'][tanksArr[tank]]["b"] = wesGeneral.toFl(tStr[1]);
  891. stat['tanks'][tanksArr[tank]]["w"] = tStr.length > 3 ? tStr[3] : 0;
  892. }
  893. }
  894. }
  895. statArr.push(stat);
  896. //localStorage.removeItem('daystat_' + uIds[i] + '_' + j);
  897. }
  898. }
  899. wesGeneral.setLSData('wes_' + uIds[i], statArr);
  900. }
  901. wesGeneral.setLSData('wesSettings', wesSettings);
  902. document.cookie = 'usSettings=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
  903. }
  904. };
  905. wesGeneral.showWait(_("sWaitText"));
  906. steps.step1();
  907. }
  908. },
  909. ratings: function (stats) {
  910. var xvmColors = ['FE0E00', 'FE7903', 'F8F400', '60FF00', '02C9B3', 'D042F3'];
  911. var effStep = [0, 615, 870, 1175, 1525, 1850 ]; //рейтинг эффективности
  912. var wn6Step = [0, 460, 850, 1215, 1620, 1960 ]; //рейтинг WN6
  913. var wn8Step = [0, 380, 860, 1420, 2105, 2770 ]; //рейтинг WN8
  914. var bsStep = [0, 720, 1920, 3905, 6700, 9600 ]; //рейтинг бронесайта
  915. var prStep = [0, 1000, 1215, 1445, 1685, 1990 ]; //рейтинг нагиба
  916. var wgStep = [0, 2495, 4345, 6425, 8625, 10040]; //рейтинг Wargaming
  917. var nbStep = [0, 69, 102, 135, 172, 203 ]; //Нубо-Рейтинг
  918. var avgLev, i;
  919. var tanksStat = wesGeneral.getLSData('wes-tanks'),
  920. wn8data = wesGeneral.getLSData('wes-wn8'),
  921. prData = wesGeneral.getLSData('wes-pr');
  922. function calcStep(rVal, steps) {
  923. var l = steps.length;
  924. if (rVal >= steps[l - 1]) {
  925. return 0;
  926. }
  927. for (var i = l - 1; i >= 0; i--) {
  928. if (rVal >= steps[i]) {
  929. return (steps[i + 1] - rVal).toFixed(2);
  930. }
  931. }
  932. return 0;
  933. }
  934.  
  935. function getColor(rVal, steps) {
  936. var l = steps.length;
  937. if (rVal <= steps[0]) {
  938. return xvmColors[0];
  939. }
  940. if (rVal >= steps[l - 1]) {
  941. return xvmColors[xvmColors.length - 1];
  942. }
  943. for (var i = l - 1; i >= 0; i--) {
  944. if (rVal >= steps[i]) {
  945. return xvmColors[i];
  946. }
  947. }
  948. return '000';
  949. }
  950.  
  951. function getAvgTanksLvl() {
  952.  
  953. var tanks = stats['tanks'];
  954. if (stats['battles'] == 0) {
  955. return 0;
  956. }
  957. var avg = 0,
  958. btl = 0;
  959. for (var id in tanks) {
  960. if (typeof(tanksStat[id]) !== 'undefined') {
  961. avg += tanksStat[id]['l'] * tanks[id]['b'];
  962. btl += tanks[id]['b'];
  963. } else {
  964. console.log('Unexpected tank: ' + id);
  965. }
  966. }
  967. return btl ? avg / btl : 0;
  968. }
  969.  
  970. avgLev = getAvgTanksLvl();
  971. for (i = 0; i < stTypeKeys.length; i++) {
  972. if (typeof stats[stTypeKeys[i]] == 'undefined') {
  973. stats[stTypeKeys[i]] = [];
  974. for (j = 0; j < stStatKeys.length; j++) {
  975. if (stats[stTypeKeys[i]][stStatKeys[j]] == undefined) {
  976. stats[stTypeKeys[i]][stStatKeys[j]] = 0;
  977. }
  978. }
  979. };
  980. }
  981. var effRat = function () {
  982. var retList = {};
  983.  
  984. function calculate() {
  985. var damag = stats['damage_dealt'],
  986. battles = stats['battles'],
  987. frags = stats['frags'],
  988. spotted = stats['spotted'],
  989. caps = stats['capture_points'],
  990. defs = stats['dropped_capture_points'];
  991. if (battles == 0) {
  992. return 0;
  993. }
  994. var value = (damag / battles * (10 / (avgLev + 2)) * (0.23 + 2 * avgLev / 100) +
  995. frags / battles * 250 +
  996. spotted / battles * 150 +
  997. Math.log((caps / battles) + 1) / Math.log(1.732) * 150 +
  998. defs / battles * 150).toFixed(2);
  999. return (value > 0) ? value : 0;
  1000. }
  1001.  
  1002. function stepToNextLvl(rVal) {
  1003. return calcStep(rVal, effStep);
  1004. }
  1005.  
  1006. function getXvm(rVal) {
  1007. if (rVal > 2250) {
  1008. return 100;
  1009. }
  1010. return Math.max(0, Math.min(100,
  1011. rVal * (rVal * (rVal * (rVal * (rVal *
  1012. (rVal * 0.000000000000000013172 - 0.000000000000092286)
  1013. + 0.00000000023692)
  1014. - 0.00000027377)
  1015. + 0.00012983)
  1016. + 0.05935)
  1017. - 31.684, 100), 0).toFixed(2);
  1018. }
  1019.  
  1020. function xvmStepToNextLvl(rVal) {
  1021. var steps = effStep.map(getXvm);
  1022. return calcStep(rVal, steps);
  1023. }
  1024.  
  1025. retList['value'] = calculate();
  1026. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1027. retList['xvm'] = getXvm(retList['value']);
  1028. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1029. retList['color'] = getColor(retList['value'], effStep);
  1030. return retList;
  1031. },
  1032. wn6Rat = function () {
  1033. var retList = {};
  1034.  
  1035. function calculate() {
  1036. var damag = stats['damage_dealt'],
  1037. battles = stats['battles'],
  1038. frags = stats['frags'],
  1039. spotted = stats['spotted'],
  1040. defs = stats['dropped_capture_points'],
  1041. wins = stats['wins'];
  1042. var value = ((1240 - 1040 / Math.pow(Math.min(avgLev, 6), 0.164)) * frags / battles +
  1043. damag / battles * 530 / (184 * Math.pow(Math.E, 0.24 * avgLev) + 130) +
  1044. spotted / battles * 125 +
  1045. Math.min(defs / battles, 2.2) * 100 +
  1046. ((185 / (0.17 + Math.pow(Math.E, (wins / battles * 100 - 35) * -0.134))) - 500) * 0.45 +
  1047. (6 - Math.min(avgLev, 6)) * -60).toFixed(2);
  1048. return (value > 0) ? value : 0;
  1049. }
  1050.  
  1051. function stepToNextLvl(rVal) {
  1052. return calcStep(rVal, wn6Step);
  1053. }
  1054.  
  1055. function getXvm(rVal) {
  1056. if (rVal > 2350) {
  1057. return 100;
  1058. }
  1059. return Math.max(0, Math.min(100,
  1060. rVal * (rVal * (rVal * (rVal * (rVal * (rVal *
  1061. 0.000000000000000001225
  1062. - 0.000000000000007167)
  1063. + 0.000000000005501)
  1064. + 0.00000002368)
  1065. - 0.00003668)
  1066. + 0.05965)
  1067. - 5.297, 100), 0).toFixed(2);
  1068. }
  1069.  
  1070. function xvmStepToNextLvl(rVal) {
  1071. var steps = wn6Step.map(getXvm);
  1072. return calcStep(rVal, steps);
  1073. }
  1074.  
  1075. retList['value'] = calculate();
  1076. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1077. retList['xvm'] = getXvm(retList['value']);
  1078. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1079. retList['color'] = getColor(retList['value'], wn6Step);
  1080. return retList;
  1081. },
  1082. wn8Rat = function () {
  1083. var retList = {};
  1084.  
  1085. function calculate() {
  1086. var tanks = stats['tanks'], tbcount;
  1087. if (stats['battles'] == 0) {
  1088. return 0;
  1089. }
  1090. var expDmg = 0.0,
  1091. expSpot = 0.0,
  1092. expFrag = 0.0,
  1093. expDef = 0.0,
  1094. alltb = 0,
  1095. expWinRate = 0.0;
  1096. for (var id in tanks) {
  1097. if (wn8data[id]) {
  1098. tbcount = parseInt(tanks[id]['b']);
  1099. alltb += tbcount;
  1100. expDmg += parseFloat(wn8data[id]['dmg']) * tbcount;
  1101. expSpot += parseFloat(wn8data[id]['spot']) * tbcount;
  1102. expFrag += parseFloat(wn8data[id]['frag']) * tbcount;
  1103. expDef += parseFloat(wn8data[id]['def']) * tbcount;
  1104. expWinRate += parseFloat(wn8data[id]['wRate']) * tbcount / 100.0;
  1105. }
  1106. }
  1107. var rDAMAGE = stats['damage_dealt'] / stats['battles'] * alltb / expDmg,
  1108. rSPOT = stats['spotted'] / stats['battles'] * alltb / expSpot,
  1109. rFRAG = stats['frags'] / stats['battles'] * alltb / expFrag,
  1110. rDEF = stats['dropped_capture_points'] / stats['battles'] * alltb / expDef,
  1111. rWIN = stats['wins'] / stats['battles'] * alltb / expWinRate,
  1112. rWINc = Math.max(0, (rWIN - 0.71) / (1 - 0.71)),
  1113. rDAMAGEc = Math.max(0, (rDAMAGE - 0.22) / (1 - 0.22)),
  1114. rFRAGc = Math.max(0, Math.min(rDAMAGEc + 0.2, (rFRAG - 0.12) / (1 - 0.12))),
  1115. rSPOTc = Math.max(0, Math.min(rDAMAGEc + 0.1, (rSPOT - 0.38) / (1 - 0.38))),
  1116. rDEFc = Math.max(0, Math.min(rDAMAGEc + 0.1, (rDEF - 0.10) / (1 - 0.10)));
  1117. var value = 980.0 * rDAMAGEc + 210.0 * rDAMAGEc * rFRAGc + 155.0 * rFRAGc * rSPOTc + 75.0 * rDEFc * rFRAGc + 145.0 * Math.min(1.8, rWINc);
  1118. return (value > 0) ? value.toFixed(2) : 0;
  1119. }
  1120.  
  1121. function stepToNextLvl(rVal) {
  1122. return calcStep(rVal, wn8Step);
  1123. }
  1124.  
  1125. function getXvm(rVal) {
  1126. if (rVal > 3650) {
  1127. return 100;
  1128. }
  1129. return Math.max(0, Math.min(100,
  1130. rVal * (rVal * (rVal * (rVal * (rVal * (-rVal *
  1131. 0.00000000000000000007656
  1132. + 0.0000000000000014848)
  1133. - 0.0000000000099633)
  1134. + 0.00000002858)
  1135. - 0.00003836)
  1136. + 0.0575)
  1137. - 0.99, 100), 0).toFixed(2);
  1138. }
  1139.  
  1140. function xvmStepToNextLvl(rVal) {
  1141. var steps = wn8Step.map(getXvm);
  1142. return calcStep(rVal, steps);
  1143. }
  1144.  
  1145. retList['value'] = calculate();
  1146. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1147. retList['xvm'] = getXvm(retList['value']);
  1148. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1149. retList['color'] = getColor(retList['value'], wn8Step);
  1150. return retList;
  1151. },
  1152. prRat = function () {
  1153. var retList = {};
  1154.  
  1155. function calculate() {
  1156. var tanks = stats['tanks'], prD;
  1157. if (stats['battles'] == 0) {
  1158. return 0;
  1159. }
  1160. var expDmg = 0;
  1161. for (var id in tanks) {
  1162. if (id in prData) {
  1163. prD = parseFloat(prData[id]);
  1164. } else {
  1165. prD = 0;
  1166. }
  1167. expDmg += prD * tanks[id]['b'];
  1168. }
  1169. var clearedFromPenalties1 = 1500.0,
  1170. expectedMinBattles1 = 500.0,
  1171. expectedMinAvgTier1 = 6.0,
  1172. clearedFromPenalties2 = 1900.0,
  1173. expectedMinBattles2 = 2000.0,
  1174. expectedMinAvgTier2 = 7.0;
  1175.  
  1176. var damage = stats['damage_dealt'],
  1177. battles = stats['battles'],
  1178. wins = stats['wins'],
  1179. avgLev = getAvgTanksLvl();
  1180. var value = (500 * (wins / battles) / 0.4856) + (1000 * damage / (expDmg * 0.975));
  1181. if (value > clearedFromPenalties1)
  1182. value = value - (value - clearedFromPenalties1) * Math.pow(Math.max(0, 1 - (avgLev / expectedMinAvgTier1), 1 - (battles / expectedMinBattles1)), 0.5);
  1183. if (value > clearedFromPenalties2)
  1184. value = value - (value - clearedFromPenalties2) * Math.pow(Math.max(0, 1 - (avgLev / expectedMinAvgTier2), 1 - (battles / expectedMinBattles2)), 0.5);
  1185. return (value > 0) ? value.toFixed(2) : 0;
  1186. }
  1187.  
  1188. function stepToNextLvl(rVal) {
  1189. return calcStep(rVal, prStep);
  1190. }
  1191.  
  1192. function getXvm(rVal) {
  1193. if (rVal >= 2175) {
  1194. return 100;
  1195. }
  1196. if (rVal >= 1500 && rVal < 2175) {
  1197. return Math.max(rVal * (rVal * (rVal *
  1198. (0.00000000074489 * rVal - 0.0000051431)
  1199. + 0.01313866)
  1200. - 14.65) + 6057.52
  1201. , rVal*(rVal*(0.000000081703*rVal - 0.000699026) + 1.88722) - 1538.59).toFixed(2);
  1202. }
  1203. return Math.max(rVal*(0.00001717*rVal + 0.03825) - 38.45, 0).toFixed(2);
  1204. }
  1205.  
  1206. function xvmStepToNextLvl(rVal) {
  1207. var steps = prStep.map(getXvm);
  1208. return calcStep(rVal, steps);
  1209. }
  1210.  
  1211. retList['value'] = calculate();
  1212. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1213. retList['xvm'] = getXvm(retList['value']);
  1214. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1215. retList['color'] = getColor(retList['value'], prStep);
  1216. return retList;
  1217. },
  1218. bsRat = function () {
  1219. var retList = {};
  1220.  
  1221. function calculate() {
  1222. var battles = stats['battles'] - stats['company']['battles'] - stats['clan']['battles'],
  1223. wins = stats['wins'] - stats['company']['wins'] - stats['clan']['wins'],
  1224. damage = stats['damage_dealt'] - stats['company']['damage_dealt'] - stats['clan']['damage_dealt'],
  1225. frags = stats['frags'] - stats['company']['frags'] - stats['clan']['frags'],
  1226. defs = stats['dropped_capture_points'] - stats['company']['dropped_capture_points'] - stats['clan']['dropped_capture_points'],
  1227. spotted = stats['spotted'] - stats['company']['spotted'] - stats['clan']['spotted'],
  1228. caps = stats['capture_points'] - stats['company']['capture_points'] - stats['clan']['capture_points'],
  1229. xp = stats['xp'] - stats['company']['xp'] - stats['clan']['xp'];
  1230. var value = Math.log(battles) / 10 * (xp / battles + damage / battles * (wins / battles * 2.0 + frags / battles * 0.9 + spotted / battles * 0.5 + caps / battles * 0.5 + defs / battles * 0.5));
  1231. return value.toFixed(2);
  1232. }
  1233.  
  1234. function stepToNextLvl(rVal) {
  1235. return calcStep(rVal, bsStep);
  1236. }
  1237.  
  1238. function getXvm(rVal) {
  1239. if (rVal > 13200) {
  1240. return 100;
  1241. }
  1242. return Math.max(Math.min(rVal * (rVal * (rVal * (rVal * (rVal *
  1243. (-0.00000000000000000000024883*rVal + 0.0000000000000000117935)
  1244. - 0.00000000000021706)
  1245. + 0.00000000193685)
  1246. - 0.0000089711)
  1247. + 0.02948)
  1248. - 0.78, 100), 0).toFixed(2);
  1249. }
  1250.  
  1251. function xvmStepToNextLvl(rVal) {
  1252. var steps = bsStep.map(getXvm);
  1253. return calcStep(rVal, steps);
  1254. }
  1255. retList['value'] = calculate();
  1256. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1257. retList['xvm'] = getXvm(retList['value']);
  1258. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1259. retList['color'] = getColor(retList['value'], bsStep);
  1260. return retList;
  1261. },
  1262. noobRat = function () {
  1263. var retList = {};
  1264.  
  1265. function calculate() {
  1266. return stats['noobRat'] ? stats['noobRat'] : 0;
  1267. }
  1268. function stepToNextLvl(rVal) {
  1269. return calcStep(rVal, nbStep);
  1270. }
  1271.  
  1272. function getXvm(rVal) {
  1273. if (rVal > 240) {
  1274. return 100;
  1275. }
  1276. return Math.max(Math.min(rVal*(rVal*(rVal*(rVal*(rVal*
  1277. (0.0000000000060542*rVal - 0.0000000047258)
  1278. + 0.00000132876)
  1279. - 0.00016789)
  1280. + 0.009921)
  1281. + 0.2677)
  1282. - 17.3, 100), 0).toFixed(2);
  1283. }
  1284.  
  1285. function xvmStepToNextLvl(rVal) {
  1286. var steps = nbStep.map(getXvm);
  1287. return calcStep(rVal, steps);
  1288. }
  1289. retList['value'] = calculate();
  1290. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1291. retList['xvm'] = getXvm(retList['value']);
  1292. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1293. retList['color'] = getColor(retList['value'], nbStep);
  1294. return retList;
  1295. },
  1296. wgRat = function () {
  1297. var retList = {};
  1298.  
  1299. function calculate() {
  1300. return stats['wgRating'];
  1301. }
  1302.  
  1303. function stepToNextLvl(rVal) {
  1304. return calcStep(rVal, wgStep);
  1305. }
  1306.  
  1307. function getXvm(rVal) {
  1308. if (rVal > 11100) {
  1309. return 100;
  1310. }
  1311. return Math.max(0, Math.min(100,
  1312. rVal * (rVal * (rVal * (rVal * (rVal * (-rVal *
  1313. 0.0000000000000000000013018
  1314. + 0.00000000000000004812)
  1315. - 0.00000000000071831)
  1316. + 0.0000000055583)
  1317. - 0.000023362)
  1318. + 0.059054)
  1319. - 47.85, 100), 0).toFixed(2);
  1320. }
  1321.  
  1322. function xvmStepToNextLvl(rVal) {
  1323. var steps = wgStep.map(getXvm);
  1324. return calcStep(rVal, steps);
  1325. }
  1326.  
  1327. retList['value'] = calculate();
  1328. retList['stepToNL'] = stepToNextLvl(retList['value']);
  1329. retList['xvm'] = getXvm(retList['value']);
  1330. retList['xvmStepToNL'] = xvmStepToNextLvl(retList['xvm']);
  1331. retList['color'] = getColor(retList['value'], wgStep);
  1332. return retList;
  1333. },
  1334. wn8tankRat = function (tank) {
  1335. var retList = {};
  1336. if (wn8data[tank] != undefined) {
  1337. var expDmg = stats['tanks'][tank]['b'] * wn8data[tank]['dmg'],
  1338. expSpot = stats['tanks'][tank]['b'] * wn8data[tank]['spot'],
  1339. expFrag = stats['tanks'][tank]['b'] * wn8data[tank]['frag'],
  1340. expDef = stats['tanks'][tank]['b'] * wn8data[tank]['def'],
  1341. expWinRate = stats['tanks'][tank]['b'] * wn8data[tank]['wRate'],
  1342. rDAMAGE = stats['tanks'][tank]['d'] / expDmg,
  1343. rSPOT = stats['tanks'][tank]['s'] / expSpot,
  1344. rFRAG = stats['tanks'][tank]['f'] / expFrag,
  1345. rDEF = stats['tanks'][tank]['p'] / expDef,
  1346. rWIN = stats['tanks'][tank]['w'] / expWinRate,
  1347. rWINc = Math.max(0, (rWIN - 0.71) / (1 - 0.71)),
  1348. rDAMAGEc = Math.max(0, (rDAMAGE - 0.22) / (1 - 0.22)),
  1349. rFRAGc = Math.max(0, Math.min(rDAMAGEc + 0.2, (rFRAG - 0.12) / (1 - 0.12))),
  1350. rSPOTc = Math.max(0, Math.min(rDAMAGEc + 0.1, (rSPOT - 0.38) / (1 - 0.38))),
  1351. rDEFc = Math.max(0, Math.min(rDAMAGEc + 0.1, (rDEF - 0.10) / (1 - 0.10)));
  1352. retList['value'] = 980 * rDAMAGEc + 210 * rDAMAGEc * rFRAGc + 155 * rFRAGc * rSPOTc + 75 * rDEFc * rFRAGc + 145 * Math.min(1.8, rWINc);
  1353. retList['stepToNL'] = calcStep(retList['value'], wn8Step);
  1354. retList['color'] = getColor(retList['value'], wn8Step);
  1355. return retList;
  1356. } else {
  1357. return 0;
  1358. }
  1359. },
  1360. prtankRat = function (tank) {
  1361. var retList = {};
  1362. var tPR = (500 * (stats['tanks'][tank]['w'] / stats['tanks'][tank]['b']) / 0.4856) + (1000 * stats['tanks'][tank]['d'] / ((stats['tanks'][tank]['b'] * prData[tank]) * 0.975)),
  1363. clearedFromPenalties1 = 1500,
  1364. expectedMinBattles1 = 500,
  1365. expectedMinAvgTier1 = 6,
  1366. clearedFromPenalties2 = 1900,
  1367. expectedMinBattles2 = 2000,
  1368. expectedMinAvgTier2 = 7;
  1369. if (tPR > clearedFromPenalties1)
  1370. tPR = tPR - (tPR - clearedFromPenalties1) * Math.pow(Math.max(0, 1 - (tanksStat[tank]['l'] / expectedMinAvgTier1), 1 - (stats['tanks'][tank]['b'] / expectedMinBattles1)), 0.5);
  1371. if (tPR > clearedFromPenalties2)
  1372. tPR = tPR - (tPR - clearedFromPenalties2) * Math.pow(Math.max(0, 1 - (tanksStat[tank]['l'] / expectedMinAvgTier2), 1 - (stats['tanks'][tank]['b'] / expectedMinBattles2)), 0.5);
  1373. retList['value'] = tPR;
  1374. retList['stepToNL'] = calcStep(retList['value'], prStep);
  1375. retList['color'] = getColor(retList['value'], prStep);
  1376. return retList;
  1377. },
  1378. tanksRat = function() {
  1379. var tanks = {};
  1380. for (var tank in stats['tanks']) {
  1381. tanks[tank] = {};
  1382. tanks[tank]['wn8'] = wn8tankRat(tank);
  1383. tanks[tank]['pr'] = prtankRat(tank);
  1384. }
  1385. return tanks;
  1386. };
  1387. return {
  1388. 'eff': effRat(),
  1389. 'wn6': wn6Rat(),
  1390. 'wn8': wn8Rat(),
  1391. 'pr': prRat(),
  1392. 'bs': bsRat(),
  1393. 'wg': wgRat(),
  1394. 'noob': noobRat(),
  1395. 'avg': avgLev,
  1396. 'tanks': tanksRat()
  1397. }
  1398. },
  1399. main: function () {
  1400. this.setStyles();
  1401. this.setScripts();
  1402. wesSettings = this.getLSData('wesSettings');
  1403. if (!wesSettings) wesSettings = this.defaultSettings;
  1404. if (wesSettings.blocks['compStat'] == undefined) {
  1405. var blocks = jQuery.extend({}, wesSettings.blocks);
  1406. wesSettings.blocks['compStat'] = this.defaultSettings.blocks['compStat'];
  1407. delete wesSettings.blocks['pers'];
  1408. delete wesSettings.blocks['speed'];
  1409. delete wesSettings.blocks['hall'];
  1410. delete wesSettings.blocks['achiev'];
  1411. delete wesSettings.blocks['common'];
  1412. delete wesSettings.blocks['diagr'];
  1413. delete wesSettings.blocks['rat'];
  1414. delete wesSettings.blocks['veh'];
  1415. wesSettings.blocks['pers'] = blocks['pers'];
  1416. wesSettings.blocks['speed'] = blocks['speed'];
  1417. wesSettings.blocks['hall'] = blocks['hall'];
  1418. wesSettings.blocks['achiev'] = blocks['achiev'];
  1419. wesSettings.blocks['common'] = blocks['common'];
  1420. wesSettings.blocks['diagr'] = blocks['diagr'];
  1421. wesSettings.blocks['rat'] = blocks['rat'];
  1422. wesSettings.blocks['veh'] = blocks['veh'];
  1423. wesGeneral.setLSData('wesSettings', wesSettings);
  1424. }
  1425. String.locale = wesSettings.locale;
  1426. wesApiKey = this.getApiKey();
  1427. this.createSettingsWindow();
  1428. this.createErrorWindow();
  1429. this.createWaitWindow();
  1430. if (wesSettings.version < 1) this.migrateToNewVersion.v1(); else $('#wes-wait').trigger('wesGeneralReady');
  1431. }
  1432. };
  1433.  
  1434. function extend(Child, Parent) {
  1435. var F = function () {
  1436. };
  1437. F.prototype = Parent.prototype;
  1438. Child.prototype = new F();
  1439. Child.prototype.constructor = Child;
  1440. Child.superclass = Parent.prototype
  1441. }
  1442.  
  1443. function WrappableBlock(name, options) {
  1444. var me = this;
  1445.  
  1446. me.name = name;
  1447. me.options = options || {};
  1448.  
  1449. me.wrap();
  1450. }
  1451.  
  1452. WrappableBlock.prototype.getCaption = function (showBlock) {
  1453. var me = this,
  1454. hasTranslate = _('block' + me.name.capitalize()) != 'block' + me.name.capitalize();
  1455.  
  1456. return (showBlock ? _('hideBlock') : _('showBlock')) +
  1457. ' ' +
  1458. (hasTranslate ? '&laquo;' + _('block' + me.name.capitalize()) + '&raquo;' : '')
  1459. };
  1460.  
  1461. WrappableBlock.prototype.wrap = function () {
  1462. var me = this,
  1463. $wrp;
  1464.  
  1465. var showBlock = me.name in wesSettings.blocks && wesSettings.blocks[me.name] == 0,
  1466. deleteBlock = me.name in wesSettings.blocks && wesSettings.blocks[me.name] == 2,
  1467. expander = '<div class="wes-s-expander' +
  1468. (me.options.extraMargin ? ' wes-s-expander__extra' : '') + '" data-expand="' + me.name + '">' +
  1469. '<a class="b-vertical-arrow' +
  1470. (showBlock ? ' b-vertical-arrow__open' : '') +
  1471. '" href="">' +
  1472. '<span class="b-link-fake">' + me.getCaption(showBlock) + '</span></a></div>',
  1473. blockWrap = '<div class="wes-b-expander" data-expand="' + me.name + '" style="' +
  1474. (showBlock ? '' : 'display: none;') +
  1475. '">';
  1476. if (!me.options.end) {
  1477. $wrp = $(me.options.start);
  1478. if (!deleteBlock) {
  1479. $wrp.wrap(blockWrap);
  1480. } else {
  1481. $wrp.remove();
  1482. }
  1483. } else {
  1484. $wrp = $(me.options.start).nextUntil(me.options.end).andSelf().next().andSelf();
  1485. if (!deleteBlock) {
  1486. $wrp.wrapAll(blockWrap);
  1487. } else {
  1488. $wrp.remove();
  1489. }
  1490. }
  1491. if (!deleteBlock) {
  1492. $('div.wes-b-expander[data-expand=' + me.name + ']').before(expander);
  1493. $('div.wes-s-expander[data-expand=' + me.name + '] a').click(me.toggle(me));
  1494. }
  1495. };
  1496. WrappableBlock.prototype.toggle = function (thisArg) {
  1497. var me = thisArg;
  1498. return function (e) {
  1499. e.preventDefault();
  1500. var $this = $(e.currentTarget),
  1501. $block = $('div.wes-b-expander[data-expand=' + me.name + ']'),
  1502. showBlock = !$block.is(':visible');
  1503. $block.slideToggle();
  1504. $this.children('span').html(me.getCaption(showBlock));
  1505. $this.toggleClass('b-vertical-arrow__open', showBlock);
  1506. }
  1507. };
  1508. WrappableBlock.prototype.draw = function () {
  1509. };
  1510.  
  1511. WBEff = function () {
  1512. var me = this;
  1513.  
  1514. me.name = 'efRat';
  1515. me.options = {
  1516. start: 'div.wes-b-efrat'
  1517. };
  1518.  
  1519. me.draw();
  1520. me.wrap();
  1521. };
  1522. extend(WBEff, WrappableBlock);
  1523. WBEff.prototype.draw = function () {
  1524. var emptyRow = function (label, wesRatingType) {
  1525. wesRatingType = wesRatingType || label;
  1526. wesRatingType = wesRatingType.toLocaleLowerCase();
  1527. return '<tr><td>' + _(label) + '</td><td class="t-dotted_number t-dotted_number__nowidth">' +
  1528. '<span class="wes-eff-' + wesRatingType + '" id="wes-eff-' + wesRatingType + '"></span></td></tr>';
  1529. };
  1530.  
  1531. var tpl = '<div class="b-user-block wes-b-efrat">' +
  1532. '<div class="b-head-block"><h3>' + _('rating') + '</h3></div>' +
  1533. //'<table cellspacing="0" cellpadding="0" class="t-profile"><thead><tr>' +
  1534. //'<th class="wes-r-header wes-r-header__active" tabindex="0" unselectable="on" style="-moz-user-select: none;" data-rating-tab="eff">&nbsp;</th>' +
  1535. // '<th class="wes-r-header" tabindex="0" unselectable="on" style="-moz-user-select: none;" data-rating-tab="global">' + _('globalMap') + '</th>' +
  1536. // '<th class="wes-r-header" tabindex="0" unselectable="on" style="-moz-user-select: none;" data-rating-tab="rota">' + _('rota') + '</th>' +
  1537. // '<th class="wes-r-header" tabindex="0" unselectable="on" style="-moz-user-select: none;" data-rating-tab="historic">' + _('historic') + '</th>' +
  1538. // '<th class="wes-r-header" tabindex="0" unselectable="on" style="-moz-user-select: none;" data-rating-tab="graph">' + _('graph') + '</th>' +
  1539. //'</tr></thead></table>' +
  1540. '<div class="b-user-block_info clearfix" style="padding-top: 0;" data-rating-tab="eff">' +
  1541. '<div class="b-user-block_right-column">' +
  1542. '<table class="us-ratings">' +
  1543. '<tr>' +
  1544. '<td class="us-ratings-head" width="33%"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">XWN8</a></td>' +
  1545. '<td class="us-ratings-head" width="33%"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">XWN6</a></td>' +
  1546. '<td class="us-ratings-head"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">XRE</a></td>' +
  1547. '</tr>' +
  1548. '<tr>' +
  1549. '<td width="33%"><span class="wes-eff-xrwn8" id="wes-eff-xrwn8"></span></td>' +
  1550. '<td width="33%"><span class="wes-eff-xrwn6" id="wes-eff-xrwn6"></span></td>' +
  1551. '<td><span class="wes-eff-xreff" id="wes-eff-xreff"></span></td>' +
  1552. '</tr>' +
  1553. '</table>' +
  1554. '<table class="us-ratings">' +
  1555. '<tr>' +
  1556. '<td class="us-ratings-head" width="33%"><a href="#" target="_blank">XWG</a></td>' +
  1557. '<td class="us-ratings-head" width="33%"><a href="http://www.noobmeter.com/player/ru/' + wesAccount.userName + '/' + wesAccount.userId + '/" target="_blank">XPR</a></td>' +
  1558. '<td class="us-ratings-head"><a href="http://armor.kiev.ua/wot/gamerstat/' + wesAccount.userName + '" target="_blank">XBS</a></td>' +
  1559. '' +
  1560. '</tr>' +
  1561. '<tr>' +
  1562. '<td width="33%"><span class="wes-eff-xrkwg" id="wes-eff-xrkwg"></span></td>' +
  1563. '<td width="33%"><span class="wes-eff-xrnag" id="wes-eff-xrnag"></span></td>' +
  1564. '<td><span class="wes-eff-xrarmor" id="wes-eff-xrarmor"></span></td>' +
  1565. '</tr>' +
  1566. '<tr>' +
  1567. '<td class="us-ratings-head" width="33%"></td>' +
  1568. '<td class="us-ratings-head" width="33%"><a href="http://wot-noobs.ru/nubomer/?nick=' + wesAccount.userName + '" target="_blank">XNR</a></td>' +
  1569. '<td class="us-ratings-head"></td>' +
  1570. '</tr>' +
  1571. '<tr>' +
  1572. '<td width="33%">&nbsp;</td>' +
  1573. '<td width="33%"><span class="wes-eff-xrnoob" id="wes-eff-xrnoob"></span></td>' +
  1574. '<td></td>' +
  1575. '</tr>' +
  1576. '</table>' +
  1577. '<table class="t-dotted"><tbody>' +
  1578. emptyRow('rExp') + emptyRow('rDamage') + emptyRow('rFrag') +
  1579. emptyRow('rSpot') + emptyRow('rCap') + emptyRow('rDeff') +
  1580. emptyRow('treesCut') + emptyRow('lastBattle') + emptyRow('lastUpdate') +
  1581. '</tbody></table></div>' +
  1582. '<div class="b-user-block_left-column">' +
  1583. '<table class="us-ratings">' +
  1584. '<tr>' +
  1585. '<td class="us-ratings-head" width="33%"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">WN8</a></td>' +
  1586. '<td class="us-ratings-head" width="33%"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">WN6</a></td>' +
  1587. '<td class="us-ratings-head"><a href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '" target="_blank">RE</a></td>' +
  1588. '</tr>' +
  1589. '<tr>' +
  1590. '<td width="33%"><span class="wes-eff-rwn8" id="wes-eff-rwn8"></span></td>' +
  1591. '<td width="33%"><span class="wes-eff-rwn6" id="wes-eff-rwn6"></span></td>' +
  1592. '<td><span class="wes-eff-reff" id="wes-eff-reff"></span></td>' +
  1593. '</tr>' +
  1594. '</table>' +
  1595. '<table class="us-ratings">' +
  1596. '<tr>' +
  1597. '<td class="us-ratings-head" width="33%"><a href="#" target="_blank">WG</a></td>' +
  1598. '<td class="us-ratings-head" width="33%"><a href="http://www.noobmeter.com/player/ru/' + wesAccount.userName + '/' + wesAccount.userId + '/" target="_blank">PR</a></td>' +
  1599. '<td class="us-ratings-head"><a href="http://armor.kiev.ua/wot/gamerstat/' + wesAccount.userName + '" target="_blank">BS</a></td>' +
  1600. '</tr>' +
  1601. '<tr>' +
  1602. '<td width="33%"><span class="wes-eff-rkwg" id="wes-eff-rkwg"></span></td>' +
  1603. '<td width="33%"><span class="wes-eff-rnag" id="wes-eff-rnag"></span></td>' +
  1604. '<td><span class="wes-eff-rarmor" id="wes-eff-rarmor"></span></td>' +
  1605. '</tr>' +
  1606. '<tr>' +
  1607. '<td class="us-ratings-head" width="33%"></td>' +
  1608. '<td class="us-ratings-head" width="33%"><a href="http://wot-noobs.ru/nubomer/?nick=' + wesAccount.userName + '" target="_blank">NR</a></td>' +
  1609. '<td class="us-ratings-head"></td>' +
  1610. '</tr>' +
  1611. '<tr>' +
  1612. '<td width="33%"></td>' +
  1613. '<td width="33%"><span class="wes-eff-rnoob" id="wes-eff-rnoob"></span></td>' +
  1614. '<td></td>' +
  1615. '</tr>' +
  1616. '</table>' +
  1617. '<table class="t-dotted"><tbody>' +
  1618. emptyRow('rBattles') +
  1619. emptyRow('rBatteDay') + emptyRow('rMedLvl') + emptyRow('rWin') +
  1620. emptyRow('rLoose') + emptyRow('rSurv') + emptyRow('rHit') +
  1621. emptyRow('maxDamage') + emptyRow('maxFrags') + emptyRow('maxXp') +
  1622. '</tbody></table></div>' +
  1623. '</div>' +
  1624. '<div class="b-user-block_info clearfix" style="padding-top: 0; display: none;" data-rating-tab="global">' +
  1625. '<table class="t-dotted"><tbody>' +
  1626. emptyRow('rBattles', 'rGBattles') + emptyRow('rGWin') + emptyRow('rDamage', 'rGDamage') +
  1627. emptyRow('rFrag', 'rGFrag') + emptyRow('rSpot', 'rGSpot') + emptyRow('rCap', 'rGCap') +
  1628. emptyRow('rDeff', 'rGDeff') + emptyRow('rExp', 'rGExp') + emptyRow('rWin', 'rGWin') +
  1629. emptyRow('rSurv', 'rGSurv') + emptyRow('rHit', 'rGHit') +
  1630. '</tbody></table>' +
  1631. '</div>' +
  1632. '<div class="b-user-block_info clearfix" style="padding-top: 0; display: none;" data-rating-tab="rota">' +
  1633. '<table class="t-dotted"><tbody>' +
  1634. emptyRow('rBattles', 'rRBattles') + emptyRow('rGWin', 'rRWin') + emptyRow('rDamage', 'rRDamage') +
  1635. emptyRow('rFrag', 'rRFrag') + emptyRow('rSpot', 'rRSpot') + emptyRow('rCap', 'rRCap') +
  1636. emptyRow('rDeff', 'rRDeff') + emptyRow('rExp', 'rRExp') + emptyRow('rWin', 'rRWin') +
  1637. emptyRow('rSurv', 'rRSurv') + emptyRow('rHit', 'rRHit') +
  1638. '</tbody></table>' +
  1639. '</div>' +
  1640. '<div class="b-user-block_info clearfix" style="padding-top: 0; display: none;" data-rating-tab="historic">' +
  1641. '<table class="t-dotted"><tbody>' +
  1642. emptyRow('rBattles', 'rHBattles') + emptyRow('rGWin', 'rHWin') + emptyRow('rDamage', 'rHDamage') +
  1643. emptyRow('rFrag', 'rHFrag') + emptyRow('rSpot', 'rHSpot') + emptyRow('rCap', 'rHCap') +
  1644. emptyRow('rDeff', 'rHDeff') + emptyRow('rExp', 'rHExp') + emptyRow('rWin', 'rHWin') +
  1645. emptyRow('rSurv', 'rHSurv') + emptyRow('rHit', 'rHHit') +
  1646. '</tbody></table>' +
  1647. '</div>' +
  1648. '<div class="b-user-block_info clearfix" style="padding-top: 0; display: none;" data-rating-tab="graph">' +
  1649. 'ГРАФФФФОН' +
  1650. '</div>' +
  1651. '</div>';
  1652.  
  1653. var $after = $('div.wes-b-expander[data-expand=newBat]');
  1654. if ($after.length) {
  1655. $after.after(tpl);
  1656. } else {
  1657. $('div.b-user-block:first').before(tpl);
  1658. }
  1659. $('th[data-rating-tab]').click(function (e) {
  1660. e.preventDefault();
  1661. var $this = $(e.currentTarget);
  1662. $('div[data-rating-tab]').hide();
  1663. $('div[data-rating-tab=' + $this.data('rating-tab') + ']').show();
  1664. $('th.wes-r-header__active').removeClass('wes-r-header__active');
  1665. $this.addClass('wes-r-header__active');
  1666. });
  1667. };
  1668. WBNew = function () {
  1669. var me = this;
  1670.  
  1671. me.name = 'newBat';
  1672. me.options = {
  1673. start: 'div.wes-b-newbat'
  1674. };
  1675.  
  1676. me.draw();
  1677. me.wrap();
  1678. };
  1679. extend(WBNew, WrappableBlock);
  1680. WBNew.prototype.draw = function () {
  1681. var emptyRow = function (label, wesRatingType) {
  1682. wesRatingType = wesRatingType || label;
  1683. wesRatingType = wesRatingType.toLocaleLowerCase();
  1684. return '<tr><td>' + _(label) + '</td>' +
  1685. '<td class="t-dotted_number t-dotted_number__nowidth">' +
  1686. '<span class="wes-eff-' + wesRatingType + '__new" id="wes-eff-' + wesRatingType + '__new"></span></td>' +
  1687. '<td class="t-dotted_number t-dotted_number__nowidth">' +
  1688. '<span class="wes-eff-' + wesRatingType + '__old" id="wes-eff-' + wesRatingType + '__old"></span></td>' +
  1689. '<td class="t-dotted_number t-dotted_number__nowidth">' +
  1690. '<span class="wes-eff-' + wesRatingType + '__cur" id="wes-eff-' + wesRatingType + '__cur"></span></td>' +
  1691. '</tr>';
  1692. };
  1693.  
  1694. var tpl = '<div class="b-user-block wes-b-newbat">' +
  1695. '<div class="b-head-block"><h3>' + _('blockNewBat') + '</h3></div>' +
  1696. '<div class="b-user-block_info clearfix" style="padding-top: 0;">' +
  1697. '<table class="t-dotted"><tbody>' +
  1698. '<th style="width: 31%;"></th>' +
  1699. '<th style="width: 23%; text-align: right;"><h4 class="wes-h-header">' + _('new') + '</h4></th>' +
  1700. '<th style="width: 23%; text-align: right;"><h4 class="wes-h-header">' + _('hsaved') + '</h4></th>' +
  1701. '<th style="width: 23%; text-align: right;"><h4 class="wes-h-header">' + _('current') + '</h4></th>' +
  1702. emptyRow('rBattles', 'nBattles') + emptyRow('nWin') + emptyRow('rWin', 'nWinRatio') +
  1703. emptyRow('rExp', 'nExp') + emptyRow('rMedLvl', 'nMedLvl') + emptyRow('rDamage', 'nDamage') +
  1704. emptyRow('rFrag', 'nFrag') + emptyRow('rSpot', 'nSpot') + emptyRow('rCap', 'nCap') +
  1705. emptyRow('rDeff', 'nDeff') + emptyRow('rEff', 'nEff') + emptyRow('rWn6', 'nWn6') +
  1706. emptyRow('rWn8', 'nWn8') +
  1707. '</tbody></table>' +
  1708. '</div></div>';
  1709.  
  1710. var $before = $('div.wes-s-expander[data-expand=efRat]');
  1711. if ($before.length) {
  1712. $before.before(tpl);
  1713. } else {
  1714. $('div.b-user-block:first').before(tpl);
  1715. }
  1716. };
  1717.  
  1718. WBCompStat = function() {
  1719. var me = this;
  1720. me.name = 'compStat';
  1721. me.options = {
  1722. start: 'div.wes-b-compstat'
  1723. };
  1724. me.draw();
  1725. me.wrap();
  1726. };
  1727. extend(WBCompStat, WrappableBlock);
  1728. WBCompStat.prototype.draw = function () {
  1729. var emptyRow = function (label, wesRatingType) {
  1730. wesRatingType = wesRatingType || label;
  1731. wesRatingType = wesRatingType.toLocaleLowerCase();
  1732. return '<tr><td>' + _(label) + '</td>' +
  1733. '<td class="t-dotted_number t-dotted_number__nowidth">' +
  1734. '<span class="wes-eff-' + wesRatingType + '__cur" id="wes-eff-' + wesRatingType + '__cur"></span></td>' +
  1735. '<td class="t-dotted_number t-dotted_number__nowidth">' +
  1736. '<span class="wes-eff-' + wesRatingType + '__my" id="wes-eff-' + wesRatingType + '__me"></span></td>' +
  1737. '</tr>';
  1738. };
  1739. var tpl = '<div class="b-user-block wes-b-compstat">' + '<div class="b-head-block"><h3>' + _('blockCompStat') + '</h3></div>' +
  1740. '<div class="b-user-block_info clearfix" style="padding-top: 0;">' +
  1741. '<table class="t-dotted"><tbody>' +
  1742. '<th style="width: 33%;"></th>' +
  1743. '<th style="width: 33%; text-align: right;"><h4 class="wes-h-header">' + _('player') + '</h4></th>' +
  1744. '<th style="width: 33%; text-align: right;"><h4 class="wes-h-header">' + _('me') + '</h4></th>' +
  1745. emptyRow('rBattles', 'nBattles') + emptyRow('nWin') + emptyRow('rWin', 'nWinRatio') +
  1746. emptyRow('rExp', 'nExp') + emptyRow('rMedLvl', 'nMedLvl') + emptyRow('rDamage', 'nDamage') +
  1747. emptyRow('rFrag', 'nFrag') + emptyRow('rSpot', 'nSpot') + emptyRow('rCap', 'nCap') +
  1748. emptyRow('rDeff', 'nDeff') + emptyRow('rEff', 'nEff') + emptyRow('rWn6', 'nWn6') +
  1749. emptyRow('rWn8', 'nWn8') +
  1750. '</tbody></table>' +
  1751. '</div></div>';
  1752. var $before = $('div.wes-s-expander[data-expand=pers]');
  1753. if (!$before.length) {
  1754. var $before = $('div.wes-s-expander[data-expand=speed]');
  1755. }
  1756. if ($before.length) {
  1757. $before.before(tpl);
  1758. } else {
  1759. $('div.b-user-block:first').before(tpl);
  1760. }
  1761. }
  1762. function SBNewBattles(saveDate) {
  1763. var me = this;
  1764.  
  1765. me.saveDate = saveDate || wesGeneral.formattedDate(new Date());
  1766. me.cssSet = false;
  1767.  
  1768. if (me.saveDate) {
  1769. me.draw();
  1770. }
  1771. }
  1772.  
  1773. SBNewBattles.prototype.draw = function () {
  1774. var me = this,
  1775. tpl = '<div class="wes-sb-new"><div class="b-sidebar-widget clearfix">' +
  1776. '<div class="b-sidebar-widget_inner" style="text-align: center; padding: 15px;">' +
  1777. '<h2 class="b-sidebar-widget_title" id="sb-nb-title">' + _('blockNewBat') + '</h2>' +
  1778. '<div><span id="sb-rb"></span>' +
  1779. '<span id="sb-nw" style="padding-left: 10px;"></span>' +
  1780. '<span id="sb-rw"></span></div><br>' +
  1781. '<div class="currency-all" style="display:none;"><span class="currency-gold" id="sb-gold" style="margin: 10px; display: none;"></span>' +
  1782. '<span class="currency-credit" id="sb-credit" style="margin: 10px; display: none;"></span>' +
  1783. '<span class="currency-experience" id="sb-experience" style="margin: 10px; display: none;"></span></div><br>' +
  1784. '<table class="us-ratings" style="width: 100%;"><tr>' +
  1785. '<td width="20%" class="us-ratings-head"><a target="_blank" ' +
  1786. 'href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '">WN8</a></td>' +
  1787. '<td width="20%" class="us-ratings-head"><a target="_blank" ' +
  1788. 'href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '">WN6</a></td>' +
  1789. '<td width="20%" class="us-ratings-head"><a target="_blank" ' +
  1790. 'href="http://wot-news.com/index.php/stat/calc/ru/ru/' + wesAccount.userName + '">RE</a></td>' +
  1791. '<td width="20%" class="us-ratings-head"><a target="_blank" ' +
  1792. 'href="http://www.noobmeter.com/player/ru/' + wesAccount.userName + '/' + wesAccount.userId + '/">PR</a></td>' +
  1793. '</tr><tr>' +
  1794. '<td width="20%" id="sb-wn8"></td><td width="20%" id="sb-wn6"></td><td width="20%" id="sb-re"></td><td width="20%" id="sb-pr"></td>' +
  1795. '</tr><tr>' +
  1796. '<td width="20%" id="sb-xwn8"></td><td width="20%" id="sb-xwn6"></td><td width="20%" id="sb-xre"></td><td width="20%" id="sb-xpr"></td>' +
  1797. '</tr></table><br><span>' + _('medals') + ':</span><br>' +
  1798. '<span id="sb-medals"></span><br>' +
  1799. // '<span>' + _('blockVeh') + ':</span><br>' +
  1800. // '<span id="sb-tanks"></span>' +
  1801. '</div></div></div>';
  1802.  
  1803. $('div.l-sidebar').append(tpl);
  1804.  
  1805. var $elem = $('div.wes-sb-new');
  1806. me.positionTop = $elem.offset().top;
  1807. me.$elem = $elem;
  1808. me.width = $elem.innerWidth();
  1809. $(window).scroll(function (e) {
  1810. me.onScroll(e);
  1811. });
  1812. };
  1813. SBNewBattles.prototype.onScroll = function (e) {
  1814. var me = this,
  1815. offY = $(window).scrollTop();
  1816. if (offY > me.positionTop) {
  1817. if (!me.cssSet) {
  1818. me.$elem.css({
  1819. 'position': 'fixed',
  1820. 'top': '10px',
  1821. 'width': me.width
  1822. });
  1823. me.cssSet = true;
  1824. }
  1825. } else {
  1826. if (me.cssSet) {
  1827. me.$elem.css({
  1828. 'position': 'relative',
  1829. 'top': 0
  1830. });
  1831. me.cssSet = false;
  1832. }
  1833. }
  1834. };
  1835.  
  1836. //Тут функции и методы для отрисовки на странице профиля
  1837. wesAccount = {
  1838. 'userId': parseInt(window.location.href.match(/\/(\d+)/)[1]),
  1839. 'userName': document.getElementById("js-profile-name").innerHTML,
  1840. 'curApiStat': false,
  1841. 'curApiTanks': false,
  1842. 'curStat': {},
  1843. addScriptInfo: function () {
  1844. var sInfoDiv = document.createElement("div"), timeDiv = $('.b-profile-name')[0];
  1845. sInfoDiv.innerHTML = '<p>' + _('scriptVersion') + ' <br></p><p>' +
  1846. '<a href="#" id="wes-show-settings">' + _('settings') + '</a></p>';
  1847. timeDiv.appendChild(sInfoDiv);
  1848. },
  1849. paintUsersNewBattles: function (resp) {
  1850. if (resp['status'] === 'ok') {
  1851. var keys = Object.keys(resp['data']), key, i, lastStat, oldBat,
  1852. newBat, oldWin, newWin, newB, newW, nDate, mText = '', saveStat = false;
  1853. for (i = 0; i < keys.length; i++) {
  1854. key = keys[i];
  1855. if (parseInt(key) !== wesSettings.myID) {
  1856. mText = '';
  1857. lastStat = wesGeneral.getUserLastStat(key);
  1858. if (lastStat) {
  1859. oldBat = parseInt(lastStat['battles']);
  1860. newBat = parseInt(resp['data'][key]['statistics']['all']['battles']);
  1861. oldWin = parseInt(lastStat['wins']);
  1862. newWin = parseInt(resp['data'][key]['statistics']['all']['wins']);
  1863. newB = newBat - oldBat;
  1864. newW = newWin - oldWin;
  1865. if (oldBat !== newBat) {
  1866. $('#wes-menu-' + key).css({
  1867. 'background-position': '0 10px'
  1868. });
  1869. $('#wes-menu-' + key + ' > span').append(' <span class="wes-s-newcounter">+' + newB + '</span>');
  1870. }
  1871. mText += '<p>' + _("player") + ': ' + resp['data'][key]['nickname'] + '</p>';
  1872. if (wesSettings['players'][key].startsWith(_("player"))) {
  1873. wesSettings['players'][key] = resp['data'][key]['nickname'];
  1874. saveStat = true;
  1875. }
  1876. nDate = new Date(parseInt(lastStat['time']));
  1877. mText += '<p>' + _("saved") + ': ' + wesGeneral.formattedDate(nDate) + '</p>';
  1878. nDate = new Date(parseInt(resp['data'][key]['updated_at']) * 1000);
  1879. mText += '<p>' + _("lastUpdate") + ' ' + wesGeneral.formattedDate(nDate) + '</p>';
  1880. nDate = new Date(parseInt(resp['data'][key]['last_battle_time']) * 1000);
  1881. mText += '<p>' + _("lastBattle") + ' ' + wesGeneral.formattedDate(nDate) + '</p>';
  1882. if (newB > 0) {
  1883. mText += '<p>' + _("battles") + ': ' + newB + '</p>';
  1884. mText += '<p>' + _("wins") + ': ' + newW + ' (' + (newW / newB * 100).toFixed(2) + '%)</p>';
  1885. }
  1886. $('#wes-menu-' + key + '_tooltip').html(mText);
  1887. }
  1888. }
  1889. }
  1890. if (saveStat) wesGeneral.setLSData('wesSettings', wesSettings);
  1891. }
  1892. },
  1893. getUsersNewBattles: function () {
  1894. var uIds = Object.keys(wesSettings.players).join(",");
  1895. if (uIds !== '')
  1896. $.get("http://api." + document.location.host + "/wot/account/info/",
  1897. {
  1898. 'application_id': wesApiKey,
  1899. 'type': "jsonp",
  1900. 'callback': "?",
  1901. "account_id": uIds
  1902. }, this.paintUsersNewBattles, "json");
  1903. },
  1904. createUserMenu: function () {
  1905. var mtext = "<li><a id='wes-save-stat' href='#'>" + _("saveStat") + "</a></li>",
  1906. uIds = Object.keys(wesSettings.players),
  1907. serv = wesGeneral.getServ(),
  1908. key, i, fake_div;
  1909. if (uIds.length > 0) {
  1910. mtext += "<br>";
  1911. for (i = 0; i < uIds.length; i++) {
  1912. key = parseInt(uIds[i]);
  1913. mtext += '<li><a id="wes-menu-' + key + '" class="js-tooltip" href="http://worldoftanks.' +
  1914. serv + '/community/accounts/' + key + '/">' +
  1915. (key === this.userId ? '<span style="color:green;">' : '<span>') + wesSettings.players[key] +
  1916. '</span></a><div class="b-tooltip-main" id="wes-menu-' + key + '_tooltip"></div></li>';
  1917. }
  1918. }
  1919. mtext += "<br>";
  1920. if (wesSettings.players[this.userId])
  1921. mtext += '<li><a id="wes-remove-stat" href="#">' + _("delStat") + '</a></li>';
  1922. fake_div = document.createElement("div");
  1923. fake_div.innerHTML = mtext;
  1924. $(".b-context-menu-list__bottomindent")[0].appendChild(fake_div);
  1925. this.getUsersNewBattles();
  1926. },
  1927. createChangeStat: function (statArr) {
  1928. var tpl = '<p>' + _('statFrom') + ': <a data-wshowed="0" href="#" class="b-link-fake b-link-fake__gray" id="show-wes-select">' +
  1929. wesGeneral.formattedDate(new Date(statArr[statArr.length - 1]['time'])) + '</a>', i;
  1930. tpl += '</p><div class="l-choose-dropdown js-date-popup" id="wes-select" style="display: none; left: 62.5px; top: 141.1667px;">' +
  1931. '<ul class="b-choose-dropdown">';
  1932. for (i = statArr.length - 1; i >= 0; i--) {
  1933. tpl +=
  1934. '<li class="js-ch-li b-choose-dropdown_item js-date-popup-li' + ((i == statArr.length - 1) ? ' b-choose-dropdown_item__active' : '') + '">' +
  1935. '<a data-stind="' + i + '" class="b-choose-dropdown_link wes-ch-date" href="#">' +
  1936. '<span class="js-date-format-utc">' + wesGeneral.formattedDate(new Date(statArr[i]['time'])) + '</span></a></li>';
  1937. }
  1938. tpl += '</ul><div class="b-choose-dropdown_arrow"></div></div>';
  1939. $('#wes-show-settings').parent().parent().after(tpl);
  1940. $('#show-wes-select').click(function (e) {
  1941. e.preventDefault();
  1942. if ($(this).attr('data-wshowed') == 0) {
  1943. $('#wes-select').show("fast");
  1944. $(this).attr('data-wshowed', 1);
  1945. } else {
  1946. $('#wes-select').hide("fast");
  1947. $(this).attr('data-wshowed', 0);
  1948. }
  1949. });
  1950. $(document).click(function (event) {
  1951. if ($(event.target).closest("#show-wes-select").length) return;
  1952. $('#wes-select').hide("fast");
  1953. $("#show-wes-select").attr('data-wshowed', 0);
  1954. event.stopPropagation();
  1955. });
  1956. $('.wes-ch-date').click(function (e) {
  1957. e.preventDefault();
  1958. $('.js-ch-li').removeClass('b-choose-dropdown_item__active');
  1959. $(this).parent().addClass('b-choose-dropdown_item__active');
  1960. $('#show-wes-select').html($(this).find("span:first").html());
  1961. wesAccount.paintCurPage(parseInt($(this).attr('data-stind')));
  1962. });
  1963. },
  1964. fillCurStat: function () {
  1965. function addData1(resp) {
  1966. if (resp['status'] === 'ok') {
  1967. var keys = Object.keys(resp['data']), key, i, j;
  1968. for (i = 0; i < keys.length; i++) {
  1969. key = keys[i];
  1970. wesAccount.curApiStat = resp['data'][key];
  1971. var apikeys = Object.keys(resp['data'][key]['statistics']['all']), apikey;
  1972. for (j = 0; j < apikeys.length; j++) {
  1973. apikey = apikeys[j];
  1974. wesAccount.curStat[apikey] = resp['data'][key]['statistics']['all'][apikey];
  1975. }
  1976. for (j = 0; j < stTypeKeys.length; j++) {
  1977. apikey = stTypeKeys[j];
  1978. wesAccount.curStat[apikey] = resp['data'][key]['statistics'][apikey];
  1979. wesAccount.curStat[apikey]['tanks'] = {};
  1980. }
  1981. var cEl = document.getElementsByClassName("b-userblock-wrpr")[0].getElementsByClassName("currency-credit")[0];
  1982. cEl = cEl ? cEl.innerHTML : NaN;
  1983. wesAccount.curStat['credit'] = wesGeneral.toFl(cEl);
  1984. cEl = document.getElementsByClassName("b-userblock-wrpr")[0].getElementsByClassName("currency-experience")[0];
  1985. cEl = cEl ? cEl.innerHTML : NaN;
  1986. wesAccount.curStat['exp'] = wesGeneral.toFl(cEl);
  1987. cEl = document.getElementsByClassName("b-userblock-wrpr")[0].getElementsByClassName("currency-gold")[0];
  1988. cEl = cEl ? cEl.innerHTML : NaN;
  1989. wesAccount.curStat['gold'] = wesGeneral.toFl(cEl);
  1990. wesAccount.curStat['medals'] = {};
  1991. wesAccount.curStat['tanks'] = {};
  1992. wesAccount.curStat['time'] = (new Date()).getTime();
  1993. wesAccount.curStat['wgRating'] = parseInt(resp['data'][key]['global_rating']);
  1994. }
  1995. $.get("http://api." + document.location.host + "/wot/account/achievements/",
  1996. {
  1997. 'application_id': wesApiKey,
  1998. 'type': "jsonp",
  1999. 'callback': "?",
  2000. "account_id": wesAccount.userId
  2001. }, addData2, "json");
  2002. }
  2003. }
  2004.  
  2005. function addData2(resp) {
  2006. if (resp['status'] === 'ok') {
  2007. var keys = Object.keys(resp['data']), key, i;
  2008. for (i = 0; i < keys.length; i++) {
  2009. key = keys[i];
  2010. for (var mkey in resp['data'][key]['achievements'])
  2011. wesAccount.curStat['medals'][mkey] = parseInt(resp['data'][key]['achievements'][mkey]);
  2012. for (mkey in resp['data'][key]['max_series'])
  2013. wesAccount.curStat['medals'][mkey] = parseInt(resp['data'][key]['max_series'][mkey]);
  2014. }
  2015. $.get("http://api." + document.location.host + "/wot/tanks/stats/",
  2016. {
  2017. 'application_id': wesApiKey,
  2018. 'type': "jsonp",
  2019. 'callback': "?",
  2020. "account_id": wesAccount.userId,
  2021. "fields": "tank_id, all.battles, all.wins, all.damage_dealt, all.spotted, all.frags, all.capture_points, all.dropped_capture_points," +
  2022. "clan.battles, clan.wins, clan.damage_dealt, clan.spotted, clan.frags, clan.capture_points, clan.dropped_capture_points," +
  2023. "company.battles, company.wins, company.damage_dealt, company.spotted, company.frags, company.capture_points, company.dropped_capture_points," +
  2024. "stronghold_skirmish.battles, stronghold_skirmish.wins, stronghold_skirmish.damage_dealt, stronghold_skirmish.spotted, stronghold_skirmish.frags, stronghold_skirmish.capture_points, stronghold_skirmish.dropped_capture_points," +
  2025. "stronghold_defense.battles, stronghold_defense.wins, stronghold_defense.damage_dealt, stronghold_defense.spotted, stronghold_defense.frags, stronghold_defense.capture_points, stronghold_defense.dropped_capture_points," +
  2026. "team.battles, team.wins, team.damage_dealt, team.spotted, team.frags, team.capture_points, team.dropped_capture_points",
  2027. }, addData3, "json");
  2028. }
  2029. }
  2030.  
  2031. function addData3(resp) {
  2032. if (resp['status'] === 'ok') {
  2033. wesAccount.curApiTanks = resp;
  2034. var keys = Object.keys(resp['data']), key, i, j, k, tank, apikey;
  2035. for (i = 0; i < keys.length; i++) {
  2036. key = keys[i];
  2037. for (j = 0; j < resp['data'][key].length; j++) {
  2038. tank = resp['data'][key][j];
  2039. if (parseInt(tank['all']['battles']) > 0) {
  2040. wesAccount.curStat['tanks'][parseInt(tank['tank_id'])] = {
  2041. 'b': tank['all']['battles'],
  2042. 'w': tank['all']['wins'],
  2043. 'd': tank['all']['damage_dealt'],
  2044. 's': tank['all']['spotted'],
  2045. 'f': tank['all']['frags'],
  2046. 'c': tank['all']['capture_points'],
  2047. 'p': tank['all']['dropped_capture_points']
  2048. };
  2049. };
  2050. for (k = 0; k < stTypeKeys.length; k++) {
  2051. apikey = stTypeKeys[k];
  2052. if (parseInt(tank[apikey]['battles']) > 0) {
  2053. wesAccount.curStat[apikey]['tanks'][parseInt(tank['tank_id'])] = {
  2054. 'b': tank[apikey]['battles'],
  2055. 'w': tank[apikey]['wins'],
  2056. 'd': tank[apikey]['damage_dealt'],
  2057. 's': tank[apikey]['spotted'],
  2058. 'f': tank[apikey]['frags'],
  2059. 'c': tank[apikey]['capture_points'],
  2060. 'p': tank[apikey]['dropped_capture_points']
  2061. };
  2062. }
  2063. }
  2064. }
  2065. }
  2066. $.get('http://wot-noobs.ru/nubomer/?nick=' + wesAccount.userName
  2067. ,function (data) {
  2068. var regexp = /<div class="kpd">(\d*\.*\d*)+<\/div>/gi,
  2069. res = regexp.exec(data);
  2070. if (res && res.length > 0) {
  2071. wesAccount.curStat['noobRat'] = Number(res[1]);
  2072. wesAccount.main();
  2073. }
  2074. }
  2075. , "html");
  2076. }
  2077. }
  2078.  
  2079. $.get("http://api." + document.location.host + "/wot/account/info/",
  2080. {
  2081. 'application_id': wesApiKey,
  2082. 'type': "jsonp",
  2083. 'callback': "?",
  2084. "account_id": wesAccount.userId
  2085. }, addData1, "json");
  2086. },
  2087. FoundProc: function (Wins, Battles, digit, inv) {
  2088. var curPerc = (Wins / Battles * 100.0),
  2089. color = "90ffff",
  2090. nextD3 = Math.ceil(Wins / Battles * 100 + 0.5) - 0.5,
  2091. nextD1 = nextD3 - 1,
  2092. nextD2 = nextD3 - 0.5,
  2093. need_b1 = Math.floor(Battles - Wins * 100 / nextD1);
  2094. if (100 * Wins / Battles > nextD2)
  2095. var need_b2 = Math.floor(Battles - Wins * 100 / nextD2);
  2096. else
  2097. need_b2 = Math.ceil((nextD2 * Battles - Wins * 100) / (100 - nextD2));
  2098. var need_b3 = Math.ceil((nextD3 * Battles - Wins * 100) / (100 - nextD3));
  2099. if (inv) {
  2100. var v = 100 - curPerc;
  2101. } else {
  2102. v = curPerc;
  2103. }
  2104. if (digit)
  2105. curPerc = curPerc.toFixed(digit);
  2106. if (v < 101)
  2107. color = "D042F3";
  2108. if (v < 64.9)
  2109. color = "02C9B3";
  2110. if (v < 56.9)
  2111. color = "60FF00";
  2112. if (v < 51.9)
  2113. color = "F8F400";
  2114. if (v < 48.9)
  2115. color = "FE7903";
  2116. if (v < 46.9)
  2117. color = "FE0E00";
  2118. return ["<font color='" + color + "'>" + curPerc + "%</font>", Wins + "<font color='red'>/</font> <font color='green'>" + Battles + "</font><br>" + nextD1 + "% (" + need_b1 + ")<br>" + nextD2 + "% (" + need_b2 + ")<br>" + nextD3 + "% (" + need_b3 + ")"];
  2119. },
  2120. diffText: function (newVal, oldVal, fcol, withNewVal, inv) {
  2121. var diff = parseFloat(newVal) - parseFloat(oldVal), tcol1, tcol2;
  2122. if (fcol == undefined) {
  2123. fcol = 2;
  2124. }
  2125. if (withNewVal == undefined) {
  2126. withNewVal = true;
  2127. }
  2128. if (inv == undefined) {
  2129. inv = false;
  2130. }
  2131. if (!diff || parseFloat(diff.toFixed(fcol)) == 0) {
  2132. return (withNewVal ? newVal : '');
  2133. }
  2134. tcol1 = inv ? 'red' : 'green';
  2135. tcol2 = inv ? 'green' : 'red';
  2136. if (diff > 0) {
  2137. return (withNewVal ? newVal : '') + '<span class="wes-s-newcounter" style="color:' + tcol1 + ';">+' + diff.toFixed(fcol) + '</span>';
  2138. } else {
  2139. return (withNewVal ? newVal : '') + '<span class="wes-s-newcounter" style="color: ' + tcol2 + ';">' + diff.toFixed(fcol) + '</span>';
  2140. }
  2141. },
  2142. setRatingValue: function (wesRatingType, value, color, tooltip) {
  2143. wesRatingType = wesRatingType.toLocaleLowerCase();
  2144. color = color || 'default';
  2145. var $span = $('span.wes-eff-' + wesRatingType);
  2146. $span.html(value);
  2147. if (color && color != 'default') {
  2148. $span.css({'color': color});
  2149. }
  2150. if (tooltip) {
  2151. this.createTooltip($span, tooltip);
  2152. }
  2153. },
  2154. createTooltip: function (elem, tooltip) {
  2155. var $elem = $(elem),
  2156. hintName = $elem.attr('id') + '_tooltip';
  2157. if (typeof tooltip === 'boolean' && !tooltip) {
  2158. $('div.' + hintName).remove();
  2159. $elem.removeClass('js-tooltip');
  2160. } else if (typeof tooltip === 'string') {
  2161. $elem.after('<div id="' + hintName + '" class="b-tooltip-main"><span>' +
  2162. tooltip + '</span></div>'
  2163. ).addClass('js-tooltip');
  2164. }
  2165. },
  2166. paintCurPage: function (statIndex) {
  2167. var curRating = wesGeneral.ratings(wesAccount.curStat),
  2168. oldStat,
  2169. oldRating,
  2170. oldDaypassed,
  2171. savedStat = wesGeneral.getLSData('wes_' + this.userId),
  2172. newStat = false,
  2173. daypassed = (new Date() - new Date(document.getElementsByClassName("js-date-format")[0].getAttribute("data-timestamp") * 1000)) / 1000 / 60 / 60 / 24,
  2174. myStat = wesGeneral.getLSData('wes_' + wesSettings.myID),
  2175. myLastStat = myStat ? myStat[myStat.length - 1] : false;
  2176. myRating = myLastStat? wesGeneral.ratings(myLastStat) : false;
  2177. if (statIndex >= 0) {
  2178. oldStat = savedStat[statIndex];
  2179. } else {
  2180. oldStat = savedStat ? savedStat[savedStat.length - 1] : false;
  2181. }
  2182. oldDaypassed = oldStat ? (oldStat['time'] - new Date(document.getElementsByClassName("js-date-format")[0].getAttribute("data-timestamp") * 1000)) / 1000 / 60 / 60 / 24 : false;
  2183. oldRating = (oldStat && (wesAccount.curStat.battles > oldStat.battles)) ? wesGeneral.ratings(oldStat) : curRating;
  2184. if (wesAccount.curStat.battles == oldStat.battles) {
  2185. $('div.wes-sb-new').css({'display': 'none'});
  2186. $('div.wes-s-expander[data-expand=newBat]').css({'display': 'none'});
  2187. $('div.wes-b-newbat').parent().css({'display': 'none'});
  2188. } else {
  2189. $('div.wes-sb-new').css({'display': 'block'});
  2190. $('div.wes-s-expander[data-expand=newBat]').css({'display': 'block'});
  2191. $('div.wes-b-newbat').parent().css({'display': 'block'});
  2192. }
  2193. if (this.userId == wesSettings.myID || myStat == undefined) {
  2194. $('div.wes-s-expander[data-expand=compStat]').css({'display': 'none'});
  2195. $('div.wes-b-compstat').parent().css({'display': 'none'});
  2196. } else {
  2197. $('div.wes-s-expander[data-expand=compStat]').css({'display': 'block'});
  2198. $('div.wes-b-compstat').parent().css({'display': 'block'});
  2199. }
  2200. if (oldStat) {
  2201. $('#sb-nb-title').html(_('blockNewBat'));
  2202. $('#sb-rb').html(_('rBattles') + ': ' + (wesAccount.curStat.battles - oldStat.battles));
  2203. $('#sb-nw').html(_('nWin') + ': ' + (wesAccount.curStat.wins - oldStat.wins));
  2204. if (wesAccount.curStat.wins - oldStat.wins != 0) {
  2205. newStat = {'tanks': {}, 'wgRating': 0,
  2206. 'clan': {
  2207. 'battles': 0, 'capture_points': 0, 'damage_dealt': 0, 'dropped_capture_points': 0, 'draws': 0, 'frags': 0, 'spotted': 0,
  2208. 'wins': 0, 'xp': 0
  2209. }, 'company': {
  2210. 'battles': 0, 'capture_points': 0, 'damage_dealt': 0, 'dropped_capture_points': 0, 'draws': 0, 'frags': 0, 'spotted': 0,
  2211. 'wins': 0, 'xp': 0
  2212. }};
  2213. newStat['wins'] = parseInt(wesAccount.curStat.wins) - parseInt(oldStat.wins);
  2214. newStat['battles'] = parseInt(wesAccount.curStat.battles) - parseInt(oldStat.battles);
  2215. newStat['capture_points'] = parseInt(wesAccount.curStat.capture_points) - parseInt(oldStat.capture_points);
  2216. newStat['damage_dealt'] = parseInt(wesAccount.curStat.damage_dealt) - parseInt(oldStat.damage_dealt);
  2217. newStat['dropped_capture_points'] = parseInt(wesAccount.curStat.dropped_capture_points) - parseInt(oldStat.dropped_capture_points);
  2218. newStat['frags'] = parseInt(wesAccount.curStat.frags) - parseInt(oldStat.frags);
  2219. newStat['spotted'] = parseInt(wesAccount.curStat.spotted) - parseInt(oldStat.spotted);
  2220. newStat['xp'] = parseInt(wesAccount.curStat.xp) - parseInt(oldStat.xp);
  2221. var newWinVal = this.FoundProc(newStat['wins'], newStat['battles'], 2, false);
  2222. $('#sb-rw').html(' (' + newWinVal[0] + ')');
  2223. var medalsText = '<ul class="b-achivements clearfix" style="background: none; margin: 0 -10px 0 0; padding: 0;">',
  2224. tanksText = '<ul class="b-achivements clearfix" style="background: none; margin: 0 -10px 0 0; padding: 0;">';
  2225. if (wesAccount.curStat.medals) {
  2226. for (var medal in wesAccount.curStat.medals) {
  2227. var medLi = $('#js-achivement-' + medal),
  2228. medToolip = $('#js-achivement-' + medal + '_tooltip');
  2229. if (medLi && medToolip) {
  2230. var cMCount = 0;
  2231. if (oldStat.medals && medal in oldStat.medals && wesAccount.curStat.medals[medal] != oldStat.medals[medal]) {
  2232. cMCount = parseInt(wesAccount.curStat.medals[medal]) - parseInt(oldStat.medals[medal]);
  2233. } else if (oldStat.medals == undefined || !(medal in oldStat.medals)){
  2234. cMCount = parseInt(wesAccount.curStat.medals[medal]);
  2235. }
  2236. if (cMCount > 0) {
  2237. medalsText += '<li id="wes-sb-' + medal + '" class="b-achivements_item js-tooltip" style="margin: 10px 10px 0 0;">' +
  2238. '<img width="34" height="36" src="' + medLi.find('img:first').attr('src') + '">' +
  2239. '<div class="b-achivements_wrpr"><span class="b-achivements_num">' +
  2240. ((cMCount > 1) ? '<span style="font-size: 60%;">' + cMCount + '</span>' : '') +
  2241. '</span></div>' +
  2242. '</li><div class="b-tooltip-main" id="wes-sb-' + medal + '_tooltip">' + medToolip.html() + '</div>';
  2243. }
  2244. }
  2245. }
  2246. }
  2247. if (oldStat.tanks != undefined) {
  2248. for (var tank in wesAccount.curStat.tanks) {
  2249. var tankTd = $('tr[data-vehicle-cd=' + tank + ']').prev(), newBattles = 0, newWins = 0;
  2250. if (tank in oldStat.tanks) {
  2251. newBattles = parseInt(wesAccount.curStat.tanks[tank].b) - parseInt(oldStat.tanks[tank].b);
  2252. newWins = parseInt(wesAccount.curStat.tanks[tank].w) - parseInt(oldStat.tanks[tank].w);
  2253. } else {
  2254. newBattles = parseInt(wesAccount.curStat.tanks[tank].b);
  2255. newWins = parseInt(wesAccount.curStat.tanks[tank].w)
  2256. }
  2257. if (tankTd && newBattles > 0) {
  2258. newStat['tanks'][tank] = {
  2259. 'b': parseInt(wesAccount.curStat.tanks[tank].b) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].b) : 0),
  2260. 'w': parseInt(wesAccount.curStat.tanks[tank].w) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].w) : 0),
  2261. 'd': parseInt(wesAccount.curStat.tanks[tank].d) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].d) : 0),
  2262. 's': parseInt(wesAccount.curStat.tanks[tank].s) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].s) : 0),
  2263. 'f': parseInt(wesAccount.curStat.tanks[tank].f) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].f) : 0),
  2264. 'c': parseInt(wesAccount.curStat.tanks[tank].c) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].c) : 0),
  2265. 'p': parseInt(wesAccount.curStat.tanks[tank].p) - ((tank in oldStat.tanks) ? parseInt(oldStat.tanks[tank].p) : 0)
  2266. };
  2267. var winVal = this.FoundProc(newWins, newBattles, 2, false);
  2268. tanksText += '<li id="wes-sb-tank-' + tank + '" class="b-achivements_item js-tooltip" style="margin: 10px 10px 4px 0; padding-bottom: 12px;">' +
  2269. '<img width="61" height="17" src="' + tankTd.find('td:first').find('img:first').attr('src') + '">' +
  2270. '<div class="b-achivements_wrpr" style="bottom: -2px;"><span class="b-achivements_num">' +
  2271. '<span style="font-size: 60%;">' + newWins + '/' + newBattles + ' (' + winVal[0] + ')</span></span></div>' +
  2272. '</li><div class="b-tooltip-main" id="wes-sb-tank-' + tank + '_tooltip">' + tankTd.find('td:first').find('.b-name-vehicle').html() + '</div>';
  2273. }
  2274. }
  2275. }
  2276. medalsText += '</ul>';
  2277. tanksText += '</ul>';
  2278. $('#sb-medals').html(medalsText);
  2279. // $('#sb-tanks').html(tanksText);
  2280. var newRating = wesGeneral.ratings(newStat);
  2281. $('#sb-wn8').html('<span style="color: #' + newRating['wn8']['color'] + '">' + newRating['wn8']['value'] + '</span>');
  2282. $('#sb-wn6').html('<span style="color: #' + newRating['wn6']['color'] + '">' + newRating['wn6']['value'] + '</span>');
  2283. $('#sb-re').html('<span style="color: #' + newRating['eff']['color'] + '">' + newRating['eff']['value'] + '</span>');
  2284. $('#sb-pr').html('<span style="color: #' + newRating['pr']['color'] + '">' + newRating['pr']['value'] + '</span>');
  2285. $('#sb-xwn8').html('<span style="color: #' + newRating['wn8']['color'] + '">' + newRating['wn8']['xvm'] + '</span>');
  2286. $('#sb-xwn6').html('<span style="color: #' + newRating['wn6']['color'] + '">' + newRating['wn6']['xvm'] + '</span>');
  2287. $('#sb-xre').html('<span style="color: #' + newRating['eff']['color'] + '">' + newRating['eff']['xvm'] + '</span>');
  2288. $('#sb-xpr').html('<span style="color: #' + newRating['pr']['color'] + '">' + newRating['pr']['xvm'] + '</span>');
  2289. }
  2290. if (oldStat['gold'] && wesAccount.curStat['gold']) {
  2291. var curVal = parseInt(wesAccount.curStat['gold']) - parseInt(oldStat['gold']);
  2292. if (curVal) {
  2293. curVal = curVal > 0 ? '+' + curVal : '' + curVal;
  2294. $('#sb-gold').html(curVal).show();
  2295. }
  2296. }
  2297. if (oldStat['credit'] && wesAccount.curStat['credit']) {
  2298. curVal = parseInt(wesAccount.curStat['credit']) - parseInt(oldStat['credit']);
  2299. if (curVal) {
  2300. curVal = curVal > 0 ? '+' + curVal : '' + curVal;
  2301. $('#sb-credit').html(curVal).show();
  2302. }
  2303. }
  2304. if (oldStat['exp'] && wesAccount.curStat['exp']) {
  2305. curVal = parseInt(wesAccount.curStat['exp']) - parseInt(oldStat['exp']);
  2306. if (curVal) {
  2307. curVal = curVal > 0 ? '+' + curVal : '' + curVal;
  2308. $('#sb-experience').html(curVal).show();
  2309. }
  2310. }
  2311. if ((oldStat['gold'] && wesAccount.curStat['gold']) ||
  2312. (oldStat['credit'] && wesAccount.curStat['credit']) ||
  2313. (oldStat['exp'] && wesAccount.curStat['exp'])) {
  2314. $('div.currency-all').show();
  2315. }
  2316. }
  2317. this.setRatingValue('rWn8',
  2318. oldRating ? this.diffText(curRating['wn8']['value'], oldRating['wn8']['value']) : curRating['wn8']['value'],
  2319. '#' + curRating['wn8']['color'], curRating['wn8']['stepToNL']);
  2320. this.setRatingValue('rWn6',
  2321. oldRating ? this.diffText(curRating['wn6']['value'], oldRating['wn6']['value']) : curRating['wn6']['value'],
  2322. '#' + curRating['wn6']['color'], curRating['wn6']['stepToNL']);
  2323. this.setRatingValue('rEff',
  2324. oldRating ? this.diffText(curRating['eff']['value'], oldRating['eff']['value']) : curRating['eff']['value'],
  2325. '#' + curRating['eff']['color'], curRating['eff']['stepToNL']);
  2326. this.setRatingValue('rKwg',
  2327. oldRating ? this.diffText(curRating['wg']['value'], oldRating['wg']['value'], 0) : curRating['wg']['value'],
  2328. '#' + curRating['wg']['color'], curRating['wg']['stepToNL']);
  2329. this.setRatingValue('rNag',
  2330. oldRating ? this.diffText(curRating['pr']['value'], oldRating['pr']['value']) : curRating['pr']['value'],
  2331. '#' + curRating['pr']['color'], curRating['pr']['stepToNL']);
  2332. this.setRatingValue('rArmor',
  2333. oldRating ? this.diffText(curRating['bs']['value'], oldRating['bs']['value']) : curRating['bs']['value'],
  2334. '#' + curRating['bs']['color'], curRating['bs']['stepToNL']);
  2335. this.setRatingValue('rNoob',
  2336. oldRating ? this.diffText(curRating['noob']['value'], oldRating['noob']['value']) : curRating['noob']['value'],
  2337. '#' + curRating['noob']['color'], curRating['noob']['stepToNL']);
  2338.  
  2339. this.setRatingValue('xrWn8',
  2340. oldRating ? this.diffText(curRating['wn8']['xvm'], oldRating['wn8']['xvm']) : curRating['wn8']['xvm'],
  2341. '#' + curRating['wn8']['color'], curRating['wn8']['xvmStepToNL']);
  2342. this.setRatingValue('xrWn6',
  2343. oldRating ? this.diffText(curRating['wn6']['xvm'], oldRating['wn6']['xvm']) : curRating['wn6']['xvm'],
  2344. '#' + curRating['wn6']['color'], curRating['wn6']['xvmStepToNL']);
  2345. this.setRatingValue('xrEff',
  2346. oldRating ? this.diffText(curRating['eff']['xvm'], oldRating['eff']['xvm']) : curRating['eff']['xvm'],
  2347. '#' + curRating['eff']['color'], curRating['eff']['xvmStepToNL']);
  2348. this.setRatingValue('xrKwg',
  2349. oldRating ? this.diffText(curRating['wg']['xvm'], oldRating['wg']['xvm']) : curRating['wg']['xvm'],
  2350. '#' + curRating['wg']['color'], curRating['wg']['xvmStepToNL']);
  2351. this.setRatingValue('xrNag',
  2352. oldRating ? this.diffText(curRating['pr']['xvm'], oldRating['pr']['xvm']) : curRating['pr']['xvm'],
  2353. '#' + curRating['pr']['color'], curRating['pr']['xvmStepToNL']);
  2354. this.setRatingValue('xrArmor',
  2355. oldRating ? this.diffText(curRating['bs']['xvm'], oldRating['bs']['xvm']) : curRating['bs']['xvm'],
  2356. '#' + curRating['bs']['color'], curRating['bs']['xvmStepToNL']);
  2357.  
  2358. this.setRatingValue('xrNoob',
  2359. oldRating ? this.diffText(curRating['noob']['xvm'], oldRating['noob']['xvm']) : curRating['noob']['xvm'],
  2360. '#' + curRating['noob']['color'], curRating['noob']['xvmStepToNL']);
  2361. this.setRatingValue('rBattles',
  2362. oldStat ? this.diffText(wesAccount.curStat.battles, oldStat.battles, 0) : wesAccount.curStat.battles);
  2363. this.setRatingValue('rBatteDay',
  2364. oldStat ? this.diffText((wesAccount.curStat.battles / daypassed).toFixed(2), (oldStat.battles / oldDaypassed).toFixed(2)) : (wesAccount.curStat.battles / daypassed).toFixed(2),
  2365. '', 'Дней: ' + daypassed.toFixed());
  2366. this.setRatingValue('rMedLvl',
  2367. oldRating ? this.diffText(curRating.avg.toFixed(2), oldRating.avg.toFixed(2)) : curRating.avg.toFixed(2));
  2368. winVal = this.FoundProc(wesAccount.curStat.wins, wesAccount.curStat.battles, 2, false);
  2369. this.setRatingValue('rWin',
  2370. winVal[0] + (oldStat ?
  2371. this.diffText(wesAccount.curStat.wins / wesAccount.curStat.battles * 100.0, oldStat.wins / oldStat.battles * 100.0, 2, false) : ''),
  2372. '', winVal[1]);
  2373. var losB = wesAccount.curStat.battles - wesAccount.curStat.wins - wesAccount.curStat.draws,
  2374. looseVal = this.FoundProc(losB, wesAccount.curStat.battles, 2, true),
  2375. oldLosB = oldStat ? oldStat.battles - oldStat.wins - oldStat.draws : 0;
  2376. this.setRatingValue('rLoose',
  2377. looseVal[0] + (oldStat ?
  2378. this.diffText(losB / wesAccount.curStat.battles * 100.0, oldLosB / oldStat.battles * 100.0, 2, false, true) : ''),
  2379. '', looseVal[1]);
  2380. this.setRatingValue('rSurv',
  2381. (wesAccount.curStat.survived_battles / wesAccount.curStat.battles * 100.0).toFixed(2) + '%' + (oldStat ? this.diffText((wesAccount.curStat.survived_battles / wesAccount.curStat.battles * 100.0).toFixed(2), (oldStat.survived_battles / oldStat.battles * 100.0).toFixed(2), 2, false) : ''),
  2382. '', wesAccount.curStat.survived_battles + '/' + wesAccount.curStat.battles);
  2383. var hitsVal = this.FoundProc(wesAccount.curStat.hits, wesAccount.curStat.shots, 2, false);
  2384. this.setRatingValue('rHit',
  2385. hitsVal[0] + (oldStat ?
  2386. this.diffText(wesAccount.curStat.hits / wesAccount.curStat.shots * 100.0, oldStat.hits / oldStat.shots * 100.0, 2, false) : ''),
  2387. '', hitsVal[1]);
  2388.  
  2389. this.setRatingValue('rExp',
  2390. oldStat ? this.diffText((wesAccount.curStat.xp / wesAccount.curStat.battles).toFixed(2), (oldStat.xp / oldStat.battles).toFixed(2)) : (wesAccount.curStat.xp / wesAccount.curStat.battles).toFixed(2),
  2391. '', wesAccount.curStat.xp + '/' + wesAccount.curStat.battles);
  2392. this.setRatingValue('rDamage',
  2393. oldStat ? this.diffText((wesAccount.curStat.damage_dealt / wesAccount.curStat.battles).toFixed(2), (oldStat.damage_dealt / oldStat.battles).toFixed(2)) : (wesAccount.curStat.damage_dealt / wesAccount.curStat.battles).toFixed(2),
  2394. '', wesAccount.curStat.damage_dealt + '/' + wesAccount.curStat.battles);
  2395. this.setRatingValue('rFrag',
  2396. oldStat ? this.diffText((wesAccount.curStat.frags / wesAccount.curStat.battles).toFixed(2), (oldStat.frags / oldStat.battles).toFixed(2)) : (wesAccount.curStat.frags / wesAccount.curStat.battles).toFixed(2),
  2397. '', wesAccount.curStat.frags + '/' + wesAccount.curStat.battles);
  2398. this.setRatingValue('rSpot',
  2399. oldStat ? this.diffText((wesAccount.curStat.spotted / wesAccount.curStat.battles).toFixed(2), (oldStat.spotted / oldStat.battles).toFixed(2)) : (wesAccount.curStat.spotted / wesAccount.curStat.battles).toFixed(2),
  2400. '', wesAccount.curStat.spotted + '/' + wesAccount.curStat.battles);
  2401. this.setRatingValue('rCap',
  2402. oldStat ? this.diffText((wesAccount.curStat.capture_points / wesAccount.curStat.battles).toFixed(2), (oldStat.capture_points / oldStat.battles).toFixed(2)) : (wesAccount.curStat.capture_points / wesAccount.curStat.battles).toFixed(2),
  2403. '', wesAccount.curStat.capture_points + '/' + wesAccount.curStat.battles);
  2404. this.setRatingValue('rDeff',
  2405. oldStat ? this.diffText((wesAccount.curStat.dropped_capture_points / wesAccount.curStat.battles).toFixed(2), (oldStat.dropped_capture_points / oldStat.battles).toFixed(2)) : (wesAccount.curStat.dropped_capture_points / wesAccount.curStat.battles).toFixed(2),
  2406. '', wesAccount.curStat.dropped_capture_points + '/' + wesAccount.curStat.battles);
  2407. var nDate = wesGeneral.formattedDate(new Date(parseInt(wesAccount.curApiStat['last_battle_time']) * 1000));
  2408. this.setRatingValue('lastBattle', nDate);
  2409. nDate = wesGeneral.formattedDate(new Date(parseInt(wesAccount.curApiStat['updated_at']) * 1000));
  2410. this.setRatingValue('lastUpdate', nDate);
  2411. this.setRatingValue('maxDamage', wesAccount.curApiStat['statistics']['all']['max_damage']);
  2412. this.setRatingValue('maxFrags', wesAccount.curApiStat['statistics']['all']['max_frags']);
  2413. this.setRatingValue('maxXp', wesAccount.curApiStat['statistics']['all']['max_xp']);
  2414. this.setRatingValue('treesCut', wesAccount.curApiStat['statistics']['trees_cut']);
  2415. this.setRatingValue('nBattles__old', oldStat.battles);
  2416. this.setRatingValue('nBattles__cur', wesAccount.curStat.battles);
  2417. this.setRatingValue('nWin__old', oldStat.wins);
  2418. this.setRatingValue('nWin__cur', wesAccount.curStat.wins);
  2419. this.setRatingValue('nWinRatio__old', this.FoundProc(oldStat.wins, oldStat.battles, 2, false)[0]);
  2420. this.setRatingValue('nWinRatio__cur', this.FoundProc(wesAccount.curStat.wins, wesAccount.curStat.battles, 2, false)[0]);
  2421. this.setRatingValue('nExp__old', (oldStat.xp / oldStat.battles).toFixed(2));
  2422. this.setRatingValue('nExp__cur', (wesAccount.curStat.xp / wesAccount.curStat.battles).toFixed(2));
  2423. this.setRatingValue('nMedLvl__old', oldRating.avg.toFixed(2));
  2424. this.setRatingValue('nMedLvl__cur', curRating.avg.toFixed(2));
  2425. this.setRatingValue('nDamage__old', (oldStat.damage_dealt / oldStat.battles).toFixed(2));
  2426. this.setRatingValue('nDamage__cur', (wesAccount.curStat.damage_dealt / wesAccount.curStat.battles).toFixed(2));
  2427. this.setRatingValue('nFrag__old', (oldStat.frags / oldStat.battles).toFixed(2));
  2428. this.setRatingValue('nFrag__cur', (wesAccount.curStat.frags / wesAccount.curStat.battles).toFixed(2));
  2429. this.setRatingValue('nSpot__old', (oldStat.spotted / oldStat.battles).toFixed(2));
  2430. this.setRatingValue('nSpot__cur', (wesAccount.curStat.spotted / wesAccount.curStat.battles).toFixed(2));
  2431. this.setRatingValue('nCap__old', (oldStat.capture_points / oldStat.battles).toFixed(2));
  2432. this.setRatingValue('nCap__cur', (wesAccount.curStat.capture_points / wesAccount.curStat.battles).toFixed(2));
  2433. this.setRatingValue('nDeff__old', (oldStat.dropped_capture_points / oldStat.battles).toFixed(2));
  2434. this.setRatingValue('nDeff__cur', (wesAccount.curStat.dropped_capture_points / wesAccount.curStat.battles).toFixed(2));
  2435. if (newRating) {
  2436. this.setRatingValue('nBattles__new', (wesAccount.curStat.battles - oldStat.battles));
  2437. this.setRatingValue('nWin__new', (wesAccount.curStat.wins - oldStat.wins));
  2438. this.setRatingValue('nWinRatio__new', this.FoundProc((wesAccount.curStat.wins - oldStat.wins), (wesAccount.curStat.battles - oldStat.battles), 2, false)[0] + this.diffText((wesAccount.curStat.wins - oldStat.wins) / (wesAccount.curStat.battles - oldStat.battles) * 100.0, oldStat.wins / oldStat.battles * 100.0, 2, false));
  2439. this.setRatingValue('nExp__new', ((wesAccount.curStat.xp - oldStat.xp) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.xp - oldStat.xp) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.xp / oldStat.battles), 2, false));
  2440. this.setRatingValue('nMedLvl__new', newRating.avg.toFixed(2) + this.diffText(newRating.avg, oldRating.avg, 2, false));
  2441. this.setRatingValue('nDamage__new', ((wesAccount.curStat.damage_dealt - oldStat.damage_dealt) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.damage_dealt - oldStat.damage_dealt) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.damage_dealt / oldStat.battles), 2, false));
  2442. this.setRatingValue('nFrag__new', ((wesAccount.curStat.frags - oldStat.frags) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.frags - oldStat.frags) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.frags / oldStat.battles), 2, false));
  2443. this.setRatingValue('nSpot__new', ((wesAccount.curStat.spotted - oldStat.spotted) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.spotted - oldStat.spotted) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.spotted / oldStat.battles), 2, false));
  2444. this.setRatingValue('nCap__new', ((wesAccount.curStat.capture_points - oldStat.capture_points) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.capture_points - oldStat.capture_points) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.capture_points / oldStat.battles), 2, false));
  2445. this.setRatingValue('nDeff__new', ((wesAccount.curStat.dropped_capture_points - oldStat.dropped_capture_points) / (wesAccount.curStat.battles - oldStat.battles)).toFixed(2) + this.diffText(((wesAccount.curStat.dropped_capture_points - oldStat.dropped_capture_points) / (wesAccount.curStat.battles - oldStat.battles)), (oldStat.dropped_capture_points / oldStat.battles), 2, false));
  2446. this.setRatingValue('nEff__new', newRating['eff']['value'] + this.diffText(newRating['eff']['value'], oldRating['eff']['value'], 2, false), '#' + newRating['eff']['color'], newRating['eff']['stepToNL']);
  2447. this.setRatingValue('nWn6__new', newRating['wn6']['value'] + this.diffText(newRating['wn6']['value'], oldRating['wn6']['value'], 2, false), '#' + newRating['wn6']['color'], newRating['wn6']['stepToNL']);
  2448. this.setRatingValue('nWn8__new', newRating['wn8']['value'] + this.diffText(newRating['wn8']['value'], oldRating['wn8']['value'], 2, false), '#' + newRating['wn8']['color'], newRating['wn8']['stepToNL']);
  2449. };
  2450. this.setRatingValue('nEff__old', oldRating['eff']['value'], '#' + oldRating['eff']['color'], oldRating['eff']['stepToNL']);
  2451. this.setRatingValue('nEff__cur', curRating['eff']['value'], '#' + curRating['eff']['color'], curRating['eff']['stepToNL']);
  2452. this.setRatingValue('nWn6__old', oldRating['wn6']['value'], '#' + oldRating['wn6']['color'], oldRating['wn6']['stepToNL']);
  2453. this.setRatingValue('nWn6__cur', curRating['wn6']['value'], '#' + curRating['wn6']['color'], curRating['wn6']['stepToNL']);
  2454. this.setRatingValue('nWn8__old', oldRating['wn8']['value'], '#' + oldRating['wn8']['color'], oldRating['wn8']['stepToNL']);
  2455. this.setRatingValue('nWn8__cur', curRating['wn8']['value'], '#' + curRating['wn8']['color'], curRating['wn8']['stepToNL']);
  2456. if (myLastStat) {
  2457. this.setRatingValue('nBattles__my', myLastStat.battles + this.diffText(myLastStat.battles, wesAccount.curStat.battles, 0, false));
  2458. this.setRatingValue('nWin__my', myLastStat.wins + this.diffText(myLastStat.wins, wesAccount.curStat.wins, 0, false));
  2459. this.setRatingValue('nWinRatio__my', this.FoundProc(myLastStat.wins, myLastStat.battles, 2, false)[0] + this.diffText(myLastStat.wins / myLastStat.battles * 100.0, wesAccount.curStat.wins / wesAccount.curStat.battles * 100.0, 2, false));
  2460. this.setRatingValue('nExp__my', (myLastStat.xp / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.xp / myLastStat.battles), (wesAccount.curStat.xp / wesAccount.curStat.battles), 2, false));
  2461. this.setRatingValue('nMedLvl__my', myRating.avg.toFixed(2) + this.diffText(myRating.avg, curRating.avg, 2, false));
  2462. this.setRatingValue('nDamage__my', (myLastStat.damage_dealt / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.damage_dealt / myLastStat.battles), (wesAccount.curStat.damage_dealt / wesAccount.curStat.battles), 2, false));
  2463. this.setRatingValue('nFrag__my', (myLastStat.frags / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.frags / myLastStat.battles), (wesAccount.curStat.frags / wesAccount.curStat.battles), 2, false));
  2464. this.setRatingValue('nSpot__my', (myLastStat.spotted / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.spotted / myLastStat.battles), (wesAccount.curStat.spotted / wesAccount.curStat.battles), 2, false));
  2465. this.setRatingValue('nCap__my', (myLastStat.capture_points / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.capture_points / myLastStat.battles), (wesAccount.curStat.capture_points / wesAccount.curStat.battles), 2, false));
  2466. this.setRatingValue('nDeff__my', (myLastStat.dropped_capture_points / myLastStat.battles).toFixed(2) + this.diffText((myLastStat.dropped_capture_points / myLastStat.battles), (wesAccount.curStat.dropped_capture_points / wesAccount.curStat.battles), 2, false));
  2467. this.setRatingValue('nEff__my', myRating['eff']['value'] + this.diffText(myRating['eff']['value'], curRating['eff']['value'], 2, false), '#' + myRating['eff']['color']);
  2468. this.setRatingValue('nWn6__my', myRating['wn6']['value'] + this.diffText(myRating['wn6']['value'], curRating['wn6']['value'], 2, false), '#' + myRating['wn6']['color']);
  2469. this.setRatingValue('nWn8__my', myRating['wn8']['value'] + this.diffText(myRating['wn8']['value'], curRating['wn8']['value'], 2, false), '#' + myRating['wn8']['color']);
  2470. }
  2471. },
  2472. main: function () {
  2473. var savedStat;
  2474. if (wesSettings.myID === 0 && $('.current-page').length) {
  2475. wesSettings.myID = this.userId;
  2476. wesGeneral.setLSData('wesSettings', wesSettings);
  2477. }
  2478. wesAccount.wbeff = new WBEff();
  2479. savedStat = wesGeneral.getLSData('wes_' + this.userId);
  2480. if (savedStat && wesSettings.players[this.userId] == undefined) {
  2481. wesSettings.players[this.userId] = this.userName;
  2482. wesGeneral.setLSData('wesSettings', wesSettings);
  2483. }
  2484. this.addScriptInfo();
  2485. this.createUserMenu();
  2486. document.getElementsByClassName('b-userblock-wrpr')[0].style.marginBottom = '0px';
  2487. new WrappableBlock('pers', {
  2488. start: $('div.b-personal-link').parent().parent()
  2489. });
  2490. new WrappableBlock('speed', {
  2491. start: 'div.b-user-block.b-user-block__sparks'
  2492. });
  2493. if ($('#js-knockout-fame-points').length) {
  2494. new WrappableBlock('hall', {
  2495. start: $('#js-knockout-fame-points').prev(),
  2496. end: $('#js-knockout-fame-points').next().next().next()
  2497. });
  2498. } else if ($('p.b-fame-message').length){
  2499. new WrappableBlock('hall', {
  2500. start: $('p.b-fame-message').parent(),
  2501. end: $('p.b-fame-message').parent().next()
  2502. });
  2503. }
  2504. new WrappableBlock('achiev', {
  2505. start: 'div.js-all-achievements',
  2506. end: $('div.js-all-achievements').next()
  2507. });
  2508. new WrappableBlock('common', {
  2509. start: $('div.b-result-classes').parent(),
  2510. end: $('div.b-result-classes').parent().next()
  2511. });
  2512. new WrappableBlock('diagr', {
  2513. start: 'div.b-diagrams-sector',
  2514. end: $('div.b-diagrams-sector').next()
  2515. });
  2516. new WrappableBlock('rat', {
  2517. start: '#js-knockout-ratings',
  2518. end: $('#js-knockout-ratings').next()
  2519. });
  2520. new WrappableBlock('veh', {
  2521. start: $('#js-vehicle-details-template').prev(),
  2522. end: $('#js-vehicle-details-template').next().next().next()
  2523. });
  2524. if (savedStat) {
  2525. wesAccount.sbnew = new SBNewBattles();
  2526. wesAccount.wbnew = new WBNew();
  2527. }
  2528. wesAccount.compStat = new WBCompStat();
  2529. if (savedStat) {
  2530. this.createChangeStat(savedStat);
  2531. var isChangedStat = false;
  2532. for (i = savedStat.length - 1; i >= 0; i--) {
  2533. for (j = 0; j < stTypeKeys.length; j++) {
  2534. var apikey;
  2535. apikey = stTypeKeys[j];
  2536. if (savedStat[i][apikey] != undefined && Array.isArray(savedStat[i][apikey]['tanks'])) {
  2537. if (savedStat[i][apikey]['tanks'].length > 0) {
  2538. savedStat[i][apikey]['tanks'] = savedStat[i][apikey]['tanks'].reduce(function(o, v, i) {
  2539. if (v) {
  2540. o[i] = v;
  2541. }
  2542. return o;
  2543. }, {});
  2544. } else {
  2545. savedStat[i][apikey]['tanks'] = {};
  2546. }
  2547. isChangedStat = true;
  2548. }
  2549. }
  2550. }
  2551. if (isChangedStat) {
  2552. wesGeneral.setLSData('wes_' + wesAccount.userId, savedStat);
  2553. }
  2554. }
  2555. this.paintCurPage(-1);
  2556. }
  2557. };
  2558. //Основное тело скрипта
  2559. $(document).ready(function () {
  2560. $(document).on("click", "#wes-remove-stat", function (event) {
  2561. event.preventDefault();
  2562. if (confirm(_('confirmDelete'))) {
  2563. wesGeneral.showWait(_("sWaitText"));
  2564. wesGeneral.deleteLSData('wes_' + wesAccount.userId);
  2565. for (var key in wesSettings.players) {
  2566. if (key == wesAccount.userId) {
  2567. delete wesSettings.players[key];
  2568. }
  2569. }
  2570. wesGeneral.setLSData('wesSettings', wesSettings);
  2571. window.location.reload();
  2572. }
  2573. });
  2574. $(document).on("click", "#wes-save-stat", function (event) {
  2575. event.preventDefault();
  2576. wesGeneral.showWait(_("sWaitText"));
  2577. var savedStat = wesGeneral.getLSData('wes_' + wesAccount.userId),
  2578. lastStat = savedStat ? savedStat[savedStat.length - 1] : false;
  2579. if (lastStat) {
  2580. if (lastStat.battles == wesAccount.curStat.battles) {
  2581. wesGeneral.hideWait();
  2582. wesGeneral.showError(_('noNewBattles'));
  2583. } else {
  2584. savedStat.push(wesAccount.curStat);
  2585. console.log(wesAccount.curStat);
  2586. if (wesSettings.scount > 0 && savedStat.length > wesSettings.scount) {
  2587. savedStat.splice(0, savedStat.length - wesSettings.scount);
  2588. }
  2589. wesGeneral.setLSData('wes_' + wesAccount.userId, savedStat);
  2590. window.location.reload();
  2591. }
  2592. } else {
  2593. wesGeneral.setLSData('wes_' + wesAccount.userId, [wesAccount.curStat]);
  2594. wesSettings.players[wesAccount.userId] = wesAccount.userName;
  2595. wesGeneral.setLSData('wesSettings', wesSettings);
  2596. window.location.reload();
  2597. }
  2598. });
  2599. $(document).on("click", "#wes-close-error", function (event) {
  2600. event.preventDefault();
  2601. $('.wes-overlay').hide();
  2602. $('#wes-error').hide();
  2603. });
  2604. $(document).on("click", "#wes-error-close", function (event) {
  2605. event.preventDefault();
  2606. $('.wes-overlay').hide();
  2607. $('#wes-error').hide();
  2608. });
  2609. $(document).on("click", "#wes-show-settings", function (event) {
  2610. event.preventDefault();
  2611. var lsSize = wesGeneral.calculateCurrentLocalStorageSize(), uIds = Object.keys(wesSettings.players), i,
  2612. key, sCount, serv = wesGeneral.getServ();
  2613. wesGeneral.updateProgressBar('ls-size', lsSize, 5000);
  2614. $('#wes-ls-size-text').html(_('lsSize') + ' ' +
  2615. String(Math.round(lsSize / 5000 * 100)) + '% (' + String(lsSize) + 'Kb)');
  2616. $("#wes-tab-content-3 > div")[0].innerHTML = '';
  2617. for (i = 0; i < uIds.length; i++) {
  2618. key = parseInt(uIds[i]);
  2619. sCount = wesGeneral.getLSData('wes_' + key);
  2620. if (sCount) sCount = sCount.length; else sCount = 0;
  2621. //if (key !== wesSettings.myID)
  2622. $("#wes-tab-content-3 > div")[0].innerHTML += '<p>' +
  2623. '<a href="http://worldoftanks.' + serv + '/community/accounts/' + key +
  2624. '/" target="_blank">' + wesSettings.players[key] + '</a>' +
  2625. '<span style="padding-left: 5px;">(' + _("saveCount") + ': ' + sCount + '):</span>' +
  2626. '<input style="margin-left: 5px;width: 200px;" type="text" id="wes-settitngs-player-' + key + '" value="' + wesSettings.players[key] + '"></p>';
  2627. }
  2628.  
  2629. $('#wes-settings-save-count').val(wesSettings.scount);
  2630. $('#wes-settings-graphs').val(wesSettings.graphs);
  2631. $('#wes-settings-lang').val(wesSettings.locale);
  2632.  
  2633. for (key in wesSettings.blocks) $('#wes-settings-block-' + key).val(wesSettings.blocks[key]);
  2634.  
  2635. $('.wes-overlay').show();
  2636. $('#wes-settings').show();
  2637. });
  2638. $(document).on("click", "#wes-close-settings", function (event) {
  2639. event.preventDefault();
  2640. $('.wes-overlay').hide();
  2641. $('#wes-settings').hide();
  2642. });
  2643. $(document).on("click", ".wes-tabs span", function (event) {
  2644. event.preventDefault();
  2645. $('.wes-active-tab').removeClass('wes-active-tab');
  2646. $(this).addClass('wes-active-tab');
  2647. $('.wes-tab-content').hide();
  2648. $('#wes-tab-content-' + $(this).attr('tabId')).show();
  2649. });
  2650. $(document).on("click", "#wes-settings-save", function (event) {
  2651. event.preventDefault();
  2652. wesGeneral.showWait(_("sWaitText"));
  2653.  
  2654. var scount = $('#wes-settings-save-count').val(), key, stat;
  2655. if (scount > 0 && scount < wesSettings.scount) {
  2656. for (key in wesSettings.players) {
  2657. stat = wesGeneral.getLSData('wes_' + key);
  2658. if (stat && stat.length > scount) {
  2659. stat.splice(0, stat.length - scount);
  2660. wesGeneral.setLSData('wes_' + key, stat);
  2661. }
  2662. }
  2663. }
  2664. wesSettings.scount = scount;
  2665. wesSettings.locale = $('#wes-settings-lang').val();
  2666. wesSettings.graphs = $('#wes-settings-graphs').val();
  2667. for (key in wesSettings.players) {
  2668. wesSettings.players[key] = $('#wes-settitngs-player-' + key).val();
  2669. }
  2670. for (key in wesSettings.blocks) {
  2671. wesSettings.blocks[key] = $('#wes-settings-block-' + key).val();
  2672. }
  2673.  
  2674. wesGeneral.setLSData('wesSettings', wesSettings);
  2675. window.location.reload();
  2676. });
  2677. $(document).on("wesGeneralReady", "#wes-wait", function (event) {
  2678. event.preventDefault();
  2679. if (!$(this).attr('wesGeneralReady')) {
  2680. $(this).attr('wesGeneralReady', 1);
  2681. if (window.location.href.indexOf("accounts") !== -1) {
  2682. //try {
  2683. wesAccount.fillCurStat();
  2684. //} catch (e) {
  2685. // wesGeneral.showError(e.message + ': ' + e.lineNumber);
  2686. //}
  2687. }
  2688. }
  2689. });
  2690. if (window.location.host.startsWith("worldoftanks")) {
  2691. //try {
  2692. wesGeneral.main();
  2693. //} catch (e) {
  2694. // wesGeneral.showError(e.message + ': ' + e.lineNumber);
  2695. //}
  2696. }
  2697. });
  2698. //} catch (e) {
  2699. // console.log(e.message + ': ' + e.lineNumber);
  2700. //}