pereka4mod

Add progress bar for sum of faction exp. and balance coef.

  1. // ==UserScript==
  2.  
  3. // @name pereka4mod
  4.  
  5. // @author dw4rf & Casperovskii
  6.  
  7. // @namespace Pereka4
  8.  
  9. // @version 2.92 (2021.11.18)
  10. // @description Add progress bar for sum of faction exp. and balance coef.
  11.  
  12. // @include *//*heroeswm.*/home.php*
  13. // @include *//178.248.235.15/home.php*
  14. // @include *//*герои.рф/home.php*
  15. // @include *//*lordswm.*/home.php*
  16. // @include *//*heroeswm.*/pl_info.php*
  17. // @include *//178.248.235.15/pl_info.php*
  18. // @include *//*герои.рф/pl_info.php*
  19. // @include *//*lordswm.*/pl_info.php*
  20. // @license GPL-3.0+
  21. // ==/UserScript==
  22.  
  23.  
  24.  
  25. // Основная функция, выполняемая при загрузке страницы целиком
  26.  
  27. if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) {
  28. this.GM_getValue=function (key,def) {
  29. return localStorage[key] || def;
  30. };
  31. this.GM_setValue=function (key,value) {
  32. return localStorage[key]=value;
  33. };
  34. this.GM_deleteValue=function (key) {
  35. return delete localStorage[key];
  36. };
  37. this.GM_addStyle = function(css) {
  38. var style = document.createElement('style');
  39. style.textContent = css;
  40. document.getElementsByTagName('head')[0].appendChild(style);
  41. };
  42. this.GM_registerMenuCommand = function(name, funk) {
  43. //todo
  44. };
  45. }
  46.  
  47. function browser()
  48. {
  49. var ua = navigator.userAgent;
  50. if (ua.search(/MSIE/) > 0) return 'Internet Explorer';
  51. if (ua.search(/Firefox/) > 0) return 'Firefox';
  52. if (ua.search(/Opera/) > 0) return 'Opera';
  53. if (ua.search(/Chrome/) > 0) return 'Google Chrome';
  54. if (ua.search(/Safari/) > 0) return 'Safari';
  55. if (ua.search(/Konqueror/) > 0) return 'Konqueror';
  56. if (ua.search(/Iceweasel/) > 0) return 'Debian Iceweasel';
  57. if (ua.search(/SeaMonkey/) > 0) return 'SeaMonkey';
  58. // Браузеров очень много, все вписывать смысле нет, Gecko почти везде встречается
  59. if (ua.search(/Gecko/) > 0) return 'Gecko';
  60.  
  61. // а может это вообще поисковый робот
  62. return 'Search Bot';
  63. }
  64.  
  65. function main(e){
  66. var browserVersion = browser();
  67.  
  68. var version = "2.90";
  69.  
  70. var srednya_umka = 0;
  71.  
  72. var vilka = 1;
  73. var umk_min = 0;
  74. var umk_max = 0;
  75.  
  76. var sum_umk = 0;
  77.  
  78. var lang_en = new Array();
  79.  
  80. var lang_uk = lang_en;
  81.  
  82. var lang_us = lang_en;
  83.  
  84. var lang_com = lang_en;
  85.  
  86. lang_en['Knight'] = 'Knight';
  87.  
  88. lang_en['Necromancer'] = 'Necromancer';
  89.  
  90. lang_en['Wizard'] = 'Wizard';
  91.  
  92. lang_en['Elf'] = 'Elf';
  93.  
  94. lang_en['Barbarian'] = 'Barbarian';
  95.  
  96. lang_en['Dark elf'] = 'Dark elf';
  97.  
  98. lang_en['Demon'] = 'Demon';
  99.  
  100. lang_en['Dwarf'] = 'Dwarf';
  101.  
  102. lang_en['Steepe barbarian'] = 'Steepe barbarian';
  103.  
  104. lang_en['Combat level'] = 'Combat level';
  105.  
  106.  
  107.  
  108.  
  109. var lang_ru = new Array();
  110.  
  111. lang_ru['Knight'] = '\u0420\u044B\u0446\u0430\u0440\u044C';
  112.  
  113. lang_ru['Necromancer'] = '\u041D\u0435\u043A\u0440\u043E\u043C\u0430\u043D\u0442';
  114.  
  115. lang_ru['Wizard'] = '\u041C\u0430\u0433';
  116.  
  117. lang_ru['Elf'] = '\u042D\u043B\u044C\u0444';
  118.  
  119. lang_ru['Barbarian'] = '\u0412\u0430\u0440\u0432\u0430\u0440';
  120.  
  121. lang_ru['Dark elf'] = '\u0422\u0435\u043C\u043D\u044B\u0439 \u044D\u043B\u044C\u0444';
  122.  
  123. lang_ru['Demon'] = '\u0414\u0435\u043C\u043E\u043D';
  124.  
  125. lang_ru['Dwarf'] = '\u0413\u043D\u043E\u043C';
  126.  
  127. lang_ru['Steepe barbarian'] = '\u0421\u0442\u0435\u043f\u043d\u043e\u0439 \u0432\u0430\u0440\u0432\u0430\u0440';
  128.  
  129. lang_ru['Combat level'] = '\u0411\u043E\u0435\u0432\u043E\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C';
  130.  
  131.  
  132. var language=lang_en;
  133.  
  134.  
  135.  
  136.  
  137.  
  138. // Определение языка
  139.  
  140. var lingua;
  141.  
  142. if (location.hostname.match('lordswm')) {lingua='en';} else {lingua = 'ru';}
  143.  
  144. try{
  145.  
  146. eval('language = lang_' + lingua);
  147.  
  148. }catch(e){
  149.  
  150. }
  151.  
  152.  
  153.  
  154. //Фракции
  155.  
  156. var factions = [
  157. T('Knight'),T('Necromancer'),T('Wizard'),T('Elf'),T('Barbarian'),T('Dark elf'),T('Demon'),T('Dwarf'),T('Steepe barbarian')
  158. ];
  159.  
  160.  
  161. //Средние умения фракций на 3-22 уровне
  162. var sred_umk = [
  163. 70,130,200,340,560,950,1510,2260,3240,4510,6350,
  164. 9210,13960,21070,31060,43820,59740,80040,104720,167260
  165. ];
  166. //Вилки границ недокача/перекача от средних умений фракций на 3-22 уровне
  167. var vilka_um = [
  168. 2.5, 2.2, 1.9, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6,
  169. 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6
  170. ];
  171.  
  172.  
  173. var XPFirst = XPathResult.FIRST_ORDERED_NODE_TYPE; // Постоянные для первого элемента XPath
  174.  
  175. var XPList = XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE; // Постоянные элементы списка XPath
  176.  
  177.  
  178.  
  179. /**
  180.  
  181. * Поиск по документу с помощью XPath
  182.  
  183. *
  184.  
  185. * Ввод:
  186.  
  187. * xpath Выражение для поиска
  188.  
  189. * xpres Тип поиска
  190.  
  191. *
  192.  
  193. * Вывод:
  194.  
  195. * Ссылка на найденный объект
  196.  
  197. */
  198.  
  199. function find(xpath, xpres,startnode){
  200.  
  201. if (!startnode) {startnode=document;}
  202.  
  203. var ret = document.evaluate(xpath, startnode, null, xpres, null);
  204.  
  205. return xpres == XPFirst ? ret.singleNodeValue : ret;
  206.  
  207. }
  208.  
  209.  
  210.  
  211. /**
  212.  
  213. * Добавляет узел после 1 условия
  214.  
  215. *
  216.  
  217. * Ввод:
  218.  
  219. * refChild узел ссылки
  220.  
  221. * newChild узлы, которые будут добавлены
  222.  
  223. */
  224.  
  225. function insertAfter(newChild, refChild) {
  226.  
  227. node.parentNode.insertBefore(newChild, refChild.nextSibling);
  228.  
  229. }
  230.  
  231.  
  232.  
  233. /**
  234.  
  235. * Создание элемента
  236.  
  237. *
  238.  
  239. * Ввод:
  240.  
  241. * tag Название нового элемента
  242.  
  243. * content Содержание нового элемента в текстовом формате
  244.  
  245. *
  246.  
  247. * Вывод:
  248.  
  249. * Ссылка на созданный элемент
  250.  
  251. */
  252.  
  253.  
  254. function elem(tag, content){
  255.  
  256. var ret = document.createElement(tag);
  257.  
  258. ret.innerHTML = content;
  259.  
  260. return ret;
  261.  
  262. }
  263.  
  264.  
  265.  
  266. /**
  267.  
  268. * Перевод текста на определенный язык
  269.  
  270. *
  271.  
  272. * Ввод:
  273.  
  274. * Текст для перевода
  275.  
  276. *
  277.  
  278. * Вывод:
  279.  
  280. * Перевод
  281.  
  282. */
  283.  
  284.  
  285. function T(testo){
  286.  
  287. // Язык по умолчанию, если слово не существует: английский
  288.  
  289. if (language[testo] == undefined) return lang_en[testo]; else return language[testo];
  290.  
  291. }
  292.  
  293. /**
  294.  
  295. * Создание прогресс бара
  296.  
  297. *
  298.  
  299. * Ввод:
  300.  
  301. * Текущий опыт
  302.  
  303. * Текущее умение фракции
  304.  
  305. * Уровень
  306.  
  307. *
  308.  
  309. * Вывод:
  310.  
  311. * HTML для создания прогресс бара
  312.  
  313. */
  314.  
  315. function makeProgressBar(exp_attuale, min_umka, max_umka, vlk, lvl){
  316.  
  317.  
  318. exp_attuale = exp_attuale - min_umka;
  319.  
  320. max_umka = max_umka - min_umka;
  321.  
  322. var perc = exp_attuale * 100 / max_umka;
  323.  
  324. var ins_txt="";
  325.  
  326. // Stile
  327.  
  328. var cssStyle = "";
  329.  
  330.  
  331. if (lvl > 18) ins_txt=" (\u0423 19-22 \u0443\u0440\u043E\u0432\u043D\u044F \u043D\u0435 \u0443\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F)."
  332. if (perc<100 && perc>0) {
  333. cssStyle += ".bar_wrap {width:150px; margin:3px 0 3px 9px;border: 1px solid #1C1C1C;background-color: #8C7526;box-shadow: 0 0 1px #666, inset 0 1px 1px #222;-webkit-box-shadow: 0 0 1px #666, inset 0 1px 1px #222;background-image: -moz-linear-gradient(#65541B, #8C7526 50%, #65541B);background-image: -webkit-linear-gradient(#65541B, #8C7526 50%, #65541B);}.bar {height: 5px;background-color: #f9e37e;border-right: 1px solid #282828;box-shadow: inset 0 0 1px #ddd;-webkit-box-shadow: inset 0 0 1px #ddd;background-image: -moz-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);background-image: -webkit-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);-moz-transition: all 1s ease;-webkit-transition: all 1s ease;}@-moz-keyframes slidein {from {width: 100%}}@-webkit-keyframes slidein {from {width: 100%}}.bar:hover {-moz-animation: animate-stripes 3s linear infinite;-webkit-animation: animate-stripes 3s linear infinite;}@-moz-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}@-webkit-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}.htooltip, .htooltip:visited, .tooltip:active {color: #0077AA;text-decoration: none;}.htooltip:hover {color: #0099CC;}.htooltip span {background-color: rgba(0,0,0, 0.8);border-radius: 5px 5px 0px 0px;-webkit-border-radius: 5px 5px 0px 0px;box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);color: #fff;margin-left: -1px;margin-top: -24px;opacity: 0;padding: 2px 5px;position: absolute;text-decoration: none;visibility: hidden;z-index: 10;-ms-transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;}.htooltip:hover span {position: absolute;opacity: 1;visibility: visible;}";
  334.  
  335. GM_addStyle(cssStyle);
  336. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  337. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  338. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ Math.round(perc*100)/100 +"%</span>"+
  339. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+Math.round(perc)/1+"% </div>" +
  340. "<div>&nbsp;&nbsp;\u0412 \u043D\u043E\u0440\u043C\u0435!"+ins_txt+" </div>";
  341. }
  342. if (perc>100){
  343. perc = 100;
  344. cssStyle += ".bar_wrap {width:150px; margin:3px 0 3px 9px;border: 1px solid #1C1C1C;background-color: #8C7526;box-shadow: 0 0 1px #666, inset 0 1px 1px #222;-webkit-box-shadow: 0 0 1px #666, inset 0 1px 1px #222;background-image: -moz-linear-gradient(#65541B, #8C7526 50%, #65541B);background-image: -webkit-linear-gradient(#65541B, #8C7526 50%, #65541B);}.bar {height: 5px;background-color: #f9e37e;border-right: 1px solid #282828;box-shadow: inset 0 0 1px #ddd;-webkit-box-shadow: inset 0 0 1px #ddd;background-image: -moz-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);background-image: -webkit-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);-moz-transition: all 1s ease;-webkit-transition: all 1s ease;}@-moz-keyframes slidein {from {width: 100%}}@-webkit-keyframes slidein {from {width: 100%}}.bar:hover {-moz-animation: animate-stripes 3s linear infinite;-webkit-animation: animate-stripes 3s linear infinite;}@-moz-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}@-webkit-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}.htooltip, .htooltip:visited, .tooltip:active {color: #0077AA;text-decoration: none;}.htooltip:hover {color: #0099CC;}.htooltip span {background-color: rgba(0,0,0, 0.8);border-radius: 5px 5px 0px 0px;-webkit-border-radius: 5px 5px 0px 0px;box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);color: #fff;margin-left: -1px;margin-top: -24px;opacity: 0;padding: 2px 5px;position: absolute;text-decoration: none;visibility: hidden;z-index: 10;-ms-transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;}.htooltip:hover span {position: absolute;opacity: 1;visibility: visible;}";
  345. GM_addStyle(cssStyle);
  346. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  347. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  348. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ perc +"%</span>"+
  349. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  350. "</div><br>&nbsp;&nbsp;\u041F\u0435\u0440\u0435\u043A\u0430\u0447!"+ins_txt+"<br>&nbsp;&nbsp;\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043E\u043F\u044B\u0442\u0430: +"+(((sum_umk/srednya_umka/vlk)-1)*100).toFixed(2)+"%<br>";
  351. }
  352. if (perc<0) {
  353. perc = 0;
  354. cssStyle += ".bar_wrap {width:150px; margin:3px 0 3px 9px;border: 1px solid #1C1C1C;background-color: #8C7526;box-shadow: 0 0 1px #666, inset 0 1px 1px #222;-webkit-box-shadow: 0 0 1px #666, inset 0 1px 1px #222;background-image: -moz-linear-gradient(#65541B, #8C7526 50%, #65541B);background-image: -webkit-linear-gradient(#65541B, #8C7526 50%, #65541B);}.bar {height: 5px;background-color: #f9e37e;border-right: 1px solid #282828;box-shadow: inset 0 0 1px #ddd;-webkit-box-shadow: inset 0 0 1px #ddd;background-image: -moz-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);background-image: -webkit-linear-gradient(#e7ae6b, #be8d55 50%, #a57b4b 51%, #ae804c);-moz-transition: all 1s ease;-webkit-transition: all 1s ease;}@-moz-keyframes slidein {from {width: 100%}}@-webkit-keyframes slidein {from {width: 100%}}.bar:hover {-moz-animation: animate-stripes 3s linear infinite;-webkit-animation: animate-stripes 3s linear infinite;}@-moz-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}@-webkit-keyframes animate-stripes {0% {background-position: 0 0;} 100% {background-position:0 22px;}}.htooltip, .htooltip:visited, .tooltip:active {color: #0077AA;text-decoration: none;}.htooltip:hover {color: #0099CC;}.htooltip span {background-color: rgba(0,0,0, 0.8);border-radius: 5px 5px 0px 0px;-webkit-border-radius: 5px 5px 0px 0px;box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);color: #fff;margin-left: -1px;margin-top: -24px;opacity: 0;padding: 2px 5px;position: absolute;text-decoration: none;visibility: hidden;z-index: 10;-ms-transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;}.htooltip:hover span {position: absolute;opacity: 1;visibility: visible;}";
  355. GM_addStyle(cssStyle);
  356. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  357. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  358. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ perc +"%</span>"+
  359. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  360. "</div><br>&nbsp;&nbsp;\u041D\u0435\u0434\u043E\u043A\u0430\u0447!"+ins_txt+"<br>&nbsp;&nbsp;\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u043C\u0435\u043D\u0438\u0439: +"+Math.round(((srednya_umka/sum_umk)-1)*1000)/10+"%<br><br>";
  361. }
  362. return progress_bar_html;
  363.  
  364. }
  365.  
  366.  
  367.  
  368. function showExpBar(){
  369.  
  370. var tabelle = find("//table", XPList);
  371.  
  372. var player_info = "";
  373.  
  374. var skill_info = "";
  375.  
  376. var player_faction = "";
  377.  
  378.  
  379.  
  380. if (location.href.indexOf('home.php') != -1) {
  381.  
  382. //Поиск страницы
  383.  
  384. for (var i = 25; i < tabelle.snapshotLength; i++){
  385.  
  386. if (!tabelle.snapshotItem(i)) continue;
  387.  
  388. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  389.  
  390. if (!tabelle.snapshotItem(i).childNodes[0].childNodes[0]) continue;
  391.  
  392.  
  393. //Player level
  394.  
  395. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0]) {
  396.  
  397. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0].innerHTML.indexOf(T('Combat level') +":") > 0) {
  398.  
  399. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0];
  400.  
  401. }
  402.  
  403. }
  404.  
  405.  
  406.  
  407. //Skill Info
  408.  
  409. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1]) {
  410.  
  411. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1].innerHTML.indexOf(T('Knight') +":") > 0) {
  412.  
  413. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1];
  414.  
  415. }
  416.  
  417. }
  418.  
  419. }
  420. } else if (location.href.indexOf('pl_info.php') != -1) {
  421.  
  422. //Поиск страницы
  423.  
  424. for (var i = 25; i < tabelle.snapshotLength; i++){
  425.  
  426. if (!tabelle.snapshotItem(i)) continue;
  427.  
  428. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  429.  
  430.  
  431.  
  432. //Player Info
  433.  
  434. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2]) {
  435.  
  436. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0]) {
  437.  
  438. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0].textContent.indexOf(T('Combat level') +":") > 0) {
  439.  
  440. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0];
  441.  
  442. }
  443.  
  444. }
  445.  
  446. }
  447.  
  448.  
  449.  
  450. //Skill Info
  451.  
  452. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1]) {
  453.  
  454. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1]) {
  455.  
  456. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1].textContent.indexOf(T('Knight')) > 0) {
  457.  
  458. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1];
  459.  
  460. }
  461.  
  462. }
  463.  
  464. }
  465.  
  466.  
  467. }
  468.  
  469.  
  470.  
  471. /*tabelle.snapshotItem(31).childNodes[0].childNodes[0].childNodes[0].innerHTML.search(/\- (.*)</);
  472.  
  473. player_faction = RegExp.$1;
  474.  
  475. alert("player_faction = "+player_faction);*/
  476.  
  477. }
  478.  
  479.  
  480.  
  481. //alert(player_faction+'\n\n'+factions.indexOf(player_faction));
  482.  
  483.  
  484.  
  485. //========== Combat Level
  486.  
  487. var lvl_info = player_info.textContent.split("\u00BB")[1];
  488.  
  489. lvl_info.search(/(.*)\((.*)\)(.*)/);
  490.  
  491. var lvl_attuale = eval(RegExp.$1.replace(T('Combat level') +": ","")); //БУ
  492. var exp_attuale = 0;
  493.  
  494. var skills = skill_info.innerHTML.split(">&nbsp;&nbsp;");
  495.  
  496. //========== Player Faction(s)
  497.  
  498. var active_faction_index = factions.indexOf(player_faction);
  499.  
  500.  
  501.  
  502. // show ALL factions
  503.  
  504. for(var faction_index=0; faction_index<factions.length; faction_index++){
  505.  
  506. lvl_info = skills[faction_index];
  507.  
  508. lvl_info.search(/\((\d*.?\d*)\)/);
  509.  
  510. exp_attuale = RegExp.$1;
  511. sum_umk = sum_umk + Number(exp_attuale);
  512. }
  513. sum_umk = Math.round(sum_umk*100)/100;
  514. var nomerumki = (lvl_attuale - 3);
  515. srednya_umka = sred_umk[nomerumki];
  516. vilka = vilka_um[nomerumki];
  517. umk_min = sred_umk[nomerumki]/vilka;
  518. umk_max = sred_umk[nomerumki]*vilka;
  519. if (lvl_attuale>2){
  520. progress_bar_html = makeProgressBar(sum_umk, umk_min, umk_max, vilka, lvl_attuale);}
  521.  
  522. if (faction_index<factions.length-1) {
  523.  
  524. var next_faction = factions[faction_index + 1];
  525.  
  526. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ next_faction, progress_bar_html +"&nbsp;&nbsp;"+ next_faction);
  527.  
  528. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;<b>"+ next_faction, progress_bar_html +"&nbsp;&nbsp;<b>"+ next_faction);
  529.  
  530. } else {
  531. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041E\u0445\u043E\u0442\u043D\u0438\u043A\u043E\u0432","<br>&nbsp;&nbsp;<span style='font-weight: bold;'>\u0421\u0443\u043C\u043C\u0430 \u0443\u043C\u0435\u043D\u0438\u0439:</span> "+ sum_umk + progress_bar_html +"<br>&nbsp;&nbsp;\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041E\u0445\u043E\u0442\u043D\u0438\u043A\u043E\u0432");
  532. }
  533. };
  534.  
  535.  
  536. // Конкретные действия для некоторых страниц
  537.  
  538. if (location.href.indexOf('home.php') != -1) showExpBar();
  539.  
  540. if (location.href.indexOf('pl_info.php') != -1) showExpBar();
  541.  
  542. };
  543.  
  544.  
  545.  
  546. main(false);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址