HWM Silentio's Mod + Pereka4

Add progress bar for Combat, Faction and Guilds levels.

  1. // ==UserScript==
  2.  
  3. // @name HWM Silentio's Mod + Pereka4
  4.  
  5. // @author Silentio & dw4rf
  6.  
  7. // @namespace HWM
  8.  
  9. // @version 1.1
  10.  
  11. // @description Add progress bar for Combat, Faction and Guilds levels.
  12.  
  13. // @include http://*heroeswm.*/home.php*
  14. // @include http://178.248.235.15/home.php*
  15. // @include http://209.200.152.144/home.php*
  16. // @include http://173.231.37.114/home.php*
  17. // @include http://*freebsd-help.org/home.php*
  18. // @include http://*heroes-wm.*/home.php*
  19. // @include http://*hommkingdoms.info/home.php*
  20. // @include http://*hmmkingdoms.com/home.php*
  21. // @include http://*герои.рф/home.php*
  22. // @include http://*lordswm.*/home.php*
  23. // @include http://*heroeswm.*/pl_info.php*
  24. // @include http://178.248.235.15/pl_info.php*
  25. // @include http://209.200.152.144/pl_info.php*
  26. // @include http://173.231.37.114/pl_info.php*
  27. // @include http://*freebsd-help.org/pl_info.php*
  28. // @include http://*heroes-wm.*/pl_info.php*
  29. // @include http://*hommkingdoms.info/pl_info.php*
  30. // @include http://*hmmkingdoms.com/pl_info.php*
  31. // @include http://*герои.рф/pl_info.php*
  32. // @include http://*lordswm.*/pl_info.php*
  33.  
  34. // ==/UserScript==
  35.  
  36. /*
  37.  
  38. * This script is licensed under the
  39.  
  40. * Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Italy License.
  41.  
  42. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/it/
  43.  
  44. */
  45.  
  46.  
  47.  
  48. // Основная функция, выполняемая при загрузке страницы целиком
  49.  
  50. if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) {
  51. this.GM_getValue=function (key,def) {
  52. return localStorage[key] || def;
  53. };
  54. this.GM_setValue=function (key,value) {
  55. return localStorage[key]=value;
  56. };
  57. this.GM_deleteValue=function (key) {
  58. return delete localStorage[key];
  59. };
  60. this.GM_addStyle = function(css) {
  61. var style = document.createElement('style');
  62. style.textContent = css;
  63. document.getElementsByTagName('head')[0].appendChild(style);
  64. };
  65. this.GM_registerMenuCommand = function(name, funk) {
  66. //todo
  67. };
  68. }
  69.  
  70. //function main(e){
  71. if (typeof LORDSWM == 'undefined') { // Own sandbox check.
  72. var LORDSWM = {};
  73. }
  74. LORDSWM.progressBars = {};
  75. LORDSWM.progressBars.init = (function () {
  76.  
  77. var version = "1.1";
  78.  
  79. var srednya_umka = 0;
  80. var umk_min = 0;
  81. var umk_max = 0;
  82.  
  83. var sum_umk = 0;
  84.  
  85. var lang_en = new Array();
  86.  
  87. var lang_uk = lang_en;
  88.  
  89. var lang_us = lang_en;
  90.  
  91. var lang_com = lang_en;
  92.  
  93. lang_en['Knight'] = 'Knight';
  94.  
  95. lang_en['Necromancer'] = 'Necromancer';
  96.  
  97. lang_en['Wizard'] = 'Wizard';
  98.  
  99. lang_en['Elf'] = 'Elf';
  100.  
  101. lang_en['Barbarian'] = 'Barbarian';
  102.  
  103. lang_en['Dark elf'] = 'Dark elf';
  104.  
  105. lang_en['Demon'] = 'Demon';
  106.  
  107. lang_en['Dwarf'] = 'Dwarf';
  108.  
  109. lang_en['Tribal'] = 'Tribal';
  110.  
  111. lang_en['Combat level'] = 'Combat level';
  112.  
  113. lang_en['Hunters\' guild'] = 'Hunters\' guild';
  114.  
  115. lang_en['Laborers\' guild'] = 'Laborers\' guild';
  116.  
  117. lang_en['Gamblers\' guild'] = 'Gamblers\' guild';
  118.  
  119. lang_en['Thieves\' guild'] = 'Thieves\' guild';
  120.  
  121. lang_en['Rangers\' guild'] = 'Rangers\' guild';
  122.  
  123. lang_en['Mercenaries\' guild'] = 'Mercenaries\' guild';
  124.  
  125. lang_en['Tactics\' guild'] = 'Commanders\' guild';
  126.  
  127. lang_en['Watchers\' guild'] = 'Watchers\' guild';
  128.  
  129. lang_en['Adventurers\' guild'] = 'Adventurers\' guild';
  130. lang_en['Smiths\' guild'] = 'Smiths\' guild';
  131.  
  132. lang_en['Enchanters\' guild'] = 'Enchanters\' guild';
  133.  
  134. lang_en['Progress Bar'] = 'Progress Bar';
  135.  
  136. lang_en['Toggle'] = 'Toggle';
  137. lang_en['Progress'] = 'Progress';
  138. lang_en['Sum of fsp'] = 'Sum of fsp';
  139. lang_en['Normal fsp'] = 'Normal fsp';
  140. lang_en['Pumped character'] = 'Pumped character';
  141. lang_en['Pimped character'] = 'Pimped character';
  142. lang_en['Additional exp'] = 'Additional exp';
  143. lang_en['Additional fsp'] = 'Additional fsp';
  144.  
  145. lang_en['Show all factions'] = 'Show all fractions';
  146.  
  147. lang_en['Show active faction'] = 'Show only active fraction';
  148.  
  149. lang_en['NewStyle'] = 'Show New style';
  150. lang_en['Abu-Bakir'] = 'Abu-Bakir';
  151.  
  152.  
  153.  
  154. var lang_ru = new Array();
  155.  
  156. lang_ru['Knight'] = '\u0420\u044B\u0446\u0430\u0440\u044C';
  157.  
  158. lang_ru['Necromancer'] = '\u041D\u0435\u043A\u0440\u043E\u043C\u0430\u043D\u0442';
  159.  
  160. lang_ru['Wizard'] = '\u041C\u0430\u0433';
  161.  
  162. lang_ru['Elf'] = '\u042D\u043B\u044C\u0444';
  163.  
  164. lang_ru['Barbarian'] = '\u0412\u0430\u0440\u0432\u0430\u0440';
  165.  
  166. lang_ru['Dark elf'] = '\u0422\u0435\u043C\u043D\u044B\u0439 \u044D\u043B\u044C\u0444';
  167.  
  168. lang_ru['Demon'] = '\u0414\u0435\u043C\u043E\u043D';
  169.  
  170. lang_ru['Dwarf'] = '\u0413\u043D\u043E\u043C';
  171.  
  172. lang_ru['Tribal'] = '\u0421\u0442\u0435\u043f\u043d\u043e\u0439 \u0432\u0430\u0440\u0432\u0430\u0440';
  173.  
  174. lang_ru['Combat level'] = '\u0411\u043E\u0435\u0432\u043E\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C';
  175.  
  176. lang_ru['Hunters\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041E\u0445\u043E\u0442\u043D\u0438\u043A\u043E\u0432';
  177.  
  178. lang_ru['Laborers\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0420\u0430\u0431\u043E\u0447\u0438\u0445';
  179.  
  180. lang_ru['Gamblers\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041A\u0430\u0440\u0442\u0435\u0436\u043D\u0438\u043A\u043E\u0432';
  181.  
  182. lang_ru['Thieves\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0412\u043E\u0440\u043E\u0432';
  183.  
  184. lang_ru['Rangers\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0420\u0435\u0439\u043D\u0434\u0436\u0435\u0440\u043E\u0432';
  185.  
  186. lang_ru['Mercenaries\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041D\u0430\u0435\u043C\u043D\u0438\u043A\u043E\u0432';
  187.  
  188. lang_ru['Tactics\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0422\u0430\u043A\u0442\u0438\u043A\u043E\u0432';
  189.  
  190. lang_ru['Watchers\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0421\u0442\u0440\u0430\u0436\u0435\u0439';
  191.  
  192. lang_ru['Adventurers\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u0418\u0441\u043A\u0430\u0442\u0435\u043B\u0435\u0439';
  193. lang_ru['Smiths\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041A\u0443\u0437\u043D\u0435\u0446\u043E\u0432';
  194.  
  195. lang_ru['Enchanters\' guild'] = '\u0413\u0438\u043B\u044C\u0434\u0438\u044F \u041E\u0440\u0443\u0436\u0435\u0439\u043D\u0438\u043A\u043E\u0432';
  196.  
  197. lang_ru['Progress Bar'] = '\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441 \u0411\u0430\u0440';
  198.  
  199. lang_ru['Toggle'] = '\u0432\u043A\u043B/\u0432\u044B\u043A\u043B';
  200. lang_ru['Progress'] = '\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441';
  201. lang_ru['Sum of fsp'] = '\u0421\u0443\u043C\u043C\u0430 \u0443\u043C\u0435\u043D\u0438\u0439';
  202. lang_ru['Normal fsp'] = '\u0412 \u043D\u043E\u0440\u043C\u0435';
  203. lang_ru['Pimped character'] = '\u041D\u0435\u0434\u043E\u043A\u0430\u0447';
  204. lang_ru['Pumped character'] = '\u041F\u0435\u0440\u0435\u043A\u0430\u0447';
  205. lang_ru['Additional exp'] = '\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043E\u043F\u044B\u0442\u0430';
  206. lang_ru['Additional fsp'] = '\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u043C\u0435\u043D\u0438\u0439';
  207.  
  208. lang_ru['NewStyle'] = '\u041d\u043e\u0432\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f';
  209. lang_ru['Abu-Bakir'] = '\u0410\u0431\u0443-\u0411\u0435\u043A\u0440\u0430';
  210.  
  211.  
  212.  
  213. var language=lang_en;
  214.  
  215.  
  216.  
  217.  
  218.  
  219. // Определение языка
  220.  
  221. var lingua;
  222.  
  223. if (location.hostname.match('lordswm')) {lingua='en';} else {lingua = 'ru';}
  224.  
  225. try{
  226.  
  227. eval('language = lang_' + lingua);
  228.  
  229. }catch(e){
  230.  
  231. }
  232.  
  233.  
  234.  
  235. //Фракции
  236.  
  237. var factions = [
  238. T('Knight'),T('Necromancer'),T('Wizard'),T('Elf'),T('Barbarian'),T('Dark elf'),T('Demon'),T('Dwarf'),T('Tribal')
  239. ];
  240.  
  241.  
  242. //Гильдии
  243.  
  244. var guilds = [
  245. T('Hunters\' guild'),T('Laborers\' guild'),T('Gamblers\' guild'),T('Thieves\' guild'),T('Rangers\' guild'),T('Mercenaries\' guild'),T('Tactics\' guild'),T('Watchers\' guild'),T('Adventurers\' guild'),T('Smiths\' guild'),T('Enchanters\' guild')
  246. ];
  247.  
  248.  
  249. //Боевой уровень (21 уровень)
  250.  
  251. var combat_exp_lvl = [
  252.  
  253. 0,1500,4500,15000,32000,90000,190000,400000,860000,1650000,
  254. 3000000,5000000,8500000,14500000,25000000,43000000,70000000,
  255. 108000000,160000000,230000000,325000000
  256.  
  257. ];
  258.  
  259.  
  260.  
  261. //Умение фракции (12 уровней)
  262.  
  263. var racial_skill_lvl = [
  264.  
  265. 20,50,90,160,280,
  266.  
  267. 500,900,1600,2900,5300,9600,17300
  268.  
  269. ];
  270.  
  271.  
  272.  
  273. //Гильдия охотников (12 уровней)
  274.  
  275. var hunters_guild_lvl = [
  276.  
  277. 16,60,180,400,700,
  278.  
  279. 1200,2000,3000,4300,6000,8000,10500
  280.  
  281. ];
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. //Гильдия рабочих (16 уровенй)
  289.  
  290. var laborers_guild_lvl = [
  291.  
  292. 90,180,360,720,1500,
  293. 3000,5000,8000,12000,17000,23000,30000,
  294. 38000,47000,57000,70000
  295.  
  296. ];
  297.  
  298.  
  299.  
  300. //Гильдия картежников (15 уровней)
  301.  
  302. var gamblers_guild_lvl = [
  303.  
  304. 10,30,60,100,150,
  305.  
  306. 210,280,360,450,550,
  307.  
  308. 660,800,1000,1300,2000
  309.  
  310. ];
  311.  
  312.  
  313.  
  314. //Гильдия воров (14 уровней)
  315.  
  316. var thieves_guild_lvl = [
  317.  
  318. 50,120,240,400,600,
  319. 840,1200,2000,3000,4300,6000,8000,
  320. 10800,14000,17600,21600,26000
  321.  
  322. ];
  323.  
  324.  
  325.  
  326. //Гильдия рейнджеров (10 уровней)
  327.  
  328. var rangers_guild_lvl = [
  329.  
  330. 100,240,480,800,1200,1680,2400,4000,6000,8600,12000
  331.  
  332. ];
  333.  
  334.  
  335.  
  336. //Гильдия наемников (12 уровней)
  337.  
  338. var mercenaries_guild_lvl = [
  339.  
  340. 50,120,300,600,1000,
  341. 1500,2200,3000,4000,5500,
  342. 7800,11000,14500,18200,22200
  343.  
  344. ];
  345.  
  346.  
  347.  
  348. //Гильдия тактиков(6 уровней)
  349.  
  350. var tactics_guild_lvl = [
  351.  
  352. 150,350,750,1400,2200,4000,6000,8400,11200
  353.  
  354. ];
  355.  
  356.  
  357.  
  358.  
  359.  
  360. //Гильдия кузнецов (9 уровней)
  361.  
  362. var smiths_guild_lvl = [
  363.  
  364. 30,80,165,310,555,
  365.  
  366. 970,1680,2885,5770
  367.  
  368. ];
  369.  
  370.  
  371.  
  372. //Watchers' guild (5 уровней)
  373.  
  374. var watchers_guild_lvl = [
  375.  
  376. 60,200,450,850,1500
  377.  
  378. ];
  379.  
  380.  
  381.  
  382. //Adventurers' guild (2 уровней)
  383.  
  384. var adventurers_guild_lvl = [
  385.  
  386. 1600,3600
  387.  
  388. ];
  389.  
  390.  
  391.  
  392. //Гильдия оружейников (5 уровней)
  393.  
  394. var enchanters_guild_lvl = [
  395.  
  396. 104,588,2200,7000,10000
  397.  
  398. ];
  399.  
  400.  
  401. //Enchanters' Guild branches (11 levels)
  402.  
  403. var enchanters_guild_branches_lvl = [
  404.  
  405. 8,29,71,155,295,
  406.  
  407. 505,799,1191,1695,6000,12000
  408.  
  409. ];
  410. //Средние умения фракций на 4-21 уровне (17.04.2013)
  411. var sred_umk = [
  412. 120, 200, 320, 520, 860, 1360, 2000, 2880, 3960, 5520,
  413. 8100, 12120, 18540, 26270, 37240, 54000, 78300, 113500
  414. //35630,51427,86189
  415. ];
  416.  
  417. // lvl avg = (total fsp * expected exp) / (1.6 * received exp)
  418.  
  419. var XPFirst = XPathResult.FIRST_ORDERED_NODE_TYPE; // Постоянные для первого элемента XPath
  420.  
  421. var XPList = XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE; // Постоянные элементы списка XPath
  422.  
  423.  
  424.  
  425. function init() {
  426.  
  427. //Меню опций
  428. makeMenuToggle("SHOW_NEW_STYLE", "false", T('Toggle') +" "+ T('NewStyle'), T('Progress Bar'));
  429.  
  430. GM_registerMenuCommand(T('Progress Bar') +": "+ T('Show all factions'), function() {
  431. GM_setValue("SHOW_ONLY_ACTIVE_FACTION_PROGRESS_BAR", "false");
  432. location.reload();
  433. });
  434.  
  435. GM_registerMenuCommand(T('Progress Bar') +": "+ T('Show active faction'), function() {
  436. GM_setValue("SHOW_ONLY_ACTIVE_FACTION_PROGRESS_BAR", "true");
  437. location.reload();
  438. });
  439.  
  440. makeMenuToggle("SHOW_PEREKA4_PROGRESS_BAR", "true", T('Toggle') +" "+ 'pereka4', T('Progress Bar'));
  441. makeMenuToggle("SHOW_HUNTERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Hunters\' guild'), T('Progress Bar'));
  442.  
  443. makeMenuToggle("SHOW_LABORERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Laborers\' guild'), T('Progress Bar'));
  444.  
  445. makeMenuToggle("SHOW_GAMBLERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Gamblers\' guild'), T('Progress Bar'));
  446.  
  447. makeMenuToggle("SHOW_THIEVES_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Thieves\' guild'), T('Progress Bar'));
  448.  
  449. makeMenuToggle("SHOW_RANGERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Rangers\' guild'), T('Progress Bar'));
  450.  
  451. makeMenuToggle("SHOW_MERCENARIES_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Mercenaries\' guild'), T('Progress Bar'));
  452.  
  453. makeMenuToggle("SHOW_TACTICS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Tactics\' guild'), T('Progress Bar'));
  454.  
  455. makeMenuToggle("SHOW_WATCHERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Watchers\' guild'), T('Progress Bar'));
  456.  
  457. makeMenuToggle("SHOW_ADVENTURERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Adventurers\' guild'), T('Progress Bar'));
  458.  
  459. makeMenuToggle("SHOW_SMITHS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Smiths\' guild'), T('Progress Bar'));
  460.  
  461. makeMenuToggle("SHOW_ENCHANTERS_PROGRESS_BAR", "true", T('Toggle') +" "+ T('Enchanters\' guild'), T('Progress Bar'));
  462.  
  463. }
  464.  
  465.  
  466. /**
  467.  
  468. * Поиск по документу с помощью XPath
  469.  
  470. *
  471.  
  472. * Ввод:
  473.  
  474. * xpath Выражение для поиска
  475.  
  476. * xpres Тип поиска
  477.  
  478. *
  479.  
  480. * Вывод:
  481.  
  482. * Ссылка на найденный объект
  483.  
  484. */
  485.  
  486. function find(xpath, xpres,startnode){
  487.  
  488. if (!startnode) {startnode=document;}
  489.  
  490. var ret = document.evaluate(xpath, startnode, null, xpres, null);
  491.  
  492. return xpres == XPFirst ? ret.singleNodeValue : ret;
  493.  
  494. }
  495.  
  496.  
  497.  
  498. /**
  499.  
  500. * Добавляет узел после 1 условия
  501.  
  502. *
  503.  
  504. * Ввод:
  505.  
  506. * refChild узел ссылки
  507.  
  508. * newChild узлы, которые будут добавлены
  509.  
  510. */
  511.  
  512. function insertAfter(newChild, refChild) {
  513.  
  514. node.parentNode.insertBefore(newChild, refChild.nextSibling);
  515.  
  516. }
  517.  
  518.  
  519.  
  520. /**
  521.  
  522. * Создание элемента
  523.  
  524. *
  525.  
  526. * Ввод:
  527.  
  528. * tag Название нового элемента
  529.  
  530. * content Содержание нового элемента в текстовом формате
  531.  
  532. *
  533.  
  534. * Вывод:
  535.  
  536. * Ссылка на созданный элемент
  537.  
  538. */
  539.  
  540. function elem(tag, content){
  541.  
  542. var ret = document.createElement(tag);
  543.  
  544. ret.innerHTML = content;
  545.  
  546. return ret;
  547.  
  548. }
  549.  
  550.  
  551.  
  552. /**
  553.  
  554. * Перевод текста на определенный язык
  555.  
  556. *
  557.  
  558. * Ввод:
  559.  
  560. * Текст для перевода
  561.  
  562. *
  563.  
  564. * Вывод:
  565.  
  566. * Перевод
  567.  
  568. */
  569.  
  570. function T(testo){
  571.  
  572. // Lingua di default in caso di parola non presente: inglese
  573.  
  574. if (language[testo] == undefined) return lang_en[testo]; else return language[testo];
  575.  
  576. }
  577.  
  578.  
  579.  
  580. function makeMenuToggle(key, defaultValue, label, prefix) {
  581.  
  582. window[key] = GM_getValue(key, defaultValue);
  583.  
  584.  
  585.  
  586. GM_registerMenuCommand((prefix ? prefix+": " : "") + label, function() {
  587.  
  588. GM_setValue(key, window[key] == "true" ? "false" : "true");
  589.  
  590. location.reload();
  591.  
  592. });
  593.  
  594. }
  595.  
  596.  
  597.  
  598. /**
  599.  
  600. * Создание прогресс бара
  601.  
  602. *
  603.  
  604. * Ввод:
  605.  
  606. * Текущий опыт
  607.  
  608. * Текущее умение фракции
  609.  
  610. * Уровень
  611.  
  612. *
  613.  
  614. * Вывод:
  615.  
  616. * HTML для создания прогресс бара
  617.  
  618. */
  619. function makeProgressBarUmk(exp_attuale, min_umka, max_umka){
  620.  
  621.  
  622. exp_attuale = exp_attuale - min_umka;
  623.  
  624. max_umka = max_umka - min_umka;
  625.  
  626. var perc = Math.round(exp_attuale * 1000 / max_umka)/10;
  627.  
  628. // Stile
  629.  
  630. /*
  631. var cssStyle = "";
  632.  
  633. return progress_bar_html;
  634.  
  635. */
  636.  
  637. var cssStyle = "";
  638. if (GM_getValue("SHOW_NEW_STYLE", "true") == "true") {
  639. if (perc<=100 && perc>0) {
  640. 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;}";
  641. GM_addStyle(cssStyle);
  642. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  643. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  644. "<span>"+T('Progress')+": " + perc +"%</span>"+
  645. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+Math.round(perc)/1+"% </div>" +
  646. "<div>&nbsp;&nbsp;"+T('Normal fsp')+"!"+"</div>";
  647. }
  648. if (perc>100){
  649. perc = 100;
  650. 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;}";
  651. GM_addStyle(cssStyle);
  652. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  653. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  654. "<span>"+T('Progress')+": " + perc +"%</span>"+
  655. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  656. "</div><br>&nbsp;&nbsp;"+T('Pumped character')+"!<br>&nbsp;&nbsp;"+T('Additional exp')+": "+Math.round(((sum_umk/srednya_umka/1.6)-1)*1000)/10+"%<br>";
  657. }
  658. if (perc<0) {
  659. perc = 0;
  660. 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;}";
  661. GM_addStyle(cssStyle);
  662. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  663. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  664. "<span>"+T('Progress')+": " + perc +"%</span>"+
  665. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>"+
  666. "</div><br>&nbsp;&nbsp;"+T('Pimped character')+"!<br>&nbsp;&nbsp;"+T('Additional fsp')+": "+Math.round(((srednya_umka/sum_umk)-1)*1000)/10+"%<br><br>";
  667. }
  668. }else{
  669. if (perc<=100 && perc>0) {
  670. cssStyle += ".table_progress {width:100px; height:3px; padding: 0px; margin-left: 9px; margin-top: 0px; margin-bottom: 0px; border: 1px solid black;}";
  671. GM_addStyle(cssStyle);
  672. var progress_bar_html = "<DIV class=\"table_progress\" title=\""+ perc +"%\">"+
  673. "<img src=\"i/top/logot.jpg\" height=\"3\" width=\""+ perc +"\" title=\""+ perc +"%\" alt\""+ perc +"%\">"+
  674.  
  675. "</DIV>" +
  676. "<div>&nbsp;&nbsp;"+T('Normal fsp')+"!"+"</div>";
  677. }
  678. if (perc>100){
  679. perc = 100;
  680. cssStyle += ".table_progress {width:100px; height:3px; padding: 0px; margin-left: 9px; margin-top: 0px; margin-bottom: 0px; border: 1px solid black;}";
  681. GM_addStyle(cssStyle);
  682. var progress_bar_html = "<DIV class=\"table_progress\" title=\""+ perc +"%\">"+
  683. "<img src=\"i/top/logot.jpg\" height=\"3\" width=\""+ perc +"\" title=\""+ perc +"%\" alt\""+ perc +"%\">"+
  684.  
  685. "</DIV>" + "</div><br>&nbsp;&nbsp;"+T('Pumped character')+"!<br>&nbsp;&nbsp;"+T('Additional exp')+": "+Math.round(((sum_umk/srednya_umka/1.6)-1)*1000)/10+"%<br>";
  686. }
  687. if (perc<0) {
  688. perc = 0;
  689. cssStyle += ".table_progress {width:100px; height:3px; padding: 0px; margin-left: 9px; margin-top: 0px; margin-bottom: 0px; border: 1px solid black;}";
  690. GM_addStyle(cssStyle);
  691. var progress_bar_html = "<DIV class=\"table_progress\" title=\""+ perc +"%\">"+
  692. "<img src=\"i/top/logot.jpg\" height=\"3\" width=\""+ perc +"\" title=\""+ perc +"%\" alt\""+ perc +"%\">"+
  693.  
  694. "</DIV>"+
  695. "</div><br>&nbsp;&nbsp;"+T('Pimped character')+"!<br>&nbsp;&nbsp;"+T('Additional fsp')+": "+Math.round(((srednya_umka/sum_umk)-1)*1000)/10+"%<br><br>";
  696. }
  697. }
  698.  
  699. return progress_bar_html;
  700.  
  701. }
  702.  
  703. function makeProgressBar(exp_attuale, lvl_attuale, exp_lvls){
  704.  
  705. if (lvl_attuale=="") {
  706.  
  707. for (var i=0; i <= exp_lvls.length; i++) {
  708.  
  709. if (exp_lvls[i] > exp_attuale || i == exp_lvls.length) {
  710.  
  711. lvl_attuale = i;
  712.  
  713. break;
  714.  
  715. }
  716.  
  717. }
  718.  
  719. }
  720.  
  721.  
  722.  
  723. var exp_necessaria = exp_lvls[lvl_attuale];
  724.  
  725. if (lvl_attuale == 0) {
  726.  
  727. var perc = Math.round(exp_attuale * 100 / exp_necessaria);
  728.  
  729. //var perc = 0;
  730.  
  731. } else if (lvl_attuale == exp_lvls.length) {
  732.  
  733. var perc = 100;
  734.  
  735. } else {
  736.  
  737. exp_attuale = exp_attuale - exp_lvls[lvl_attuale-1];
  738.  
  739. exp_necessaria = exp_necessaria - exp_lvls[lvl_attuale-1];
  740.  
  741. var perc = Math.round(exp_attuale * 100 / exp_necessaria);
  742.  
  743. }
  744.  
  745. // Стиль
  746.  
  747. /*
  748. var cssStyle = "";
  749.  
  750. return progress_bar_html;
  751.  
  752. */
  753.  
  754.  
  755. var cssStyle = "";
  756.  
  757. if (GM_getValue("SHOW_NEW_STYLE", "true") == "true") {
  758.  
  759. 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;}";
  760. GM_addStyle(cssStyle);
  761. var progress_bar_html = "<div class=\"bar_wrap htooltip\">"+
  762. "<div class=\"bar\" style=\"max-width:150px;width:"+ perc +"%\"></div>"+
  763. "<span>"+T('Progress')+": " + perc +"%</span>"+
  764. "</div>"+"<div style='font-size: 8px; font-weight: bold; margin: -11px 0 0 165px'>"+perc+"% </div>";;
  765.  
  766. } else {
  767.  
  768. cssStyle += ".table_progress {width:100px; height:3px; padding: 0px; margin-left: 9px; margin-top: 0px; margin-bottom: 0px; border: 1px solid black;}";
  769. GM_addStyle(cssStyle);
  770. var progress_bar_html = "<DIV class=\"table_progress\" title=\""+ perc +"%\">"+
  771. "<img src=\"i/top/logot.jpg\" height=\"3\" width=\""+ perc +"\" title=\""+ perc +"%\" alt\""+ perc +"%\">"+
  772.  
  773. "</DIV>";
  774.  
  775. }
  776.  
  777. return progress_bar_html;
  778.  
  779. }
  780.  
  781.  
  782. function showExpBar(){
  783.  
  784. var tabelle = find("//table", XPList);
  785.  
  786. var player_info = "";
  787.  
  788. var skill_info = "";
  789.  
  790. var player_faction = "";
  791.  
  792.  
  793. //TODO: Trovare un modo per individuare univocamente le informazioni. La struttura attuale del server non sembra permetterlo.
  794.  
  795. if (location.href.indexOf('home.php') != -1) {
  796. //Поиск страницы
  797.  
  798. for (var i = 25; i < tabelle.snapshotLength; i++){
  799.  
  800. if (!tabelle.snapshotItem(i)) continue;
  801.  
  802. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  803.  
  804. if (!tabelle.snapshotItem(i).childNodes[0].childNodes[0]) continue;
  805.  
  806.  
  807.  
  808. //Player Info
  809.  
  810. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0]) {
  811.  
  812. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0].innerHTML.indexOf(T('Combat level') +":") > 0) {
  813.  
  814. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0];
  815.  
  816. }
  817.  
  818. }
  819.  
  820.  
  821.  
  822. //Skill Info
  823.  
  824. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1]) {
  825.  
  826. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1].innerHTML.indexOf(T('Knight') +":") > 0) {
  827.  
  828. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[1];
  829.  
  830. }
  831.  
  832. }
  833.  
  834.  
  835.  
  836. //Faction Info
  837.  
  838.  
  839.  
  840. if (player_faction == "") {
  841. if(tabelle.snapshotItem(i).childNodes[0].childNodes[0].innerHTML.search(/title\=\"(.*?)\"/) > 0) {
  842.  
  843. if (RegExp.$1.indexOf(language['Abu-Bakir']) != -1) {
  844. tabelle.snapshotItem(i).childNodes[0].childNodes[0].innerHTML.split(language['Abu-Bakir'])[1].search(/title\=\"(.*?)\"/);
  845. }
  846. player_faction = RegExp.$1;
  847. // временный фикс под альт-фраки
  848. if (player_faction == "Демон тьмы") player_faction="Демон";
  849. if (player_faction == "Рыцарь света") player_faction="Рыцарь";
  850. if (player_faction == "Некромант повелитель смерти") player_faction="Некромант";
  851. if (player_faction == "Варвар крови") player_faction="Варвар";
  852. if (player_faction == "Варвар-шаман") player_faction="Варвар";
  853. if (player_faction == "Темный эльф-укротитель") player_faction="Темный эльф";
  854. if (player_faction == "Маг-разрушитель") player_faction="Маг";
  855. if (player_faction == "Эльф-заклинатель") player_faction="Эльф";
  856. if (player_faction == "Darkness demon") player_faction="Demon";
  857. if (player_faction == "Holy knight") player_faction="Knight";
  858. if (player_faction == "Unholy necromancer") player_faction="Necromancer";
  859. if (player_faction == "Fury barbarian") player_faction="Barbarian";
  860. if (player_faction == "Shadow barbarian") player_faction="Barbarian";
  861. if (player_faction == "Tamer dark elf") player_faction="Dark elf";
  862. if (player_faction == "Battlewise wizard") player_faction="Wizard";
  863. if (player_faction == "Charmer elf") player_faction="Elf";
  864. if (factions.indexOf(player_faction) < 0) player_faction="";
  865.  
  866.  
  867. }
  868.  
  869. }
  870.  
  871.  
  872.  
  873.  
  874. if (player_info !="" && skill_info != "" && player_faction != "") break;
  875.  
  876. }
  877.  
  878.  
  879.  
  880.  
  881.  
  882. } else if (location.href.indexOf('pl_info.php') != -1) {
  883.  
  884. //Ricerco in tutte le tabelle della pagina
  885.  
  886. for (var i = 25; i < tabelle.snapshotLength; i++){
  887.  
  888. if (!tabelle.snapshotItem(i)) continue;
  889.  
  890. if (!tabelle.snapshotItem(i).childNodes[0]) continue;
  891.  
  892.  
  893.  
  894. //Player Info
  895.  
  896. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2]) {
  897.  
  898. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0]) {
  899.  
  900. if (tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0].textContent.indexOf(T('Combat level') +":") > 0) {
  901.  
  902. player_info = tabelle.snapshotItem(i).childNodes[0].childNodes[2].childNodes[0];
  903.  
  904. }
  905.  
  906. }
  907.  
  908. }
  909.  
  910.  
  911.  
  912. //Skill Info
  913.  
  914. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1]) {
  915.  
  916. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1]) {
  917.  
  918. if (tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1].textContent.indexOf(T('Knight')) > 0) {
  919.  
  920. skill_info = tabelle.snapshotItem(i).childNodes[0].childNodes[1].childNodes[1];
  921.  
  922. }
  923.  
  924. }
  925.  
  926. }
  927.  
  928.  
  929. //Faction Info
  930.  
  931. if (player_faction == "") {
  932. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0]) {
  933. if (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0]) {
  934. if ((tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0].innerHTML.search(/\.gif\" title\=\"(.*?)\"/) > 0) || (tabelle.snapshotItem(i).childNodes[0].childNodes[0].childNodes[0].innerHTML.search(/\.gif\" width\=\"15\" height\=\"15\" border\=\"0\" title\=\"(.*?)\"/) > 0)) {
  935.  
  936. player_faction = RegExp.$1;
  937. // временный фикс под альт-фраки
  938. if (player_faction == "Демон тьмы") player_faction="Демон";
  939. if (player_faction == "Рыцарь света") player_faction="Рыцарь";
  940. if (player_faction == "Некромант повелитель смерти") player_faction="Некромант";
  941. if (player_faction == "Варвар крови") player_faction="Варвар";
  942. if (player_faction == "Варвар-шаман") player_faction="Варвар";
  943. if (player_faction == "Темный эльф-укротитель") player_faction="Темный эльф";
  944. if (player_faction == "Маг-разрушитель") player_faction="Маг";
  945. if (player_faction == "Эльф-заклинатель") player_faction="Эльф";
  946. if (player_faction == "Darkness demon") player_faction="Demon";
  947. if (player_faction == "Holy knight") player_faction="Knight";
  948. if (player_faction == "Unholy Necromancer") player_faction="Necromancer";
  949. if (player_faction == "Unholy necromancer") player_faction="Necromancer";
  950.  
  951. if (player_faction == "Fury barbarian") player_faction="Barbarian";
  952. if (player_faction == "Shadow barbarian") player_faction="Barbarian";
  953. if (player_faction == "Tamer dark elf") player_faction="Dark elf";
  954. if (player_faction == "Battlewise wizard") player_faction="Wizard";
  955. if (player_faction == "Charmer elf") player_faction="Elf";
  956. if (factions.indexOf(player_faction) < 0) player_faction="";
  957.  
  958. }
  959.  
  960. }
  961.  
  962. }
  963.  
  964. }
  965.  
  966.  
  967. if (player_info !="" && skill_info != "" && player_faction != "") break;
  968.  
  969. }
  970.  
  971. /*tabelle.snapshotItem(31).childNodes[0].childNodes[0].childNodes[0].innerHTML.search(/\- (.*)</);
  972.  
  973. player_faction = RegExp.$1;
  974.  
  975. alert("player_faction = "+player_faction);*/
  976.  
  977. }
  978.  
  979.  
  980.  
  981. //alert(player_faction+'\n\n'+factions.indexOf(player_faction));
  982.  
  983.  
  984.  
  985. //========== Боевой уровень
  986.  
  987. var lvl_info = player_info.textContent.split("\u00BB")[1];
  988.  
  989. lvl_info.search(/(.*)\((.*)\)(.*)/);
  990.  
  991. var lvl_attuale = eval(RegExp.$1.replace(T('Combat level') +": ",""));
  992.  
  993. lvl_info.search(/\((.*)\)/);
  994.  
  995. var exp_attuale = eval(RegExp.$1.replace(/,/g, ''));
  996.  
  997.  
  998.  
  999. var progress_bar_html = makeProgressBar(exp_attuale, lvl_attuale, combat_exp_lvl);
  1000.  
  1001. player_info.innerHTML = player_info.innerHTML.replace("</font><br><br>", "</font>"+ progress_bar_html +"<br>");
  1002.  
  1003. player_info.innerHTML = player_info.innerHTML.replace("</font><br>", "</font>"+ progress_bar_html +"<br>");
  1004.  
  1005.  
  1006.  
  1007. var skills = skill_info.innerHTML.split(">&nbsp;&nbsp;");
  1008.  
  1009. //========== Фракция игрока
  1010. var active_faction_index = factions.indexOf(player_faction);
  1011.  
  1012.  
  1013.  
  1014. if (GM_getValue("SHOW_ONLY_ACTIVE_FACTION_PROGRESS_BAR", "true") == "true") { // показывать только активную фракцию
  1015. var faction_index = active_faction_index;
  1016. lvl_info = skills[faction_index];
  1017. lvl_info.search(/\((\d*.?\d*)\)/);
  1018. exp_attuale = RegExp.$1;
  1019.  
  1020. progress_bar_html = makeProgressBar(exp_attuale, "", racial_skill_lvl);
  1021.  
  1022.  
  1023. if (faction_index<factions.length-1) {
  1024.  
  1025. var next_faction = factions[faction_index + 1];
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ next_faction, progress_bar_html +"&nbsp;&nbsp;"+ next_faction);
  1034.  
  1035. } else {
  1036.  
  1037. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Hunters\' guild'), progress_bar_html +"<br>&nbsp;&nbsp;"+ T('Hunters\' guild'));
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043. }
  1044. for(var faction_index=0; faction_index<factions.length; faction_index++){
  1045.  
  1046. lvl_info = skills[faction_index];
  1047.  
  1048. lvl_info.search(/\((\d*.?\d*)\)/);
  1049.  
  1050. exp_attuale = RegExp.$1;
  1051. sum_umk = sum_umk + Number(exp_attuale);
  1052. }
  1053.  
  1054. if (GM_getValue("SHOW_PEREKA4_PROGRESS_BAR", "true") == "true") {
  1055. sum_umk = Math.round(sum_umk*100)/100;
  1056.  
  1057. var nomerumki = (lvl_attuale - 4);
  1058. srednya_umka = sred_umk[nomerumki];
  1059. umk_min = sred_umk[nomerumki]/1.6;
  1060. umk_max = sred_umk[nomerumki]*1.6;
  1061. if (lvl_attuale>3){
  1062. progress_bar_html = makeProgressBarUmk(sum_umk, umk_min, umk_max);
  1063.  
  1064. if (faction_index<factions.length-1) {
  1065.  
  1066. var next_faction = factions[faction_index + 1];
  1067.  
  1068. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ next_faction, progress_bar_html +"&nbsp;&nbsp;"+ next_faction);
  1069.  
  1070. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;<b>"+ next_faction, progress_bar_html +"&nbsp;&nbsp;<b>"+ next_faction);
  1071.  
  1072. } else {
  1073. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Hunters\' guild'),"<br>&nbsp;&nbsp;<span style='font-weight: ;'>"+T('Sum of fsp')+":</span> "+ sum_umk + progress_bar_html +"<br>&nbsp;&nbsp;"+ T('Hunters\' guild'));
  1074. }
  1075. }
  1076. }
  1077.  
  1078. } else { // показывать все фракции
  1079. for(var faction_index=0; faction_index<factions.length; faction_index++){
  1080.  
  1081. lvl_info = skills[faction_index];
  1082.  
  1083. lvl_info.search(/\((\d*.?\d*)\)/);
  1084.  
  1085. exp_attuale = RegExp.$1;
  1086.  
  1087.  
  1088. progress_bar_html = makeProgressBar(exp_attuale, "", racial_skill_lvl);
  1089.  
  1090.  
  1091. if (faction_index<factions.length-1) {
  1092.  
  1093. var next_faction = factions[faction_index + 1];
  1094.  
  1095. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ next_faction, progress_bar_html +"&nbsp;&nbsp;"+ next_faction);
  1096.  
  1097. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;<b>"+ next_faction, progress_bar_html +"&nbsp;&nbsp;<b>"+ next_faction);
  1098.  
  1099. } else {
  1100.  
  1101. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Hunters\' guild'), progress_bar_html +"<br>&nbsp;&nbsp;"+ T('Hunters\' guild'));
  1102.  
  1103. }
  1104. sum_umk = sum_umk + Number(exp_attuale);
  1105.  
  1106. }
  1107. if (GM_getValue("SHOW_PEREKA4_PROGRESS_BAR", "true") == "true") {
  1108. sum_umk = Math.round(sum_umk*100)/100;
  1109. var nomerumki = (lvl_attuale - 4);
  1110. srednya_umka = sred_umk[nomerumki];
  1111. umk_min = sred_umk[nomerumki]/1.6;
  1112. umk_max = sred_umk[nomerumki]*1.6;
  1113. if (lvl_attuale>3){
  1114. progress_bar_html = makeProgressBarUmk(sum_umk, umk_min, umk_max);
  1115.  
  1116. if (faction_index<factions.length-1) {
  1117.  
  1118. var next_faction = factions[faction_index + 1];
  1119.  
  1120. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ next_faction, progress_bar_html +"&nbsp;&nbsp;"+ next_faction);
  1121.  
  1122. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;<b>"+ next_faction, progress_bar_html +"&nbsp;&nbsp;<b>"+ next_faction);
  1123.  
  1124. } else {
  1125. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Hunters\' guild'),"<br>&nbsp;&nbsp;<span style='font-weight: ;'>"+T('Sum of fsp')+":</span> "+ sum_umk + progress_bar_html +"<br>&nbsp;&nbsp;"+ T('Hunters\' guild'));
  1126. }
  1127. }
  1128. }
  1129.  
  1130. }
  1131.  
  1132. var guild_lvls = new Array();
  1133.  
  1134. for (var i=0; i < guilds.length; i++) {
  1135. for (var j=skills.length; j--;) {
  1136. if (skills[j].match(guilds[i])) {
  1137. lvl_info = skills[j];
  1138. lvl_info.search(/\((\d*.?\d*)\)/);
  1139. exp_attuale = RegExp.$1;
  1140. guild_lvls[guilds[i]] = exp_attuale;
  1141. }
  1142. }
  1143. }
  1144.  
  1145.  
  1146. //========== Гильдия охотников
  1147.  
  1148. if (GM_getValue("SHOW_HUNTERS_PROGRESS_BAR", "true") == "true") {
  1149.  
  1150. progress_bar_html = makeProgressBar(guild_lvls[T('Hunters\' guild')], "", hunters_guild_lvl);
  1151.  
  1152. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Laborers\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Laborers\' guild'));
  1153.  
  1154. }
  1155.  
  1156.  
  1157. //========== Гильдия рабочих
  1158.  
  1159. if (GM_getValue("SHOW_LABORERS_PROGRESS_BAR", "true") == "true") {
  1160.  
  1161. progress_bar_html = makeProgressBar(guild_lvls[T('Laborers\' guild')], "", laborers_guild_lvl);
  1162.  
  1163. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Gamblers\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Gamblers\' guild'));
  1164.  
  1165. }
  1166.  
  1167.  
  1168. //========== Гильдия картежников
  1169.  
  1170. if (GM_getValue("SHOW_GAMBLERS_PROGRESS_BAR", "true") == "true") {
  1171.  
  1172. lvl_info = skills[factions.length+2];
  1173.  
  1174. lvl_info.search(/\((\d*.?\d*)\)/);
  1175.  
  1176. exp_attuale = RegExp.$1;
  1177.  
  1178.  
  1179. progress_bar_html = makeProgressBar(guild_lvls[T('Gamblers\' guild')], "", gamblers_guild_lvl);
  1180.  
  1181. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Thieves\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Thieves\' guild'));
  1182.  
  1183. }
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189. //========== Гильдия воров
  1190.  
  1191. if (GM_getValue("SHOW_THIEVES_PROGRESS_BAR", "true") == "true") {
  1192.  
  1193. lvl_info = skills[factions.length+3];
  1194.  
  1195. lvl_info.search(/\((\d*.?\d*)\)/);
  1196.  
  1197. exp_attuale = RegExp.$1;
  1198.  
  1199.  
  1200. progress_bar_html = makeProgressBar(guild_lvls[T('Thieves\' guild')], "", thieves_guild_lvl);
  1201.  
  1202. if (guild_lvls[T('Rangers\' guild')]==null) {
  1203. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Mercenaries\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Mercenaries\' guild'));
  1204. } else {
  1205. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Rangers\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Rangers\' guild'));
  1206. }
  1207. }
  1208. if (guild_lvls[T('Rangers\' guild')]!=null) {
  1209. //========== Гильдия рейнджеров
  1210.  
  1211. if (GM_getValue("SHOW_RANGERS_PROGRESS_BAR", "true") == "true") {
  1212.  
  1213. lvl_info = skills[factions.length+4];
  1214.  
  1215. lvl_info.search(/\((\d*.?\d*)\)/);
  1216.  
  1217. exp_attuale = RegExp.$1;
  1218.  
  1219.  
  1220. progress_bar_html = makeProgressBar(guild_lvls[T('Rangers\' guild')], "", rangers_guild_lvl);
  1221.  
  1222. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Mercenaries\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Mercenaries\' guild'));
  1223.  
  1224. }
  1225. }
  1226.  
  1227.  
  1228. //========== Гильдия наемников
  1229.  
  1230. if (GM_getValue("SHOW_MERCENARIES_PROGRESS_BAR", "true") == "true") {
  1231.  
  1232. lvl_info = skills[factions.length+5];
  1233.  
  1234. lvl_info.search(/\((\d*.?\d*)\)/);
  1235.  
  1236. exp_attuale = RegExp.$1;
  1237.  
  1238.  
  1239. progress_bar_html = makeProgressBar(guild_lvls[T('Mercenaries\' guild')], "", mercenaries_guild_lvl);
  1240.  
  1241. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Tactics\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Tactics\' guild'));
  1242.  
  1243. }
  1244.  
  1245.  
  1246.  
  1247.  
  1248. //========== Гильдия тактиков
  1249.  
  1250. if (GM_getValue("SHOW_TACTICS_PROGRESS_BAR", "true") == "true") {
  1251.  
  1252. lvl_info = skills[factions.length+6];
  1253.  
  1254. lvl_info.search(/\((\d*.?\d*)\)/);
  1255.  
  1256. exp_attuale = RegExp.$1;
  1257.  
  1258.  
  1259. progress_bar_html = makeProgressBar(guild_lvls[T('Tactics\' guild')], "", tactics_guild_lvl);
  1260.  
  1261. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Watchers\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Watchers\' guild'));
  1262.  
  1263. }
  1264.  
  1265.  
  1266.  
  1267. //========== Watchers' guild
  1268.  
  1269. if (GM_getValue("SHOW_WATCHERS_PROGRESS_BAR", "true") == "true") {
  1270.  
  1271. lvl_info = skills[factions.length+7];
  1272.  
  1273. lvl_info.search(/\((\d*.?\d*)\)/);
  1274.  
  1275. exp_attuale = RegExp.$1;
  1276.  
  1277.  
  1278. progress_bar_html = makeProgressBar(guild_lvls[T('Watchers\' guild')], "", watchers_guild_lvl);
  1279. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Adventurers\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Adventurers\' guild'));
  1280.  
  1281. }
  1282.  
  1283.  
  1284.  
  1285. //========== Adventurers' guild
  1286.  
  1287. if (GM_getValue("SHOW_ADVENTURERS_PROGRESS_BAR", "true") == "true") {
  1288.  
  1289. lvl_info = skills[factions.length+8];
  1290.  
  1291. lvl_info.search(/\((\d*.?\d*)\)/);
  1292.  
  1293. exp_attuale = RegExp.$1;
  1294.  
  1295.  
  1296. progress_bar_html = makeProgressBar(guild_lvls[T('Adventurers\' guild')], "", adventurers_guild_lvl);
  1297.  
  1298. skill_info.innerHTML = skill_info.innerHTML.replace("<br>&nbsp;&nbsp;"+ T('Smiths\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Smiths\' guild'));
  1299.  
  1300. }
  1301.  
  1302.  
  1303.  
  1304. //========== Гильдия кузнецов
  1305.  
  1306. if (GM_getValue("SHOW_SMITHS_PROGRESS_BAR", "true") == "true") {
  1307.  
  1308. lvl_info = skills[factions.length+9];
  1309.  
  1310. lvl_info.search(/\((\d*.?\d*)\)/);
  1311.  
  1312. exp_attuale = RegExp.$1;
  1313.  
  1314.  
  1315. progress_bar_html = makeProgressBar(guild_lvls[T('Smiths\' guild')], "", smiths_guild_lvl);
  1316.  
  1317. skill_info.innerHTML = skill_info.innerHTML.replace("&nbsp;&nbsp;"+ T('Enchanters\' guild'), progress_bar_html +"&nbsp;&nbsp;"+ T('Enchanters\' guild'));
  1318.  
  1319. }
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325. //========== Гильдия оружейников
  1326.  
  1327. if (GM_getValue("SHOW_ENCHANTERS_PROGRESS_BAR", "true") == "true") {
  1328.  
  1329. lvl_info = skills[factions.length+10];
  1330.  
  1331. lvl_info.search(/\((\d*.?\d*)\)/);
  1332.  
  1333. exp_attuale = RegExp.$1;
  1334.  
  1335. progress_bar_html = makeProgressBar(guild_lvls[T('Enchanters\' guild')], "", enchanters_guild_lvl);
  1336.  
  1337. skill_info.innerHTML = skill_info.innerHTML.replace("<div id=\"mod_guild\">", progress_bar_html +"<div id=\"mod_guild\">");
  1338.  
  1339. }
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348. }
  1349.  
  1350.  
  1351.  
  1352. init();
  1353.  
  1354.  
  1355.  
  1356. // Конкретные действия для некоторых страниц
  1357.  
  1358. if (location.href.indexOf('home.php') != -1) showExpBar();
  1359.  
  1360. if (location.href.indexOf('pl_info.php') != -1) showExpBar();
  1361. }());
  1362. //};
  1363.  
  1364.  
  1365.  
  1366. //window.addEventListener('load', main, false);
  1367. // addEventListener replaced by a self launching function by Antviolence for better browser compatibility.

QingJ © 2025

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