pereka4mod

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

当前为 2017-06-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2.  
  3. // @name pereka4mod
  4.  
  5. // @author dw4rf & Casperovskii
  6.  
  7. // @namespace Pereka4
  8.  
  9. // @version 2.72 (2017.06.06)
  10. // @description Add progress bar for sum of faction exp. and balance coef.
  11.  
  12. // @include http://*heroeswm.*/home.php*
  13. // @include http://178.248.235.15/home.php*
  14. // @include http://*герои.рф/home.php*
  15. // @include http://*lordswm.*/home.php*
  16. // @include http://*heroeswm.*/pl_info.php*
  17. // @include http://178.248.235.15/pl_info.php*
  18. // @include http://*герои.рф/pl_info.php*
  19. // @include http://*lordswm.*/pl_info.php*
  20.  
  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.72";
  69. var srednya_umka = 0;
  70. var umk_min = 0;
  71. var umk_max = 0;
  72.  
  73. var sum_umk = 0;
  74.  
  75. var lang_en = new Array();
  76.  
  77. var lang_uk = lang_en;
  78.  
  79. var lang_us = lang_en;
  80.  
  81. var lang_com = lang_en;
  82.  
  83. lang_en['Knight'] = 'Knight';
  84.  
  85. lang_en['Necromancer'] = 'Necromancer';
  86.  
  87. lang_en['Wizard'] = 'Wizard';
  88.  
  89. lang_en['Elf'] = 'Elf';
  90.  
  91. lang_en['Barbarian'] = 'Barbarian';
  92.  
  93. lang_en['Dark elf'] = 'Dark elf';
  94.  
  95. lang_en['Demon'] = 'Demon';
  96.  
  97. lang_en['Dwarf'] = 'Dwarf';
  98.  
  99. lang_en['Steepe barbarian'] = 'Steepe barbarian';
  100.  
  101. lang_en['Combat level'] = 'Combat level';
  102.  
  103.  
  104.  
  105.  
  106. var lang_ru = new Array();
  107.  
  108. lang_ru['Knight'] = '\u0420\u044B\u0446\u0430\u0440\u044C';
  109.  
  110. lang_ru['Necromancer'] = '\u041D\u0435\u043A\u0440\u043E\u043C\u0430\u043D\u0442';
  111.  
  112. lang_ru['Wizard'] = '\u041C\u0430\u0433';
  113.  
  114. lang_ru['Elf'] = '\u042D\u043B\u044C\u0444';
  115.  
  116. lang_ru['Barbarian'] = '\u0412\u0430\u0440\u0432\u0430\u0440';
  117.  
  118. lang_ru['Dark elf'] = '\u0422\u0435\u043C\u043D\u044B\u0439 \u044D\u043B\u044C\u0444';
  119.  
  120. lang_ru['Demon'] = '\u0414\u0435\u043C\u043E\u043D';
  121.  
  122. lang_ru['Dwarf'] = '\u0413\u043D\u043E\u043C';
  123.  
  124. lang_ru['Steepe barbarian'] = '\u0421\u0442\u0435\u043f\u043d\u043e\u0439 \u0432\u0430\u0440\u0432\u0430\u0440';
  125.  
  126. lang_ru['Combat level'] = '\u0411\u043E\u0435\u0432\u043E\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C';
  127.  
  128.  
  129. var language=lang_en;
  130.  
  131.  
  132.  
  133.  
  134.  
  135. // Определение языка
  136.  
  137. var lingua;
  138.  
  139. if (location.hostname.match('lordswm')) {lingua='en';} else {lingua = 'ru';}
  140.  
  141. try{
  142.  
  143. eval('language = lang_' + lingua);
  144.  
  145. }catch(e){
  146.  
  147. }
  148.  
  149.  
  150.  
  151. //Фракции
  152.  
  153. var factions = [
  154. T('Knight'),T('Necromancer'),T('Wizard'),T('Elf'),T('Barbarian'),T('Dark elf'),T('Demon'),T('Dwarf'),T('Steepe barbarian')
  155. ];
  156.  
  157.  
  158. //Средние умения фракций на 5-22 уровне
  159. var sred_umk = [
  160. 63.5,109,223,320,520,860,1360,2000,2880,3960,5520,
  161.  
  162. 8100,12120,18540,26720,37240,37497,54278,68909,180000
  163. ];
  164.  
  165.  
  166. var XPFirst = XPathResult.FIRST_ORDERED_NODE_TYPE; // Постоянные для первого элемента XPath
  167.  
  168. var XPList = XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE; // Постоянные элементы списка XPath
  169.  
  170.  
  171.  
  172. /**
  173.  
  174. * Поиск по документу с помощью XPath
  175.  
  176. *
  177.  
  178. * Ввод:
  179.  
  180. * xpath Выражение для поиска
  181.  
  182. * xpres Тип поиска
  183.  
  184. *
  185.  
  186. * Вывод:
  187.  
  188. * Ссылка на найденный объект
  189.  
  190. */
  191.  
  192. function find(xpath, xpres,startnode){
  193.  
  194. if (!startnode) {startnode=document;}
  195.  
  196. var ret = document.evaluate(xpath, startnode, null, xpres, null);
  197.  
  198. return xpres == XPFirst ? ret.singleNodeValue : ret;
  199.  
  200. }
  201.  
  202.  
  203.  
  204. /**
  205.  
  206. * Добавляет узел после 1 условия
  207.  
  208. *
  209.  
  210. * Ввод:
  211.  
  212. * refChild узел ссылки
  213.  
  214. * newChild узлы, которые будут добавлены
  215.  
  216. */
  217.  
  218. function insertAfter(newChild, refChild) {
  219.  
  220. node.parentNode.insertBefore(newChild, refChild.nextSibling);
  221.  
  222. }
  223.  
  224.  
  225.  
  226. /**
  227.  
  228. * Создание элемента
  229.  
  230. *
  231.  
  232. * Ввод:
  233.  
  234. * tag Название нового элемента
  235.  
  236. * content Содержание нового элемента в текстовом формате
  237.  
  238. *
  239.  
  240. * Вывод:
  241.  
  242. * Ссылка на созданный элемент
  243.  
  244. */
  245.  
  246.  
  247. function elem(tag, content){
  248.  
  249. var ret = document.createElement(tag);
  250.  
  251. ret.innerHTML = content;
  252.  
  253. return ret;
  254.  
  255. }
  256.  
  257.  
  258.  
  259. /**
  260.  
  261. * Перевод текста на определенный язык
  262.  
  263. *
  264.  
  265. * Ввод:
  266.  
  267. * Текст для перевода
  268.  
  269. *
  270.  
  271. * Вывод:
  272.  
  273. * Перевод
  274.  
  275. */
  276.  
  277.  
  278. function T(testo){
  279.  
  280. // Язык по умолчанию, если слово не существует: английский
  281.  
  282. if (language[testo] == undefined) return lang_en[testo]; else return language[testo];
  283.  
  284. }
  285.  
  286. /**
  287.  
  288. * Создание прогресс бара
  289.  
  290. *
  291.  
  292. * Ввод:
  293.  
  294. * Текущий опыт
  295.  
  296. * Текущее умение фракции
  297.  
  298. * Уровень
  299.  
  300. *
  301.  
  302. * Вывод:
  303.  
  304. * HTML для создания прогресс бара
  305.  
  306. */
  307.  
  308. function makeProgressBar(exp_attuale, min_umka, max_umka){
  309.  
  310.  
  311. exp_attuale = exp_attuale - min_umka;
  312.  
  313. max_umka = max_umka - min_umka;
  314.  
  315. var perc = exp_attuale * 100 / max_umka;
  316.  
  317.  
  318. // Stile
  319.  
  320. /*
  321. var cssStyle = "";
  322.  
  323. return progress_bar_html;
  324.  
  325. */
  326.  
  327. var cssStyle = "";
  328.  
  329. if (perc<100 && perc>0) {
  330. 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;}";
  331. GM_addStyle(cssStyle);
  332. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  333. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  334. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ Math.round(perc*100)/100 +"%</span>"+
  335. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+Math.round(perc)/1+"% </div>" +
  336. "<div>&nbsp;&nbsp;\u0412 \u043D\u043E\u0440\u043C\u0435!</div>";
  337. }
  338. if (perc>100){
  339. perc = 100;
  340. 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;}";
  341. GM_addStyle(cssStyle);
  342. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  343. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  344. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ perc +"%</span>"+
  345. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  346. "</div><br>&nbsp;&nbsp;\u041F\u0435\u0440\u0435\u043A\u0430\u0447!<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/1.6)-1)*100).toFixed(2)+"%<br>";
  347. }
  348. if (perc<0) {
  349. perc = 0;
  350. 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;}";
  351. GM_addStyle(cssStyle);
  352. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  353. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  354. "<span>\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441: "+ perc +"%</span>"+
  355. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  356. "</div><br>&nbsp;&nbsp;\u041D\u0435\u0434\u043E\u043A\u0430\u0447!<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>";
  357. }
  358. return progress_bar_html;
  359.  
  360. }
  361.  
  362.  
  363.  
  364. function showExpBar(){
  365.  
  366. var tabelle = find("//table", XPList);
  367.  
  368. var player_info = "";
  369.  
  370. var skill_info = "";
  371.  
  372. var player_faction = "";
  373.  
  374.  
  375.  
  376. if (location.href.indexOf('home.php') != -1) {
  377.  
  378. //Поиск страницы
  379.  
  380. for (var i = 25; i < tabelle.snapshotLength; i++){
  381.  
  382. if (!tabelle.snapshotItem(i)) continue;
  383.  
  384. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  385.  
  386. if (!tabelle.snapshotItem(i).childNodes[0].childNodes[0]) continue;
  387.  
  388.  
  389. //Player level
  390.  
  391. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0]) {
  392.  
  393. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0].innerHTML.indexOf(T('Combat level') +":") > 0) {
  394.  
  395. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0];
  396.  
  397. }
  398.  
  399. }
  400.  
  401.  
  402.  
  403. //Skill Info
  404.  
  405. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1]) {
  406.  
  407. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1].innerHTML.indexOf(T('Knight') +":") > 0) {
  408.  
  409. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1];
  410.  
  411. }
  412.  
  413. }
  414.  
  415. }
  416. } else if (location.href.indexOf('pl_info.php') != -1) {
  417.  
  418. //Поиск страницы
  419.  
  420. for (var i = 25; i < tabelle.snapshotLength; i++){
  421.  
  422. if (!tabelle.snapshotItem(i)) continue;
  423.  
  424. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  425.  
  426.  
  427.  
  428. //Player Info
  429.  
  430. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2]) {
  431.  
  432. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0]) {
  433.  
  434. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0].textContent.indexOf(T('Combat level') +":") > 0) {
  435.  
  436. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0];
  437.  
  438. }
  439.  
  440. }
  441.  
  442. }
  443.  
  444.  
  445.  
  446. //Skill Info
  447.  
  448. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1]) {
  449.  
  450. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1]) {
  451.  
  452. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1].textContent.indexOf(T('Knight')) > 0) {
  453.  
  454. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1];
  455.  
  456. }
  457.  
  458. }
  459.  
  460. }
  461.  
  462.  
  463. }
  464.  
  465.  
  466.  
  467. /*tabelle.snapshotItem(31).childNodes[0].childNodes[0].childNodes[0].innerHTML.search(/\- (.*)</);
  468.  
  469. player_faction = RegExp.$1;
  470.  
  471. alert("player_faction = "+player_faction);*/
  472.  
  473. }
  474.  
  475.  
  476.  
  477. //alert(player_faction+'\n\n'+factions.indexOf(player_faction));
  478.  
  479.  
  480.  
  481. //========== Combat Level
  482.  
  483. var lvl_info = player_info.textContent.split("\u00BB")[1];
  484.  
  485. lvl_info.search(/(.*)\((.*)\)(.*)/);
  486.  
  487. var lvl_attuale = eval(RegExp.$1.replace(T('Combat level') +": ","")); //БУ
  488. var exp_attuale = 0;
  489.  
  490. var skills = skill_info.innerHTML.split(">&nbsp;&nbsp;");
  491.  
  492. //========== Player Faction(s)
  493.  
  494. var active_faction_index = factions.indexOf(player_faction);
  495.  
  496.  
  497.  
  498. // show ALL factions
  499.  
  500. for(var faction_index=0; faction_index<factions.length; faction_index++){
  501.  
  502. lvl_info = skills[faction_index];
  503.  
  504. lvl_info.search(/\((\d*.?\d*)\)/);
  505.  
  506. exp_attuale = RegExp.$1;
  507. sum_umk = sum_umk + Number(exp_attuale);
  508. }
  509. sum_umk = Math.round(sum_umk*100)/100;
  510. var nomerumki = (lvl_attuale - 3);
  511. srednya_umka = sred_umk[nomerumki];
  512. if (lvl_attuale != 22) {
  513. umk_min = sred_umk[nomerumki]/1.6;
  514. umk_max = sred_umk[nomerumki]*1.6;
  515. } else {
  516. umk_min = sum_umk/2;
  517. umk_max = sum_umk*1.5;
  518. }
  519. if (lvl_attuale>2){
  520. progress_bar_html = makeProgressBar(sum_umk, umk_min, umk_max);}
  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);