The West Duel Cloth Calc

Calculates the Duel skill values of your opponents.

目前為 2018-05-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name        The West Duel Cloth Calc
// @author      Mr. Perseus
// @namespace   tw-perseus
// @description Calculates the Duel skill values of your opponents.
// @include     https://*.the-west.*/game.php*
// @include     http://*.the-west.*/game.php*
// @include     https://*.tw.innogames.*/game.php*
// @include     http://*.tw.innogames.*/game.php*
// @version     0.0.1-beta-2
// @grant       none
// ==/UserScript==

"use strict";(function(a){var b=document.createElement("script");b.setAttribute("type","application/javascript"),b.textContent="("+a+")();",document.body.appendChild(b),document.body.removeChild(b)})(function(){var a={version:"0.0.1-beta-2"};a.InitUpdater=function(){setTimeout(function(){$.getScript("https://glcdn.githack.com/knom_retsam/the-west-public/raw/master/script-updater.js",function(){if(scriptUpdater.TWDCC>a.version)var b=new west.gui.Dialog("Update: The West Duel Cloth Calc","<span>Update Available<br><br><b>v"+scriptUpdater.TWDCC+":</b><br>"+scriptUpdater.TWDCCNew+"</span>",west.gui.Dialog.SYS_WARNING).addButton("Update",function(){b.hide(),location.href="https://gf.qytechs.cn/scripts/210874-the-west-duel-cloth-calc/code/The%20West%20Duel%20Cloth%20Calc.user.js"}).addButton("cancel").show()})},5e3)},a.Helper={generateNpcPopup:function(a,b,c){var d,e;return b&&(d=ItemManager.get(b),e=d.getDamage(c)),"<table class=\"dln_npcskill_popup\">"+(d?"<tr><td colspan=\"5\" class=\"text_bold\">Fertigkeitenbonus des Gegners<br />&nbsp;</td></tr>":"")+"<tr><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_shot.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_punch.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_aim.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_appearance.jpg\" /></td><td></td></tr><tr><td class=\"text_bold\">"+(a.shot||0)+"</td><td class=\"text_bold\">"+(a.punch||0)+"</td><td class=\"text_bold\">"+(a.aim||0)+"</td><td class=\"text_bold\">"+(a.appearance||0)+"</td><td></td></tr><tr><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_tactic.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_reflex.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_dodge.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_tough.jpg\" /></td><td><img src=\"https://westde.innogamescdn.com/images/window/duels/npcskill_health.jpg\" /></td></tr><tr><td class=\"text_bold\">"+(a.tactic||0)+"</td><td class=\"text_bold\">"+(a.reflex||0)+"</td><td class=\"text_bold\">"+(a.dodge||0)+"</td><td class=\"text_bold\">"+(a.tough||0)+"</td><td class=\"text_bold\">"+(a.health||0)+"</td></tr>"+(d?"<tr><td colspan=\"2\" class=\"text_bold\"><img src=\""+d.image+"\" /></td><td colspan=\"3\" class=\"text_bold\"><br />"+d.name+"<br />(Schaden:&nbsp;"+e.min+" - "+e.max+")</td></tr>":"")+"</table>"}},a.CalcValue=function(b,c,d,e){var f=ItemManager.get(b);f.set&&(d.hasOwnProperty(f.set)?d[f.set]++:d[f.set]=1);var g=a.GetBonusObjectValues(f.bonus.item);a.FactorizeValues(g,e,f.item_level),a.AddToValues(c,g);var h=a.GetSimpleObjectValues(f);a.AddToValues(c,h)},a.FactorizeValues=function(a,b,c){for(var d in c=c?1+c/10:1,a)if(a.hasOwnProperty(d)){var e=Math.ceil(a[d]*b);a[d]=Math.round(e*c),a[d]===e&&1!==c&&a[d]++}},a.AddToValues=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=a[c]?a[c]+b[c]:b[c])},a.GetBonusObjectValues=function(a){var b={},c=!0,d=!1,e=void 0;try{for(var f,g,h=a[Symbol.iterator]();!(c=(f=h.next()).done);c=!0)g=f.value,"character"===g.type&&"level"===g.key&&("skill"===g.bonus.type||"attribute"===g.bonus.type)&&(b[g.bonus.name]=g.bonus.value)}catch(a){d=!0,e=a}finally{try{!c&&h.return&&h.return()}finally{if(d)throw e}}return b},a.GetSimpleSetObjectValues=function(a){var b={},c=!0,d=!1,e=void 0;try{for(var f,g,h=a[Symbol.iterator]();!(c=(f=h.next()).done);c=!0)g=f.value,("attribute"===g.type||"skill"===g.type)&&(b[g.name]=g.value)}catch(a){d=!0,e=a}finally{try{!c&&h.return&&h.return()}finally{if(d)throw e}}return b},a.GetSimpleObjectValues=function(a){var b={};for(var c in a.bonus.skills)a.bonus.skills.hasOwnProperty(c)&&(b[c]=a.bonus.skills[c]);for(var d in a.bonus.attributes)a.bonus.attributes.hasOwnProperty(d)&&(b[d]=a.bonus.attributes[d]);return b},a.AddSetsToValues=function(b,c,d){for(var e in b)if(b.hasOwnProperty(e)){var f=west.storage.ItemSetManager.get(e);if(f&&f.bonus[b[e]]){for(var g,h={},j={},k=2;k<=b[e];k++){g=a.GetBonusObjectValues(f.bonus[k]),a.AddToValues(h,g);var i=a.GetSimpleSetObjectValues(f.bonus[k]);a.AddToValues(j,i)}a.FactorizeValues(h,d),a.AddToValues(c,h),a.AddToValues(c,j)}}},a.InitClothCalc=function(){PlayerProfileMain.backup_setWear=PlayerProfileMain.setWear,PlayerProfileMain.setWear=function(){PlayerProfileMain.backup_setWear.apply(this,arguments);var b={},c={strength:0,flexibility:0,dexterity:0,charisma:0,build:0,punch:0,tough:0,endurance:0,health:0,ride:0,reflex:0,dodge:0,hide:0,swim:0,aim:0,shot:0,pitfall:0,finger_dexterity:0,repair:0,leadership:0,tactic:0,trade:0,animal:0,appearance:0},d=this.resp.level,e=void 0;for(var f in this.resp.wear)this.resp.wear.hasOwnProperty(f)&&this.resp.wear[f]&&("animal"==f||"yield"==f||"head"==f||"body"==f||"pants"==f||"foot"==f||"neck"==f||"belt"==f||"right_arm"==f||"left_arm"==f)&&("right_arm"==f&&(e=this.resp.wear[f]),a.CalcValue(this.resp.wear[f],c,b,d));a.AddSetsToValues(b,c,d);var g={shot:c.dexterity+c.shot,punch:c.strength+c.punch,aim:c.dexterity+c.aim,appearance:c.charisma+c.appearance,tactic:c.charisma+c.tactic,reflex:c.flexibility+c.reflex,dodge:c.flexibility+c.dodge,tough:c.strength+c.tough,health:c.strength+c.health};console.log("TWDCC: FINISHED CALCULATING PLAYER: "+this.resp.playername+" Level: "+d,c,"Duel Values:",g);var h=a.Helper.generateNpcPopup(g,e,this.resp),i=this.window.find("div.profileavatar");i.attr("title",h);var j=this.window.find("div.overlay");j.removeClass("overlay")}},$(document).ready(function(){try{a.InitUpdater(),a.InitClothCalc()}catch(a){console.log(a.stack)}})});

QingJ © 2025

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