Legna UI Mix

这个东西是给idle游戏准备的 没有什么附加功能,单纯就是改变界面 不适合所有人,适当接受建议 感谢原作者班登

  1. // ==UserScript==
  2. // @name Legna UI Mix
  3. // @version 2.1.1
  4. // @namespace Legna
  5. // @description 这个东西是给idle游戏准备的 没有什么附加功能,单纯就是改变界面 不适合所有人,适当接受建议 感谢原作者班登
  6. // @author limitedmeng@icloud.com
  7. // @grant GM_addStyle
  8. // @run-at document-start
  9. // @match https://www.idleinfinity.cn/*
  10. // @exclude https://www.idleinfinity.cn/Home/Login*
  11. // @exclude https://www.idleinfinity.cn/Home/Validate*
  12. // @exclude https://www.idleinfinity.cn/Home/EditPassword*
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-url-parser/2.3.1/purl.min.js
  15. // @license MIT
  16. // ==/UserScript==
  17.  
  18. const defaultFilterOptions = [''];
  19.  
  20. let config = {
  21. userNumber: 1,
  22. showRequire: true,
  23. fastFilter: true,
  24. fastOptions: defaultFilterOptions.slice(0), // 快速过滤器配置,可自行增删
  25. showSpellColor: true,
  26. showSpeedLevel: true,
  27. showCharDmg: true,
  28. showAccuracy: true,
  29. dropNotification: true,
  30. itemStats: true,
  31. showBattle: true,
  32. mapHack: true,
  33. mapHackType: 'all',
  34. infiniteMap: false,
  35. showSetAttr: true,
  36. showAuctionNote: true,
  37. auctionWatch: true,
  38. oneKeyEquip: true,
  39. oneKeyAgree: true,
  40. oneKeyRune: true,
  41. showRuneTip: true,
  42. showBattleDetail: true,
  43. d3theme: true,
  44. minLevel: null,
  45. // 秘境的石头等级 0 表示普通 1表示魔法 2表示稀有,以此类推 按照下拉列表的排序
  46. level: '',
  47. moveTime: 5000,
  48. failure: 10,
  49. magical: true,
  50. };
  51.  
  52. const configLabel = {
  53. showRequire: '职业专属显示',
  54. fastFilter: '快速过滤选项',
  55. showSpellColor: '法术技能高亮',
  56. showSpeedLevel: '显示速度档位',
  57. showCharDmg: '角色均伤显示',
  58. showAccuracy: '角色命中显示',
  59. dropNotification: '欧皇暗金通知',
  60. itemStats: '欧皇收获统计',
  61. showBattle: '快速秘境战斗',
  62. mapHack: '秘境自动战斗',
  63. infiniteMap: '无限秘境模式',
  64. showSetAttr: '显示套装属性',
  65. showAuctionNote: '显示拍卖备注',
  66. auctionWatch: '拍卖特别关注',
  67. oneKeyEquip: '一键换装功能',
  68. oneKeyAgree: '一键同意功能',
  69. oneKeyRune: '一键转移符文',
  70. showRuneTip: '符文之语提示',
  71. showBattleDetail: '战斗详细分析',
  72. d3theme: '暗黑界面皮肤',
  73. minLevel: '符文序号',
  74. failure: '失败重置次数',
  75. magical: '一件升级蓝色秘境',
  76. };
  77.  
  78. const userConfig = ['dropNotification', 'd3theme'];
  79.  
  80. let localConfig = localStorage.getItem('idle-ui-config');
  81. if (localConfig) {
  82. localConfig = JSON.parse(localConfig);
  83. Object.keys(localConfig).map(key => {
  84. if (config[key] !== undefined) config[key] = localConfig[key];
  85. });
  86. }
  87.  
  88. if (config.d3theme) {
  89. const htmlElement = document.getElementsByTagName('html')[0];
  90. htmlElement.setAttribute('class', 'd3');
  91. }
  92. (function(doc, win) {
  93. var docEl = doc.documentElement,
  94. resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
  95. recalc = function() {
  96. var clientWidth = docEl.clientWidth;//clientWidth是设计稿宽度
  97. if (!clientWidth) return;
  98. docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
  99. };
  100. if (!doc.addEventListener) return;
  101. win.addEventListener(resizeEvt, recalc, false);
  102. doc.addEventListener('DOMContentLoaded', recalc, false);
  103. })(document, window);
  104.  
  105. function idleInit() {
  106.  
  107. // 秘境的石头等级 ''空表示所有秘境 0 表示普通 1表示魔法 2表示稀有,以此类推 按照下拉列表的排序
  108. config.level = '';
  109. // 转移物品间隔时间,单位毫秒,最低不能低于300,会被制裁
  110. config.moveTime = 500;
  111. // 战斗失败重置次数,当同一组怪物失败到达此次数,自动重置当前秘境
  112. config.failure = 25;
  113. // 是否绕着Boss走
  114. config.dodge = false;
  115. // 同意消息间隔时间
  116. config.agreedTime = 300;
  117. var style = document.createElement('style');
  118. style.type = 'text/css';
  119. style.innerHTML = `.eq-weapon { background-color: #700;} .eq-armor {background-color: #007;} .eq-amulet {background-color: #0b0;} .eq-delete {background-color: gray;}
  120. .eq-jewel {background-color: #808a87;} .selected-b {border: 1px solid #66ccff!important;} .selected-r {border: 1px solid #f00!important;} .selected-d {border: 1px solid #fff!important;}`;
  121. document.getElementsByTagName('head')[0].appendChild(style);
  122.  
  123. // Extend page width
  124. // $('.container:nth(1)').css('width', '70%');
  125. $('body').css('height', $('body').height() + 500);
  126.  
  127. var equips = $(".panel-filter").parent().prev().find(".equip-content");
  128. var on_gears = $('.equip-container .equip-content');
  129. var i, gear, ps, hits, key, n_name, eqn;
  130. for (i = 0; i < on_gears.length; i++) {
  131. gear = on_gears[i];
  132. ps = gear.getElementsByTagName('p');
  133. if (ps.length > 0) {
  134. hits = gear.innerHTML.match(/彩虹刻面/);
  135. if (hits != null) {
  136. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  137. hits = gear.innerHTML.match(/(\d+)陨石/);
  138. if (hits != null) {
  139. eqn[eqn.length - 1].innerHTML += ' <span style="color:red; background-color: transparent;">🔥刻 ' + hits[1] + 'slv</span>';
  140. }
  141. hits = gear.innerHTML.match(/(\d+)暴风雪/);
  142. if (hits != null) {
  143. eqn[eqn.length - 1].innerHTML += ' <span style="color:#3ff; background-color: transparent;">🧊刻 ' + hits[1] + 'slv</span>';
  144. }
  145. hits = gear.innerHTML.match(/(\d+)准确率/);
  146. if (hits != null) {
  147. eqn[eqn.length - 1].innerHTML += ' <span style="color:#3ff; background-color: transparent;">准确 ' + hits[1] + 'slv</span>';
  148. }
  149. hits = gear.innerHTML.match(/(\d+)连锁闪电/);
  150. if (hits != null) {
  151. eqn[eqn.length - 1].innerHTML += ' <span style="color:yellow; background-color: transparent;">⚡️刻 ' + hits[1] + 'slv</span>';
  152. }
  153. hits = gear.innerHTML.match(/(\d+)剧毒新星/);
  154. if (hits != null) {
  155. eqn[eqn.length - 1].innerHTML += ' <span style="color:#00c400; background-color: transparent;">🦠刻 ' + hits[1] + 'slv</span>';
  156. }
  157. hits = gear.innerHTML.match(/(\d+)虚化/);
  158. if (hits != null) {
  159. eqn[eqn.length - 1].innerHTML += ' <span style="color:#B659F5; background-color: transparent;">🔮刻 ' + hits[1] + 'slv</span>';
  160. }
  161. hits = gear.innerHTML.match(/(\d+)伤害加深/);
  162. if (hits != null) {
  163. eqn[eqn.length - 1].innerHTML += ' <span style="color:white; background-color: transparent;">⚔️刻</span>';
  164. }
  165. hits = gear.innerHTML.match(/(\d+)\% 火焰伤害/);
  166. if (hits != null) {
  167. eqn[eqn.length - 1].innerHTML += ' <span style="color:red; background-color: transparent;">+' + hits[1] + '</span>';
  168. }
  169. hits = gear.innerHTML.match(/(\d+)\% 冰冷伤害/);
  170. if (hits != null) {
  171. eqn[eqn.length - 1].innerHTML += ' <span style="color:#3ff; background-color: transparent;">+' + hits[1] + '</span>';
  172. }
  173. hits = gear.innerHTML.match(/(\d+)\% 闪电伤害/);
  174. if (hits != null) {
  175. eqn[eqn.length - 1].innerHTML += ' <span style="color:yellow; background-color: transparent;">+' + hits[1] + '</span>';
  176. }
  177. hits = gear.innerHTML.match(/(\d+)\% 毒素伤害/);
  178. if (hits != null) {
  179. eqn[eqn.length - 1].innerHTML += ' <span style="color:#00c400; background-color: transparent;">+' + hits[1] + '</span>';
  180. }
  181. hits = gear.innerHTML.match(/(\d+)\% 魔法伤害/);
  182. if (hits != null) {
  183. eqn[eqn.length - 1].innerHTML += ' <span style="color:#B659F5; background-color: transparent;">+' + hits[1] + '🔮 </span>';
  184. }
  185. hits = gear.innerHTML.match(/(\d+)\% 物理伤害/);
  186. if (hits != null) {
  187. eqn[eqn.length - 1].innerHTML += ' <span style="color:white; background-color: transparent;">+' + hits[1] + '⚔️ </span>';
  188. }
  189. hits = gear.innerHTML.match(/(\d+)\% 目标火焰抗性/);
  190. if (hits != null) {
  191. eqn[eqn.length - 1].innerHTML += ' <span style="color:red; background-color: transparent;">-' + hits[1] + '</span>';
  192. }
  193. hits = gear.innerHTML.match(/(\d+)\% 目标冰冷抗性/);
  194. if (hits != null) {
  195. eqn[eqn.length - 1].innerHTML += ' <span style="color:#3ff; background-color: transparent;">-' + hits[1] + '</span>';
  196. }
  197. hits = gear.innerHTML.match(/(\d+)\% 目标闪电抗性/);
  198. if (hits != null) {
  199. eqn[eqn.length - 1].innerHTML += ' <span style="color:yellow; background-color: transparent;">-' + hits[1] + '</span>';
  200. }
  201. hits = gear.innerHTML.match(/(\d+)\% 目标毒素抗性/);
  202. if (hits != null) {
  203. eqn[eqn.length - 1].innerHTML += ' <span style="color:#00c400; background-color: transparent;">-' + hits[1] + '</span>';
  204. }
  205. }
  206. hits = gear.innerHTML.match(/攻击速度提升 (\d+)\%/);
  207. if (hits != null) {
  208. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  209. eqn[eqn.length - 1].innerHTML += ' <span style="color:#ffd700; background-color: transparent;">' + hits[1] + '攻速 </span>';
  210. }
  211. hits = gear.innerHTML.match(/施法速度提升 (\d+)\%/);
  212. if (hits != null) {
  213. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  214. eqn[eqn.length - 1].innerHTML += ' <span style="color:#ff8000; background-color: transparent;">' + hits[1] + '施法 </span>';
  215. }
  216. /* hits = gear.innerHTML.match(/\+(\d+)\% 增强伤害/);
  217. if (hits != null) {
  218. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  219. eqn[eqn.length - 1].innerHTML += ' <span style="color:#66ccff; background-color: transparent;">' + hits[1] + '增伤 </span>';
  220. }*/
  221. hits = gear.innerHTML.match(/\+(\d+)\% 暴击几率/);
  222. if (hits != null) {
  223. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  224. eqn[eqn.length - 1].innerHTML += ' <span style="color:#CCCC00; background-color: transparent;">' + hits[1] + '暴击 </span>';
  225. }
  226. hits = gear.innerHTML.match(/\-(\d+)\% 目标伤害/);
  227. if (hits != null) {
  228. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  229. eqn[eqn.length - 1].innerHTML += ' <span style="color:#CCCC00; background-color: transparent;">' + hits[1] + '减伤 </span>';
  230. }
  231. hits = ps[ps.length - 1].textContent.match(/凹槽(\(\d+\/\d+\))/);
  232. if (hits != null) {
  233. eqn = gear.previousElementSibling.getElementsByClassName('equip-name')
  234. eqn[eqn.length - 1].innerHTML += ' <span>' + hits[1] + '槽 </span>';
  235. }
  236. hits = gear.innerHTML.match(/\+(\d+)\% 更佳的机会取得魔法装备/);
  237. if (hits != null) {
  238. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  239. eqn[eqn.length - 1].innerHTML += ' <span style="color:white; background-color: transparent;"> ' + hits[1] + '🍀 </span>';
  240. }
  241.  
  242. hits = gear.innerHTML.match(/\+(\d+)\% 额外金币从怪物身上取得/);
  243. if (hits != null) {
  244. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  245. eqn[eqn.length - 1].innerHTML += ' <span style="color:gold; background-color: transparent;"> ' + hits[1] + '💰 </span>';
  246. }
  247. hits = gear.innerHTML.match(/元素抗性 \+(\d+)\%/);
  248. if (hits != null) {
  249. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  250. eqn[eqn.length - 1].innerHTML += ' <span style="color:#f90; background-color: transparent;">' + hits[1] + '🛡 </span>';
  251. }
  252. //----------------技能------------------
  253. hits = gear.innerHTML.match(/\+(\d+) 武僧真言技能/);
  254. if (hits != null) {
  255. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  256. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '真言 </span>';
  257. }
  258. hits = gear.innerHTML.match(/\+(\d+) 武僧武学技能/);
  259. if (hits != null) {
  260. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  261. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '武学 </span>';
  262. }
  263. hits = gear.innerHTML.match(/\+(\d+) 骑士光环技能/);
  264. if (hits != null) {
  265. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  266. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '光环 </span>';
  267. }
  268. hits = gear.innerHTML.match(/\+(\d+) 骑士惩戒技能/);
  269. if (hits != null) {
  270. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  271. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '惩戒 </span>';
  272. }
  273. hits = gear.innerHTML.match(/\+(\d+) 骑士技能/);
  274. if (hits != null) {
  275. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  276. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '骑技 </span>';
  277. }
  278. hits = gear.innerHTML.match(/\+(\d+) 法师技能/);
  279. if (hits != null) {
  280. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  281. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '法技 </span>';
  282. }
  283. hits = gear.innerHTML.match(/\+(\d+) 武僧技能/);
  284. if (hits != null) {
  285. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  286. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '僧技 </span>';
  287. }
  288. hits = gear.innerHTML.match(/\+(\d+) 萨满技能/);
  289. if (hits != null) {
  290. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  291. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '萨技 </span>';
  292. }
  293. hits = gear.innerHTML.match(/\+(\d+) 牧师技能/);
  294. if (hits != null) {
  295. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  296. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '牧技 </span>';
  297. }
  298. hits = gear.innerHTML.match(/\+(\d+) 贤者技能/);
  299. if (hits != null) {
  300. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  301. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '贤技 </span>';
  302. }
  303. hits = gear.innerHTML.match(/\+(\d+) 所有技能/);
  304. if (hits != null) {
  305. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  306. eqn[eqn.length - 1].innerHTML += ' <span style="color:darkpink; background-color: transparent;"> ' + hits[1] + '全技 </span>';
  307. }
  308. hits = gear.innerHTML.match(/\+(\d+) 死灵技能/);
  309. if (hits != null) {
  310. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  311. eqn[eqn.length - 1].innerHTML += ' <span style="color:darkpink; background-color: transparent;"> ' + hits[1] + '死技 </span>';
  312. }
  313. hits = gear.innerHTML.match(/\+(\d+) 游侠技能/);
  314. if (hits != null) {
  315. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  316. eqn[eqn.length - 1].innerHTML += ' <span style="color:darkpink; background-color: transparent;"> ' + hits[1] + '游技 </span>';
  317. }
  318. hits = gear.innerHTML.match(/\+(\d+) 法师元素技能/);
  319. if (hits != null) {
  320. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  321. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '法元 </span>';
  322. }
  323. hits = gear.innerHTML.match(/\+(\d+) 法师冥想技能/);
  324. if (hits != null) {
  325. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  326. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '法冥 </span>';
  327. }
  328. hits = gear.innerHTML.match(/\+(\d+) 战士作战技能/);
  329. if (hits != null) {
  330. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  331. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '作战 </span>';
  332. }
  333. hits = gear.innerHTML.match(/\+(\d+) 战士防御技能/);
  334. if (hits != null) {
  335. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  336. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '战防 </span>';
  337. }
  338. hits = gear.innerHTML.match(/\+(\d+) 游侠远程技能/);
  339. if (hits != null) {
  340. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  341. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '远程 </span>';
  342. }
  343. hits = gear.innerHTML.match(/\+(\d+) 游侠辅助技能/);
  344. if (hits != null) {
  345. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  346. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '游辅 </span>';
  347. }
  348. hits = gear.innerHTML.match(/\+(\d+) 牧师神圣技能/);
  349. if (hits != null) {
  350. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  351. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '神牧 </span>';
  352. }
  353. hits = gear.innerHTML.match(/\+(\d+) 牧师暗影技能/);
  354. if (hits != null) {
  355. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  356. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '暗牧 </span>';
  357. }
  358. hits = gear.innerHTML.match(/\+(\d+) 刺客格斗技能/);
  359. if (hits != null) {
  360. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  361. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '格斗 </span>';
  362. }
  363. hits = gear.innerHTML.match(/\+(\d+) 刺客刺杀技能/);
  364. if (hits != null) {
  365. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  366. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '刺杀 </span>';
  367. }
  368. hits = gear.innerHTML.match(/\+(\d+) 萨满增强技能/);
  369. if (hits != null) {
  370. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  371. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '萨增 </span>';
  372. }
  373. hits = gear.innerHTML.match(/\+(\d+) 萨满元素技能/);
  374. if (hits != null) {
  375. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  376. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '萨元 </span>';
  377. }
  378. hits = gear.innerHTML.match(/\+(\d+) 死灵白骨技能/);
  379. if (hits != null) {
  380. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  381. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '白骨 </span>';
  382. }
  383. hits = gear.innerHTML.match(/\+(\d+) 死灵召唤技能/);
  384. if (hits != null) {
  385. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  386. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '召唤 </span>';
  387. }
  388. hits = gear.innerHTML.match(/\+(\d+) 贤者变形技能/);
  389. if (hits != null) {
  390. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  391. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '变形 </span>';
  392. }
  393. hits = gear.innerHTML.match(/\+(\d+) 贤者自然技能/);
  394. if (hits != null) {
  395. eqn = gear.previousElementSibling.getElementsByClassName('equip-name');
  396. eqn[eqn.length - 1].innerHTML += ' <span style="color:lightblue; background-color: transparent;"> ' + hits[1] + '自然 </span>';
  397. }
  398. }
  399. }
  400.  
  401. addConfig(
  402.  
  403.  
  404.  
  405. );
  406. // 显示限定字符
  407. switchSkin(config.showRequire);
  408. Notification.requestPermission();
  409.  
  410. $('.navbar-nav > li > a').each(function () {
  411. if ($(this).text().indexOf('帮助') >= 0) {
  412. const links = [
  413. {text: '🟠暗金列表', link: '/Help/Content?url=Unique'},
  414. {text: '🟢套装列表', link: '/Help/Content?url=Set'},
  415. {text: '🟢秘境圣衣', link: '/Help/Content?url=Sacred'},
  416. {text: '🟣神器列表', link: '/Help/Content?url=Artifact'},
  417. {text: '⚪️普通物品', link: '/Help/Content?url=BaseEquip'},
  418. {text: '🔳前缀属性', link: '/Help/Content?url=Prefix'},
  419. {text: '🔳后缀属性', link: '/Help/Content?url=Suffix'},
  420. {text: '🔳固定词缀', link: '/Help/Content?url=SpecialAffix'},
  421. {text: '🫥神秘玩具', link: '/Help/specialequip'},
  422. ].map(item => {
  423. return `<li><a class="base" href="${item.link}" target="_blank">${item.text}</a></li>`;
  424. }).join('');
  425. $(this).next().append(links);
  426. }
  427. });
  428.  
  429. function fetchItem(name, callback) {
  430. if (!name) return;
  431. if (quickSearchType === 'Set' || quickSearchType === 'Unique') {
  432. $.get(`/Help/${quickSearchType}`, function (html) {
  433. const dom = $.parseHTML(html);
  434. const type = quickSearchType.toLowerCase();
  435. $(dom).find(`.equip > .${type}`).each(function () {
  436. if ($(this).text().indexOf(name) >= 0) {
  437. callback($(this).parent());
  438. return;
  439. }
  440. });
  441. });
  442. } else {
  443. $.get('/Help/Artifact', function (html) {
  444. const dom = $.parseHTML(html);
  445. $(dom).find('tr').each(function (i) {
  446. if (i > 0) {
  447. const nameLabel = $(this).children().last().find('.artifact');
  448. if (nameLabel.text().indexOf(name) >= 0) {
  449. const ret = [];
  450. ret.push(`<p class="artifact">${nameLabel.text()}</p>`);
  451. $(this).children().first().children('div').each(function () {
  452. ret.push(`<p class="physical">${$(this).text()}</p>`);
  453. });
  454. ret.push('<p class="artifact">神器</p>');
  455. nameLabel.parent().children().each(function (index) {
  456. if (index > 0) ret.push(`<p>${$(this).text()}</p>`);
  457. });
  458. const recipe = [];
  459. $(this).children().eq(1).find('.artifact.equip-name').each(function () {
  460. const id = $(this).text().match(/\d+/g)[0];
  461. recipe.push(`<span class="artifact">${id}#</span>`);
  462. });
  463. ret.push(`<p class="physical">${recipe.join(' + ')}</p>`);
  464. callback($(`<div class="equip">${ret.join('')}</div>`));
  465. return;
  466. }
  467. }
  468. });
  469. });
  470. }
  471. }
  472.  
  473. let quickSearchType = 'Unique';
  474. const itemTypes = `
  475. <div class="btn-group">
  476. <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
  477. <span id="idle-quick-type">🟠暗金</span><span class="caret" style="margin-left: 5px;"></span>
  478. </button>
  479. <ul class="dropdown-menu">
  480. <li><a class="quick-option unique" data-type="Unique" href="javascript: void(0);">🟠暗金</a></li>
  481. <li><a class="quick-option set" data-type="Set" href="javascript: void(0);">🟢套装</a></li>
  482. <li><a class="quick-option artifact" data-type="Artifact" href="javascript: void(0);">🟣神器</a></li>
  483. </ul>
  484. </div>
  485. `;
  486. const input = `<div id="idle-ui-quicksearch">${itemTypes}<input placeholder="搜索..." class="form-control"/><div class="popover" style="display: none; left: 60px; top: 28px;"><div class="popover-content"></div></div></div>`;
  487. $('.navbar-header').append(input);
  488.  
  489. $('.quick-option').click(function (e) {
  490. e.preventDefault();
  491. quickSearchType = $(this).data('type');
  492. $('#idle-quick-type').text($(this).text());
  493. const val = $('#idle-ui-quicksearch > input').val();
  494. if (val) {
  495. const popover = $('#idle-ui-quicksearch > input').next();
  496. popover.hide();
  497. fetchItem(val, function (html) {
  498. popover.children().first().html(html);
  499. popover.show();
  500. });
  501. }
  502. });
  503.  
  504. let quickTimer = null;
  505. $('#idle-ui-quicksearch > input').keyup(function () {
  506. if (quickTimer) {
  507. clearTimeout(quickTimer);
  508. quickTimer = null;
  509. }
  510. const val = $(this).val();
  511. if (!val) $(this).next().hide();
  512. quickTimer = setTimeout(() => {
  513. const popover = $(this).next();
  514. popover.hide();
  515. fetchItem(val, function (html) {
  516. popover.children().first().html(html);
  517. popover.show();
  518. });
  519. }, 500);
  520. });
  521.  
  522. if (config.fastFilter) {
  523. const fastOptions = (['无'].concat(config.fastOptions)).map(function (item) {
  524. return `<li><a href="javascript: void(0);" class="filter-text" style="color: white">${item}</a></li>`;
  525. }).join('');
  526.  
  527. const fastFilter = '<div class="fast-filter btn-group">' +''+ `<ul class="dropdown-menu">${fastOptions}</ul></div>`;
  528. $(fastFilter).insertAfter('.panel-filter');
  529.  
  530. $('.filter-text').click(function () {
  531. const text = $(this).text() === '无' ? '' : $(this).text();
  532. const filter = $(this).parent().parent().parent().prev();
  533. filter.val(text);
  534. filter.trigger('input');
  535. });
  536. }
  537.  
  538. if (config.showSpellColor) {
  539. $('.skill-name').each(function () {
  540. let desc = '';
  541. let label = '';
  542. if ($(this).children().length === 2) {
  543. desc = $(this).next().text();
  544. label = $(this).children().last();
  545. } else {
  546. desc = $(this).parent().next().text();
  547. label = $(this);
  548. }
  549. if (desc.indexOf('法术技能') >= 0) {
  550. label.addClass('skill');
  551. }
  552. });
  553. }
  554.  
  555. function getSpeedLevel(speed, isAttack) {
  556. const levels = isAttack ? [0, -25, -50, -80, -120, -160, -200] : [0, -20, -45, -75, -110, -145, -180];
  557. for (let i = 0; i < levels.length; i++) {
  558. if (speed > levels[i]) {
  559. const next = levels[i];
  560. return [i, next];
  561. }
  562. }
  563. return [levels.length, '已最高'];
  564. }
  565.  
  566. function getAvgDmg(dmgStr) {
  567. const dmgArray = dmgStr.split('~');
  568. const avg = (((dmgArray[0] - 0) + (dmgArray[1] - 0)) / 2);
  569. return avg;
  570. }
  571.  
  572. function getKeySkill() {
  573. let ret = {name: '', accRate: 0, dmgRate: 0};
  574. $('span.label.label-danger').each(function () {
  575. if (!$(this).hasClass('sr-only') && $(this).text().indexOf('K') >= 0) {
  576. ret.name = $(this).prev().text();
  577. const skill = $(this).parent().next().text();
  578. ret.isAttack = skill.indexOf('攻击技能') >= 0;
  579. if (ret.isAttack) {
  580. const accMatch = skill.match(/提升(\d+)%准确率/);
  581. const dmgMatch = skill.match(/(\d+)%基础伤害/);
  582. if (accMatch) ret.accRate = (accMatch[1] - 0) / 100;
  583. if (dmgMatch) ret.dmgRate = (dmgMatch[1] - 0) / 100;
  584. }
  585. }
  586. });
  587. return ret;
  588. }
  589.  
  590. function renderCharLabel(name, value, id) {
  591. const idStr = id ? `id="${id}"` : '';
  592. return `<p><span>${name}:</span><span ${idStr} class="state">${value}</span></p>`;
  593. }
  594.  
  595. if (location.href.indexOf('Character/Detail') >= 0) {
  596. const keySkill = getKeySkill();
  597. let level = 0;
  598. $('.label.label-default').each(function () {
  599. const label = $(this).text();
  600. if (label.indexOf('Lv') >= 0 && level === 0) {
  601. level = label.replace('Lv', '') - 0;
  602. }
  603. if (config.showSpeedLevel) {
  604. if (label === '攻击') {
  605. const attackSpeed = $(this).parent().next().next().next().next().children().last();
  606. const level = getSpeedLevel(attackSpeed.text(), true);
  607. const levelElement = renderCharLabel('攻速档位', level[0]) + renderCharLabel('下档攻速', level[1]);
  608. $(levelElement).insertAfter(attackSpeed.parent());
  609. } else if (label === '法术') {
  610. const spellSpeed = $(this).parent().next().children().last();
  611. const level = getSpeedLevel(spellSpeed.text(), false);
  612. const levelElement = renderCharLabel('速度档位', level[0]) + renderCharLabel('下档速度', level[1]);
  613. $(levelElement).insertAfter(spellSpeed.parent());
  614. }
  615. }
  616. if (config.showCharDmg) {
  617. if (label === '攻击') {
  618. const baseDmg = $(this).parent().next().children().last().text();
  619. const critElement = $(this).parent().next().next().next();
  620. const crit = critElement.children().last().text().replace('%', '') / 100;
  621. const avgDmg = getAvgDmg(baseDmg);
  622. const finalDmg = (avgDmg * (1 + (crit - 0))).toFixed(2) - 0;
  623. let dmgElement = renderCharLabel('普攻均伤', finalDmg);
  624. if (keySkill.isAttack) {
  625. const keyDmg = (keySkill.dmgRate * finalDmg).toFixed(2) - 0;
  626. dmgElement += renderCharLabel(`${keySkill.name}均伤`, keyDmg);
  627. }
  628. $(dmgElement).insertAfter(critElement);
  629. }
  630. }
  631. if (config.showAccuracy) {
  632. if (label === '攻击') {
  633. const accuracy = $(this).parent().next().next().children().last().text() - 0;
  634. const accuracyElement = $(this).parent().next().next();
  635. const accRate = getAccRate(level, level, accuracy);
  636. let accElement = `<p><span>命中怪物等级:</span><span><input type="number" class="form-control hit-input" value="${level}"/></span></p>`;
  637. accElement += renderCharLabel('普攻命中率', `${accRate}%`, 'idle-ui-acc');
  638. if (keySkill.isAttack) {
  639. const keyAcc = accuracy * keySkill.accRate;
  640. const keyAccRate = getAccRate(level, level, keyAcc);
  641. accElement += renderCharLabel(`${keySkill.name}命中率`, `${keyAccRate}%`, 'idle-ui-key-acc');
  642. }
  643. $(accElement).insertAfter(accuracyElement);
  644.  
  645. $('.hit-input').change(function () {
  646. const mlvl = $(this).val();
  647. const def = (mlvl - 0 + 1) * 10;
  648. const curAccRate = getAccRate(level, mlvl, accuracy);
  649. $('#idle-ui-acc').text(`${curAccRate}%`);
  650. if (keySkill.isAttack) {
  651. const curKeyAccRate = getAccRate(level, mlvl, accuracy * keySkill.accRate);
  652. $('#idle-ui-key-acc').text(`${curKeyAccRate}%`);
  653. }
  654. });
  655. }
  656. }
  657. if (config.itemStats) {
  658. if (label == '综合') {
  659. const uniqueNum = $(this).parent().next().next().next().next().children().last().text();
  660. const setNum = $(this).parent().next().next().next().next().next().children().last().text();
  661. const statsData = {uniqueNum: uniqueNum, setNum: setNum};
  662. saveStats({uniqueNum: uniqueNum, setNum: setNum});
  663. }
  664. }
  665. });
  666. }
  667.  
  668. function getAccRate(clvl, mlvl, acc) {
  669. clvl = clvl - 0;
  670. mlvl = mlvl - 0;
  671. acc = acc - 0;
  672. const def = (mlvl - 0 + 1) * 10;
  673. return (2 * (clvl / (clvl + mlvl)) * (acc / (acc + def)) * 100).toFixed(2) - 0;
  674. }
  675.  
  676. function saveStats(statsData) {
  677. const idMatch = location.href.match(/Character\/Detail\?Id=(\d+)/i);
  678. if (!idMatch) return;
  679. const id = idMatch[1];
  680. let stats = localStorage.getItem('idle-ui-stats');
  681. stats = stats ? JSON.parse(stats) : {uniqueNum: 0, setNum: 0};
  682. const lastStatsData = stats[id];
  683. const time = +new Date();
  684. if (lastStatsData && lastStatsData.time) {
  685. const duration = moment.duration(moment(time).diff(moment(lastStatsData.time)));
  686. const timeSpan = duration.asMinutes() > 60 ? (duration.asHours().toFixed(1) - 0) + '小时前' : Math.round(duration.asMinutes()) + '分钟前';
  687. const uniqueChange = statsData.uniqueNum - lastStatsData.uniqueNum;
  688. const setChange = statsData.setNum - lastStatsData.setNum;
  689. displayStats(id, timeSpan, uniqueChange, setChange);
  690. }
  691. statsData.time = time;
  692. stats[id] = statsData;
  693. localStorage.setItem('idle-ui-stats', JSON.stringify(stats));
  694. }
  695.  
  696. function displayStats(id, timeSpan, uniqueChange, setChange) {
  697. const message = `<div class="panel panel-inverse panel-top"><div class="panel-body">上次访问是${timeSpan},这段时间内你获得了 <span class="unique">${uniqueChange}</span> 件暗金,<span class="set">${setChange}</span> 件套装。</div></div>`;
  698.  
  699. $('.navbar.navbar-inverse.navbar-fixed-top').next().next().prepend(message);
  700. $('#open-ui-modal').click(function () {
  701. $('#modalUI').modal('show');
  702. });
  703. }
  704.  
  705. if (config.showBattle && inBattlePage() && !$('.error').length) {
  706. let waitTime = $('#time');
  707. if (waitTime.length) {
  708. waitTime = waitTime.val();
  709. } else {
  710. $(document).ready(function () {
  711. $(".turn").battle({
  712. interval: 0,
  713. guaji: 0
  714. });
  715. });
  716. }
  717. }
  718.  
  719. function renderConigHtml() {
  720. return Object.keys(config)
  721. .filter(item => userConfig.indexOf(item) >= 0)
  722. .map(key => {
  723. const cfg = config[key];
  724. return `<div class="col-sm-4"><div class="checkbox" style="margin: 2px 0;"><label><input class=" idle-ui-config" type="checkbox" data-key="${key}"> ${configLabel[key]}</label></div></div>`
  725. })
  726. .join('');
  727. }
  728.  
  729. function addConfig() {
  730. // $("[name='gold'][id='gold'][type='number']").attr('value', 50000);
  731. const configHtml = renderConigHtml();
  732. const html = `
  733.  
  734. `;
  735. $(document.body).append(html);
  736. loadLocalConfig();
  737. }
  738.  
  739. function loadLocalConfig() {
  740. $('.idle-ui-config').each(function () {
  741. const key = $(this).data('key');
  742. $(this).prop('checked', config[key]);
  743. });
  744. $('#idle-ui-filters').val(config.fastOptions.join('\n'));
  745. $(`#hack-${config.mapHackType}`).prop('checked', true);
  746.  
  747. $('#idle-ui-reset-filters').click(function () {
  748. config.fastOptions = defaultFilterOptions;
  749. saveLocalConfig();
  750. loadLocalConfig();
  751. });
  752.  
  753. $('#idle-ui-save-filters').click(function () {
  754. config.fastOptions = $('#idle-ui-filters').val().split('\n');
  755. config.minLevel = $('#idle-ui-rune-filter').val();
  756. saveLocalConfig();
  757. });
  758.  
  759. $('.idle-ui-config').change(function () {
  760. const key = $(this).data('key');
  761. config[key] = $(this).prop('checked');
  762. if (config.d3theme) {
  763. $('html').addClass('d3');
  764. } else {
  765. $('html').removeClass('d3');
  766. }
  767. saveLocalConfig();
  768. });
  769.  
  770. $('.idle-ui-hack-type').change(function () {
  771. if ($(this).prop('checked')) config.mapHackType = $(this).val();
  772. saveLocalConfig();
  773. });
  774.  
  775. // 监听alt+t按键,切换界面
  776. $(document).bind('keyup', function (event) {
  777. if (event.which === 84 && event.altKey) {
  778. $('html').toggleClass('d3');
  779. switchSkin(document.getElementsByClassName('d3').length > 0)
  780. }
  781. });
  782. }
  783.  
  784. function saveLocalConfig() {
  785. localStorage.setItem('idle-ui-config', JSON.stringify(config));
  786. }
  787.  
  788. // 监听过滤条件输入框的改变
  789. $(".panel-filter").on("input propertychange", function () {
  790. $(this).parent().prev().find(".selected").removeClass("selected")
  791.  
  792. // 输入的值
  793. var value = $(this).val();
  794. // 保存到缓存,方便下次使用
  795. window.localStorage.setItem($(this).attr("id"), value);
  796. if (value.length > 0) {
  797. var values = value.split(",");
  798. var equips = $(this).parent().prev().find(".equip-content");
  799.  
  800. // 正则判断是否是数字
  801. const min = /^<[0-9]+.?[0-9]*$/;
  802. const max = /^>[0-9]+.?[0-9]*$/;
  803.  
  804. // 提取装备等级的正则表达式
  805. const level = /\([0-9]*\)/;
  806.  
  807. // 去的当页数据
  808. equips.each(function (i, e) {
  809. var match = 0;
  810. $.each(values, function (j, p) {
  811. let text = $(e).text();
  812. if (min.test(p)) {
  813. // 纯数字,作为掉落等级来判断
  814. let exec = String(level.exec(text));
  815. exec = exec.substring(1, exec.length - 1);
  816. p = p.substring(1, p.length);
  817. if (parseInt(exec) <= parseInt(p)) match++;
  818. } else if (max.test(p)) {
  819. let exec = String(level.exec(text));
  820. exec = exec.substring(1, exec.length - 1);
  821. p = p.substring(1, p.length);
  822. if (parseInt(exec) >= parseInt(p)) match++;
  823. } else if (text.indexOf(p) >= 0) {
  824. // 其他属性
  825. match++;
  826. }
  827. });
  828. if (match == values.length) {
  829. $(e).prev().addClass("selected");
  830. }
  831. });
  832. }
  833. });
  834.  
  835. $(document).ready(function () {
  836. $(".panel-filter").each(function (i, input) {
  837. var value = window.localStorage.getItem($(this).attr("id"));
  838. if (value != null && value.length > 0) {
  839. $(this).val(value);
  840. $(this).trigger("propertychange");
  841. }
  842. });
  843. });
  844.  
  845. function autoHint() {
  846. if (config.infiniteMap) {
  847. setTimeout(() => {
  848. tryReset();
  849. }, 500);
  850. } else {
  851. new Notification('秘境扫荡完毕');
  852. map = {};
  853. map[id] = 'end';
  854. }
  855. }
  856.  
  857. // 当前是秘境界面
  858. if (config.mapHack && location.href.indexOf('Map/Dungeon') >= 0) {
  859. let hacking = false;
  860. const idMatch = location.href.match(/id=(\d+)/i);
  861. if (!idMatch) return;
  862. const id = idMatch[1];
  863. const btns = '';
  864. $('.dungeon-container').prev().children().last().prepend(btns);
  865.  
  866. if (config.infiniteMap) $('#auto-reset').prop('checked', true);
  867. $('#auto-reset').change(function () {
  868. config.infiniteMap = $(this).prop('checked');
  869. saveLocalConfig();
  870. });
  871.  
  872. let failedBlocks = localStorage.getItem('idle-ui-fail-blocks');
  873. failedBlocks = failedBlocks ? JSON.parse(failedBlocks) : [];
  874.  
  875. let map = localStorage.getItem('idle-ui-maphack');
  876.  
  877. // 是否出现验证码提示
  878. if ($("[role='dialog'][data-code='True']").length) {
  879. // 提示验证码 停止自动秘境
  880. endMove("验证码出现");
  881. return;
  882. }
  883.  
  884. if (map) {
  885. map = JSON.parse(map);
  886.  
  887. if (map[id] && map[id] === 'start') {
  888. const bossLeft = $('.boss-left').text() - 0;
  889. const monster = $('.monster-left').text() - 0;
  890. // 只刷Boss
  891. if (config.mapHackType === 'boss') {
  892. if (bossLeft === 0) {
  893. // Boss干掉了
  894. autoHint();
  895. } else {
  896. // Boss还存活
  897. startHack();
  898. }
  899. } else if (config.mapHackType === 'all') {
  900. if (bossLeft === 0 && monster === 0) {
  901. autoHint();
  902. } else {
  903. startHack();
  904. }
  905. } else if (config.mapHackType === 'mystery') {
  906. if (monster === 0) {
  907. // 秘境扫荡完毕,跳转到装备界面开始继续打石头
  908. // 获得用户的ID
  909. // 秘境的石头等级 0 表示普通 1表示魔法 2表示稀有,以此类推 按照下拉列表的排序
  910. // https://www.idleinfinity.cn/Equipment/Query?id=5671&pt2=2&et2=2147483648&pi=0&pt=1&et=2147483648
  911. // https://www.idleinfinity.cn/Equipment/Query?id=5671&et2=2147483648&pt2=1&pi=0&pt=1&et=2147483648
  912. // https://www.idleinfinity.cn/Equipment/Query?id=5671&pt=2&et=2147483648&pi2=0&pt2=2&et2=2147483648
  913. localStorage.setItem('failure', "0");
  914. const level = config.level;
  915. const userId = $("#cid").val();
  916. location.href = `/Equipment/Query?id=${userId}&pt=5&et=2147483648&pi2=0&pt2=${level}&et2=2147483648`;
  917. } else {
  918. startHack();
  919. }
  920. }
  921. }
  922. } else {
  923. map = {};
  924. map[id] = 'end';
  925. }
  926.  
  927. function tryReset() {
  928. const stoneLeft = $('.panel-heading .state').text() - 0;
  929. if (stoneLeft > 0) {
  930. localStorage.setItem('idle-ui-fail-blocks', '[]');
  931. localStorage.setItem('failure', "0");
  932. $("form").attr("action", "DungeonRefresh");
  933. $("form").trigger("submit");
  934. } else {
  935. endMove('秘境之石已用完');
  936. }
  937. }
  938.  
  939. $('#start-hack').click(function (params) {
  940. startHack(true);
  941. });
  942.  
  943. $('#end-hack').click(function (params) {
  944. alert('自动秘境已停止');
  945. endMove();
  946. });
  947.  
  948. function startHack(fromClick) {
  949. if (hacking) return;
  950. hacking = true;
  951. if (!map[id] && typeof map == 'string') {
  952. map = JSON.parse(map);
  953. }
  954. $('.dungeon-container').prev().children().last().prepend('<button class="btn btn-xs btn-default" style="margin-right: 5px;" id="end-hack">停止自动秘境</button>');
  955. map[id] = 'start';
  956. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  957. if (fromClick) {
  958. localStorage.setItem('idle-ui-fail-blocks', '[]');
  959. localStorage.setItem('failure', "0");
  960. }
  961. setTimeout(() => {
  962. mapMove();
  963. }, 900);
  964. }
  965.  
  966. function mapMove() {
  967. if (map[id] !== 'start') return;
  968. // 有boss先打boss
  969. const bossBlock = $('.boss').eq(0);
  970. if (!config.dodge) {
  971. if (bossBlock.length && !bossBlock.hasClass('mask')) {
  972. clickBlock(bossBlock);
  973. return;
  974. }
  975. }
  976.  
  977. const bossId = bossBlock.attr("id");
  978. const asc = Number(bossId) <= 200;
  979. const enemyBlocks = []; // 有敌人的可行区块
  980. for (let i = asc ? 0 : 399; asc ? i <= 399 : i >= 0; asc ? i++ : i--) {
  981. const block = $(`#${i}`);
  982. if (canExplore(i) && block.hasClass('public monster')) {
  983. enemyBlocks.push(i);
  984. }
  985. }
  986. // 下一个怪
  987. let nextBlockIndex = null;
  988.  
  989. for (let i = 0; i < enemyBlocks.length; i++) {
  990. if ((config.mapHackType === 'boss') && failedBlocks.indexOf(enemyBlocks[i]) === -1) {
  991. nextBlockIndex = enemyBlocks[i];
  992. }
  993. }
  994. if (nextBlockIndex === null && (enemyBlocks.length > 0)) {
  995. nextBlockIndex = enemyBlocks[0];
  996. localStorage.setItem('idle-ui-fail-blocks', '[]');
  997. let number = parseInt(localStorage.getItem("failure"));
  998. let failure = (isNaN(number) ? 0 : number) + 1;
  999. localStorage.setItem('failure', failure);
  1000. if ((failure % 3) === 0) {
  1001. if (failure > 1) new Notification('第' + failure + '轮战斗失败');
  1002. }
  1003. if (failure > config.failure) {
  1004. if (config.mapHackType === 'mystery') {
  1005. const level = config.level;
  1006. const userId = $("#cid").val();
  1007. location.href = `/Equipment/Query?id=${userId}&pt=5&et=2147483648&pi2=0&pt2=${level}&et2=2147483648`;
  1008. return;
  1009. } else if (config.infiniteMap) {
  1010. tryReset();
  1011. return
  1012. }
  1013. }
  1014. }
  1015. if (nextBlockIndex !== null) {
  1016. clickBlock($(`#${nextBlockIndex}`));
  1017. } else {
  1018. new Notification('当前怪物已清理完毕');
  1019. }
  1020. }
  1021.  
  1022. function clickBlock(block) {
  1023. const width = block.width();
  1024. const height = block.height();
  1025. const rect = document.getElementById(block.attr('id')).getBoundingClientRect();
  1026. console.log(block.attr('id'));
  1027. const x = Math.round(rect.left + width / 3 + (width / 4 * Math.random(id))) + $(window).scrollLeft();
  1028. const y = Math.round(rect.top + height / 3 + (height / 4 * Math.random(id))) + $(window).scrollTop();
  1029. ajaxMove(block, {pageX: x, pageY: y, originalEvent: {isTrusted: true}});
  1030. }
  1031.  
  1032. function ajaxMove(block, a) {
  1033. const f = block;
  1034. var c = f.parent();
  1035. const g = f.attr("id");
  1036. const k = $("#cid").val();
  1037. const td = localStorage.getItem("t");
  1038. if (f.hasClass("public monster")) {
  1039. window.location.href = "/Battle/InDungeon?id=" + k + "&bid=" + g;
  1040. } else {
  1041. $(".dungeon-layer").show();
  1042. var e = [];
  1043. /* if (0 < a.pageX && 0 < a.pageY && a.hasOwnProperty("originalEvent") && (a.originalEvent.isTrusted || 1 == a.originalEvent.detail)) {
  1044. e = $(c).offset();
  1045. const h = $(c).width();
  1046. c = $(c).height();
  1047. const l = Math.floor(Math.random() * h);
  1048. e = [a.pageX, l, a.pageY, e.left, h - l, e.top, h, Math.floor(Math.random() * c), c]
  1049. }
  1050. */
  1051. if (a.pageX > 0 && a.pageY > 0 && a.hasOwnProperty('originalEvent') && (a.originalEvent.isTrusted || a.originalEvent.detail == 1)) {
  1052. var offset = $(c).offset();
  1053. var width = $(c).width();
  1054. var height = $(c).height();
  1055. var rand1 = Math.floor(Math.random() * width);
  1056. var rand2 = width - rand1;
  1057. var rand3 = Math.floor(Math.random() * height);
  1058. e = [a.pageX, rand1, a.pageY, offset.left, rand2, offset.top, width, rand3, height];
  1059. }
  1060.  
  1061. a = {
  1062. id: k,
  1063. bid: g,
  1064. m: e,
  1065. t: td,
  1066. __RequestVerificationToken: $("[name='__RequestVerificationToken']").val()
  1067. };
  1068. $.ajax({
  1069. url: "MoveTo",
  1070. type: "post",
  1071. data: a,
  1072. dataType: "json",
  1073. success: function (a) {
  1074. $.each(a, function (a, b) {
  1075. if (b.id == undefined) {
  1076. b.id = 0;
  1077. }
  1078. void 0 == b.id && (b.id = 0);
  1079. a = "";
  1080. 0 == b.d[0] && (a += " top");
  1081. 0 == b.d[1] && (a += " left");
  1082. if (1 == b.m){
  1083. $("#" + b.id).addClass(a);
  1084. }
  1085. else {
  1086. a += " public";
  1087. var c = "";
  1088.  
  1089. if (b.mlvl > 0) {
  1090. a += " monster ";
  1091. c += "Lv" + b.mlvl + " " + b.mname;
  1092.  
  1093. a += b.mtype;
  1094. }
  1095.  
  1096. $("#" + b.id).removeClass("mask").addClass(a);
  1097. if (c != "") {
  1098. $("#" + b.id).attr("title", c);
  1099. }
  1100. }
  1101. });
  1102. /* 0 < a.length && ($("#explore").text(parseInt($("#explore").text()) + a.length),
  1103. $("#not-explore").text(parseInt($("#not-explore").text()) - a.length));
  1104. $(".current").removeClass("current");
  1105. f.addClass("current");
  1106. $(".dungeon-layer").hide();
  1107. setTimeout(() => {
  1108. mapMove();
  1109. }, Math.round(config.userNumber * 300));
  1110. }, */
  1111.  
  1112. if (a.length > 0) {
  1113. $("#explore").text(parseInt($("#explore").text()) + a.length);
  1114. $("#not-explore").text(parseInt($("#not-explore").text()) - a.length);
  1115. }
  1116.  
  1117. $(".current").removeClass("current");
  1118. f.addClass("current");
  1119.  
  1120. $(".dungeon-layer").hide();
  1121. },
  1122.  
  1123. error: function (XMLHttpRequest) {
  1124. const responseText = XMLHttpRequest.responseText;
  1125. if (responseText.indexOf('封号') >= 0) {
  1126. addBlockNum();
  1127. }
  1128. $(".dungeon-layer").hide();
  1129. }
  1130. });
  1131. }
  1132. }
  1133.  
  1134. function endMove(notice, retry, reset) {
  1135. if (!reset) {
  1136. map[id] = 'end';
  1137. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1138. }
  1139.  
  1140. if (notice) new Notification(notice);
  1141.  
  1142. if (retry) {
  1143. // 请求异常情况直接刷新界面,暂时注释原来逻辑
  1144. $('#modalAlert').modal('hide');
  1145. setTimeout(function () {
  1146. const userId = $("#cid").val();
  1147. location.href = `../Map/DungeonForEquip?id=${userId}`
  1148. }, Math.round(300));
  1149. } else if (reset) {
  1150. tryReset();
  1151. }
  1152. }
  1153.  
  1154. // 判断是否可以点击
  1155. function canExplore(i) {
  1156. const size = 20;
  1157. const block = $(`#${i}`);
  1158. if (block.hasClass('mask')) return false;
  1159. if ((config.mapHackType === 'all' || config.mapHackType === 'mystery') && block.hasClass('monster')) return true;
  1160. const left = i % size === 0 ? null : $(`#${i - 1}`);
  1161. const right = i % size === (size - 1) ? null : $(`#${i + 1}`);
  1162. const up = i < size ? null : $(`#${i - size}`);
  1163. const down = i >= ((size * size) - size) ? null : $(`#${i + size}`);
  1164. const canMoveLeft = left && left.hasClass('mask') && !block.hasClass('left');
  1165. const canMoveRight = right && right.hasClass('mask') && !right.hasClass('left');
  1166. const canMoveUp = up && up.hasClass('mask') && !block.hasClass('top');
  1167. const canMoveDown = down && down.hasClass('mask') && !down.hasClass('top');
  1168. return canMoveLeft || canMoveRight || canMoveUp || canMoveDown;
  1169. }
  1170. }
  1171.  
  1172. if (location.href.indexOf('Map/Dungeon') === -1) {
  1173. $.ajaxSetup({
  1174. complete: function (XMLHttpRequest) {
  1175. if (!XMLHttpRequest.responseText) return;
  1176. if (XMLHttpRequest.responseText.indexOf('封号') >= 0) {
  1177. addBlockNum();
  1178. location.reload();
  1179. }
  1180. }
  1181. });
  1182. }
  1183.  
  1184. // 战斗界面
  1185. if (config.mapHack && location.href.indexOf('Battle/InDungeon') >= 0) {
  1186.  
  1187. const id = purl().param().id;
  1188. const bid = purl().param().bid - 0;
  1189. if (!id) return;
  1190. let map = localStorage.getItem('idle-ui-maphack');
  1191. if (map) {
  1192. map = JSON.parse(map);
  1193. if (map[id] && map[id] === 'start') {
  1194. const exception = $('.error').length;
  1195. if (exception) {
  1196. setTimeout(() => {
  1197. location.href = `/Map/Dungeon?id=${id}`;
  1198. }, Math.round(Math.random() * 2500));
  1199. return;
  1200. }
  1201.  
  1202. const stopBtn = renderButton('end-hack', '停止自动秘境', 'default');
  1203. $('.btn.btn-xs').eq(1).before(stopBtn);
  1204. $('#end-hack').click(function () {
  1205. map[id] = 'end';
  1206. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1207. alert('自动秘境已停止');
  1208. });
  1209.  
  1210. let waitTime = $('head').text().match(/waitTime:(\d+)/);
  1211. if (waitTime) {
  1212. waitTime = waitTime[1];
  1213. }
  1214. if (waitTime) {
  1215. setTimeout(() => {
  1216. endFight(id);
  1217. }, (waitTime + 1) * 1000);
  1218. } else {
  1219. endFight(id);
  1220. }
  1221. }
  1222. }
  1223.  
  1224. function endFight(dungeonId) {
  1225. const win = $('.turn').first().text().indexOf('战斗胜利') > 0;
  1226. const turns = $('.turn').length - 1;
  1227. let enemys = {};
  1228. $('.battle-char').each(function () {
  1229. const id = $(this).prop('id').split('_')[1];
  1230. if (id < 0) {
  1231. const type = $(this).children().first().children().last().prop('class');
  1232. if (enemys[type]) {
  1233. enemys[type] += 1;
  1234. } else {
  1235. enemys[type] = 1;
  1236. }
  1237. }
  1238. });
  1239. let drops = [];
  1240. $('.turn').first().find('.equip-name').each(function () {
  1241. const type = $(this).clone().prop('class').replace('equip-name', '').trim();
  1242. const name = $(this).text();
  1243. drops.push({type: type, name: name});
  1244. });
  1245. const isBoss = $('.boss').length > 0;
  1246. const battleLog = {time: +new Date(), win, boss: isBoss, turns, enemys, drops};
  1247. addBattleLog(battleLog);
  1248.  
  1249. const bossWin = isBoss && win;
  1250. if (!win) {
  1251. let failedBlocks = localStorage.getItem('idle-ui-fail-blocks');
  1252. failedBlocks = failedBlocks ? JSON.parse(failedBlocks) : [];
  1253. if (failedBlocks.indexOf(bid) === -1) failedBlocks.push(bid);
  1254. localStorage.setItem('idle-ui-fail-blocks', JSON.stringify(failedBlocks));
  1255. } else {
  1256. localStorage.setItem('failure', '0');
  1257. localStorage.setItem('idle-ui-fail-blocks', '[]');
  1258. }
  1259. let timeout = 5;
  1260. if (turns < 50) {
  1261. timeout = 3
  1262. } else if (turns < 100) {
  1263. timeout = 7;
  1264. } else if (turns < 200) {
  1265. timeout = 10;
  1266. }
  1267. setTimeout(() => {
  1268. location.href = `/Map/Dungeon?id=${dungeonId}`;
  1269. }, timeout * 1100);
  1270. }
  1271.  
  1272. function addBattleLog(battleLog) {
  1273. let log = localStorage.getItem('idle-ui-maplog');
  1274. log = log ? JSON.parse(log) : {};
  1275. if (!log[id]) log[id] = [];
  1276. log[id].unshift(battleLog);
  1277. log[id] = log[id].slice(0, 500);
  1278. localStorage.setItem('idle-ui-maplog', JSON.stringify(log));
  1279. }
  1280. }
  1281.  
  1282. if (config.mapHack && location.href.indexOf('Map/Detail') >= 0) {
  1283. const btn = "";
  1284. $('.btn.btn-xs').eq(1).before(btn);
  1285. let page = 1;
  1286. let log = {};
  1287. let dataSource = [];
  1288. const id = purl().param().id;
  1289. const pageSize = 20;
  1290. let maxPage = 0;
  1291. const modal = ``;
  1292. $(document.body).append(modal);
  1293.  
  1294. function getBattleLogStats(battleLog) {
  1295. let creepNum = 0;
  1296. let bossNum = 0;
  1297. let creepWin = 0;
  1298. let bossWin = 0;
  1299. let creepTurns = 0;
  1300. let bossTurns = 0;
  1301. battleLog.forEach(item => {
  1302. if (item.boss) {
  1303. bossNum += 1;
  1304. if (item.win) bossWin += 1;
  1305. bossTurns += item.turns;
  1306. } else {
  1307. creepNum += 1;
  1308. if (item.win) creepWin += 1;
  1309. creepTurns += item.turns;
  1310. }
  1311. });
  1312. const avgCreepTurns = creepNum > 0 ? Math.round(creepTurns / creepNum) : 0;
  1313. const avgBossTurns = bossNum > 0 ? Math.round(bossTurns / bossNum) : 0;
  1314. const creepWinRate = creepNum > 0 ? Math.round(creepWin / creepNum * 100) : 0;
  1315. const bossWinRate = bossNum > 0 ? Math.round(bossWin / bossNum * 100) : 0;
  1316. return {creepNum, bossNum, avgCreepTurns, avgBossTurns, creepWinRate, bossWinRate}
  1317. }
  1318.  
  1319. const enemyTypes = {'battle-char-name normal': '普通', 'battle-char-name rare': '稀有', 'battle-char-name super': '精英', 'battle-char-name boss': 'Boss'};
  1320.  
  1321. function renderRows() {
  1322. const start = (page - 1) * pageSize;
  1323. let data = [];
  1324. if ($('#idle-ui-only-boss').prop('checked')) {
  1325. data = dataSource.filter(item => item.boss).slice(start, start + pageSize);
  1326. } else {
  1327. data = dataSource.slice(start, start + pageSize);
  1328. }
  1329. const rows = data.map(item => {
  1330. const date = moment(item.time).format('MM-DD HH:mm:ss');
  1331. const result = item.win ? '<span class="poison">胜利</span>' : '<span class="fire">失败</span>';
  1332. const enemys = Object.keys(item.enemys).map(type => {
  1333. const count = item.enemys[type];
  1334. return `<span class="${type}">${enemyTypes[type]}</span><span class="normal mr-10"> x ${count}</span>`;
  1335. }).join('');
  1336. const drops = item.drops.map(item => {
  1337. return `<span class="${item.type}">${item.name}</span>`;
  1338. }).join('');
  1339. return `<tr><td>${date}</td><td>${result}</td><td>${item.turns}</td><td>${enemys}</td><td>${drops}</td></tr>`;
  1340. }).join('');
  1341. $('#idle-ui-log-table').html(rows);
  1342. if (page === 1) {
  1343. $('#page-prev').prop('disabled', true);
  1344. } else {
  1345. $('#page-prev').prop('disabled', false);
  1346. }
  1347. if (page === maxPage) {
  1348. $('#page-next').prop('disabled', true);
  1349. } else {
  1350. $('#page-next').prop('disabled', false);
  1351. }
  1352. $('#idle-ui-log-length').text(logLength);
  1353. $('#idle-ui-max-page').text(maxPage);
  1354. $('#idle-ui-page').text(page);
  1355. }
  1356.  
  1357. $('#page-prev').click(function () {
  1358. page = page - 1;
  1359. renderRows();
  1360. });
  1361.  
  1362. $('#page-next').click(function () {
  1363. page = page + 1;
  1364. renderRows();
  1365. });
  1366.  
  1367. $('#idle-ui-only-boss').change(function () {
  1368. page = 1;
  1369. getLengthAndMaxPage();
  1370. renderRows();
  1371. });
  1372.  
  1373. $('#clear-log').click(function () {
  1374. log[id] = [];
  1375. localStorage.setItem('idle-ui-maplog', JSON.stringify(log));
  1376. location.reload();
  1377. });
  1378.  
  1379. function getLengthAndMaxPage() {
  1380. const checked = $('#idle-ui-only-boss').prop('checked');
  1381. logLength = checked ? dataSource.filter(item => item.boss).length : dataSource.length;
  1382. maxPage = Math.ceil(logLength / pageSize);
  1383. }
  1384.  
  1385. function reloadLog() {
  1386. log = localStorage.getItem('idle-ui-maplog');
  1387. log = log ? JSON.parse(log) : {};
  1388. dataSource = log[id] || [];
  1389. getLengthAndMaxPage();
  1390. const stats = getBattleLogStats(dataSource);
  1391. $('#idle-ui-creepnum').text(stats.creepNum);
  1392. $('#idle-ui-avgcreepturns').text(stats.avgCreepTurns);
  1393. $('#idle-ui-creepwinrate').text(`${stats.creepWinRate}%`);
  1394. $('#idle-ui-bossnum').text(stats.bossNum);
  1395. $('#idle-ui-avgbossturns').text(stats.avgBossTurns);
  1396. $('#idle-ui-bosswinrate').text(`${stats.bossWinRate}%`);
  1397. page = 1;
  1398. renderRows();
  1399. }
  1400.  
  1401. $('#idle-ui-reload').click(function () {
  1402. reloadLog();
  1403. });
  1404.  
  1405. $('#idle-ui-maplog').click(function () {
  1406. reloadLog();
  1407. $('#modalMapLog').modal('show');
  1408. });
  1409. }
  1410.  
  1411. if (config.showSetAttr && location.href.indexOf('Auction/Query') < 0) {
  1412. loadSetAttr();
  1413.  
  1414. function loadSetAttr() {
  1415. if (!$('.equip-content > .equip > .set').length) return;
  1416. const setDB = localStorage.getItem('idle-ui-set-db');
  1417. const newSetDB = localStorage.getItem('idle-ui-set-db-new');
  1418. if (setDB && newSetDB) {
  1419. const JSONSetDB = JSON.parse(setDB);
  1420. const JSONNewSetDB = JSON.parse(newSetDB);
  1421. $('.equip-content > .equip > .set').each(function () {
  1422. const content = $(this).parent();
  1423. const itemName = content.children().first().text().replace(/\(\d+\)/g, '');
  1424. const singleData = JSONSetDB.singleData[itemName];
  1425. const existSingLeNum = content.children('.set').length - 1;
  1426. if (singleData && singleData.length > existSingLeNum) {
  1427. const singleContent = singleData.slice(existSingLeNum).map(item => {
  1428. return `<p class="set idle-ui-set-single">${item}</p>`;
  1429. }).join('');
  1430. content.children('.unique').before(singleContent);
  1431. }
  1432. const fullContent = content.children('.unique');
  1433. const existFullNum = fullContent.children('p[class!="set"][class!="require"]').length - 1;
  1434. const setName = fullContent.children('br').last().next().text().replace(/\(\d+\)/g, '');
  1435. var fullData = JSONSetDB.setData[setName];
  1436. if (!fullData) {
  1437. fullData = JSONNewSetDB.setData[setName];
  1438. }
  1439. let setContent = fullData.slice(existFullNum).map(item => {
  1440. return `<p class="idle-ui-set-full">${item}</p>`;
  1441. }).join('');
  1442. if (fullContent.children('br').length === 1) setContent = '<br>' + setContent;
  1443. fullContent.children('br').last().before(setContent);
  1444. });
  1445. } else {
  1446. $.get('/Help/Set', function (html) {
  1447. const parsedsetDB = parseSetHtml(html);
  1448. localStorage.setItem('idle-ui-set-db', JSON.stringify(parsedsetDB));
  1449. loadSetAttr();
  1450. });
  1451. $.get('/Help/Sacred', function (html) {
  1452. const parsedsetDB = parseSetHtml(html);
  1453. localStorage.setItem('idle-ui-set-db-new', JSON.stringify(parsedsetDB));
  1454. loadSetAttr();
  1455. });
  1456. }
  1457. }
  1458.  
  1459. function parseSetHtml(html) {
  1460. $(".footer").before(`<div style="display: none;" id="set-data">${html}</div>`);
  1461. const singleData = {};
  1462. const setData = {};
  1463. $('#set-data .masonry-item .panel-body .equip').each(function () {
  1464. const lines = $(this).children();
  1465. const itemName = lines.first().text().replace(/\(\d+\)/, '');
  1466. const singleLines = [];
  1467. lines.each(function (index) {
  1468. const line = $(this);
  1469. if (index > 0 && line.hasClass('set')) {
  1470. singleLines.push(line.text().replace(/\n/g, ''));
  1471. }
  1472. if (line.hasClass('unique')) {
  1473. const setItems = line.children();
  1474. let stop = false;
  1475. const setLines = [];
  1476. let setName = '';
  1477. setItems.each(function (index) {
  1478. if (index > 0) {
  1479. if ($(this).prop('tagName').toLowerCase() === 'br') {
  1480. stop = true;
  1481. setName = $(this).next().text();
  1482. }
  1483. if (!stop) setLines.push($(this).text().replace(/\n/g, ''));
  1484. }
  1485. });
  1486. if (!setData[setName]) setData[setName] = setLines;
  1487. }
  1488. });
  1489. if (singleLines.length) singleData[itemName] = singleLines;
  1490. });
  1491. return {singleData, setData};
  1492. }
  1493. }
  1494.  
  1495. if (location.href.indexOf('Auction/Query') >= 0 && location.href.indexOf('Auction/QueryBid') === -1) {
  1496. if (config.showAuctionNote) {
  1497. $('.physical.equip-des').each(function () {
  1498. const note = $(this).text();
  1499. const label = $(this).parent().parent().prev().children('.equip-name').last();
  1500. label.after(`<span style="color: #fff;"> ${note}</span>`);
  1501. });
  1502. }
  1503.  
  1504. // if (config.auctionWatch) {
  1505. // let watchList = [];
  1506. //
  1507. // function renderTable(params) {
  1508. // const list = localStorage.getItem('idle-ui-auction');
  1509. // watchList = (list ? JSON.parse(list) : []) || [];
  1510. // const rows = watchList.map((item, index) => {
  1511. // return `<tr><td>${item.category}</td><td>${item.name}</td><td><a href="Query?id=&${item.link}" class="btn btn-xs btn-default" style="margin-right: 12px;">查看</a><button data-index="${index}" type="button" class="delete-auction btn btn-xs btn-danger">取消关注</button></td></tr>`;
  1512. // });
  1513. // $('#modalAuction .table-body').html(rows);
  1514. // $('.delete-auction').click(function () {
  1515. // const index = $(this).data('index');
  1516. // watchList.splice(index, 1);
  1517. // localStorage.setItem('idle-ui-auction', JSON.stringify(watchList));
  1518. // renderTable();
  1519. // });
  1520. // renderNewItems();
  1521. // }
  1522. //
  1523. // function renderNewItems() {
  1524. // const ids = purl().param().items;
  1525. // if (!ids) return;
  1526. // ids.split(',').map(id => {
  1527. // $(`span[data-id="${id}"`).parent().addClass('idle-ui-new-item');
  1528. // });
  1529. // }
  1530. //
  1531. // const link = '<button id="open-auction-modal" type="button" class="btn btn-xs btn-success" style="margin-right: 10px;">特别关注</button>';
  1532. // $('.btn-group').eq(1).before(link);
  1533. // const categorys = [];
  1534. // $('.panel-heading .btn-group button.dropdown-toggle').each(function () {
  1535. // categorys.push($(this).text().replace('<span class="caret"></span>', '').replace(/\s/g, ''));
  1536. // });
  1537. // const category = categorys.join(' - ');
  1538. //
  1539. // const modal = `
  1540. // <div class="modal fade" id="modalAuction" style="display: none;">
  1541. // <div class="modal-dialog modal-large" role="">
  1542. // <div class="modal-content model-inverse">
  1543. // <div class="modal-header">
  1544. // <span class="modal-title">拍卖行特别关注</span>
  1545. // </div>
  1546. // <div class="modal-body">
  1547. // <div class="panel-header state">已有关注项目</div>
  1548. // <table class="table table-condensed">
  1549. // <thead><tr><td>筛选条件</td><td>装备名称</td><td>操作</td></tr></thead>
  1550. // <tbody class="table-body"></tbody>
  1551. // </table>
  1552. // <div class="panel-header state">添加新项目</div>
  1553. // <div class="form">
  1554. // <div class="form-group">
  1555. // <label>筛选条件</label>
  1556. // <p class="form-control-static" style="color: #fff;">${category}</p>
  1557. // </div>
  1558. // <div class="form-group">
  1559. // <label>装备名称</label>
  1560. // <input type="text" id="auction-name" class="form-control hit-input" style="width: 100%;">
  1561. // </div>
  1562. // <button type="button" class="btn btn-success btn-xs" id="add-auction">新增</button>
  1563. // </div>
  1564. // </div>
  1565. // <div class="modal-footer">
  1566. // <button type="button" class="btn btn-default btn-xs" data-dismiss="modal">关闭</button>
  1567. // </div>
  1568. // </div>
  1569. // </div>
  1570. // </div>
  1571. // `;
  1572. // $(document.body).append(modal);
  1573. // renderTable();
  1574. // $('#open-auction-modal').click(function () {
  1575. // if ($('.equip-name').length) {
  1576. // $('#auction-name').val($('.equip-name').eq(0).text().replace('【', '').replace('】', ''));
  1577. // }
  1578. // $('#modalAuction').modal('show');
  1579. // });
  1580. //
  1581. // $('#add-auction').click(function () {
  1582. // if (watchList.length >= 10) {
  1583. // alert('最多关注10条');
  1584. // return;
  1585. // }
  1586. // const params = purl().param();
  1587. // const et = params.et || '';
  1588. // const pt = params.pt || '';
  1589. // const ei = params.ei || '';
  1590. // const link = `et=${et}&pt=${pt}&ei=${ei}`;
  1591. // const name = $('#auction-name').val();
  1592. // const items = [];
  1593. // $('.equip-name').each(function () {
  1594. // const curName = $(this).text().replace('【', '').replace('】', '');
  1595. // if (curName === name) {
  1596. // const id = $(this).parent().children().last().data('id');
  1597. // items.push(id);
  1598. // }
  1599. // });
  1600. // const data = {
  1601. // category: category,
  1602. // name: $('#auction-name').val(),
  1603. // link: link,
  1604. // items: items
  1605. // };
  1606. // watchList.push(data);
  1607. // localStorage.setItem('idle-ui-auction', JSON.stringify(watchList));
  1608. // renderTable();
  1609. // });
  1610. // }1
  1611. }
  1612.  
  1613. if (config.magical && location.href.indexOf('Equipment/Query') >= 0) {
  1614. let map = localStorage.getItem('idle-ui-maphack');
  1615. if (map) {
  1616. map = JSON.parse(map);
  1617. } else {
  1618. map = {};
  1619. }
  1620. const cid = $("#cid").val();
  1621.  
  1622. const magicalStart = '';
  1623. const magicalEnd = '';
  1624.  
  1625. // 是否一键升蓝
  1626. const magical = map[`magical${cid}`];
  1627. const panel = $('.panel-footer .btn.btn-xs.btn-warning');
  1628. panel.eq(panel.length - 1).before(magicalStart);
  1629. if ((magical) && magical === 'start') {
  1630. panel.eq(panel.length - 1).before(magicalEnd);
  1631. }
  1632.  
  1633. $('#start-magical').click(function (params) {
  1634. map[`magical${cid}`] = 'start';
  1635. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1636. // startMagical();
  1637. // 重定向到过滤为白色秘境的界面去
  1638. const level = '0';
  1639. const userId = $("#cid").val();
  1640. location.href = `/Equipment/Query?id=${userId}&pt=${level}&et=2147483648&pi2=0&pt2=${level}&et2=2147483648`;
  1641. });
  1642.  
  1643. $('#end-magical').click(function (params) {
  1644. map[`magical${cid}`] = 'end';
  1645. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1646. location.reload();
  1647. });
  1648.  
  1649. // 设置点击对应的点击事件
  1650. function startMagical() {
  1651. const magicalId = $(".base.equip-name").eq(0).data('id');
  1652. if (!magicalId) {
  1653. map[`magical${cid}`] = 'end';
  1654. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1655. alert('没有普通秘境,已停止自动升级');
  1656. return;
  1657. }
  1658. map[`magical${cid}`] = 'start';
  1659. a = {
  1660. id: cid,
  1661. cid: cid,
  1662. eid: magicalId,
  1663. type: '0',
  1664. __RequestVerificationToken: $("[name='__RequestVerificationToken']").val(),
  1665. };
  1666.  
  1667. $.ajax({
  1668. //几个参数需要注意一下
  1669. type: "POST",//方法类型
  1670. dataType: "html",//预期服务器返回的数据类型
  1671. url: "EquipReform",//url
  1672. data: a,
  1673. success: function (result) {
  1674. location.reload()
  1675. },
  1676. error: function (XMLHttpRequest, textStatus) {
  1677. map[`magical${cid}`] = 'end';
  1678. alert("发生错误,请检查是否材料不够,或者不够改造等级")
  1679. }
  1680. });
  1681. }
  1682.  
  1683. if (magical && magical === 'start') {
  1684. setTimeout(() => {
  1685. if ((magical) && magical === 'start') {
  1686. startMagical()
  1687. }
  1688. }, config.moveTime);
  1689. }
  1690. }
  1691.  
  1692. if (config.oneKeyEquip && location.href.indexOf('Equipment/Query') >= 0) {
  1693. const btn = '';
  1694. const cname = '';
  1695. const startMetastasis = '';
  1696. const stopMetastasis = '';
  1697.  
  1698. const start = '';
  1699. const end = '';
  1700. $('.panel-heading .btn').eq(0).before(btn);
  1701. $('.panel-heading .btn').eq(0).before(cname);
  1702. let map = localStorage.getItem('idle-ui-maphack');
  1703. if (map) {
  1704. map = JSON.parse(map);
  1705. } else {
  1706. map = {};
  1707. }
  1708. const cid = $("#cid").val();
  1709. var mysteryIndex = 5;
  1710.  
  1711. // 是否一键转移
  1712. const metastasis = map[`metastasis${cid}`];
  1713. // 要转移人的姓名
  1714. const name = map[`cname${cid}`];
  1715.  
  1716. if (name) {
  1717. $('.move-name').val(name);
  1718. }
  1719. if ((metastasis) && metastasis === 'start') {
  1720. $('.panel-heading .btn').eq(0).before(stopMetastasis);
  1721. mysteryIndex = 6;
  1722. }
  1723.  
  1724. $('#end-metastasis').click(function (params) {
  1725. map[`metastasis${cid}`] = 'end';
  1726. map[`cname${cid}`] = "";
  1727. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1728. location.reload();
  1729. });
  1730.  
  1731. $('.panel-heading .btn').eq(0).before(startMetastasis);
  1732. $('#start-metastasis').click(function (params) {
  1733. map[`metastasis${cid}`] = 'start';
  1734. map[`cname${cid}`] = $('.move-name').val();
  1735. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1736. moveMystery();
  1737. });
  1738.  
  1739. function moveMystery() {
  1740. const mysteryId = $(".selected").children(":first").next().next().next().data('id');
  1741. if (!mysteryId) {
  1742. map[`metastasis${cid}`] = 'end';
  1743. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1744. alert('没有物品被选中,已停止');
  1745. return;
  1746. }
  1747. a = {
  1748. cid: cid,
  1749. eid: mysteryId,
  1750. cname: map[`cname${cid}`],
  1751. __RequestVerificationToken: $("[name='__RequestVerificationToken']").val(),
  1752. };
  1753.  
  1754. $.ajax({
  1755. //几个参数需要注意一下
  1756. type: "POST",//方法类型
  1757. dataType: "html",//预期服务器返回的数据类型
  1758. url: 'EquipTrade',//url
  1759. data: a,
  1760. success: function (result) {
  1761. location.reload()
  1762. },
  1763. error: function (result) {
  1764. alert(result)
  1765. }
  1766. });
  1767. }
  1768.  
  1769. if (metastasis && metastasis === 'start') {
  1770. setTimeout(() => {
  1771. if ((metastasis) && metastasis === 'start') {
  1772. moveMystery()
  1773. }
  1774. }, config.moveTime);
  1775. }
  1776.  
  1777.  
  1778. // 开始扫荡秘境了,就显示停止扫荡按钮
  1779. const mystery = map[`mystery${cid}`];
  1780. if ((mystery) && mystery === 'start') {
  1781. $('.panel-heading .btn').eq(mysteryIndex).before(end);
  1782. $('#end-mystery').click(function (params) {
  1783. alert('已停止扫荡秘境');
  1784. map[`mystery${cid}`] = 'end';
  1785. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1786. });
  1787. }
  1788. $('.panel-heading .btn').eq(mysteryIndex).before(start);
  1789.  
  1790. $('#start-mystery').click(function (params) {
  1791. map[`mystery${cid}`] = 'start';
  1792. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1793. startMystery();
  1794. });
  1795.  
  1796. function startMystery() {
  1797. const mysteryId = $(".selected").children(":first").next().next().next().data('id');
  1798. if (!mysteryId) {
  1799. map[cid] = 'end';
  1800. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  1801. alert('没有物品被选中,或使用等级不够,已停止');
  1802. return;
  1803. }
  1804. map[cid] = 'start';
  1805. a = {
  1806. id: cid,
  1807. cid: cid,
  1808. eid: mysteryId,
  1809. __RequestVerificationToken: $("[name='__RequestVerificationToken']").val(),
  1810. };
  1811.  
  1812. $.ajax({
  1813. //几个参数需要注意一下
  1814. type: "POST",//方法类型
  1815. dataType: "html",//预期服务器返回的数据类型
  1816. url: "EquipDungeon",//url
  1817. data: a,
  1818. success: function (result) {
  1819. // 请求成功,返回网页,自动跳转到秘境界面
  1820. location.href = `../Map/DungeonForEquip?id=${userId}`
  1821. },
  1822. error: function (XMLHttpRequest, textStatus) {
  1823. alert(XMLHttpRequest)
  1824. }
  1825. });
  1826. }
  1827.  
  1828. if (mystery && mystery === 'start') {
  1829. setTimeout(() => {
  1830. if ((mystery) && mystery === 'start') {
  1831. startMystery()
  1832. }
  1833. }, 15000);
  1834. }
  1835.  
  1836. const equipList = ['主手', '副手', '头盔', '护符', '项链', '戒指', '戒指', '衣服', '腰带', '手套', '靴子'];
  1837. let buildMap = {};
  1838. let buildData = [];
  1839. const userId = purl().param().id;
  1840. const equipItems = getEquipItems();
  1841.  
  1842. function loadEquipBuild() {
  1843. buildMap = JSON.parse(localStorage.getItem('idle-ui-equip-build') || '{}');
  1844. buildData = buildMap[userId] || [];
  1845. }
  1846.  
  1847. function saveEquipBuild(data) {
  1848. localStorage.setItem('idle-ui-equip-build', JSON.stringify(data));
  1849. loadEquipBuild();
  1850. renderEquip();
  1851. }
  1852.  
  1853. function renderEquip(buildIndex) {
  1854. if (!buildIndex && buildData.length) buildIndex = 0;
  1855. const data = buildData[buildIndex] || {};
  1856. const equipContent = equipList.map((item, index) => {
  1857. const equipItem = data.items ? data.items[index] : {};
  1858. return `<p><span>${item}</span><span class="${equipItem.type || ''}">${equipItem.name || ''}</span></p>`;
  1859. });
  1860. const firstCol = equipContent.slice(0, 4).join('');
  1861. const secondCol = equipContent.slice(4, 7).join('');
  1862. const thirdCol = equipContent.slice(7).join('');
  1863. const content = `<div class="col-sm-6 col-md-4">${firstCol}</div><div class="col-sm-6 col-md-4">${secondCol}</div><div class="col-sm-6 col-md-4">${thirdCol}</div>`;
  1864. $('#equip-build-content').html(content);
  1865.  
  1866. // 一键换装
  1867. const buildTags = buildData.map((item, index) => {
  1868. return `<li><a class="physical equip-build-option" href="#" data-index="${index}">${item.name}</a></li>`;
  1869. }).join('');
  1870. $('#equip-build-tags').html(buildTags);
  1871. $('#selected-build-name').text(data.name || '选择方案');
  1872. if (buildIndex !== undefined) {
  1873. $('#use-equip-build').data('index', buildIndex);
  1874. $('#del-equip-build').data('index', buildIndex);
  1875. } else {
  1876. $('#use-equip-build').data('index', -1);
  1877. $('#del-equip-build').data('index', -1);
  1878. }
  1879. $('.equip-build-option').click(function (e) {
  1880. e.preventDefault();
  1881. const index = $(this).data('index');
  1882. renderEquip(index);
  1883. });
  1884. }
  1885.  
  1886. const modal = `
  1887. <div class="modal fade" id="modalEquipBuild" style="display: none;">
  1888. <div class="modal-dialog modal-large" role="" style="width: 800px;">
  1889. <div class="modal-content model-inverse">
  1890. <div class="modal-header">
  1891. <span class="modal-title">一键换装</span>
  1892. </div>
  1893. <div class="modal-body">
  1894. <div class="panel-header state">
  1895. <span>已有装备方案:</span>
  1896. <div class="btn-group"><button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span id="selected-build-name">选择方案</span><span class="caret" style="margin-left: 5px;"></span></button><ul class="dropdown-menu" id="equip-build-tags"></ul></div>
  1897. </div>
  1898. <div class="row" id="equip-build-content"></div>
  1899. <button type="button" class="btn btn-success btn-xs mr-10" id="use-equip-build">使用本方案</button>
  1900. <button type="button" class="btn btn-danger btn-xs" id="del-equip-build">删除本方案</button>
  1901. <div id="processing" style="display:none; margin-top: 10px;"><i class="glyphicon glyphicon-refresh"></i> 处理中...</div>
  1902. <div class="panel-header state" style="margin-top: 10px;">保存当前装备到新方案</div>
  1903. <div class="form">
  1904. <div class="form-group">
  1905. <label>方案名称</label>
  1906. <input type="text" id="equip-build-name" class="form-control hit-input" style="width: 100%;">
  1907. </div>
  1908. <button type="button" class="btn btn-success btn-xs" id="add-equip-build">保存</button>
  1909. </div>
  1910. </div>
  1911. <div class="modal-footer">
  1912. <button type="button" class="btn btn-default btn-xs" data-dismiss="modal">关闭</button>
  1913. </div>
  1914. </div>
  1915. </div>
  1916. </div>
  1917. `;
  1918. $(document.body).append(modal);
  1919. loadEquipBuild();
  1920. renderEquip();
  1921. $('#show-one-key-equip').click(function () {
  1922. $('#modalEquipBuild').modal('show');
  1923. });
  1924.  
  1925. let processing = false;
  1926.  
  1927. function doEquip(buildIndex, itemIndex) {
  1928. if (blockData.num >= 9) {
  1929. alert('封号打击次数过多,禁止一键换装');
  1930. location.reload();
  1931. }
  1932. if (itemIndex > equipItems.length - 1) {
  1933. setTimeout(() => {
  1934. processing = false;
  1935. $('#processing').hide();
  1936. location.reload();
  1937. }, 500);
  1938. return;
  1939. }
  1940. const list = $('#form').serializeArray();
  1941. const params = {};
  1942. list.forEach(item => {
  1943. params[item.name] = item.value;
  1944. });
  1945. params.eid = buildData[buildIndex].items[itemIndex].id;
  1946. params.cid = userId;
  1947. // 判断当前要替换的装备是否已经装备
  1948. const itemAlreadyEquiped = equipItems.some(item => item.id === params.eid);
  1949. if (!params.eid || !params.cid) return;
  1950. const name = buildData[buildIndex].items[itemIndex].name;
  1951.  
  1952. if (itemAlreadyEquiped) {
  1953. // 已经装备,进入下一件装备
  1954. doEquip(buildIndex, itemIndex + 1);
  1955. } else {
  1956. // 没有装备,还是进行替换
  1957. $.post('/Equipment/EquipOn', params, function (data) {
  1958. setTimeout(function () {
  1959. doEquip(buildIndex, itemIndex + 1);
  1960. }, 1000);
  1961. }).fail(function (data) {
  1962. setTimeout(function () {
  1963. doEquip(buildIndex, itemIndex + 1);
  1964. }, 1000);
  1965. });
  1966. }
  1967. }
  1968.  
  1969. $('#use-equip-build').click(function () {
  1970. if (processing) return;
  1971. const index = $(this).data('index');
  1972. if (index >= 0) {
  1973. processing = true;
  1974. $('#processing').show();
  1975. doEquip(index, 0);
  1976. } else {
  1977. alert('请先选择一个方案');
  1978. }
  1979. });
  1980.  
  1981. $('#del-equip-build').click(function () {
  1982. const index = $(this).data('index');
  1983. if (index >= 0) {
  1984. buildData.splice(index, 1);
  1985. buildMap[userId] = buildData;
  1986. saveEquipBuild(buildMap);
  1987. } else {
  1988. alert('请先选择一个方案');
  1989. }
  1990. });
  1991.  
  1992. function getEquipItems() {
  1993. const items = [];
  1994. $('.panel-body').eq(0).find('.equip-content').each(function () {
  1995. const label = $(this).prev().children('.equip-name').eq(0);
  1996. if (label.length) {
  1997. const name = label.text();
  1998. const type = label.prop('class').replace('equip-name', '').trim();
  1999. const id = label.parent().children().last().data('id');
  2000. items.push({name: name, type: type, id: id});
  2001. } else {
  2002. items.push({name: '', type: '', id: 0});
  2003. }
  2004. });
  2005. return items;
  2006. }
  2007.  
  2008. $('#add-equip-build').click(function () {
  2009. if (buildData.length >= 5) {
  2010. alert('同一角色最多保存5套方案');
  2011. return;
  2012. }
  2013. const name = $('#equip-build-name').val();
  2014. if (!name) {
  2015. alert('方案必须有一个名称');
  2016. return;
  2017. }
  2018. const newBuild = {
  2019. name: name,
  2020. items: equipItems
  2021. };
  2022. buildData.push(newBuild);
  2023. buildMap[userId] = buildData;
  2024. saveEquipBuild(buildMap);
  2025. });
  2026. }
  2027.  
  2028. if (config.oneKeyAgree && location.href.indexOf('Notice/Query') >= 0) {
  2029. let map = localStorage.getItem('idle-ui-maphack');
  2030. if (map) {
  2031. map = JSON.parse(map);
  2032. } else {
  2033. map = {};
  2034. }
  2035. // 所有消息的数量
  2036. const allCount = $('.badge').eq(0).text();
  2037.  
  2038. let processing = false;
  2039. const agreeList = [];
  2040. $('.notice-yes').each(function () {
  2041. agreeList.push($(this).data('id'));
  2042. });
  2043.  
  2044. function doAgree(index) {
  2045. if (blockData.num >= 9) {
  2046. alert('封号打击次数过多,禁止一键同意');
  2047. location.reload();
  2048. }
  2049. if (index > agreeList.length - 1) {
  2050. $('#processing').hide();
  2051. processing = false;
  2052.  
  2053. if (map[`agree${cid}`] && map[`agree${cid}`] === 'start' && allCount > 0) {
  2054. // 获得当前页面的第几页数据,然后+1
  2055. var number = getUrlParam('pi');
  2056. if (number > 0) {
  2057. number = Number(number) + 1;
  2058. } else {
  2059. number = 1;
  2060. }
  2061. // 跳转到下一页
  2062. location.href = `/Notice/Query?pi=${number}&pi2=0`;
  2063. return;
  2064. } else {
  2065. map[`agree${cid}`] = 'end';
  2066. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  2067. location.reload();
  2068. return;
  2069. }
  2070. }
  2071. const id = agreeList[index];
  2072. const list = $('#form').serializeArray();
  2073. const params = {
  2074. contentType: false,
  2075. processData: false,
  2076. };
  2077. list.forEach(item => {
  2078. params[item.name] = item.value;
  2079. });
  2080. params.nid = id;
  2081. $.post('/Notice/NoticeYes', params, function () {
  2082. setTimeout(function () {
  2083. location.reload();
  2084. }, config.agreedTime);
  2085. }).fail(function (data) {
  2086. alert("发生异常");
  2087. setTimeout(function () {
  2088. location.reload();
  2089. }, config.agreedTime);
  2090. });
  2091. }
  2092.  
  2093. function getUrlParam(paraName) {
  2094. const url = document.location.toString();
  2095. const arrObj = url.split("?");
  2096.  
  2097. if (arrObj.length > 1) {
  2098. const arrPara = arrObj[1].split("&");
  2099. var arr;
  2100.  
  2101. for (var i = 0; i < arrPara.length; i++) {
  2102. arr = arrPara[i].split("=");
  2103. if (arr != null && arr[0] == paraName) {
  2104. return arr[1];
  2105. }
  2106. }
  2107. return "";
  2108. }
  2109. else {
  2110. return "";
  2111. }
  2112. }
  2113.  
  2114. const def = $('a.btn.btn-xs.btn-default');
  2115. let all = renderProcessing();
  2116. all += renderButton('idle-ui-agree-all', '同意所有');
  2117. def.eq(0).before(all);
  2118. $('#idle-ui-agree-all').click(function () {
  2119. // 终止转移
  2120. map[`agree${cid}`] = 'start';
  2121. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  2122. agreeMessage();
  2123. });
  2124.  
  2125. if (map[`agree${cid}`] && map[`agree${cid}`] === 'start') {
  2126. let stop = renderProcessing();
  2127. stop += renderButton('idle-ui-agree-stop', '停止同意');
  2128. def.eq(0).before(stop);
  2129.  
  2130. $('#idle-ui-agree-stop').click(function () {
  2131. // 终止转移
  2132. map[`agree${cid}`] = 'stop';
  2133. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  2134. location.reload();
  2135. });
  2136. if (allCount > 0) {
  2137. setTimeout(function () {
  2138. agreeMessage();
  2139. }, 500);
  2140. } else {
  2141. // 终止转移
  2142. map[`agree${cid}`] = 'end';
  2143. localStorage.setItem('idle-ui-maphack', JSON.stringify(map));
  2144. }
  2145. }
  2146.  
  2147. function agreeMessage() {
  2148. if (processing) return;
  2149. if (agreeList.length || allCount > 0) {
  2150. $('#processing').show();
  2151. processing = true;
  2152. doAgree(0);
  2153. } else {
  2154. alert('没有可处理的消息');
  2155. }
  2156. }
  2157. }
  2158.  
  2159. if (config.oneKeyRune && location.href.indexOf('Equipment/Material') >= 0) {
  2160. let processing = false;
  2161. const runeList = [];
  2162. $('.artifact.equip-name').each(function () {
  2163. const count = $(this).next().next().text() - 0;
  2164. if (count > 0) {
  2165. const rune = {
  2166. id: $(this).next().next().next().data('id') - 0,
  2167. count: count
  2168. };
  2169. runeList.push(rune);
  2170. }
  2171. });
  2172.  
  2173. $('.equip-name').each(function () {
  2174. const count = $(this).next().next().text() - 0;
  2175. if (count > 0) {
  2176. const rune = {
  2177. id: $(this).next().next().next().data('id') - 0,
  2178. count: count
  2179. };
  2180. runeList.push(rune);
  2181. }
  2182. });
  2183.  
  2184. function doMoveRune(index, cname) {
  2185. if (blockData.num >= 9) {
  2186. alert('封号打击次数过多,禁止一键符文转移');
  2187. location.reload();
  2188. }
  2189. if (index > runeList.length - 1) {
  2190. $('#processing').hide();
  2191. processing = false;
  2192. location.reload();
  2193. return;
  2194. }
  2195. const rune = runeList[index];
  2196. const list = $('#form').serializeArray();
  2197. const params = {};
  2198. list.forEach(item => {
  2199. params[item.name] = item.value;
  2200. });
  2201. params.cname = cname;
  2202. params.count = rune.count;
  2203. params.rune = rune.id;
  2204. $.post('/Equipment/RuneTrade', params, function () {
  2205. setTimeout(function () {
  2206. doMoveRune(index + 1, cname);
  2207. }, 300);
  2208. }).fail(function (data) {
  2209. alert("发生异常,请检查角色名是否正确");
  2210. location.reload();
  2211. });
  2212. }
  2213. $('.btn.btn-xs.btn-default').eq(1).before("");
  2214. $('#idle-ui-show-rune').click(function () {
  2215. $('#modalMoveRune').modal('show');
  2216. });
  2217. const spinner = renderProcessing();
  2218. const modal = ``;
  2219. $(document.body).append(modal);
  2220. $('#idle-ui-move-rune').click(function () {
  2221. if (processing) return;
  2222. if (runeList.length) {
  2223. const cname = $('#idle-ui-cname').val();
  2224. if (!cname) {
  2225. alert('请输入角色名称');
  2226. } else {
  2227. processing = true;
  2228. $('#processing').show();
  2229. doMoveRune(0, cname);
  2230. }
  2231. } else {
  2232. alert('没有转移的符文');
  2233. }
  2234. });
  2235. }
  2236.  
  2237. if (config.showRuneTip) {
  2238. let runeList = [];
  2239. const runeData = localStorage.getItem('idle-ui-rune-db');
  2240. if (runeData) {
  2241. runeList = JSON.parse(runeData);
  2242. } else {
  2243. fetchRuneTip();
  2244. }
  2245.  
  2246. if (location.href.indexOf('Equipment/Inlay') >= 0) {
  2247. const footer = `
  2248. <div class="panel-footer">
  2249. <input class="panel-filter hidden-xs filter-input" id="panel-filter-runeword" placeholder="搜索符文之语">
  2250. <span id="runeword-content"></span>
  2251. </div>
  2252. `;
  2253. $('.panel').eq(0).append(footer);
  2254. let timer = null;
  2255. $('#panel-filter-runeword').keyup(function () {
  2256. if (timer) {
  2257. clearTimeout(timer);
  2258. timer = null;
  2259. }
  2260. timer = setTimeout(() => {
  2261. const name = $(this).val();
  2262. const filtered = name ? runeList.filter(item => item.name.indexOf(name) >= 0) : [];
  2263. let ret = '';
  2264. if (filtered.length) {
  2265. const item = filtered[0];
  2266. const recipe = item.recipe.map(item => {
  2267. return `<span class="artifact">${item}</span>`
  2268. }).join(' + ');
  2269. ret = `<span><span class="artifact equip-name">【${item.name}】</span>:<span>${recipe}</span></span>`;
  2270. const requireContent = item.require.map(item => {
  2271. return `<p><span class="equip-label">${item}</span></p>`;
  2272. }).join('');
  2273. const attrContent = item.attr.map(item => {
  2274. return `<p>${item}</p>`;
  2275. }).join('');
  2276. const tip = `<div class="equip-content"><div class="equip"><p class="artifact">${item.name}</p>${requireContent}${attrContent}</div></div>`;
  2277. ret += tip;
  2278. }
  2279. $('#runeword-content').html(ret);
  2280. $.initPopup();
  2281. }, 300);
  2282. });
  2283.  
  2284. $('.equip').eq(0).children().last().prop('id', 'big-slot');
  2285.  
  2286. const link = '<a href="/Help/Content?url=Artifact" target="_blank" class="btn btn-xs btn-success mr-10">神器列表</a>';
  2287. $('.btn.btn-xs').eq(0).before(link);
  2288. }
  2289.  
  2290. if (location.href.indexOf('Help/Content?url=Artifact') >= 0) {
  2291. const filter = '<div class="container" style="margin-bottom: 20px;"><input class="form-control" id="panel-filter" placeholder="输入神器名称或符文序号" /></div>';
  2292. $('.navbar').next().after(filter);
  2293. let timer = null;
  2294. $('#panel-filter').keyup(function () {
  2295. if (timer) {
  2296. clearTimeout(timer);
  2297. timer = null;
  2298. }
  2299. timer = setTimeout(() => {
  2300. const val = $(this).val();
  2301. if (val) {
  2302. if (/^\d+$/.test(val)) {
  2303. $('tbody tr').each(function (i) {
  2304. const recipe = [];
  2305. $(this).children().eq(1).find('.artifact.equip-name').each(function () {
  2306. recipe.push($(this).text().match(/\d+/g)[0]);
  2307. });
  2308. if (recipe.indexOf(val) >= 0) {
  2309. $(this).show();
  2310. } else {
  2311. $(this).hide();
  2312. }
  2313. });
  2314. } else {
  2315. $('tbody tr').each(function (i) {
  2316. const name = $(this).children().last().find('.artifact').text();
  2317. if (name.indexOf(val) >= 0) {
  2318. $(this).show();
  2319. } else {
  2320. $(this).hide();
  2321. }
  2322. });
  2323. }
  2324. } else {
  2325. $('tbody tr').show();
  2326. }
  2327. }, 300);
  2328. });
  2329. }
  2330.  
  2331. function fetchRuneTip() {
  2332. $.get('/Help/Artifact', function (html) {
  2333. const dom = $.parseHTML(html);
  2334. $(dom).find('tr').each(function (i) {
  2335. if (i > 0) {
  2336. const nameLabel = $(this).children().last().find('.artifact');
  2337. const rune = {name: nameLabel.text(), attr: [], recipe: [], require: []};
  2338. nameLabel.parent().children().each(function (index) {
  2339. if (index > 0) rune.attr.push($(this).text());
  2340. });
  2341. $(this).children().eq(1).find('.artifact.equip-name').each(function () {
  2342. rune.recipe.push($(this).text());
  2343. });
  2344. $(this).children().eq(0).find('.equip-label').each(function () {
  2345. rune.require.push($(this).text());
  2346. });
  2347. runeList.push(rune);
  2348. }
  2349. });
  2350. localStorage.setItem('idle-ui-rune-db', JSON.stringify(runeList));
  2351. });
  2352. }
  2353. }
  2354.  
  2355. if (config.showBattleDetail && inBattlePage()) {
  2356. const battleResult = {};
  2357. const addedDamageTypes = ['溅射', '触发了技能', '对方受到'];
  2358.  
  2359. function getDamageType(plainText) {
  2360. let ret = -1;
  2361. addedDamageTypes.forEach((item, i) => {
  2362. if (plainText.indexOf(item) >= 0) ret = i;
  2363. });
  2364. return ret;
  2365. }
  2366.  
  2367. $('.turn').each(function (index) {
  2368. if (index > 0) {
  2369. const line = $(this).children().eq(1);
  2370. const hpData = $(this).children().first().data('hp');
  2371. const id = line.children()[0].innerHTML;
  2372. if (!hpData[1]) return;
  2373. const firstTargetId = hpData[1].id;
  2374. const skillLabel = line.children('.skill-name');
  2375. const skill = skillLabel.length ? skillLabel.eq(0).text() : '普通攻击';
  2376. const damageLabel = line.children('.damage');
  2377.  
  2378. let damage = 0;
  2379. let damageDetail = {base: 0};
  2380. if (firstTargetId < 0) {
  2381. damage = damageLabel.length ? damageLabel.eq(0).text() - 0 : 0;
  2382. damageDetail = {base: damage};
  2383. $(this).children().each(function (i) {
  2384. if (i > 1) {
  2385. const plainText = getPlainText($(this));
  2386. if (getDamageType(plainText) >= 0) {
  2387. const addedDamage = $(this).children('.damage').eq(0).text() - 0;
  2388. const damageType = getDamageType(plainText);
  2389. damage += addedDamage;
  2390. const lastDamage = damageDetail[damageType];
  2391. damageDetail[damageType] = lastDamage ? lastDamage + addedDamage : addedDamage;
  2392. }
  2393. }
  2394. });
  2395. }
  2396. if (!battleResult[id]) battleResult[id] = {};
  2397. if (!battleResult[id][skill]) battleResult[id][skill] = {
  2398. turn: 0,
  2399. damage: 0,
  2400. damageDetail: {}
  2401. };
  2402.  
  2403. const skillData = battleResult[id][skill];
  2404. skillData.turn += 1;
  2405. skillData.damage += damage;
  2406. Object.keys(damageDetail).forEach(type => {
  2407. if (skillData.damageDetail[type]) {
  2408. skillData.damageDetail[type] += damageDetail[type];
  2409. } else {
  2410. skillData.damageDetail[type] = damageDetail[type];
  2411. }
  2412. });
  2413. }
  2414. });
  2415.  
  2416. const totalTurns = $('.turn').length - 1;
  2417. let partyTotalDamage = 0;
  2418. $('.battle-data tbody tr').each(function (index) {
  2419. if (getCharId(index) > 0) {
  2420. const dmg = $(this).children().eq(2).text() - 0;
  2421. partyTotalDamage += dmg;
  2422. }
  2423. });
  2424.  
  2425. $('.battle-data thead td').eq(2).after('<td class="text-center">友方伤害占比</td><td class="text-center">详情</td><td class="text-center">出手次数</td><td class="text-center">出手占比</td><td class="text-center">每回合伤害</td>');
  2426. $('.battle-data tbody tr').each(function (index) {
  2427. const id = getCharId(index);
  2428. const actor = $(this).children().first().text();
  2429. const turns = getActorTurns(actor);
  2430. const turnsPercent = (turns / totalTurns * 100).toFixed(1) - 0;
  2431. const damage = $(this).children().eq(2).text() - 0;
  2432. const damagePercent = id > 0 ? `${(damage / partyTotalDamage * 100).toFixed(1) - 0}%` : '-';
  2433. const avgDamage = turns > 0 ? Math.round(damage / turns) : '-';
  2434. const link = battleResult[actor] ? `<a href="javascript: void(0);" class="link-detail" data-id="${actor}" data-actor="${actor}">查看</a>` : '-';
  2435. const content = `<td class="text-center poison">${damagePercent}</td><td class="text-center">${link}</td><td class="text-center physical ddd">${turns}</td><td class="text-center poison">${turnsPercent}%</td><td class="text-center fire ee">${avgDamage}</td>`;
  2436. $(this).children().eq(2).after(content);
  2437. });
  2438.  
  2439. $('.battle-data').css('overflow', 'auto');
  2440.  
  2441. const modal = `
  2442. <div class="modal fade" id="modalBattleDetail" tabindex="-1" role="dialog">
  2443. <div class="modal-dialog modal-lg" role="document">
  2444. <div class="modal-content model-inverse">
  2445. <div class="modal-header">
  2446. <span class="modal-title"><span id="idle-ui-char"></span> - 伤害详情</span>
  2447. </div>
  2448. <div class="modal-body">
  2449. <table class="table table-condensed">
  2450. <thead><tr><th class="text-center">技能</th><th class="text-center">总伤害</th><th class="text-center">伤害占比</th><th class="text-center">出手次数</th><th class="text-center">出手占比</th><th class="text-center">每回合伤害</th><th class="text-center">直接伤害</th><th class="text-center">溅射</th><th class="text-center">触发技能</th><th class="text-center">持续伤害及其他</th></tr></thead>
  2451. <tbody id="idle-ui-battle-rows"></tbody>
  2452. </table>
  2453. <ul>
  2454. <li>直接伤害:技能造成的实际直接伤害</li>
  2455. <li>溅射:因溅射,对非主目标造成的溅射伤害之和</li>
  2456. <li>触发技能:【装备自带技能】或【被击中触发】的技能等被触发后造成的伤害</li>
  2457. <li>持续伤害及其他:技能造成的持续伤害,以及其他伤害 </li>
  2458. </ul>
  2459. </div>
  2460. <div class="modal-footer">
  2461. <button type="button" class="btn btn-default btn-xs" data-dismiss="modal">关闭</button>
  2462. </div>
  2463. </div>
  2464. </div>
  2465. </div>
  2466. `;
  2467.  
  2468. $(document.body).append(modal);
  2469.  
  2470. $('.link-detail').click(function () {
  2471. const id = $(this).data('id');
  2472. const data = battleResult[id];
  2473. const actor = $(this).data('actor');
  2474. $('#idle-ui-char').text(actor);
  2475. let actorTotalTurns = 0;
  2476. let actorTotalDamage = 0;
  2477. Object.keys(data).forEach(skill => {
  2478. actorTotalTurns += data[skill].turn;
  2479. actorTotalDamage += data[skill].damage;
  2480. });
  2481.  
  2482. const content = Object.keys(data).map(skill => {
  2483. const skillData = data[skill];
  2484. const percent = (skillData.turn / actorTotalTurns * 100).toFixed(1) - 0;
  2485. const damagePercent = (skillData.damage / actorTotalDamage * 100).toFixed(1) - 0;
  2486. const avgDamage = skillData.turn > 0 ? Math.round(skillData.damage / skillData.turn) : '-';
  2487. return `<tr><td class="text-center skill">${skill}</td><td class="text-center fire">${skillData.damage}</td><td class="text-center poison">${damagePercent}%</td><td class="text-center physical">${skillData.turn}</td><td class="text-center poison">${percent}%</td><td class="text-center fire">${avgDamage}</td><td class="text-center fire">${skillData.damageDetail.base}</td><td class="text-center fire">${skillData.damageDetail['0'] || 0}</td><td class="text-center fire">${skillData.damageDetail['1'] || 0}</td><td class="text-center fire">${skillData.damageDetail['2'] || 0}</td></tr>`;
  2488. }).join('');
  2489. $('#idle-ui-battle-rows').html(content);
  2490. $('#modalBattleDetail').modal('show');
  2491. });
  2492.  
  2493. function getCharId(index) {
  2494. const ary = $('.battle-char').eq(index).prop('id').split('_');
  2495. return ary[ary.length - 1];
  2496. }
  2497.  
  2498. function getActorTurns(id) {
  2499. let ret = 0;
  2500. if (battleResult[id]) {
  2501. Object.keys(battleResult[id]).forEach(skill => {
  2502. ret += battleResult[id][skill].turn;
  2503. });
  2504. }
  2505. return ret;
  2506. }
  2507.  
  2508. function getPlainText(element) {
  2509. return element.clone() //clone the element
  2510. .children() //select all the children
  2511. .remove() //remove all the children
  2512. .end() //again go back to selected element
  2513. .text();
  2514. }
  2515. }
  2516.  
  2517. function switchSkin(showRequire) {
  2518. $('.equip-content > .equip').each(function (item) {
  2519. const type = $(this).children().first().attr('class');
  2520.  
  2521. let classLabel = '';
  2522. const requireIndex = $(this).text().indexOf('限');
  2523. if (requireIndex >= 0) {
  2524. const requireClass = $(this).text().substring(requireIndex + 1, requireIndex + 2);
  2525. classLabel = '';
  2526. }
  2527.  
  2528. const label = location.href.indexOf('Auction/QueryBid') >= 0 ? $(this).parent().prev().find('.equip-name').first() : $(this).parent().prev().find('.equip-name').last();
  2529. if (classLabel) {
  2530. showRequire ? label.after(classLabel) : label.next().remove();
  2531. }
  2532. });
  2533. }
  2534.  
  2535. function inBattlePage() {
  2536. const battePages = ['Battle/Simulate', 'Battle/InDungeon', 'Battle/WithChar'];
  2537. return battePages.some(path => location.href.indexOf(path) >= 0);
  2538. }
  2539.  
  2540. function renderProcessing() {
  2541. return '<span id="processing" class="mr-10" style="display:none;"><i class="glyphicon glyphicon-refresh"></i> 处理中...</span>';
  2542. }
  2543.  
  2544. function renderButton(id, text, type) {
  2545. if (!type) type = 'success';
  2546. return `<button type="button" class="btn btn-xs btn-${type} mr-10" id="${id}">${text}</button>`;
  2547. }
  2548.  
  2549. let uid = purl().param().id || purl().param().Id;
  2550.  
  2551. let blockMap = localStorage.getItem('idle-ui-block');
  2552. if (blockMap) {
  2553. blockMap = JSON.parse(blockMap);
  2554. } else {
  2555. blockMap = {};
  2556. }
  2557. if (!blockMap[uid]) blockMap[uid] = {num: 0, time: +new Date()};
  2558. let blockData = blockMap[uid];
  2559.  
  2560. if (location.href.indexOf('Character/Detail') >= 0) {
  2561. checkBlockNum();
  2562. //$('.col-sm-6 .panel-body').eq(0).children().last().append(`<p>封号打击次数(仅供参考):<span class="physical">${blockData.num}</span></p>`);
  2563. $('.col-sm-6 .panel-body').eq(0).children().last().append(``);
  2564. }
  2565.  
  2566. function addBlockNum() {
  2567. checkBlockNum();
  2568. if (!blockData.num) blockData.num = 0;
  2569. blockData.num += 1;
  2570. blockData.time = +new Date();
  2571. localStorage.setItem('idle-ui-block', JSON.stringify(blockMap));
  2572. new Notification(`当前封号打击为${blockData.num}次,请注意`);
  2573. }
  2574.  
  2575. function checkBlockNum() {
  2576. const curTime = +new Date();
  2577. const hours = Math.floor((curTime - blockData.time) / (3600 * 1000));
  2578. if (hours > 0) {
  2579. blockData.num = blockData.num > hours ? blockData.num - hours : 0;
  2580. blockData.time = blockData.time + (hours * 3600 * 1000);
  2581. localStorage.setItem('idle-ui-block', JSON.stringify(blockMap));
  2582. }
  2583. }
  2584. };
  2585.  
  2586. window.addEventListener('load', idleInit, false);
  2587.  
  2588. const borderColor = '#6f5a40';
  2589. GM_addStyle(`
  2590. @font-face {
  2591. font-family:"雅圆Comic sans MS- binsforever";
  2592. src: url(https://down.brighost.com/guyin.woff);
  2593. }
  2594. .panel-top {
  2595. margin-bottom: 20px;
  2596. text-align: center;
  2597. }
  2598. .idle-ui-title {
  2599. font-size: 13px;
  2600. color: #fff;
  2601. margin-bottom: 6px;
  2602. }
  2603. .panel-header {
  2604. margin: 8px 0;
  2605. }
  2606. .panel-textarea {
  2607. background-color: rgba(255,255,255,0.1);
  2608. color: #a99877;
  2609. margin-bottom: 8px;
  2610. }
  2611. .block-visited {
  2612. background-color: #3f51b5 !important;
  2613. }
  2614. .hit-input {
  2615. display: inline-block;
  2616. color: #fff;
  2617. width: 60px;
  2618. padding: 0 8px;
  2619. border-radius: 0;
  2620. background-color: transparent;
  2621. }
  2622. .idle-ui-set-single, .idle-ui-set-full {
  2623. opacity: 0.5;
  2624. }
  2625. .idle-ui-new-item {
  2626. border: 1px dashed #888 !important;
  2627. }
  2628. .mr-10 {
  2629. margin-right: 10px;
  2630. }
  2631. .ml-10 {
  2632. margin-left: 10px;
  2633. }
  2634. @-webkit-keyframes rotate {
  2635. from {
  2636. -webkit-transform: rotate(0deg);
  2637. -o-transform: rotate(0deg);
  2638. transform: rotate(0deg);
  2639. }
  2640. to {
  2641. -webkit-transform: rotate(360deg);
  2642. -o-transform: rotate(360deg);
  2643. transform: rotate(360deg);
  2644. }
  2645. }
  2646. #processing i {
  2647. animation: rotate 1s ease-in-out infinite;
  2648. }
  2649. .filter-input {
  2650. width: 150px !important;
  2651. }
  2652. #big-slot {
  2653. font-size: 17px;
  2654. margin-top: 10px !important;
  2655. color: #fff;
  2656. }
  2657. #idle-ui-quicksearch {
  2658. position: relative;
  2659. float: left;
  2660. margin-top: 1em;
  2661. }
  2662. #idle-ui-quicksearch > input {
  2663. width: 10em;
  2664. display: inline;
  2665. height: 1.3em;
  2666. line-height: 2em;
  2667. border-radius: 0.3em;
  2668. }
  2669. .equip-container > p:hover {
  2670. white-space: nowrap;
  2671. }
  2672. .equip-container > p:hover .sr-only {
  2673. z-index: 1;
  2674. position: relative;
  2675. }
  2676. html.d3 body {
  2677. color: #a99877;
  2678. font-family: "雅圆Comic sans MS- binsforever";
  2679. }
  2680. html.d3 .panel {
  2681. background-color: #171614;
  2682. border-color: ${borderColor};
  2683. }
  2684. html.d3 .panel-inverse > .panel-heading {
  2685. background-color: #101010;
  2686. border-color: #6f5a40;
  2687. font: normal 8px "guyin";
  2688. color: #F3E6D0;
  2689. border-radius: 9px 9px 0 0;
  2690. height: 21px;
  2691. line-height: inherit;
  2692. font-family: "雅圆Comic sans MS- binsforever";
  2693. }
  2694. html.d3 .panel-inverse > .panel-heading .label {
  2695. font-size: 9px;
  2696. font-family: "雅圆Comic sans MS- binsforever";
  2697. }
  2698. .dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover {
  2699. border-radius: 0.3em;
  2700. background-color: #515151;
  2701. cursor: pointer;
  2702. line-height: inherit;
  2703. }
  2704. html.d3 .btn {
  2705. background-color: transparent;
  2706. border: 0.1em solid #6f5a40;
  2707. color: #ad835a;
  2708. line-height: 1.3em;
  2709. border-radius: 0.3em;
  2710. margin-top: -0.2em;
  2711. }
  2712. html.d3 .btn:hover {
  2713. color: #fff !important;
  2714. }
  2715. html.d3 .btn:active {
  2716. background-color: transparent;
  2717. }
  2718. .label {
  2719. padding: 0px 0.1em 0px 0.1em;
  2720. }
  2721. html.d3 .label {
  2722. border-radius: 0.3em;
  2723. border: 0.3px solid #5f3d11;
  2724. box-shadow: 0 0 2px #000;
  2725. background-color: #000;
  2726. color: #ad835a;
  2727. font-family: "雅圆Comic sans MS- binsforever";
  2728. display: inline-table;
  2729. }
  2730. .equip-container .selected {
  2731. animation: glow 800ms ease-out infinite alternate;
  2732. }
  2733. @keyframes glow {
  2734. 0% {
  2735. border-color: rgb(255 255 255);
  2736. border-radius: 3em;
  2737. box-shadow: 0 0 0.3px 0.7px rgb(95 52 255 / 43%), inset 0 0 8px 1.4px rgb(255 255 255 / 33%), 0 0 0.3px 0.7px rgb(52 0 255);
  2738. }
  2739. 100% {
  2740. border-color: rgb(2 255 0);
  2741. border-radius: 0.3em;
  2742. box-shadow: 0 0 9px 1px rgb(166 255 0 / 23%), inset 0 0 1px 1px rgb(10 239 46 / 24%), 0 0 8px 0px rgb(107 255 0);
  2743. }
  2744. }
  2745. .navbar-inverse {
  2746. background-color: #222;
  2747. border-color: #080808;
  2748. height: 3.3em;
  2749. }
  2750. .navbar {
  2751. position: relative;
  2752. min-height: 2em;
  2753. margin-bottom: 1em;
  2754. border: 1px solid transparent;
  2755. }
  2756. .btn-group-xs>.btn, .btn-xs {
  2757. padding: 0px 3px 0px 3px;
  2758. font-size: 12px;
  2759. border-radius: 9px;
  2760. }
  2761. html.d3 .label.label-info {
  2762. color: #6969ff;
  2763. }
  2764. html.d3 .label.label-warning {
  2765. color: #ffff00;
  2766. }
  2767. html.d3 .label.label-danger {
  2768. color: #e60101;
  2769. }
  2770. html.d3 .label.label-success {
  2771. color: #00c400;
  2772. }
  2773. html.d3 .physical {
  2774. color: #f3e6d0 !important;
  2775. }
  2776. html.d3 .navbar-inverse.navbar-fixed-top {
  2777. border-bottom: 1px solid #322a20;
  2778. background-color: #171614;
  2779. margin-top:-30px;
  2780. }
  2781. html.d3 .navbar-inverse .navbar-brand {
  2782. color: #f3e6d0;
  2783. font-family: "雅圆Comic sans MS- binsforever";
  2784. text-align: center;
  2785. margin-top: 7px;
  2786. }
  2787. html.d3 a, html.d3 .navbar-inverse .navbar-nav>li>a {
  2788. color: #ad835a;
  2789. line-height: 8px;
  2790. font-size: 14px;
  2791. }
  2792. .navbar-nav {
  2793. border-radius: 0.3em;
  2794. background-color: #171614;
  2795. text-align: right;
  2796. padding: 5px 0px 0px 0px;
  2797. }
  2798. .navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover {
  2799. color: #fff;
  2800. background-color: #303030;
  2801. border-radius: 0.3em;
  2802. }
  2803. .navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse {
  2804. max-height: max-content;
  2805. }
  2806. .navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
  2807. color: #9d9d9d;
  2808. line-height: 14px;
  2809. height: auto;
  2810. text-align: right;
  2811. }
  2812. html.d3 .magical, html.d3 .skill, html.d3 .cold {
  2813. color: #6969ff !important;
  2814. }
  2815. html.d3 .hit-input {
  2816. border-color: ${borderColor};
  2817. height: fit-content;
  2818. }
  2819. html.d3 .progress {
  2820. border: 1px solid #513f2e;
  2821. border-radius: 0;
  2822. box-shadow: 0 0 5px #000;
  2823. background-color: #101010;
  2824. color: #f3e6d0;
  2825. height: 15px;
  2826. border-radius: 9px;
  2827. }
  2828. html.d3 .progress-bar {
  2829. border: 1px solid #101010;
  2830. line-height: 14px;
  2831. border-radius: 9px;
  2832. }
  2833.  
  2834. html.d3 .footer {
  2835. border-top: 1px solid #322a20;
  2836. background-color: #171614;
  2837. }
  2838. html.d3 .btn.btn-success {
  2839. color: #00c400;
  2840. }
  2841. html.d3 .btn.btn-danger {
  2842. color: #e60101;
  2843. }
  2844. html.d3 .img-thumbnail {
  2845. border-color: #d59c52;
  2846. }
  2847. html.d3 .popover {
  2848. background: #1d180e;
  2849. border: 1px solid #322a20;
  2850. border-radius: 9px;
  2851. box-shadow: 0 0 10px #000;
  2852. max-width: 100%;
  2853. width: max-content;
  2854. }
  2855. html.d3 .popover-content .equip p:first-child {
  2856. height: 100%;
  2857. width: 100%;
  2858. padding: 0;
  2859. margin: 5px 0px 5px 0px !important;
  2860. text-align: center;
  2861. line-height: 15px;
  2862. font-size: 14px;
  2863. font-family: "雅圆Comic sans MS- binsforever";
  2864. }
  2865.  
  2866. .popover-content {
  2867. padding: 3PX 3PX 3PX 3PX;
  2868. }
  2869. html.d3 .popover-content .equip p.unique:first-child {
  2870. background-position: 0 -120px;
  2871. }
  2872. html.d3 .popover-content .equip p.set:first-child {
  2873. background-position: 0 -180px;
  2874. }
  2875. html.d3 .popover-content .equip p.rare:first-child {
  2876. background-position: 0 -90px;
  2877. }
  2878. html.d3 .popover-content .equip p.artifact:first-child {
  2879. background-position: 0 -150px;
  2880. }
  2881. html.d3 .popover-content .equip p.magical:first-child {
  2882. background-position: 0 -60px;
  2883. }
  2884. html.d3 .popover-content .equip p.base:first-child {
  2885. background-position: 0 -30px;
  2886. }
  2887. html.d3 .popover-content .equip p.slot:first-child {
  2888. background-position: 0 -30px;
  2889. }
  2890. html.d3 .popover-content {
  2891. background-color: #000;
  2892. border-radius: 0.3em;
  2893. text-align: center;
  2894. font-size:11px;
  2895. }
  2896. html.d3 hr {
  2897. border-color: ${borderColor};
  2898. }
  2899. html.d3 .panel-inverse > .panel-footer {
  2900. background-color: #00000000;
  2901. border-color: ${borderColor};
  2902. }
  2903. html.d3 .modal-dialog {
  2904. box-shadow: 0 0 10px #000;
  2905. }
  2906. .panel {
  2907. background-color: transparent;
  2908. margin-bottom: 0.3em;
  2909. border-radius: 0.3em;
  2910. }
  2911. .panel.panel-inverse {
  2912. background-color: transparent;
  2913. margin-bottom: 0.3em;
  2914. border-radius: 0.3em;
  2915. }
  2916. html.d3 .modal-content {
  2917. background-color: #171614;
  2918. border-color: ${borderColor};
  2919. border-radius: 9px;
  2920. }
  2921. html.d3 .model-inverse > .modal-header, html.d3 .model-inverse > .modal-footer {
  2922. background-color: #101010;
  2923. border-color: ${borderColor};
  2924. padding: 1px 1px 1px 1px;
  2925. text-align: center;
  2926. border-radius: 9px;
  2927. }
  2928. .skill-name {
  2929. cursor: pointer;
  2930. border-radius: 9px;
  2931. }
  2932. html.d3 .model-inverse > .modal-header span {
  2933. line-height: normal;
  2934. }
  2935. html.d3 .panel-textarea {
  2936. border-color: ${borderColor};
  2937. }
  2938. .panel-footer .panel-filter {
  2939. height: 2em;
  2940. background: black;
  2941. border: solid 0.1em #000;
  2942. width: 20%;
  2943. text-indent: 0.4em;
  2944. border-radius: 0.3em;
  2945. font-size: 0.7em;
  2946. }
  2947. html.d3 .panel-footer .panel-filter {
  2948. border-color: #2a241c;
  2949. }
  2950. .panel-footer {
  2951. background-color: #f5f5f5;
  2952. border-top: 0.1em solid #ddd;
  2953. border-bottom-right-radius: 0.3em;
  2954. border-bottom-left-radius: 0.3em;
  2955. line-height: 0.8em;
  2956. }
  2957. html.d3 .btn-default:active:focus,
  2958. html.d3 .open>.dropdown-toggle.btn-default:focus,
  2959. html.d3 .btn-default.active, .btn-default:active,
  2960. html.d3 .open>.dropdown-toggle.btn-default {
  2961. background-color: transparent;
  2962. color: #a99877;
  2963. }
  2964. html.d3 .dropdown-menu {
  2965. background-color: #101010;
  2966. border-color: ${borderColor};
  2967. box-shadow: 0 0 10px #000;
  2968. font-family: "雅圆Comic sans MS- binsforever";
  2969. border-radius: 0.3em;
  2970. padding: 3px 3px 3px 3px;
  2971. }
  2972. html.d3 .equip-container .selected {
  2973. border: 1px solid ${borderColor};
  2974. background-color: transparent;
  2975. }
  2976. html.d3 .table > tbody > tr > td,
  2977. html.d3 .table > tbody > tr > th,
  2978. html.d3 .table > tfoot > tr > td,
  2979. html.d3 .table > tfoot > tr > th,
  2980. html.d3 .table > thead > tr > td,
  2981. html.d3 .table > thead > tr > th {
  2982. border-color: ${borderColor};
  2983. padding: 1px 1px 1px 1px;
  2984. }
  2985. html.d3 .equip .divider {
  2986. background-color: ${borderColor};
  2987. }
  2988. html.d3 .panel-heading .btn-group, html.d3 .panel-heading .btn {
  2989. vertical-align: middle;
  2990. border-radius: 0.3em;
  2991. margin-right: 0.3em;
  2992. margin-top: -0.1em;
  2993. margin-bottom: 0.1em;
  2994. }
  2995. html.d3 .form-control{
  2996. border-color: ${borderColor};
  2997. background-color: #101010;
  2998. color: #a99877;
  2999. border-radius: 0.3em;
  3000. line-height: 2.1em;
  3001. height: 2.1em;
  3002. width: 10em;
  3003. margin: auto;
  3004. }
  3005. html.d3 .form-validation .form-control {
  3006. width: 198px;
  3007. }
  3008. html.d3 .popover.bottom>.arrow:after {
  3009. border-bottom-color: #322a20;
  3010. }
  3011. html.d3 .super, html.d3 .unique {
  3012. color: rgb(255,128,0) !important;
  3013. }
  3014. html.d3 .artifact {
  3015. color: rgb(182,89,245) !important;
  3016. }
  3017. html.d3 .equip > p {
  3018. color: #6969ff;
  3019. line-height: 11px;
  3020. font-size: 11px;
  3021. font-family: "雅圆Comic sans MS- binsforever";
  3022. padding: 0 0 0 0;
  3023. }
  3024. .panel {
  3025. background-color: transparent;
  3026. margin-bottom: 10px;
  3027. border-radius: 9px;
  3028. }
  3029. .panel .col-xs-1, .panel .col-sm-1, .panel .col-md-1, .panel .col-lg-1, .panel .col-xs-2, .panel .col-sm-2, .panel .col-md-2, .panel .col-lg-2, .panel .col-xs-3, .panel .col-sm-3, .panel .col-md-3, .panel .col-lg-3, .panel .col-xs-4, .panel .col-sm-4, .panel .col-md-4, .panel .col-lg-4, .panel .col-xs-5, .panel .col-sm-5, .panel .col-md-5, .panel .col-lg-5, .panel .col-xs-6, .panel .col-sm-6, .panel .col-md-6, .panel .col-lg-6, .panel .col-xs-7, .panel .col-sm-7, .panel .col-md-7, .panel .col-lg-7, .panel .col-xs-8, .panel .col-sm-8, .panel .col-md-8, .panel .col-lg-8, .panel .col-xs-9, .panel .col-sm-9, .panel .col-md-9, .panel .col-lg-9, .panel .col-xs-10, .panel .col-sm-10, .panel .col-md-10, .panel .col-lg-10, .panel .col-xs-11, .panel .col-sm-11, .panel .col-md-11, .panel .col-lg-11, .panel .col-xs-12, .panel .col-sm-12, .panel .col-md-12, .panel .col-lg-12 {
  3030. position: relative;
  3031. min-height: 1em;
  3032. line-height: 14px;
  3033. font-size: 11px;
  3034. font-variant: common-ligatures;
  3035. }
  3036. .equip-container > p {
  3037. border: 1px solid transparent;
  3038. font-size: 13px;
  3039. font-variant: common-ligatures;
  3040. line-height: 14px;
  3041. width: max-content;
  3042. }
  3043. .char-container > p {
  3044. cursor: pointer;
  3045. font-size: 9px;
  3046. font-variant: proportional-width;
  3047. line-height: 100%;
  3048. }
  3049. p {
  3050. margin: 0px 0px 0px 0px;
  3051. font-size: 15px;
  3052. line-height: 15px;
  3053. }
  3054. .panel-heading {
  3055. border-bottom: 1px solid transparent;
  3056. border-top-left-radius: 3px;
  3057. border-top-right-radius: 3px;
  3058. padding: 0 0 10px 10px;
  3059. }
  3060. .badge {
  3061. display: inline-block;
  3062. min-width: 10px;
  3063. font-size: 12px;
  3064. font-weight: 700;
  3065. line-height: 1.5;
  3066. color: #fff;
  3067. text-align: center;
  3068. white-space: nowrap;
  3069. vertical-align: middle;
  3070. border-radius: 10px;
  3071. line-height: 10px;
  3072. }
  3073.  
  3074. span.badge.attr-points {
  3075. line-height: 10px;
  3076. }
  3077. .equip p, .equip-magic p {
  3078. margin-bottom: 3px !important;
  3079. margin-top: 1px !important;
  3080. line-height: 11px;
  3081. font-size: 9px;
  3082. }
  3083. .media-body, .media-left, .media-right {
  3084. display: table-cell;
  3085. vertical-align: top;
  3086. line-height: 20px;
  3087. }
  3088. .panel-body {
  3089. padding: 0.5em;
  3090. }
  3091. .char-container {
  3092. padding: 5px 0px 0px 5px;
  3093. }
  3094. .notice-content {
  3095. cursor: pointer;
  3096. font-size: 11px;
  3097. line-height: 15px;
  3098. }
  3099. .panel>.panel-collapse>.table, .panel>.table, .panel>.table-responsive>.table {
  3100. margin-bottom: 0;
  3101. font-size: 9px;
  3102. }
  3103. td, th {
  3104. padding: 0;
  3105. line-height: 10px;
  3106. }
  3107. tr {
  3108. padding: 0;
  3109. line-height: 10px;
  3110. }
  3111. hr {
  3112. margin-top: 7px;
  3113. margin-bottom: 7px;
  3114. border: 0;
  3115. border-top: 1px solid #eee;
  3116. }
  3117. .turn {
  3118. display: none;
  3119. line-height: 12px;
  3120. font-size: 5px;
  3121. }
  3122. .dropdown-menu>li>a {
  3123. display: flow-root;
  3124. padding: 1px 1px 1px 1px;
  3125. font-weight: 400;
  3126. color: #333;
  3127. white-space: nowrap;
  3128. height: 15px;
  3129. font-size: 13px;
  3130. text-align: center;
  3131. line-height: inherit;
  3132. }
  3133. .media-object.img-thumbnail {
  3134. max-width: 64px;
  3135. max-height: 64px;
  3136. margin: auto;
  3137. margin-top: 10px;
  3138. margin-left: 10px;
  3139. }
  3140. .popover-content {
  3141. padding: 1px 1px 1px 1px;
  3142. line-height: 13px;
  3143. font-family: "雅圆Comic sans MS- binsforever";
  3144. font-size: 9px;
  3145. }
  3146. .modal-body {
  3147. position: relative;
  3148. text-align: center;
  3149. padding: 0px 32px 0px 32px;
  3150. }
  3151. .modal-body.dungeon-log {
  3152. text-align: left;
  3153. padding: 0px 1px 0px 1px'';
  3154. font-size: 9px;
  3155. line-height: 13px;
  3156. display: flow-root;
  3157. }
  3158. ol, ul {
  3159. margin-top: 0;
  3160. margin-bottom: 10px;
  3161. list-style: inside;
  3162. text-align: left;
  3163. font-size: 11px;
  3164. padding: 1px 1px 1px 1px;
  3165. line-height: 14px;
  3166. }
  3167. .table {
  3168. width: 100%;
  3169. max-width: 100%;
  3170. margin-bottom: 5px;
  3171. }
  3172. .skill-editor .selected {
  3173. border: 1px solid #5cb85c;
  3174. padding: 1px 2px;
  3175. background-color: #222;
  3176. animation: selectskill 800ms ease-out infinite alternate;
  3177. }
  3178. @keyframes selectskill {
  3179. 0% {
  3180. border-color: rgb(155, 247, 6);
  3181. border-radius: 9px;
  3182. box-shadow: 0 0 0.3px 0.7px rgba(0, 255, 30, 0.43), inset 0 0 8px 1.4px rgba(0, 255, 42, 0.19), 0 0 0.3px 0.7px rgb(43, 255, 0);
  3183. }
  3184. 100% {
  3185. border-color: rgb(255, 255, 255);
  3186. border-radius: 9px;
  3187. box-shadow: 0 0 11px 5px rgb(183 183 183 / 20%), inset 0 0 7px 2px rgb(255 255 255 / 10%), 0 0 5px 1px rgb(237 237 237);
  3188. }
  3189. }
  3190.  
  3191. .progress-bar-mana {
  3192. border-radius: 9px;
  3193. height: 14px;
  3194. background: url(https://down.brighost.com/mana.png)no-repeat;
  3195. background-size: cover;
  3196. text-shadow: 0px 0px 3px black;
  3197. box-shadow: inset 0 0 2px 0.1px #00000082;
  3198. }
  3199. html.d3 .progress-bar-exp {
  3200. border-radius: 9px;
  3201. height: 14px;
  3202. background: url(https://down.brighost.com/exp.png)no-repeat;
  3203. background-size: cover;
  3204. text-shadow: 0px 0px 3px black;
  3205. box-shadow: inset 0 0 2px 0.1px #00000082;
  3206. }
  3207. html.d3 .progress-bar-life {
  3208. border-radius: 9px;
  3209. height: 14px;
  3210. background: url(https://down.brighost.com/blood.png)no-repeat;
  3211. background-size: cover;
  3212. text-shadow: 0px 0px 3px black;
  3213. box-shadow: inset 0 0 2px 0.1px #00000082;
  3214. }
  3215. //这里往下是密境修改
  3216. .dungeon-container .normal {
  3217. background-image: url(https://down.brighost.com/normal.png);
  3218. }
  3219.  
  3220. .dungeon-container .rare {
  3221. background-image: url(https://down.brighost.com/rare.png);
  3222. }
  3223.  
  3224. .dungeon-container .super {
  3225. background-image: url(https://down.brighost.com/super.png);
  3226. }
  3227.  
  3228. .dungeon-container .boss {
  3229. background-image: url(https://down.brighost.com/boss.png);
  3230. background-color: #100f0b;
  3231. }
  3232.  
  3233. .dungeon-container .public {
  3234. background-image: url(https://down.brighost.com/backdgue.png)no-repeat;
  3235. }
  3236. .dungeon-container .left {
  3237. border-left: solid 7px #808080;
  3238. border-image-source: url(https://down.brighost.com/left.png);
  3239. border-image-slice: 32;
  3240. }
  3241. .dungeon-container .top {
  3242. border-top: solid 7px #808080;
  3243. border-image-source: url(https://down.brighost.com/top.png);
  3244. border-image-slice: 32;
  3245. }
  3246. .dungeon-container .top.left {
  3247. border-top: solid 7px #808080;
  3248. border-image-source: url(https://down.brighost.com/left.png);
  3249. border-image-slice: 32;
  3250. }
  3251. .dungeon-container .block {
  3252. display: block;
  3253. float: left;
  3254. width: 4.77%;
  3255. height: 30px;
  3256. color: white;
  3257. font-size: 30px;
  3258. text-align: center;
  3259. line-height: 30px;
  3260. box-sizing: border-box;
  3261. background-repeat: no-repeat;
  3262. background-size: contain;
  3263. }
  3264. .panel-body.dungeon-container.hidden-xsm {
  3265. margin-left: 37px;
  3266. }
  3267.  
  3268. .skill-container .disabled {
  3269. border: 1px solid red;
  3270. padding: 1px 2px;
  3271. cursor: not-allowed;
  3272. }
  3273. .popover-content > .equip > .equip-title {
  3274. height: 30px;
  3275. width: 263px;
  3276. line-height: 30px;
  3277. text-align: center;
  3278. background-image: url();
  3279. background-repeat: no-repeat;
  3280. }
  3281. body {
  3282. font-family: Arial,Helvetica,Sans-Serif;
  3283. background-color: black;
  3284. font-size: 15px;
  3285. line-height: 150%;
  3286. color: #afafaf;
  3287. padding-top: 2em;
  3288. padding-bottom: 2em;
  3289. overflow-x: hidden;
  3290. height:100%;
  3291. }
  3292. .equip {
  3293. text-align: center;
  3294. }
  3295. .duik-go-to {
  3296. border: 1px dashed #c3bebe;
  3297. z-index: 100;
  3298. width: 2.75rem;
  3299. height: 2.75rem;
  3300. color: #555;
  3301. opacity: 1;
  3302. background-color: #f5f5f5;
  3303. border-radius: 50%;
  3304. font-size: 1rem;
  3305. transition: all .3s ease-out;
  3306. position: fixed;
  3307. bottom: -50px;
  3308. right: 25px;
  3309. display: none;
  3310. }
  3311. `);