From ad5ac8b5dd76db3f0fa7c41de52c0b0b60a5a4d8 Mon Sep 17 00:00:00 2001 From: GuybrushGit Date: Mon, 16 Dec 2024 17:57:04 +0000 Subject: [PATCH] classic deep wounds --- dist/js/classes/player.min.js | 2 +- js/classes/player.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/js/classes/player.min.js b/dist/js/classes/player.min.js index 5d12e2fa..22ea682d 100644 --- a/dist/js/classes/player.min.js +++ b/dist/js/classes/player.min.js @@ -1 +1 @@ -class Player{static getConfig(s){return{level:$('input[name="level"]').val(),race:$('select[name="race"]').val(),aqbooks:"Yes"==$('select[name="aqbooks"]').val(),reactionmin:parseInt($('input[name="reactionmin"]').val()),reactionmax:parseInt($('input[name="reactionmax"]').val()),adjacent:parseInt($('input[name="adjacent"]').val()),mode:globalThis.mode,spellqueueing:"Yes"==$('select[name="spellqueueing"]').val(),target:{level:parseInt($('input[name="targetlevel"]').val()),basearmor:parseInt($('select[name="targetbasearmor"]').val()||$('input[name="targetcustomarmor"]').val()),defense:5*parseInt($('input[name="targetlevel"]').val()),resistance:parseInt($('input[name="targetresistance"]').val()),speed:1e3*parseFloat($('input[name="targetspeed"]').val()),mindmg:parseInt($('input[name="targetmindmg"]').val()),maxdmg:parseInt($('input[name="targetmaxdmg"]').val()),bleedreduction:$('select[name="bleedreduction"]').val()}}}constructor(s,t,e,a){if(a||(a=Player.getConfig()),this.rage=0,this.ragemod=1,this.level=a.level,this.rageconversion=.0091107836*this.level*this.level+3.225598133*this.level+4.2652911,25==this.level&&(this.rageconversion=82.25),40==this.level&&(this.rageconversion=140.5),this.agipercrit=this.getAgiPerCrit(this.level),this.timer=0,this.itemtimer=0,this.stancetimer=0,this.ragetimer=0,this.dodgetimer=0,this.crittimer=0,this.critdmgbonus=0,this.mainspelldmg=1,this.extraattacks=0,this.batchedextras=0,this.nextswinghs=!1,this.nextswingcl=!1,this.freeslam=!1,this.ragecostbonus=0,this.logging=a.logging,this.race=a.race,this.aqbooks=a.aqbooks,this.reactionmin=a.reactionmin,this.reactionmax=a.reactionmax,this.adjacent=a.adjacent,this.spelldamage=0,this.target=a.target,this.mode=a.mode,this.bleedmod=parseFloat(this.target.bleedreduction),this.spellqueueing=a.spellqueueing,this.target.misschance=this.getTargetSpellMiss(),this.target.mitigation=this.getTargetSpellMitigation(),this.target.binaryresist=this.getTargetSpellBinaryResist(),this.target.dodge=0,this.timeworn=0,this.dodgetimeworn=0,this.base={ap:0,agi:0,str:0,hit:0,crit:0,spellcrit:0,skill_0:5*this.level,skill_1:5*this.level,skill_2:5*this.level,skill_3:5*this.level,skill_4:5*this.level,skill_5:5*this.level,skill_6:5*this.level,skill_7:this.level<35?225:300,skill_10:0,skill_11:0,skill_13:0,skill_20:0,skill_21:0,skill_23:0,haste:1,expertise:0,strmod:1,agimod:1,dmgmod:1,spelldmgmod:1,moddmgdone:0,moddmgtaken:0,apmod:1,baseapmod:1,resist:{shadow:0,arcane:0,nature:0,fire:0,frost:0},block:0,defense:0},1==e?(this.testEnch=s,this.testEnchType=t):2==e?(this.testTempEnch=s,this.testTempEnchType=t):3==e?0==t?this.base.ap+=s:1==t?this.base.crit+=s:2==t?this.base.hit+=s:3==t?this.base.str+=s:4==t&&(this.base.agi+=s):(this.testItem=s,this.testItemType=t),this.stats={},this.auras={},this.spells={},this.items=[],this.addRace(),this.addTalents(),this.addGear(),this.mh){if(this.addSets(),this.addEnchants(),this.addTempEnchants(),this.preAddRunes(),this.addBuffs(),this.addSpells(s),this.sortSpells(),this.addRunes(),this.setSkills(),this.talents.flurry&&(this.auras.flurry=new Flurry(this)),this.talents.deepwounds&&"classic"!==this.mode&&(this.auras.deepwounds="sod"==this.mode?new DeepWounds(this):new OldDeepWounds(this)),this.adjacent&&this.talents.deepwounds&&"classic"!==this.mode)for(let s=2;s<=this.adjacent+1;s++)this.auras["deepwounds"+s]="sod"==this.mode?new DeepWounds(this,null,s):new OldDeepWounds(this,null,s);this.spells.stanceswitch=new StanceSwitch(this),this.spells.bloodrage&&(this.auras.bloodrage=new BloodrageAura(this)),this.spells.berserkerrage&&(this.auras.berserkerrage=new BerserkerRageAura(this)),this.spells.shieldslam&&(this.auras.defendersresolve=new DefendersResolve(this)),("def"==this.basestance||"glad"==this.basestance)&&this.spells.sunderarmor&&this.devastate&&this.shield&&(this.spells.sunderarmor.devastate=!0,this.spells.sunderarmor.nocrit=!1),this.items.includes(233490)&&(this.auras.obsidianstrength=new ObsidianStrength(this),this.auras.obsidianhaste=new ObsidianHaste(this)),this.update(),this.oh&&(this.oh.timer=Math.round(1e3*this.oh.speed/this.stats.haste/2))}}initStances(){this.stance=this.basestance,this.auras.battlestance=new BattleStance(this),this.auras.berserkerstance=new BerserkerStance(this),this.auras.defensivestance=new DefensiveStance(this),this.auras.gladiatorstance=new GladiatorStance(this),"battle"==this.basestance&&(this.auras.battlestance.timer=1),"zerk"==this.basestance&&(this.auras.berserkerstance.timer=1),"def"==this.basestance&&(this.auras.defensivestance.timer=1),"glad"==this.basestance&&(this.auras.gladiatorstance.timer=1),this.spells.unstoppablemight&&this.spells.unstoppablemight.switchstart&&this.switch(this.spells.unstoppablemight.secondarystance)}addRace(){for(let s of levelstats){let t;"Human"==this.race&&(t="1"),"Orc"==this.race&&(t="2"),"Dwarf"==this.race&&(t="3"),"Night Elf"==this.race&&(t="4"),"Undead"==this.race&&(t="5"),"Tauren"==this.race&&(t="6"),"Gnome"==this.race&&(t="7"),"Troll"==this.race&&(t="8");let e=s.split(",");e[0]==t&&e[2]==this.level&&(this.base.aprace=3*this.level-20,this.base.ap+=3*this.level-20,this.base.str+=parseInt(e[3]),this.base.agi+=parseInt(e[4]),this.base.skill_0+="1"==t?5:0,this.base.skill_1+="1"==t?5:0,this.base.skill_2+=0,this.base.skill_3+="2"==t?5:0)}}addTalents(){this.talents={};for(let s in talents)for(let t of talents[s].t)this.talents=Object.assign(this.talents,t.aura(t.c));this.talents.defense&&(this.base.defense+=this.talents.defense)}addGear(){for(let type in gear)for(let item of gear[type])if(this.testItemType==type&&this.testItem==item.id||this.testItemType!=type&&item.selected){for(let s in this.base)if("haste"==s)this.base.haste*=1+item.haste/100||1;else if("object"==typeof item[s])for(let t in item[s])this.base[s][t]+=item[s][t]||0;else item[s]&&(this.base[s]+=item[s]||0);if(item.skill&&item.skill>0){let s=WEAPONTYPE[item.type.replace(" ","").toUpperCase()];this.base["skill_"+s]+=item.skill}if(item.skills&&Object.keys(item.skills).forEach(s=>{this.base["skill_"+s]+=item.skills[s]}),item.d&&(this.base.defense+=item.d),"mainhand"!=type&&"offhand"!=type&&"twohand"!=type||this.addWeapon(item,type),item.proc&&item.proc.chance&&("trinket1"==type||"trinket2"==type)){let proc={};proc.chance=100*item.proc.chance,proc.extra=item.proc.extra,proc.magicdmg=item.proc.dmg,proc.cooldown=item.proc.cooldown,item.spell&&(this.auras[item.proc.spell.toLowerCase()]=eval("new "+item.proc.spell+"(this)"),proc.spell=this.auras[item.proc.spell.toLowerCase()]),this["trinketproc"+(this.trinketproc1?2:1)]=proc}else if(item.proc&&item.proc.chance){let proc={};proc.chance=100*item.proc.chance,item.proc.dmg&&(proc.magicdmg=item.proc.dmg),item.proc.spell&&(this.auras[item.proc.spell.toLowerCase()]=eval("new "+item.proc.spell+"(this)"),proc.spell=this.auras[item.proc.spell.toLowerCase()]),this.attackproc2&&console.log("Warning! overlapping attack procs!"),this.attackproc1?this.attackproc2=proc:this.attackproc1=proc}21189==item.id&&(this.base.moddmgdone+=4),19968==item.id&&(this.base.moddmgdone+=2),215166==item.id&&(this.base.moddmgdone+=3),228089==item.id&&(this.base.moddmgdone+=4),227809==item.id&&(this.base.moddmgdone+=3),230003!=item.id&&23000399!=item.id||(this.base.moddmgdone+=4),233638==item.id&&(this.base.moddmgdone+=3),234761==item.id&&(this.base.moddmgdone+=4),234084==item.id&&(this.base.moddmgdone+=3),234065==item.id&&(this.base.moddmgdone+=2),234147==item.id&&(this.base.moddmgdone+=4),228122==item.id&&(this.spells.themoltencore=new TheMoltenCore(this)),item.tw&&(this.timeworn++,this.dodgetimeworn++),this.items.push(item.id)}}addWeapon(s,t){let e,a;for(let s of enchant[t])s.temp||(this.testEnchType==t&&this.testEnch==s.id?e=s:this.testEnchType!=t&&s.selected&&(e=s));for(let s of enchant[t])s.temp&&(this.testTempEnchType==t&&this.testTempEnch==s.id?a=s:this.testTempEnchType!=t&&s.selected&&(a=s));"mainhand"==t&&(this.mh=new Weapon(this,s,e,a,!1,!1)),"offhand"==t&&"Shield"!=s.type&&(this.oh=new Weapon(this,s,e,a,!0,!1)),"offhand"==t&&"Shield"==s.type&&(this.shield=s),"twohand"==t&&(this.mh=new Weapon(this,s,e,a,!1,!0))}addEnchants(){for(let s in enchant)for(let t of enchant[s])if(!t.temp&&(this.testEnchType==s&&this.testEnch==t.id||this.testEnchType!=s&&t.selected))for(let s in this.base)if("haste"==s)this.base.haste*=1+t.haste/100||1;else if("object"==typeof t[s])for(let e in t[s])this.base[s][e]+=t[s][e]||0;else t[s]&&(this.base[s]+=t[s]||0)}addTempEnchants(){for(let s in enchant)for(let t of enchant[s])if(t.temp&&("mainhand"!=s&&"twohand"!=s||!this.mh.windfury)&&(this.testTempEnchType==s&&this.testTempEnch==t.id||this.testTempEnchType!=s&&t.selected))for(let s in this.base)if("haste"==s)this.base.haste*=1+t.haste/100||1;else if("object"==typeof t[s])for(let e in t[s])this.base[s][e]+=t[s][e]||0;else t[s]&&(this.base[s]+=t[s]||0)}preAddRunes(){if("undefined"!=typeof runes)for(let s in runes)for(let t of runes[s])t.selected&&(t.focusedrage&&(this.ragecostbonus=3),t.precisetiming&&(this.precisetiming=t.precisetiming))}addRunes(){if("undefined"!=typeof runes)for(let s in runes)for(let t of runes[s])t.selected&&(t.bloodfrenzy&&(this.bloodfrenzy=t.bloodfrenzy),t.ragemod&&(this.base.ragemod=(this.base.ragemod||1)*t.ragemod),t.haste2h&&this.mh.twohand&&(this.base.haste*=1+t.haste2h/100||1,this.extrarage=2,this.extracritrage=4),t.furiousthunder&&(this.furiousthunder=t.furiousthunder),t.dmgdw&&this.oh&&(this.base.dmgmod*=1+t.dmgdw/100||1),t.devastate&&(this.devastate=t.devastate),t.bloodsurge&&(this.bloodsurge=t.bloodsurge),t.swordboard&&(this.swordboard=t.swordboard),t.wreckingcrew&&(this.wreckingcrew=t.wreckingcrew,this.auras.wreckingcrew=new WreckingCrew(this)),t.dmgshield&&this.shield&&(this.base.dmgmod*=1+t.dmgshield/100||1),t.tasteforblood&&(this.tasteforblood=t.tasteforblood),t.freshmeat&&(this.freshmeat=t.freshmeat,this.auras.freshmeat=new FreshMeat(this)),t.suddendeath&&(this.suddendeath=t.suddendeath,this.auras.suddendeath=new SuddenDeath(this)),t.singleminded&&(this.auras.singleminded=new SingleMinded(this)))}addSets(){for(let set of sets){let counter=0;for(let s of set.items)this.items.includes(s)&&counter++;if(0!=counter)for(let bonus of set.bonus)if(counter>=bonus.count){for(let s in bonus.stats)if("object"==typeof bonus.stats[s])for(let t in bonus.stats[s])this.base[s][t]+=bonus.stats[s][t]||0;else this.base[s]+=bonus.stats[s]||0;if(bonus.stats.procchance){let proc={};proc.chance=100*bonus.stats.procchance,bonus.stats.magicdmg&&(proc.magicdmg=bonus.stats.magicdmg),bonus.stats.procspell&&(this.auras[bonus.stats.procspell.toLowerCase()]=eval("new "+bonus.stats.procspell+"(this)"),proc.spell=this.auras[bonus.stats.procspell.toLowerCase()]),this.attackproc2&&console.log("Warning! overlapping attack procs!"),this.attackproc1?this.attackproc2=proc:this.attackproc1=proc}bonus.stats.enhancedbs&&(this.enhancedbs=!0),bonus.stats.wailingextra&&(this.wailingextra=bonus.stats.wailingextra),bonus.stats.hakkariextra&&(this.hakkariextra=bonus.stats.hakkariextra),bonus.stats.switchrage&&(this.switchrage=bonus.stats.switchrage),bonus.stats.switchdelay&&(this.switchdelay=bonus.stats.switchdelay,this.auras.echoesbattle=new EchoesBattle(this),this.auras.echoeszerk=new EchoesZerk(this),this.auras.echoesglad=new EchoesGlad(this),this.auras.echoesdef=new EchoesDef(this)),bonus.stats.switchbonus&&(this.auras.battleforecast=new BattleForecast(this),this.auras.zerkforecast=new ZerkForecast(this),this.auras.defforecast=new DefForecast(this),this.auras.gladforecast=new GladForecast(this)),bonus.stats.overpowerrend&&(this.overpowerrend=bonus.stats.overpowerrend),bonus.stats.heroicbonus&&(this.heroicbonus=bonus.stats.heroicbonus),bonus.stats.slammainreset&&(this.slammainreset=bonus.stats.slammainreset),bonus.stats.shieldslamcd&&(this.shieldslamcd=bonus.stats.shieldslamcd),bonus.stats.gladbloodrage&&(this.gladbloodrage=bonus.stats.gladbloodrage),bonus.stats.whirlwindcost&&(this.whirlwindcost=bonus.stats.whirlwindcost),bonus.stats.deathwishcd&&(this.deathwishcd=bonus.stats.deathwishcd),bonus.stats.bleedbonus&&(this.bleedbonus=bonus.stats.bleedbonus),bonus.stats.shockwavecd&&(this.shockwavecd=bonus.stats.shockwavecd)}}}addBuffs(){this.target.basearmorbuffed=this.target.basearmor;for(let s of buffs)s.active&&s.improvedexposed&&(this.improvedexposed=!0),s.active&&"Expose Armor"==s.name&&(this.exposed=!0),s.active&&"Homunculi"==s.name&&(this.homunculi=!0);for(let s of buffs)if(s.active){let t=0,e=0,a=0;if("Blessing of Might"==s.name){let e=buffs.filter(s=>s.mightmod&&s.active)[0];t=~~(s.ap*(e?e.mightmod:1))}if("Mark of the Wild"==s.name){let t=buffs.filter(s=>s.motwmod&&s.active)[0];e=~~(s.str*(t?t.motwmod:1)),a=~~(s.agi*(t?t.motwmod:1))}if("vaelbuff"==s.group&&(this.vaelbuff=!0),"dragonbreath"==s.group&&(this.dragonbreath=!0),s.bleedmod&&(this.bleedmod*=s.bleedmod),s.armor&&(this.target.basearmorbuffed-=s.armor+("Expose Armor"!=s.name&&"Sebacious Poison"!=s.name||!this.improvedexposed?0:.5*s.armor)),s.armorperlevel&&(this.target.basearmorbuffed-=s.armorperlevel*this.level),"Faerie Fire"==s.name&&(this.faeriefire=!0),s.dmgshield&&this.shield&&(this.base.dmgmod*=1+s.dmgshield/100||1),s.voodoofrenzy&&(this.auras.voodoofrenzy=new VoodooFrenzy(this)),s.stance){this.basestance=s.stance,"glad"==s.stance&&this.gladdmg&&this.shield&&(this.base.dmgmod*=1+this.gladdmg/100);continue}if("trueshot"==s.group&&"sod"==this.mode&&(s.ap=s.apsod),s.dodge&&(this.target.dodge+=s.dodge),this.base.ap+=t||s.ap||0,this.base.agi+=a||s.agi||0,this.base.str+=e||s.str||0,this.base.crit+=s.crit||0,this.base.hit+=s.hit||0,this.base.spellcrit+=s.spellcrit||0,this.base.agimod*=1+s.agimod/100||1,this.base.strmod*=1+s.strmod/100||1,this.base.dmgmod*=1+s.dmgmod/100||1,this.base.spelldmgmod*=1+s.spelldmgmod/100||1,this.base.haste*=1+s.haste/100||1,this.base.moddmgdone+=s.moddmgdone||0,this.base.moddmgtaken+=s.moddmgtaken||0,this.base.defense+=s.defense||0,this.base.skill_0+="Human"==this.race?0:s.skill_0||0,this.base.skill_1+="Human"==this.race?0:s.skill_1||0,this.base.skill_2+=s.skill_2||0,this.base.skill_3+="Orc"==this.race?0:s.skill_3||0,this.base.skill_4+=s.skill_4||0,this.base.skill_5+=s.skill_5||0,this.base.skill_6+=s.skill_6||0,this.base.skill_7+=s.skill_7||0,s.resist){let t="Mark of the Wild"==s.name&&buffs.filter(s=>s.motwmod&&s.active)[0];if("Mark of the Wild"==s.name&&buffs.filter(s=>s.mrp&&s.active)[0])continue;if(("Mark of the Wild"==s.name||s.mrp)&&buffs.filter(s=>s.fra&&s.active)[0])continue;this.base.resist.fire+=~~(s.resist.fire*(t?t.motwmod:1)||0),this.base.resist.frost+=~~(s.resist.frost*(t?t.motwmod:1)||0),this.base.resist.nature+=~~(s.resist.nature*(t?t.motwmod:1)||0),this.base.resist.shadow+=~~(s.resist.shadow*(t?t.motwmod:1)||0)}}this.target.basearmorbuffed=Math.max(this.target.basearmorbuffed,0),"undefined"!=typeof $&&$("#currentarmor").text(this.target.basearmorbuffed),this.items.includes(234034)||this.items.includes(234202)||(this.timeworn=0),this.items.includes(234035)||(this.dodgetimeworn=0)}addSpells(testItem){this.preporder=[];for(let spell of spells)if(spell.item&&this.items.includes(spell.id)&&spell.id==testItem&&spell.id==testItem&&!spell.timetoendactive&&!spell.timetostartactive&&(219223==spell.id?spell.active=!0:spell.timetoendactive=!0),spell.active||spell.item&&this.items.includes(spell.id)&&(spell.timetoendactive||spell.timetostartactive)){if(!spell.aura&&this.mh.type==WEAPONTYPE.FISHINGPOLE)continue;if(spell.item&&!this.items.includes(spell.id))continue;spell.aura?this.auras[spell.classname.toLowerCase()]=eval(`new ${spell.classname}(this, ${spell.id})`):this.spells[spell.classname.toLowerCase()]=eval(`new ${spell.classname}(this, ${spell.id})`),this.preporder.push(spell)}this.preporder.sort((s,t)=>s.timetoend-t.timetoend)}sortSpells(){this.normalspells=[],this.executespells=[];for(let s=10;s>0;s--){for(let t in this.spells)this.spells[t].priority==s&&this.normalspells.push(this.spells[t]),this.spells[t].expriority==s&&this.executespells.push(this.spells[t]);for(let t in this.auras)this.auras[t].priority==s&&this.normalspells.push(this.auras[t]),this.auras[t].expriority==s&&this.executespells.push(this.auras[t])}this.normalspells_c=this.normalspells.length,this.executespells_c=this.executespells.length}setSkills(){this.base.skill_0+=this.mh.twohand?this.base.skill_20:this.base.skill_10,this.base.skill_1+=this.mh.twohand?this.base.skill_21:this.base.skill_11,this.base.skill_3+=this.mh.twohand?this.base.skill_23:this.base.skill_13}reset(s){this.rage=s,this.timer=0,this.itemtimer=0,this.stancetimer=0,this.ragetimer=0,this.dodgetimer=0,this.crittimer=0,this.critdmgbonus=0,this.mainspelldmg=1,this.spelldelay=0,this.heroicdelay=0,this.mh.timer=0,this.oh&&(this.oh.timer=Math.round(1e3*this.oh.speed/this.stats.haste/2)),this.extraattacks=0,this.batchedextras=0,this.nextswinghs=!1,this.nextswingcl=!1,this.freeslam=!1;for(let s in this.spells)this.spells[s].timer=0,this.spells[s].stacks=0;for(let s in this.auras)this.auras[s].timer=0,this.auras[s].firstuse=!0,this.auras[s].stacks=0,this.auras[s].ticksleft&&(this.auras[s].ticksleft=0),this.auras[s].saveddmg&&(this.auras[s].saveddmg=0),this.auras[s].nexttick&&(this.auras[s].nexttick=0),this.auras[s].cooldowntimer&&(this.auras[s].cooldowntimer=0),this.auras[s].tfbstep&&(this.auras[s].tfbstep=-6e3);this.trinketproc1&&this.trinketproc1.usestep&&(this.trinketproc1.usestep=0),this.trinketproc2&&this.trinketproc2.usestep&&(this.trinketproc2.usestep=0),this.auras.deepwounds&&(this.auras.deepwounds.idmg=0),this.auras.deepwounds2&&(this.auras.deepwounds2.idmg=0),this.auras.deepwounds3&&(this.auras.deepwounds3.idmg=0),this.auras.deepwounds4&&(this.auras.deepwounds4.idmg=0),this.auras.rend&&(this.auras.rend.idmg=0),this.auras.weaponbleedmh&&(this.auras.weaponbleedmh.idmg=0),this.auras.weaponbleedoh&&(this.auras.weaponbleedoh.idmg=0),this.spells.fireball&&(this.spells.fireball.idmg=0),this.spells.gunaxe&&(this.spells.gunaxe.idmg=0),this.spells.themoltencore&&(this.spells.themoltencore.idmg=0),this.initStances(),this.update()}update(){this.updateAuras(),this.updateArmorReduction(),this.mh.glanceChance=this.getGlanceChance(this.mh),this.mh.miss=this.getMissChance(this.mh),this.mh.dwmiss=this.mh.miss,this.mh.dodge=this.getDodgeChance(this.mh),this.oh&&(this.mh.dwmiss=this.getDWMissChance(this.mh),this.oh.glanceChance=this.getGlanceChance(this.oh),this.oh.miss=this.getMissChance(this.oh),this.oh.dwmiss=this.getDWMissChance(this.oh),this.oh.dodge=this.getDodgeChance(this.oh))}updateAuras(){for(let s in this.base)this.stats[s]=this.base[s];for(let s in this.auras)if(this.auras[s].timer){for(let t in this.auras[s].stats)this.stats[t]+=this.auras[s].stats[t];for(let t in this.auras[s].mult_stats)this.stats[t]*=1+this.auras[s].mult_stats[t]/100}this.stats.str=~~(this.stats.str*this.stats.strmod),this.stats.agi=~~(this.stats.agi*this.stats.agimod),this.stats.ap+=2*this.stats.str,this.stats.crit+=this.stats.agi*this.agipercrit,this.crit=this.getCritChance(),this.stats.block=this.stats.block+~~(this.stats.str/20),1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}getAgiPerCrit(s){return[.25,.2381,.2381,.2273,.2174,.2083,.2083,.2,.1923,.1923,.1852,.1786,.1667,.1613,.1563,.1515,.1471,.1389,.1351,.1282,.1282,.125,.119,.1163,.1111,.1087,.1064,.102,.1,.0962,.0943,.0926,.0893,.0877,.0847,.0833,.082,.0794,.0781,.0758,.0735,.0725,.0704,.0694,.0676,.0667,.0649,.0633,.0625,.061,.0595,.0588,.0575,.0562,.0549,.0543,.0532,.0521,.051,.05][parseInt(s)-1]}getTargetSpellMiss(){let s=100,t=this.target.level-this.level;return-2==t&&(s=200),-1==t&&(s=300),0==t&&(s=400),1==t&&(s=500),2==t&&(s=600),3==t&&(s=1700),4==t&&(s=2800),t>4&&(s=2800+1100*(t-4)),s}getTargetSpellMitigation(){return 1-this.target.resistance/(100*this.level)*15}getTargetSpellBinaryResist(){return parseInt(1e4-(1e4-this.target.misschance)*(1-.15*this.target.resistance/(100*this.level)))}updateStrength(){this.stats.str=this.base.str,this.stats.ap=this.base.ap,this.stats.apmod=this.base.apmod,this.stats.baseapmod=this.base.baseapmod;for(let s in this.auras)this.auras[s].timer&&(this.auras[s].stats.str&&(this.stats.str+=this.auras[s].stats.str),this.auras[s].stats.ap&&(this.stats.ap+=this.auras[s].stats.ap),this.auras[s].mult_stats.apmod&&(this.stats.apmod*=1+this.auras[s].mult_stats.apmod/100),this.auras[s].mult_stats.baseapmod&&(this.stats.baseapmod*=1+this.auras[s].mult_stats.baseapmod/100));this.stats.str=~~(this.stats.str*this.stats.strmod),this.stats.ap+=2*this.stats.str,this.stats.block=this.base.block+~~(this.stats.str/20),1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}updateAP(){this.stats.ap=this.base.ap,this.stats.apmod=this.base.apmod,this.stats.baseapmod=this.base.apmod;for(let s in this.auras)this.auras[s].timer&&this.auras[s].stats.ap&&(this.stats.ap+=this.auras[s].stats.ap),this.auras[s].timer&&this.auras[s].mult_stats.apmod&&(this.stats.apmod*=1+this.auras[s].mult_stats.apmod/100),this.auras[s].timer&&this.auras[s].mult_stats.baseapmod&&(this.stats.baseapmod*=1+this.auras[s].mult_stats.baseapmod/100);this.stats.ap+=2*this.stats.str,1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}updateHaste(){this.stats.haste=this.base.haste,this.auras.flurry&&this.auras.flurry.timer&&(this.stats.haste*=1+this.auras.flurry.mult_stats.haste/100),this.auras.berserking&&this.auras.berserking.timer&&(this.stats.haste*=1+this.auras.berserking.mult_stats.haste/100),this.auras.empyrean&&this.auras.empyrean.timer&&(this.stats.haste*=1+this.auras.empyrean.mult_stats.haste/100),this.auras.eskhandar&&this.auras.eskhandar.timer&&(this.stats.haste*=1+this.auras.eskhandar.mult_stats.haste/100),this.auras.pummeler&&this.auras.pummeler.timer&&(this.stats.haste*=1+this.auras.pummeler.mult_stats.haste/100),this.auras.spider&&this.auras.spider.timer&&(this.stats.haste*=1+this.auras.spider.mult_stats.haste/100),this.auras.voidmadness&&this.auras.voidmadness.timer&&(this.stats.haste*=1+this.auras.voidmadness.mult_stats.haste/100),this.auras.jackhammer&&this.auras.jackhammer.timer&&(this.stats.haste*=1+this.auras.jackhammer.mult_stats.haste/100),this.auras.ragehammer&&this.auras.ragehammer.timer&&(this.stats.haste*=1+this.auras.ragehammer.mult_stats.haste/100),this.auras.blisteringragehammer&&this.auras.blisteringragehammer.timer&&(this.stats.haste*=1+this.auras.blisteringragehammer.mult_stats.haste/100),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.timer&&(this.stats.haste*=1+this.auras.gyromaticacceleration.mult_stats.haste/100),this.auras.gneurological&&this.auras.gneurological.timer&&(this.stats.haste*=1+this.auras.gneurological.mult_stats.haste/100),this.auras.spicy&&this.auras.spicy.timer&&(this.stats.haste*=1+this.auras.spicy.mult_stats.haste/100),this.auras.echoesdread&&this.auras.echoesdread.timer&&(this.stats.haste*=1+this.auras.echoesdread.mult_stats.haste/100),this.auras.singleminded&&this.auras.singleminded.timer&&(this.stats.haste*=1+this.auras.singleminded.mult_stats.haste/100),this.auras.magmadarsreturn&&this.auras.magmadarsreturn.timer&&(this.stats.haste*=1+this.auras.magmadarsreturn.mult_stats.haste/100),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&(this.stats.haste*=1+this.auras.jujuflurry.mult_stats.haste/100),this.auras.crusaderzeal&&this.auras.crusaderzeal.timer&&(this.stats.haste*=1+this.auras.crusaderzeal.mult_stats.haste/100),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&(this.stats.haste*=1+this.auras.obsidianhaste.mult_stats.haste/100)}updateHasteDamage(){let s=1;this.auras.spicy&&this.auras.spicy.timer&&(s*=1+this.auras.spicy.mult_stats.haste/100),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&(s*=1+this.auras.jujuflurry.mult_stats.haste/100),this.mh.mindmg=this.mh.basemindmg/s,this.mh.maxdmg=this.mh.basemaxdmg/s,this.oh&&(this.oh.mindmg=this.oh.basemindmg/s,this.oh.maxdmg=this.oh.basemaxdmg/s)}updateBonusDmg(){let s=0,t=0;this.auras.stoneslayer&&this.auras.stoneslayer.timer&&(s+=this.auras.stoneslayer.stats.moddmgdone),this.auras.zeal&&this.auras.zeal.timer&&(s+=this.auras.zeal.stats.moddmgdone),this.auras.zandalarian&&this.auras.zandalarian.timer&&(s+=this.auras.zandalarian.stats.moddmgdone),this.auras.relentlessstrength&&this.auras.relentlessstrength.timer&&(s+=this.auras.relentlessstrength.stats.moddmgdone),this.auras.blisteringragehammer&&this.auras.blisteringragehammer.timer&&(s+=this.auras.blisteringragehammer.stats.moddmgdone),this.auras.meltarmor&&this.auras.meltarmor.timer&&(t+=this.auras.meltarmor.stats.moddmgtaken),this.auras.crusaderzeal&&this.auras.crusaderzeal.timer&&(s+=this.auras.crusaderzeal.stats.moddmgdone),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&(s+=this.auras.obsidianhaste.stats.moddmgdone),this.stats.moddmgdone=this.base.moddmgdone+s,this.stats.moddmgtaken=this.base.moddmgtaken+t,this.mh.bonusdmg=this.mh.basebonusdmg,this.oh&&(this.oh.bonusdmg=this.oh.basebonusdmg)}updateArmorReduction(){this.target.armor=this.target.basearmorbuffed,this.auras.annihilator&&this.auras.annihilator.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.annihilator.stacks*this.auras.annihilator.armor,0)),this.auras.rivenspike&&this.auras.rivenspike.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.rivenspike.stacks*this.auras.rivenspike.armor,0)),this.auras.vibroblade&&this.auras.vibroblade.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.vibroblade.armor,0)),this.auras.ultrasonic&&this.auras.ultrasonic.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.ultrasonic.armor,0)),this.auras.cleavearmor&&this.auras.cleavearmor.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.cleavearmor.armor,0)),this.auras.bonereaver&&this.auras.bonereaver.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.bonereaver.stacks*this.auras.bonereaver.armor,0)),this.auras.swarmguard&&this.auras.swarmguard.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.swarmguard.stacks*this.auras.swarmguard.armor,0)),this.armorReduction=this.getArmorReduction()}updateDmgMod(){this.stats.dmgmod=this.base.dmgmod,this.stats.spelldmgmod=this.base.spelldmgmod;for(let s in this.auras)this.auras[s].timer&&this.auras[s].mult_stats.dmgmod&&(this.stats.dmgmod*=1+this.auras[s].mult_stats.dmgmod/100);this.bleedbonus&&this.auras.rend&&this.auras.rend.timer&&this.auras.deepwounds&&this.auras.deepwounds.timer&&(this.stats.dmgmod*=1.1)}getGlanceReduction(s){let t=this.target.defense-this.stats["skill_"+s.type],e=Math.max(Math.min(1.3-.05*t,.91),.01),a=Math.max(Math.min(1.2-.03*t,.99),.2);return Math.random()*(a-e)+e}getGlanceChance(s){return 10+2*Math.max(this.target.defense-Math.min(5*this.level,this.stats["skill_"+s.type]),0)}getMissChance(s){let t=this.target.defense-this.stats["skill_"+s.type],e=5+(t>10?.2*t:.1*t);return e-=t>10?this.stats.hit-1:this.stats.hit}getDWMissChance(s){let t=this.target.defense-this.stats["skill_"+s.type],e=5+(t>10?.2*t:.1*t);return e=.8*e+20,e-=t>10?this.stats.hit-1:this.stats.hit}getCritChance(){let s=this.stats.crit+(this.talents.crit||0)+1*(this.level-this.target.level);return this.target.level-this.level>=3&&(s-=1.8),Math.max(s,0)}getDodgeChance(s){return Math.max(5-this.stats.expertise-this.dodgetimeworn-this.target.dodge+.1*(this.target.defense-this.stats["skill_"+s.type]),0)}getArmorReduction(){isNaN(this.target.armor)&&(this.target.armor=0);let s=this.target.armor/(this.target.armor+400+85*this.level);return s>.75?.75:s}addRage(s,t,e,a){let i=this.rage;(!a||a instanceof HeroicStrike||a instanceof Cleave)&&t!=RESULT.MISS&&t!=RESULT.DODGE&&this.talents.umbridledwrath&&rng10k()<100*this.talents.umbridledwrath&&(this.rage+=1),a?(a instanceof Execute&&(a.result=t),t!=RESULT.MISS&&t!=RESULT.DODGE||(this.rage+=a.refund?.8*a.cost:0,i+=(a.cost||0)+(a.usedrage||0))):t==RESULT.DODGE?this.rage+=e.avgdmg()/this.rageconversion*7.5*.75:t!=RESULT.MISS&&(this.rage+=s/this.rageconversion*7.5*this.ragemod),this.extrarage&&t==RESULT.HIT&&(this.rage+=this.extrarage),this.extracritrage&&t==RESULT.CRIT&&(this.rage+=this.extracritrage),this.rage>100&&(this.rage=100),this.auras.consumedrage&&i<60&&this.rage>=60&&this.auras.consumedrage.use()}steptimer(s){return this.timer<=s?(this.timer=0,this.logging&&this.log("Global CD off"),!0):(this.timer-=s,!1)}stepitemtimer(s){return this.itemtimer<=s?(this.itemtimer=0,this.logging&&this.log("Item CD off"),!0):(this.itemtimer-=s,!1)}stepstancetimer(s){return this.stancetimer<=s?(this.stancetimer=0,this.logging&&this.log("Stance CD off"),!0):(this.stancetimer-=s,!1)}stepragetimer(s){return this.ragetimer<=s?(this.ragetimer=0,this.rage+=10,this.logging&&this.log("10 rage gained"),!0):(this.ragetimer-=s,!1)}stepdodgetimer(s){this.dodgetimer<=s?this.dodgetimer=0:this.dodgetimer-=s}stepauras(s){this.mh.proc1&&this.mh.proc1.spell&&this.mh.proc1.spell.timer&&this.mh.proc1.spell.step(),this.mh.proc2&&this.mh.proc2.spell&&this.mh.proc2.spell.timer&&this.mh.proc2.spell.step(),this.oh&&this.oh.proc1&&this.oh.proc1.spell&&this.oh.proc1.spell.timer&&this.oh.proc1.spell.step(),this.oh&&this.oh.proc2&&this.oh.proc2.spell&&this.oh.proc2.spell.timer&&this.oh.proc2.spell.step(),this.auras.mightyragepotion&&this.auras.mightyragepotion.firstuse&&this.auras.mightyragepotion.timer&&this.auras.mightyragepotion.step(),this.auras.mildlyirradiated&&this.auras.mildlyirradiated.firstuse&&this.auras.mildlyirradiated.timer&&this.auras.mildlyirradiated.step(),this.auras.recklessness&&this.auras.recklessness.firstuse&&this.auras.recklessness.timer&&this.auras.recklessness.step(),this.auras.deathwish&&this.auras.deathwish.firstuse&&this.auras.deathwish.timer&&this.auras.deathwish.step(),this.auras.cloudkeeper&&this.auras.cloudkeeper.firstuse&&this.auras.cloudkeeper.timer&&this.auras.cloudkeeper.step(),this.auras.voidmadness&&this.auras.voidmadness.firstuse&&this.auras.voidmadness.timer&&this.auras.voidmadness.step(),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.firstuse&&this.auras.gyromaticacceleration.timer&&this.auras.gyromaticacceleration.step(),this.auras.gneurological&&this.auras.gneurological.firstuse&&this.auras.gneurological.timer&&this.auras.gneurological.step(),this.auras.coinflip&&this.auras.coinflip.timer&&this.auras.coinflip.step(),this.auras.flask&&this.auras.flask.firstuse&&this.auras.flask.timer&&this.auras.flask.step(),this.auras.bloodfury&&this.auras.bloodfury.firstuse&&this.auras.bloodfury.timer&&this.auras.bloodfury.step(),this.auras.berserking&&this.auras.berserking.firstuse&&this.auras.berserking.timer&&this.auras.berserking.step(),this.auras.slayer&&this.auras.slayer.firstuse&&this.auras.slayer.timer&&this.auras.slayer.step(),this.auras.spider&&this.auras.spider.firstuse&&this.auras.spider.timer&&this.auras.spider.step(),this.auras.earthstrike&&this.auras.earthstrike.firstuse&&this.auras.earthstrike.timer&&this.auras.earthstrike.step(),this.auras.roarguardian&&this.auras.roarguardian.firstuse&&this.auras.roarguardian.timer&&this.auras.roarguardian.step(),this.auras.pummeler&&this.auras.pummeler.firstuse&&this.auras.pummeler.timer&&this.auras.pummeler.step(),this.auras.swarmguard&&this.auras.swarmguard.firstuse&&this.auras.swarmguard.timer&&this.auras.swarmguard.step(),this.auras.zandalarian&&this.auras.zandalarian.firstuse&&this.auras.zandalarian.timer&&this.auras.zandalarian.step(),this.auras.relentlessstrength&&this.auras.relentlessstrength.firstuse&&this.auras.relentlessstrength.timer&&this.auras.relentlessstrength.step(),this.auras.rampage&&this.auras.rampage.timer&&this.auras.rampage.step(),this.auras.wreckingcrew&&this.auras.wreckingcrew.timer&&this.auras.wreckingcrew.step(),this.auras.freshmeat&&this.auras.freshmeat.timer&&this.auras.freshmeat.step(),this.auras.suddendeath&&this.auras.suddendeath.timer&&this.auras.suddendeath.step(),this.auras.voodoofrenzy&&this.auras.voodoofrenzy.timer&&this.auras.voodoofrenzy.step(),this.auras.battleshout&&this.auras.battleshout.timer&&this.auras.battleshout.step(),this.auras.echoeszerk&&this.auras.echoeszerk.timer&&this.auras.echoeszerk.step(),this.auras.echoesbattle&&this.auras.echoesbattle.timer&&this.auras.echoesbattle.step(),this.auras.echoesdef&&this.auras.echoesdef.timer&&this.auras.echoesdef.step(),this.auras.echoesglad&&this.auras.echoesglad.timer&&this.auras.echoesglad.step(),this.auras.battleforecast&&this.auras.battleforecast.timer&&this.auras.battleforecast.step(),this.auras.zerkforecast&&this.auras.zerkforecast.timer&&this.auras.zerkforecast.step(),this.auras.defforecast&&this.auras.defforecast.timer&&this.auras.defforecast.step(),this.auras.gladforecast&&this.auras.gladforecast.timer&&this.auras.gladforecast.step(),this.auras.defendersresolve&&this.auras.defendersresolve.timer&&this.auras.defendersresolve.step(),this.auras.singleminded&&this.auras.singleminded.timer&&this.auras.singleminded.step(),this.auras.demontaintedblood&&this.auras.demontaintedblood.timer&&this.auras.demontaintedblood.step(),this.auras.wrathwray&&this.auras.wrathwray.timer&&this.auras.wrathwray.step(),this.auras.moonstalkerfury&&this.auras.moonstalkerfury.timer&&this.auras.moonstalkerfury.step(),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&this.auras.jujuflurry.step(),this.auras.grilekguard&&this.auras.grilekguard.timer&&this.auras.grilekguard.step(),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&this.auras.obsidianhaste.step(),this.auras.obsidianstrength&&this.auras.obsidianstrength.timer&&this.auras.obsidianstrength.step(),this.mh.windfury&&this.mh.windfury.timer&&this.mh.windfury.step(),this.trinketproc1&&this.trinketproc1.spell&&this.trinketproc1.spell.timer&&this.trinketproc1.spell.step(),this.trinketproc2&&this.trinketproc2.spell&&this.trinketproc2.spell.timer&&this.trinketproc2.spell.step(),this.attackproc1&&this.attackproc1.spell&&this.attackproc1.spell.timer&&this.attackproc1.spell.step(),this.attackproc2&&this.attackproc2.spell&&this.attackproc2.spell.timer&&this.attackproc2.spell.step(),!s&&this.auras.deepwounds&&this.auras.deepwounds.timer&&this.auras.deepwounds.step(),!s&&this.auras.rend&&this.auras.rend.timer&&this.auras.rend.step(),this.auras.berserkerrage&&this.auras.berserkerrage.timer&&this.auras.berserkerrage.step(),this.auras.consumedrage&&this.auras.consumedrage.timer&&this.auras.consumedrage.step(),this.auras.weaponbleedmh&&this.auras.weaponbleedmh.timer&&this.auras.weaponbleedmh.step(),this.auras.weaponbleedoh&&this.auras.weaponbleedoh.timer&&this.auras.weaponbleedoh.step(),!s&&this.adjacent&&(this.auras.deepwounds2&&this.auras.deepwounds2.timer&&this.auras.deepwounds2.step(),this.auras.deepwounds3&&this.auras.deepwounds3.timer&&this.auras.deepwounds3.step(),this.auras.deepwounds4&&this.auras.deepwounds4.timer&&this.auras.deepwounds4.step())}endauras(){this.mh.proc1&&this.mh.proc1.spell&&this.mh.proc1.spell.timer&&this.mh.proc1.spell.end(),this.mh.proc2&&this.mh.proc2.spell&&this.mh.proc2.spell.timer&&this.mh.proc2.spell.end(),this.oh&&this.oh.proc1&&this.oh.proc1.spell&&this.oh.proc1.spell.timer&&this.oh.proc1.spell.end(),this.oh&&this.oh.proc2&&this.oh.proc2.spell&&this.oh.proc2.spell.timer&&this.oh.proc2.spell.end(),this.auras.mightyragepotion&&this.auras.mightyragepotion.firstuse&&this.auras.mightyragepotion.timer&&this.auras.mightyragepotion.end(),this.auras.mildlyirradiated&&this.auras.mildlyirradiated.firstuse&&this.auras.mildlyirradiated.timer&&this.auras.mildlyirradiated.end(),this.auras.recklessness&&this.auras.recklessness.firstuse&&this.auras.recklessness.timer&&this.auras.recklessness.end(),this.auras.deathwish&&this.auras.deathwish.firstuse&&this.auras.deathwish.timer&&this.auras.deathwish.end(),this.auras.cloudkeeper&&this.auras.cloudkeeper.firstuse&&this.auras.cloudkeeper.timer&&this.auras.cloudkeeper.end(),this.auras.voidmadness&&this.auras.voidmadness.firstuse&&this.auras.voidmadness.timer&&this.auras.voidmadness.end(),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.firstuse&&this.auras.gyromaticacceleration.timer&&this.auras.gyromaticacceleration.end(),this.auras.gneurological&&this.auras.gneurological.firstuse&&this.auras.gneurological.timer&&this.auras.gneurological.end(),this.auras.coinflip&&this.auras.coinflip.timer&&this.auras.coinflip.end(),this.auras.flask&&this.auras.flask.firstuse&&this.auras.flask.timer&&this.auras.flask.end(),this.auras.bloodfury&&this.auras.bloodfury.firstuse&&this.auras.bloodfury.timer&&this.auras.bloodfury.end(),this.auras.berserking&&this.auras.berserking.firstuse&&this.auras.berserking.timer&&this.auras.berserking.end(),this.auras.slayer&&this.auras.slayer.firstuse&&this.auras.slayer.timer&&this.auras.slayer.end(),this.auras.spider&&this.auras.spider.firstuse&&this.auras.spider.timer&&this.auras.spider.end(),this.auras.gabbar&&this.auras.gabbar.firstuse&&this.auras.gabbar.timer&&this.auras.gabbar.end(),this.auras.earthstrike&&this.auras.earthstrike.firstuse&&this.auras.earthstrike.timer&&this.auras.earthstrike.end(),this.auras.roarguardian&&this.auras.roarguardian.firstuse&&this.auras.roarguardian.timer&&this.auras.roarguardian.end(),this.auras.pummeler&&this.auras.pummeler.firstuse&&this.auras.pummeler.timer&&this.auras.pummeler.end(),this.auras.swarmguard&&this.auras.swarmguard.firstuse&&this.auras.swarmguard.timer&&this.auras.swarmguard.end(),this.auras.zandalarian&&this.auras.zandalarian.firstuse&&this.auras.zandalarian.timer&&this.auras.zandalarian.end(),this.auras.relentlessstrength&&this.auras.relentlessstrength.firstuse&&this.auras.relentlessstrength.timer&&this.auras.relentlessstrength.end(),this.auras.rampage&&this.auras.rampage.timer&&this.auras.rampage.end(),this.auras.wreckingcrew&&this.auras.wreckingcrew.timer&&this.auras.wreckingcrew.end(),this.auras.freshmeat&&this.auras.freshmeat.timer&&this.auras.freshmeat.end(),this.auras.suddendeath&&this.auras.suddendeath.timer&&this.auras.suddendeath.end(),this.auras.voodoofrenzy&&this.auras.voodoofrenzy.timer&&this.auras.voodoofrenzy.end(),this.auras.battleshout&&this.auras.battleshout.timer&&this.auras.battleshout.end(),this.auras.echoeszerk&&this.auras.echoeszerk.timer&&this.auras.echoeszerk.end(),this.auras.echoesbattle&&this.auras.echoesbattle.timer&&this.auras.echoesbattle.end(),this.auras.echoesdef&&this.auras.echoesdef.timer&&this.auras.echoesdef.end(),this.auras.echoesglad&&this.auras.echoesglad.timer&&this.auras.echoesglad.end(),this.auras.battleforecast&&this.auras.battleforecast.timer&&this.auras.battleforecast.end(),this.auras.zerkforecast&&this.auras.zerkforecast.timer&&this.auras.zerkforecast.end(),this.auras.defforecast&&this.auras.defforecast.timer&&this.auras.defforecast.end(),this.auras.gladforecast&&this.auras.gladforecast.timer&&this.auras.gladforecast.end(),this.auras.defendersresolve&&this.auras.defendersresolve.timer&&this.auras.defendersresolve.end(),this.auras.singleminded&&this.auras.singleminded.timer&&this.auras.singleminded.end(),this.auras.moonstalkerfury&&this.auras.moonstalkerfury.timer&&this.auras.moonstalkerfury.end(),this.auras.demontaintedblood&&this.auras.demontaintedblood.timer&&this.auras.demontaintedblood.end(),this.auras.wrathwray&&this.auras.wrathwray.timer&&this.auras.wrathwray.end(),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&this.auras.jujuflurry.end(),this.auras.grilekguard&&this.auras.grilekguard.timer&&this.auras.grilekguard.end(),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&this.auras.obsidianhaste.end(),this.auras.obsidianstrength&&this.auras.obsidianstrength.timer&&this.auras.obsidianstrength.end(),this.mh.windfury&&this.mh.windfury.timer&&this.mh.windfury.end(),this.trinketproc1&&this.trinketproc1.spell&&this.trinketproc1.spell.timer&&this.trinketproc1.spell.end(),this.trinketproc2&&this.trinketproc2.spell&&this.trinketproc2.spell.timer&&this.trinketproc2.spell.end(),this.attackproc1&&this.attackproc1.spell&&this.attackproc1.spell.timer&&this.attackproc1.spell.end(),this.attackproc2&&this.attackproc2.spell&&this.attackproc2.spell.timer&&this.attackproc2.spell.end(),this.auras.flurry&&this.auras.flurry.timer&&this.auras.flurry.end(),this.auras.deepwounds&&this.auras.deepwounds.timer&&this.auras.deepwounds.end(),this.auras.deepwounds2&&this.auras.deepwounds2.timer&&this.auras.deepwounds2.end(),this.auras.deepwounds3&&this.auras.deepwounds3.timer&&this.auras.deepwounds3.end(),this.auras.deepwounds4&&this.auras.deepwounds4.timer&&this.auras.deepwounds4.end(),this.auras.rend&&this.auras.rend.timer&&this.auras.rend.end(),this.auras.berserkerrage&&this.auras.berserkerrage.timer&&this.auras.berserkerrage.end(),this.auras.consumedrage&&this.auras.consumedrage.timer&&this.auras.consumedrage.end(),this.auras.weaponbleedmh&&this.auras.weaponbleedmh.timer&&this.auras.weaponbleedmh.end(),this.auras.weaponbleedoh&&this.auras.weaponbleedoh.timer&&this.auras.weaponbleedoh.end()}rollweapon(s){let t=0,e=rng10k();return e<(t+=100*Math.max(this.nextswinghs?s.miss:s.dwmiss,0))?RESULT.MISS:e<(t+=100*s.dodge)?RESULT.DODGE:e<(t+=100*s.glanceChance)?RESULT.GLANCE:e<(t+=100*(this.crit+s.crit))?RESULT.CRIT:RESULT.HIT}rollmeleespell(s,t){t||(t=this.mh);let e=0,a=rng10k();if(a<(e+=100*Math.max(t.miss,0)))return RESULT.MISS;if(s.canDodge&&a<(e+=100*t.dodge))return RESULT.DODGE;s.weaponspell||(a=rng10k(),e=0);let i=this.crit+t.crit;return s instanceof Overpower&&(i+=this.talents.overpowercrit),a<(e+=100*i)&&!s.nocrit?RESULT.CRIT:RESULT.HIT}rollmagicspell(s){let t=this.target.misschance;return s.binaryspell&&(t=this.target.binaryresist),rng10k()0&&t.proc1.phantom&&(s+=this.phantomproc(t)),r+=s}this.logging&&this.log(`${t.name} proc ${r?"for "+~~r:""}`)}t.proc1&&t.proc1.extra&&!i&&rng10k()this.trinketproc1.usestep)&&(this.trinketproc1.cooldown&&(this.trinketproc1.usestep=step+this.trinketproc1.cooldown),s?this.batchedextras+=this.trinketproc1.extra:o=this.trinketproc1.extra,this.logging&&this.log("Trinket 1 proc")),this.trinketproc2&&!this.trinketproc2.extra&&rng10k()this.trinketproc2.usestep)&&(this.trinketproc2.cooldown&&(this.trinketproc2.usestep=step+this.trinketproc2.cooldown),s?this.batchedextras+=this.trinketproc2.extra:o=this.trinketproc2.extra,this.logging&&this.log("Trinket 2 proc")),this.attackproc1&&rng10k()0&&(t+=this.phantomproc(s)),s.proc2&&rng10k()1||s.indexOf("Global")>-1?t="Gray":s.indexOf("tick")>1?t="Tomato":s.indexOf(" for ")>-1?t="DarkOrchid":(s.indexOf("applied")>1||s.indexOf("removed")>-1)&&(t="#17A8B6"),console.log(`%c ${(step/1e3).toFixed(3).padStart(6," ")} | ${this.rage.toFixed(2).padStart(6," ")} | ${s}`,`color: ${t}`)}switch(s){let t=this.stance;this.stance=s,this.auras.battlestance.timer=0,this.auras.berserkerstance.timer=0,this.auras.defensivestance.timer=0,this.auras.gladiatorstance.timer=0,"battle"==s&&(this.auras.battlestance.timer=1),"zerk"==s&&(this.auras.berserkerstance.timer=1),"def"==s&&(this.auras.defensivestance.timer=1),"glad"==s&&(this.auras.gladiatorstance.timer=1),this.rage=Math.min(this.rage,this.talents.rageretained),this.auras["echoes"+t]&&this.auras["echoes"+t].use(),this.auras[this.stance+"forecast"]&&this.auras[this.stance+"forecast"].use(),this.ragemod=(this.base.ragemod||1)*("glad"!=this.stance||this.target.speed?1:1.5),this.switchrage&&(this.ragetimer=10),this.stancetimer=1e3,this.updateAuras(),this.logging&&this.log(`Switched to ${s} stance`)}isValidStance(s,t){return this.stance==s||"glad"==this.stance&&this.shield||"zerk"==s&&this.auras.echoeszerk&&this.auras.echoeszerk.timer||"battle"==s&&this.auras.echoesbattle&&this.auras.echoesbattle.timer||"def"==s&&this.auras.echoesdef&&this.auras.echoesdef.timer||this.auras.echoesglad&&this.auras.echoesglad.timer||t&&"zerk"==this.stance&&this.bloodfrenzy}isEnraged(){return this.auras.wreckingcrew&&this.auras.wreckingcrew.timer||this.auras.consumedrage&&this.auras.consumedrage.timer||this.auras.freshmeat&&this.auras.freshmeat.timer||this.auras.bloodrage&&this.auras.bloodrage.timer||this.auras.berserkerrage&&this.auras.berserkerrage.timer}} \ No newline at end of file +class Player{static getConfig(s){return{level:$('input[name="level"]').val(),race:$('select[name="race"]').val(),aqbooks:"Yes"==$('select[name="aqbooks"]').val(),reactionmin:parseInt($('input[name="reactionmin"]').val()),reactionmax:parseInt($('input[name="reactionmax"]').val()),adjacent:parseInt($('input[name="adjacent"]').val()),mode:globalThis.mode,spellqueueing:"Yes"==$('select[name="spellqueueing"]').val(),target:{level:parseInt($('input[name="targetlevel"]').val()),basearmor:parseInt($('select[name="targetbasearmor"]').val()||$('input[name="targetcustomarmor"]').val()),defense:5*parseInt($('input[name="targetlevel"]').val()),resistance:parseInt($('input[name="targetresistance"]').val()),speed:1e3*parseFloat($('input[name="targetspeed"]').val()),mindmg:parseInt($('input[name="targetmindmg"]').val()),maxdmg:parseInt($('input[name="targetmaxdmg"]').val()),bleedreduction:$('select[name="bleedreduction"]').val()}}}constructor(s,t,e,a){if(a||(a=Player.getConfig()),this.rage=0,this.ragemod=1,this.level=a.level,this.rageconversion=.0091107836*this.level*this.level+3.225598133*this.level+4.2652911,25==this.level&&(this.rageconversion=82.25),40==this.level&&(this.rageconversion=140.5),this.agipercrit=this.getAgiPerCrit(this.level),this.timer=0,this.itemtimer=0,this.stancetimer=0,this.ragetimer=0,this.dodgetimer=0,this.crittimer=0,this.critdmgbonus=0,this.mainspelldmg=1,this.extraattacks=0,this.batchedextras=0,this.nextswinghs=!1,this.nextswingcl=!1,this.freeslam=!1,this.ragecostbonus=0,this.logging=a.logging,this.race=a.race,this.aqbooks=a.aqbooks,this.reactionmin=a.reactionmin,this.reactionmax=a.reactionmax,this.adjacent=a.adjacent,this.spelldamage=0,this.target=a.target,this.mode=a.mode,this.bleedmod=parseFloat(this.target.bleedreduction),this.spellqueueing=a.spellqueueing,this.target.misschance=this.getTargetSpellMiss(),this.target.mitigation=this.getTargetSpellMitigation(),this.target.binaryresist=this.getTargetSpellBinaryResist(),this.target.dodge=0,this.timeworn=0,this.dodgetimeworn=0,this.base={ap:0,agi:0,str:0,hit:0,crit:0,spellcrit:0,skill_0:5*this.level,skill_1:5*this.level,skill_2:5*this.level,skill_3:5*this.level,skill_4:5*this.level,skill_5:5*this.level,skill_6:5*this.level,skill_7:this.level<35?225:300,skill_10:0,skill_11:0,skill_13:0,skill_20:0,skill_21:0,skill_23:0,haste:1,expertise:0,strmod:1,agimod:1,dmgmod:1,spelldmgmod:1,moddmgdone:0,moddmgtaken:0,apmod:1,baseapmod:1,resist:{shadow:0,arcane:0,nature:0,fire:0,frost:0},block:0,defense:0},1==e?(this.testEnch=s,this.testEnchType=t):2==e?(this.testTempEnch=s,this.testTempEnchType=t):3==e?0==t?this.base.ap+=s:1==t?this.base.crit+=s:2==t?this.base.hit+=s:3==t?this.base.str+=s:4==t&&(this.base.agi+=s):(this.testItem=s,this.testItemType=t),this.stats={},this.auras={},this.spells={},this.items=[],this.addRace(),this.addTalents(),this.addGear(),this.mh){if(this.addSets(),this.addEnchants(),this.addTempEnchants(),this.preAddRunes(),this.addBuffs(),this.addSpells(s),this.sortSpells(),this.addRunes(),this.setSkills(),this.talents.flurry&&(this.auras.flurry=new Flurry(this)),this.talents.deepwounds&&(this.auras.deepwounds="sod"==this.mode?new DeepWounds(this):new OldDeepWounds(this)),this.adjacent&&this.talents.deepwounds)for(let s=2;s<=this.adjacent+1;s++)this.auras["deepwounds"+s]="sod"==this.mode?new DeepWounds(this,null,s):new OldDeepWounds(this,null,s);this.spells.stanceswitch=new StanceSwitch(this),this.spells.bloodrage&&(this.auras.bloodrage=new BloodrageAura(this)),this.spells.berserkerrage&&(this.auras.berserkerrage=new BerserkerRageAura(this)),this.spells.shieldslam&&(this.auras.defendersresolve=new DefendersResolve(this)),("def"==this.basestance||"glad"==this.basestance)&&this.spells.sunderarmor&&this.devastate&&this.shield&&(this.spells.sunderarmor.devastate=!0,this.spells.sunderarmor.nocrit=!1),this.items.includes(233490)&&(this.auras.obsidianstrength=new ObsidianStrength(this),this.auras.obsidianhaste=new ObsidianHaste(this)),this.update(),this.oh&&(this.oh.timer=Math.round(1e3*this.oh.speed/this.stats.haste/2))}}initStances(){this.stance=this.basestance,this.auras.battlestance=new BattleStance(this),this.auras.berserkerstance=new BerserkerStance(this),this.auras.defensivestance=new DefensiveStance(this),this.auras.gladiatorstance=new GladiatorStance(this),"battle"==this.basestance&&(this.auras.battlestance.timer=1),"zerk"==this.basestance&&(this.auras.berserkerstance.timer=1),"def"==this.basestance&&(this.auras.defensivestance.timer=1),"glad"==this.basestance&&(this.auras.gladiatorstance.timer=1),this.spells.unstoppablemight&&this.spells.unstoppablemight.switchstart&&this.switch(this.spells.unstoppablemight.secondarystance)}addRace(){for(let s of levelstats){let t;"Human"==this.race&&(t="1"),"Orc"==this.race&&(t="2"),"Dwarf"==this.race&&(t="3"),"Night Elf"==this.race&&(t="4"),"Undead"==this.race&&(t="5"),"Tauren"==this.race&&(t="6"),"Gnome"==this.race&&(t="7"),"Troll"==this.race&&(t="8");let e=s.split(",");e[0]==t&&e[2]==this.level&&(this.base.aprace=3*this.level-20,this.base.ap+=3*this.level-20,this.base.str+=parseInt(e[3]),this.base.agi+=parseInt(e[4]),this.base.skill_0+="1"==t?5:0,this.base.skill_1+="1"==t?5:0,this.base.skill_2+=0,this.base.skill_3+="2"==t?5:0)}}addTalents(){this.talents={};for(let s in talents)for(let t of talents[s].t)this.talents=Object.assign(this.talents,t.aura(t.c));this.talents.defense&&(this.base.defense+=this.talents.defense)}addGear(){for(let type in gear)for(let item of gear[type])if(this.testItemType==type&&this.testItem==item.id||this.testItemType!=type&&item.selected){for(let s in this.base)if("haste"==s)this.base.haste*=1+item.haste/100||1;else if("object"==typeof item[s])for(let t in item[s])this.base[s][t]+=item[s][t]||0;else item[s]&&(this.base[s]+=item[s]||0);if(item.skill&&item.skill>0){let s=WEAPONTYPE[item.type.replace(" ","").toUpperCase()];this.base["skill_"+s]+=item.skill}if(item.skills&&Object.keys(item.skills).forEach(s=>{this.base["skill_"+s]+=item.skills[s]}),item.d&&(this.base.defense+=item.d),"mainhand"!=type&&"offhand"!=type&&"twohand"!=type||this.addWeapon(item,type),item.proc&&item.proc.chance&&("trinket1"==type||"trinket2"==type)){let proc={};proc.chance=100*item.proc.chance,proc.extra=item.proc.extra,proc.magicdmg=item.proc.dmg,proc.cooldown=item.proc.cooldown,item.spell&&(this.auras[item.proc.spell.toLowerCase()]=eval("new "+item.proc.spell+"(this)"),proc.spell=this.auras[item.proc.spell.toLowerCase()]),this["trinketproc"+(this.trinketproc1?2:1)]=proc}else if(item.proc&&item.proc.chance){let proc={};proc.chance=100*item.proc.chance,item.proc.dmg&&(proc.magicdmg=item.proc.dmg),item.proc.spell&&(this.auras[item.proc.spell.toLowerCase()]=eval("new "+item.proc.spell+"(this)"),proc.spell=this.auras[item.proc.spell.toLowerCase()]),this.attackproc2&&console.log("Warning! overlapping attack procs!"),this.attackproc1?this.attackproc2=proc:this.attackproc1=proc}21189==item.id&&(this.base.moddmgdone+=4),19968==item.id&&(this.base.moddmgdone+=2),215166==item.id&&(this.base.moddmgdone+=3),228089==item.id&&(this.base.moddmgdone+=4),227809==item.id&&(this.base.moddmgdone+=3),230003!=item.id&&23000399!=item.id||(this.base.moddmgdone+=4),233638==item.id&&(this.base.moddmgdone+=3),234761==item.id&&(this.base.moddmgdone+=4),234084==item.id&&(this.base.moddmgdone+=3),234065==item.id&&(this.base.moddmgdone+=2),234147==item.id&&(this.base.moddmgdone+=4),228122==item.id&&(this.spells.themoltencore=new TheMoltenCore(this)),item.tw&&(this.timeworn++,this.dodgetimeworn++),this.items.push(item.id)}}addWeapon(s,t){let e,a;for(let s of enchant[t])s.temp||(this.testEnchType==t&&this.testEnch==s.id?e=s:this.testEnchType!=t&&s.selected&&(e=s));for(let s of enchant[t])s.temp&&(this.testTempEnchType==t&&this.testTempEnch==s.id?a=s:this.testTempEnchType!=t&&s.selected&&(a=s));"mainhand"==t&&(this.mh=new Weapon(this,s,e,a,!1,!1)),"offhand"==t&&"Shield"!=s.type&&(this.oh=new Weapon(this,s,e,a,!0,!1)),"offhand"==t&&"Shield"==s.type&&(this.shield=s),"twohand"==t&&(this.mh=new Weapon(this,s,e,a,!1,!0))}addEnchants(){for(let s in enchant)for(let t of enchant[s])if(!t.temp&&(this.testEnchType==s&&this.testEnch==t.id||this.testEnchType!=s&&t.selected))for(let s in this.base)if("haste"==s)this.base.haste*=1+t.haste/100||1;else if("object"==typeof t[s])for(let e in t[s])this.base[s][e]+=t[s][e]||0;else t[s]&&(this.base[s]+=t[s]||0)}addTempEnchants(){for(let s in enchant)for(let t of enchant[s])if(t.temp&&("mainhand"!=s&&"twohand"!=s||!this.mh.windfury)&&(this.testTempEnchType==s&&this.testTempEnch==t.id||this.testTempEnchType!=s&&t.selected))for(let s in this.base)if("haste"==s)this.base.haste*=1+t.haste/100||1;else if("object"==typeof t[s])for(let e in t[s])this.base[s][e]+=t[s][e]||0;else t[s]&&(this.base[s]+=t[s]||0)}preAddRunes(){if("undefined"!=typeof runes)for(let s in runes)for(let t of runes[s])t.selected&&(t.focusedrage&&(this.ragecostbonus=3),t.precisetiming&&(this.precisetiming=t.precisetiming))}addRunes(){if("undefined"!=typeof runes)for(let s in runes)for(let t of runes[s])t.selected&&(t.bloodfrenzy&&(this.bloodfrenzy=t.bloodfrenzy),t.ragemod&&(this.base.ragemod=(this.base.ragemod||1)*t.ragemod),t.haste2h&&this.mh.twohand&&(this.base.haste*=1+t.haste2h/100||1,this.extrarage=2,this.extracritrage=4),t.furiousthunder&&(this.furiousthunder=t.furiousthunder),t.dmgdw&&this.oh&&(this.base.dmgmod*=1+t.dmgdw/100||1),t.devastate&&(this.devastate=t.devastate),t.bloodsurge&&(this.bloodsurge=t.bloodsurge),t.swordboard&&(this.swordboard=t.swordboard),t.wreckingcrew&&(this.wreckingcrew=t.wreckingcrew,this.auras.wreckingcrew=new WreckingCrew(this)),t.dmgshield&&this.shield&&(this.base.dmgmod*=1+t.dmgshield/100||1),t.tasteforblood&&(this.tasteforblood=t.tasteforblood),t.freshmeat&&(this.freshmeat=t.freshmeat,this.auras.freshmeat=new FreshMeat(this)),t.suddendeath&&(this.suddendeath=t.suddendeath,this.auras.suddendeath=new SuddenDeath(this)),t.singleminded&&(this.auras.singleminded=new SingleMinded(this)))}addSets(){for(let set of sets){let counter=0;for(let s of set.items)this.items.includes(s)&&counter++;if(0!=counter)for(let bonus of set.bonus)if(counter>=bonus.count){for(let s in bonus.stats)if("object"==typeof bonus.stats[s])for(let t in bonus.stats[s])this.base[s][t]+=bonus.stats[s][t]||0;else this.base[s]+=bonus.stats[s]||0;if(bonus.stats.procchance){let proc={};proc.chance=100*bonus.stats.procchance,bonus.stats.magicdmg&&(proc.magicdmg=bonus.stats.magicdmg),bonus.stats.procspell&&(this.auras[bonus.stats.procspell.toLowerCase()]=eval("new "+bonus.stats.procspell+"(this)"),proc.spell=this.auras[bonus.stats.procspell.toLowerCase()]),this.attackproc2&&console.log("Warning! overlapping attack procs!"),this.attackproc1?this.attackproc2=proc:this.attackproc1=proc}bonus.stats.enhancedbs&&(this.enhancedbs=!0),bonus.stats.wailingextra&&(this.wailingextra=bonus.stats.wailingextra),bonus.stats.hakkariextra&&(this.hakkariextra=bonus.stats.hakkariextra),bonus.stats.switchrage&&(this.switchrage=bonus.stats.switchrage),bonus.stats.switchdelay&&(this.switchdelay=bonus.stats.switchdelay,this.auras.echoesbattle=new EchoesBattle(this),this.auras.echoeszerk=new EchoesZerk(this),this.auras.echoesglad=new EchoesGlad(this),this.auras.echoesdef=new EchoesDef(this)),bonus.stats.switchbonus&&(this.auras.battleforecast=new BattleForecast(this),this.auras.zerkforecast=new ZerkForecast(this),this.auras.defforecast=new DefForecast(this),this.auras.gladforecast=new GladForecast(this)),bonus.stats.overpowerrend&&(this.overpowerrend=bonus.stats.overpowerrend),bonus.stats.heroicbonus&&(this.heroicbonus=bonus.stats.heroicbonus),bonus.stats.slammainreset&&(this.slammainreset=bonus.stats.slammainreset),bonus.stats.shieldslamcd&&(this.shieldslamcd=bonus.stats.shieldslamcd),bonus.stats.gladbloodrage&&(this.gladbloodrage=bonus.stats.gladbloodrage),bonus.stats.whirlwindcost&&(this.whirlwindcost=bonus.stats.whirlwindcost),bonus.stats.deathwishcd&&(this.deathwishcd=bonus.stats.deathwishcd),bonus.stats.bleedbonus&&(this.bleedbonus=bonus.stats.bleedbonus),bonus.stats.shockwavecd&&(this.shockwavecd=bonus.stats.shockwavecd)}}}addBuffs(){this.target.basearmorbuffed=this.target.basearmor;for(let s of buffs)s.active&&s.improvedexposed&&(this.improvedexposed=!0),s.active&&"Expose Armor"==s.name&&(this.exposed=!0),s.active&&"Homunculi"==s.name&&(this.homunculi=!0);for(let s of buffs)if(s.active){let t=0,e=0,a=0;if("Blessing of Might"==s.name){let e=buffs.filter(s=>s.mightmod&&s.active)[0];t=~~(s.ap*(e?e.mightmod:1))}if("Mark of the Wild"==s.name){let t=buffs.filter(s=>s.motwmod&&s.active)[0];e=~~(s.str*(t?t.motwmod:1)),a=~~(s.agi*(t?t.motwmod:1))}if("vaelbuff"==s.group&&(this.vaelbuff=!0),"dragonbreath"==s.group&&(this.dragonbreath=!0),s.bleedmod&&(this.bleedmod*=s.bleedmod),s.armor&&(this.target.basearmorbuffed-=s.armor+("Expose Armor"!=s.name&&"Sebacious Poison"!=s.name||!this.improvedexposed?0:.5*s.armor)),s.armorperlevel&&(this.target.basearmorbuffed-=s.armorperlevel*this.level),"Faerie Fire"==s.name&&(this.faeriefire=!0),s.dmgshield&&this.shield&&(this.base.dmgmod*=1+s.dmgshield/100||1),s.voodoofrenzy&&(this.auras.voodoofrenzy=new VoodooFrenzy(this)),s.stance){this.basestance=s.stance,"glad"==s.stance&&this.gladdmg&&this.shield&&(this.base.dmgmod*=1+this.gladdmg/100);continue}if("trueshot"==s.group&&"sod"==this.mode&&(s.ap=s.apsod),s.dodge&&(this.target.dodge+=s.dodge),this.base.ap+=t||s.ap||0,this.base.agi+=a||s.agi||0,this.base.str+=e||s.str||0,this.base.crit+=s.crit||0,this.base.hit+=s.hit||0,this.base.spellcrit+=s.spellcrit||0,this.base.agimod*=1+s.agimod/100||1,this.base.strmod*=1+s.strmod/100||1,this.base.dmgmod*=1+s.dmgmod/100||1,this.base.spelldmgmod*=1+s.spelldmgmod/100||1,this.base.haste*=1+s.haste/100||1,this.base.moddmgdone+=s.moddmgdone||0,this.base.moddmgtaken+=s.moddmgtaken||0,this.base.defense+=s.defense||0,this.base.skill_0+="Human"==this.race?0:s.skill_0||0,this.base.skill_1+="Human"==this.race?0:s.skill_1||0,this.base.skill_2+=s.skill_2||0,this.base.skill_3+="Orc"==this.race?0:s.skill_3||0,this.base.skill_4+=s.skill_4||0,this.base.skill_5+=s.skill_5||0,this.base.skill_6+=s.skill_6||0,this.base.skill_7+=s.skill_7||0,s.resist){let t="Mark of the Wild"==s.name&&buffs.filter(s=>s.motwmod&&s.active)[0];if("Mark of the Wild"==s.name&&buffs.filter(s=>s.mrp&&s.active)[0])continue;if(("Mark of the Wild"==s.name||s.mrp)&&buffs.filter(s=>s.fra&&s.active)[0])continue;this.base.resist.fire+=~~(s.resist.fire*(t?t.motwmod:1)||0),this.base.resist.frost+=~~(s.resist.frost*(t?t.motwmod:1)||0),this.base.resist.nature+=~~(s.resist.nature*(t?t.motwmod:1)||0),this.base.resist.shadow+=~~(s.resist.shadow*(t?t.motwmod:1)||0)}}this.target.basearmorbuffed=Math.max(this.target.basearmorbuffed,0),"undefined"!=typeof $&&$("#currentarmor").text(this.target.basearmorbuffed),this.items.includes(234034)||this.items.includes(234202)||(this.timeworn=0),this.items.includes(234035)||(this.dodgetimeworn=0)}addSpells(testItem){this.preporder=[];for(let spell of spells)if(spell.item&&this.items.includes(spell.id)&&spell.id==testItem&&spell.id==testItem&&!spell.timetoendactive&&!spell.timetostartactive&&(219223==spell.id?spell.active=!0:spell.timetoendactive=!0),spell.active||spell.item&&this.items.includes(spell.id)&&(spell.timetoendactive||spell.timetostartactive)){if(!spell.aura&&this.mh.type==WEAPONTYPE.FISHINGPOLE)continue;if(spell.item&&!this.items.includes(spell.id))continue;spell.aura?this.auras[spell.classname.toLowerCase()]=eval(`new ${spell.classname}(this, ${spell.id})`):this.spells[spell.classname.toLowerCase()]=eval(`new ${spell.classname}(this, ${spell.id})`),this.preporder.push(spell)}this.preporder.sort((s,t)=>s.timetoend-t.timetoend)}sortSpells(){this.normalspells=[],this.executespells=[];for(let s=10;s>0;s--){for(let t in this.spells)this.spells[t].priority==s&&this.normalspells.push(this.spells[t]),this.spells[t].expriority==s&&this.executespells.push(this.spells[t]);for(let t in this.auras)this.auras[t].priority==s&&this.normalspells.push(this.auras[t]),this.auras[t].expriority==s&&this.executespells.push(this.auras[t])}this.normalspells_c=this.normalspells.length,this.executespells_c=this.executespells.length}setSkills(){this.base.skill_0+=this.mh.twohand?this.base.skill_20:this.base.skill_10,this.base.skill_1+=this.mh.twohand?this.base.skill_21:this.base.skill_11,this.base.skill_3+=this.mh.twohand?this.base.skill_23:this.base.skill_13}reset(s){this.rage=s,this.timer=0,this.itemtimer=0,this.stancetimer=0,this.ragetimer=0,this.dodgetimer=0,this.crittimer=0,this.critdmgbonus=0,this.mainspelldmg=1,this.spelldelay=0,this.heroicdelay=0,this.mh.timer=0,this.oh&&(this.oh.timer=Math.round(1e3*this.oh.speed/this.stats.haste/2)),this.extraattacks=0,this.batchedextras=0,this.nextswinghs=!1,this.nextswingcl=!1,this.freeslam=!1;for(let s in this.spells)this.spells[s].timer=0,this.spells[s].stacks=0;for(let s in this.auras)this.auras[s].timer=0,this.auras[s].firstuse=!0,this.auras[s].stacks=0,this.auras[s].ticksleft&&(this.auras[s].ticksleft=0),this.auras[s].saveddmg&&(this.auras[s].saveddmg=0),this.auras[s].nexttick&&(this.auras[s].nexttick=0),this.auras[s].cooldowntimer&&(this.auras[s].cooldowntimer=0),this.auras[s].tfbstep&&(this.auras[s].tfbstep=-6e3);this.trinketproc1&&this.trinketproc1.usestep&&(this.trinketproc1.usestep=0),this.trinketproc2&&this.trinketproc2.usestep&&(this.trinketproc2.usestep=0),this.auras.deepwounds&&(this.auras.deepwounds.idmg=0),this.auras.deepwounds2&&(this.auras.deepwounds2.idmg=0),this.auras.deepwounds3&&(this.auras.deepwounds3.idmg=0),this.auras.deepwounds4&&(this.auras.deepwounds4.idmg=0),this.auras.rend&&(this.auras.rend.idmg=0),this.auras.weaponbleedmh&&(this.auras.weaponbleedmh.idmg=0),this.auras.weaponbleedoh&&(this.auras.weaponbleedoh.idmg=0),this.spells.fireball&&(this.spells.fireball.idmg=0),this.spells.gunaxe&&(this.spells.gunaxe.idmg=0),this.spells.themoltencore&&(this.spells.themoltencore.idmg=0),this.initStances(),this.update()}update(){this.updateAuras(),this.updateArmorReduction(),this.mh.glanceChance=this.getGlanceChance(this.mh),this.mh.miss=this.getMissChance(this.mh),this.mh.dwmiss=this.mh.miss,this.mh.dodge=this.getDodgeChance(this.mh),this.oh&&(this.mh.dwmiss=this.getDWMissChance(this.mh),this.oh.glanceChance=this.getGlanceChance(this.oh),this.oh.miss=this.getMissChance(this.oh),this.oh.dwmiss=this.getDWMissChance(this.oh),this.oh.dodge=this.getDodgeChance(this.oh))}updateAuras(){for(let s in this.base)this.stats[s]=this.base[s];for(let s in this.auras)if(this.auras[s].timer){for(let t in this.auras[s].stats)this.stats[t]+=this.auras[s].stats[t];for(let t in this.auras[s].mult_stats)this.stats[t]*=1+this.auras[s].mult_stats[t]/100}this.stats.str=~~(this.stats.str*this.stats.strmod),this.stats.agi=~~(this.stats.agi*this.stats.agimod),this.stats.ap+=2*this.stats.str,this.stats.crit+=this.stats.agi*this.agipercrit,this.crit=this.getCritChance(),this.stats.block=this.stats.block+~~(this.stats.str/20),1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}getAgiPerCrit(s){return[.25,.2381,.2381,.2273,.2174,.2083,.2083,.2,.1923,.1923,.1852,.1786,.1667,.1613,.1563,.1515,.1471,.1389,.1351,.1282,.1282,.125,.119,.1163,.1111,.1087,.1064,.102,.1,.0962,.0943,.0926,.0893,.0877,.0847,.0833,.082,.0794,.0781,.0758,.0735,.0725,.0704,.0694,.0676,.0667,.0649,.0633,.0625,.061,.0595,.0588,.0575,.0562,.0549,.0543,.0532,.0521,.051,.05][parseInt(s)-1]}getTargetSpellMiss(){let s=100,t=this.target.level-this.level;return-2==t&&(s=200),-1==t&&(s=300),0==t&&(s=400),1==t&&(s=500),2==t&&(s=600),3==t&&(s=1700),4==t&&(s=2800),t>4&&(s=2800+1100*(t-4)),s}getTargetSpellMitigation(){return 1-this.target.resistance/(100*this.level)*15}getTargetSpellBinaryResist(){return parseInt(1e4-(1e4-this.target.misschance)*(1-.15*this.target.resistance/(100*this.level)))}updateStrength(){this.stats.str=this.base.str,this.stats.ap=this.base.ap,this.stats.apmod=this.base.apmod,this.stats.baseapmod=this.base.baseapmod;for(let s in this.auras)this.auras[s].timer&&(this.auras[s].stats.str&&(this.stats.str+=this.auras[s].stats.str),this.auras[s].stats.ap&&(this.stats.ap+=this.auras[s].stats.ap),this.auras[s].mult_stats.apmod&&(this.stats.apmod*=1+this.auras[s].mult_stats.apmod/100),this.auras[s].mult_stats.baseapmod&&(this.stats.baseapmod*=1+this.auras[s].mult_stats.baseapmod/100));this.stats.str=~~(this.stats.str*this.stats.strmod),this.stats.ap+=2*this.stats.str,this.stats.block=this.base.block+~~(this.stats.str/20),1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}updateAP(){this.stats.ap=this.base.ap,this.stats.apmod=this.base.apmod,this.stats.baseapmod=this.base.apmod;for(let s in this.auras)this.auras[s].timer&&this.auras[s].stats.ap&&(this.stats.ap+=this.auras[s].stats.ap),this.auras[s].timer&&this.auras[s].mult_stats.apmod&&(this.stats.apmod*=1+this.auras[s].mult_stats.apmod/100),this.auras[s].timer&&this.auras[s].mult_stats.baseapmod&&(this.stats.baseapmod*=1+this.auras[s].mult_stats.baseapmod/100);this.stats.ap+=2*this.stats.str,1!=this.stats.baseapmod&&(this.stats.ap+=~~((this.base.aprace+2*this.stats.str)*(this.stats.baseapmod-1))),this.stats.ap=~~(this.stats.ap*this.stats.apmod)}updateHaste(){this.stats.haste=this.base.haste,this.auras.flurry&&this.auras.flurry.timer&&(this.stats.haste*=1+this.auras.flurry.mult_stats.haste/100),this.auras.berserking&&this.auras.berserking.timer&&(this.stats.haste*=1+this.auras.berserking.mult_stats.haste/100),this.auras.empyrean&&this.auras.empyrean.timer&&(this.stats.haste*=1+this.auras.empyrean.mult_stats.haste/100),this.auras.eskhandar&&this.auras.eskhandar.timer&&(this.stats.haste*=1+this.auras.eskhandar.mult_stats.haste/100),this.auras.pummeler&&this.auras.pummeler.timer&&(this.stats.haste*=1+this.auras.pummeler.mult_stats.haste/100),this.auras.spider&&this.auras.spider.timer&&(this.stats.haste*=1+this.auras.spider.mult_stats.haste/100),this.auras.voidmadness&&this.auras.voidmadness.timer&&(this.stats.haste*=1+this.auras.voidmadness.mult_stats.haste/100),this.auras.jackhammer&&this.auras.jackhammer.timer&&(this.stats.haste*=1+this.auras.jackhammer.mult_stats.haste/100),this.auras.ragehammer&&this.auras.ragehammer.timer&&(this.stats.haste*=1+this.auras.ragehammer.mult_stats.haste/100),this.auras.blisteringragehammer&&this.auras.blisteringragehammer.timer&&(this.stats.haste*=1+this.auras.blisteringragehammer.mult_stats.haste/100),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.timer&&(this.stats.haste*=1+this.auras.gyromaticacceleration.mult_stats.haste/100),this.auras.gneurological&&this.auras.gneurological.timer&&(this.stats.haste*=1+this.auras.gneurological.mult_stats.haste/100),this.auras.spicy&&this.auras.spicy.timer&&(this.stats.haste*=1+this.auras.spicy.mult_stats.haste/100),this.auras.echoesdread&&this.auras.echoesdread.timer&&(this.stats.haste*=1+this.auras.echoesdread.mult_stats.haste/100),this.auras.singleminded&&this.auras.singleminded.timer&&(this.stats.haste*=1+this.auras.singleminded.mult_stats.haste/100),this.auras.magmadarsreturn&&this.auras.magmadarsreturn.timer&&(this.stats.haste*=1+this.auras.magmadarsreturn.mult_stats.haste/100),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&(this.stats.haste*=1+this.auras.jujuflurry.mult_stats.haste/100),this.auras.crusaderzeal&&this.auras.crusaderzeal.timer&&(this.stats.haste*=1+this.auras.crusaderzeal.mult_stats.haste/100),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&(this.stats.haste*=1+this.auras.obsidianhaste.mult_stats.haste/100)}updateHasteDamage(){let s=1;this.auras.spicy&&this.auras.spicy.timer&&(s*=1+this.auras.spicy.mult_stats.haste/100),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&(s*=1+this.auras.jujuflurry.mult_stats.haste/100),this.mh.mindmg=this.mh.basemindmg/s,this.mh.maxdmg=this.mh.basemaxdmg/s,this.oh&&(this.oh.mindmg=this.oh.basemindmg/s,this.oh.maxdmg=this.oh.basemaxdmg/s)}updateBonusDmg(){let s=0,t=0;this.auras.stoneslayer&&this.auras.stoneslayer.timer&&(s+=this.auras.stoneslayer.stats.moddmgdone),this.auras.zeal&&this.auras.zeal.timer&&(s+=this.auras.zeal.stats.moddmgdone),this.auras.zandalarian&&this.auras.zandalarian.timer&&(s+=this.auras.zandalarian.stats.moddmgdone),this.auras.relentlessstrength&&this.auras.relentlessstrength.timer&&(s+=this.auras.relentlessstrength.stats.moddmgdone),this.auras.blisteringragehammer&&this.auras.blisteringragehammer.timer&&(s+=this.auras.blisteringragehammer.stats.moddmgdone),this.auras.meltarmor&&this.auras.meltarmor.timer&&(t+=this.auras.meltarmor.stats.moddmgtaken),this.auras.crusaderzeal&&this.auras.crusaderzeal.timer&&(s+=this.auras.crusaderzeal.stats.moddmgdone),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&(s+=this.auras.obsidianhaste.stats.moddmgdone),this.stats.moddmgdone=this.base.moddmgdone+s,this.stats.moddmgtaken=this.base.moddmgtaken+t,this.mh.bonusdmg=this.mh.basebonusdmg,this.oh&&(this.oh.bonusdmg=this.oh.basebonusdmg)}updateArmorReduction(){this.target.armor=this.target.basearmorbuffed,this.auras.annihilator&&this.auras.annihilator.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.annihilator.stacks*this.auras.annihilator.armor,0)),this.auras.rivenspike&&this.auras.rivenspike.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.rivenspike.stacks*this.auras.rivenspike.armor,0)),this.auras.vibroblade&&this.auras.vibroblade.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.vibroblade.armor,0)),this.auras.ultrasonic&&this.auras.ultrasonic.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.ultrasonic.armor,0)),this.auras.cleavearmor&&this.auras.cleavearmor.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.cleavearmor.armor,0)),this.auras.bonereaver&&this.auras.bonereaver.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.bonereaver.stacks*this.auras.bonereaver.armor,0)),this.auras.swarmguard&&this.auras.swarmguard.timer&&(this.target.armor=Math.max(this.target.armor-this.auras.swarmguard.stacks*this.auras.swarmguard.armor,0)),this.armorReduction=this.getArmorReduction()}updateDmgMod(){this.stats.dmgmod=this.base.dmgmod,this.stats.spelldmgmod=this.base.spelldmgmod;for(let s in this.auras)this.auras[s].timer&&this.auras[s].mult_stats.dmgmod&&(this.stats.dmgmod*=1+this.auras[s].mult_stats.dmgmod/100);this.bleedbonus&&this.auras.rend&&this.auras.rend.timer&&this.auras.deepwounds&&this.auras.deepwounds.timer&&(this.stats.dmgmod*=1.1)}getGlanceReduction(s){let t=this.target.defense-this.stats["skill_"+s.type],e=Math.max(Math.min(1.3-.05*t,.91),.01),a=Math.max(Math.min(1.2-.03*t,.99),.2);return Math.random()*(a-e)+e}getGlanceChance(s){return 10+2*Math.max(this.target.defense-Math.min(5*this.level,this.stats["skill_"+s.type]),0)}getMissChance(s){let t=this.target.defense-this.stats["skill_"+s.type],e=5+(t>10?.2*t:.1*t);return e-=t>10?this.stats.hit-1:this.stats.hit}getDWMissChance(s){let t=this.target.defense-this.stats["skill_"+s.type],e=5+(t>10?.2*t:.1*t);return e=.8*e+20,e-=t>10?this.stats.hit-1:this.stats.hit}getCritChance(){let s=this.stats.crit+(this.talents.crit||0)+1*(this.level-this.target.level);return this.target.level-this.level>=3&&(s-=1.8),Math.max(s,0)}getDodgeChance(s){return Math.max(5-this.stats.expertise-this.dodgetimeworn-this.target.dodge+.1*(this.target.defense-this.stats["skill_"+s.type]),0)}getArmorReduction(){isNaN(this.target.armor)&&(this.target.armor=0);let s=this.target.armor/(this.target.armor+400+85*this.level);return s>.75?.75:s}addRage(s,t,e,a){let i=this.rage;(!a||a instanceof HeroicStrike||a instanceof Cleave)&&t!=RESULT.MISS&&t!=RESULT.DODGE&&this.talents.umbridledwrath&&rng10k()<100*this.talents.umbridledwrath&&(this.rage+=1),a?(a instanceof Execute&&(a.result=t),t!=RESULT.MISS&&t!=RESULT.DODGE||(this.rage+=a.refund?.8*a.cost:0,i+=(a.cost||0)+(a.usedrage||0))):t==RESULT.DODGE?this.rage+=e.avgdmg()/this.rageconversion*7.5*.75:t!=RESULT.MISS&&(this.rage+=s/this.rageconversion*7.5*this.ragemod),this.extrarage&&t==RESULT.HIT&&(this.rage+=this.extrarage),this.extracritrage&&t==RESULT.CRIT&&(this.rage+=this.extracritrage),this.rage>100&&(this.rage=100),this.auras.consumedrage&&i<60&&this.rage>=60&&this.auras.consumedrage.use()}steptimer(s){return this.timer<=s?(this.timer=0,this.logging&&this.log("Global CD off"),!0):(this.timer-=s,!1)}stepitemtimer(s){return this.itemtimer<=s?(this.itemtimer=0,this.logging&&this.log("Item CD off"),!0):(this.itemtimer-=s,!1)}stepstancetimer(s){return this.stancetimer<=s?(this.stancetimer=0,this.logging&&this.log("Stance CD off"),!0):(this.stancetimer-=s,!1)}stepragetimer(s){return this.ragetimer<=s?(this.ragetimer=0,this.rage+=10,this.logging&&this.log("10 rage gained"),!0):(this.ragetimer-=s,!1)}stepdodgetimer(s){this.dodgetimer<=s?this.dodgetimer=0:this.dodgetimer-=s}stepauras(s){this.mh.proc1&&this.mh.proc1.spell&&this.mh.proc1.spell.timer&&this.mh.proc1.spell.step(),this.mh.proc2&&this.mh.proc2.spell&&this.mh.proc2.spell.timer&&this.mh.proc2.spell.step(),this.oh&&this.oh.proc1&&this.oh.proc1.spell&&this.oh.proc1.spell.timer&&this.oh.proc1.spell.step(),this.oh&&this.oh.proc2&&this.oh.proc2.spell&&this.oh.proc2.spell.timer&&this.oh.proc2.spell.step(),this.auras.mightyragepotion&&this.auras.mightyragepotion.firstuse&&this.auras.mightyragepotion.timer&&this.auras.mightyragepotion.step(),this.auras.mildlyirradiated&&this.auras.mildlyirradiated.firstuse&&this.auras.mildlyirradiated.timer&&this.auras.mildlyirradiated.step(),this.auras.recklessness&&this.auras.recklessness.firstuse&&this.auras.recklessness.timer&&this.auras.recklessness.step(),this.auras.deathwish&&this.auras.deathwish.firstuse&&this.auras.deathwish.timer&&this.auras.deathwish.step(),this.auras.cloudkeeper&&this.auras.cloudkeeper.firstuse&&this.auras.cloudkeeper.timer&&this.auras.cloudkeeper.step(),this.auras.voidmadness&&this.auras.voidmadness.firstuse&&this.auras.voidmadness.timer&&this.auras.voidmadness.step(),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.firstuse&&this.auras.gyromaticacceleration.timer&&this.auras.gyromaticacceleration.step(),this.auras.gneurological&&this.auras.gneurological.firstuse&&this.auras.gneurological.timer&&this.auras.gneurological.step(),this.auras.coinflip&&this.auras.coinflip.timer&&this.auras.coinflip.step(),this.auras.flask&&this.auras.flask.firstuse&&this.auras.flask.timer&&this.auras.flask.step(),this.auras.bloodfury&&this.auras.bloodfury.firstuse&&this.auras.bloodfury.timer&&this.auras.bloodfury.step(),this.auras.berserking&&this.auras.berserking.firstuse&&this.auras.berserking.timer&&this.auras.berserking.step(),this.auras.slayer&&this.auras.slayer.firstuse&&this.auras.slayer.timer&&this.auras.slayer.step(),this.auras.spider&&this.auras.spider.firstuse&&this.auras.spider.timer&&this.auras.spider.step(),this.auras.earthstrike&&this.auras.earthstrike.firstuse&&this.auras.earthstrike.timer&&this.auras.earthstrike.step(),this.auras.roarguardian&&this.auras.roarguardian.firstuse&&this.auras.roarguardian.timer&&this.auras.roarguardian.step(),this.auras.pummeler&&this.auras.pummeler.firstuse&&this.auras.pummeler.timer&&this.auras.pummeler.step(),this.auras.swarmguard&&this.auras.swarmguard.firstuse&&this.auras.swarmguard.timer&&this.auras.swarmguard.step(),this.auras.zandalarian&&this.auras.zandalarian.firstuse&&this.auras.zandalarian.timer&&this.auras.zandalarian.step(),this.auras.relentlessstrength&&this.auras.relentlessstrength.firstuse&&this.auras.relentlessstrength.timer&&this.auras.relentlessstrength.step(),this.auras.rampage&&this.auras.rampage.timer&&this.auras.rampage.step(),this.auras.wreckingcrew&&this.auras.wreckingcrew.timer&&this.auras.wreckingcrew.step(),this.auras.freshmeat&&this.auras.freshmeat.timer&&this.auras.freshmeat.step(),this.auras.suddendeath&&this.auras.suddendeath.timer&&this.auras.suddendeath.step(),this.auras.voodoofrenzy&&this.auras.voodoofrenzy.timer&&this.auras.voodoofrenzy.step(),this.auras.battleshout&&this.auras.battleshout.timer&&this.auras.battleshout.step(),this.auras.echoeszerk&&this.auras.echoeszerk.timer&&this.auras.echoeszerk.step(),this.auras.echoesbattle&&this.auras.echoesbattle.timer&&this.auras.echoesbattle.step(),this.auras.echoesdef&&this.auras.echoesdef.timer&&this.auras.echoesdef.step(),this.auras.echoesglad&&this.auras.echoesglad.timer&&this.auras.echoesglad.step(),this.auras.battleforecast&&this.auras.battleforecast.timer&&this.auras.battleforecast.step(),this.auras.zerkforecast&&this.auras.zerkforecast.timer&&this.auras.zerkforecast.step(),this.auras.defforecast&&this.auras.defforecast.timer&&this.auras.defforecast.step(),this.auras.gladforecast&&this.auras.gladforecast.timer&&this.auras.gladforecast.step(),this.auras.defendersresolve&&this.auras.defendersresolve.timer&&this.auras.defendersresolve.step(),this.auras.singleminded&&this.auras.singleminded.timer&&this.auras.singleminded.step(),this.auras.demontaintedblood&&this.auras.demontaintedblood.timer&&this.auras.demontaintedblood.step(),this.auras.wrathwray&&this.auras.wrathwray.timer&&this.auras.wrathwray.step(),this.auras.moonstalkerfury&&this.auras.moonstalkerfury.timer&&this.auras.moonstalkerfury.step(),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&this.auras.jujuflurry.step(),this.auras.grilekguard&&this.auras.grilekguard.timer&&this.auras.grilekguard.step(),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&this.auras.obsidianhaste.step(),this.auras.obsidianstrength&&this.auras.obsidianstrength.timer&&this.auras.obsidianstrength.step(),this.mh.windfury&&this.mh.windfury.timer&&this.mh.windfury.step(),this.trinketproc1&&this.trinketproc1.spell&&this.trinketproc1.spell.timer&&this.trinketproc1.spell.step(),this.trinketproc2&&this.trinketproc2.spell&&this.trinketproc2.spell.timer&&this.trinketproc2.spell.step(),this.attackproc1&&this.attackproc1.spell&&this.attackproc1.spell.timer&&this.attackproc1.spell.step(),this.attackproc2&&this.attackproc2.spell&&this.attackproc2.spell.timer&&this.attackproc2.spell.step(),!s&&this.auras.deepwounds&&this.auras.deepwounds.timer&&this.auras.deepwounds.step(),!s&&this.auras.rend&&this.auras.rend.timer&&this.auras.rend.step(),this.auras.berserkerrage&&this.auras.berserkerrage.timer&&this.auras.berserkerrage.step(),this.auras.consumedrage&&this.auras.consumedrage.timer&&this.auras.consumedrage.step(),this.auras.weaponbleedmh&&this.auras.weaponbleedmh.timer&&this.auras.weaponbleedmh.step(),this.auras.weaponbleedoh&&this.auras.weaponbleedoh.timer&&this.auras.weaponbleedoh.step(),!s&&this.adjacent&&(this.auras.deepwounds2&&this.auras.deepwounds2.timer&&this.auras.deepwounds2.step(),this.auras.deepwounds3&&this.auras.deepwounds3.timer&&this.auras.deepwounds3.step(),this.auras.deepwounds4&&this.auras.deepwounds4.timer&&this.auras.deepwounds4.step())}endauras(){this.mh.proc1&&this.mh.proc1.spell&&this.mh.proc1.spell.timer&&this.mh.proc1.spell.end(),this.mh.proc2&&this.mh.proc2.spell&&this.mh.proc2.spell.timer&&this.mh.proc2.spell.end(),this.oh&&this.oh.proc1&&this.oh.proc1.spell&&this.oh.proc1.spell.timer&&this.oh.proc1.spell.end(),this.oh&&this.oh.proc2&&this.oh.proc2.spell&&this.oh.proc2.spell.timer&&this.oh.proc2.spell.end(),this.auras.mightyragepotion&&this.auras.mightyragepotion.firstuse&&this.auras.mightyragepotion.timer&&this.auras.mightyragepotion.end(),this.auras.mildlyirradiated&&this.auras.mildlyirradiated.firstuse&&this.auras.mildlyirradiated.timer&&this.auras.mildlyirradiated.end(),this.auras.recklessness&&this.auras.recklessness.firstuse&&this.auras.recklessness.timer&&this.auras.recklessness.end(),this.auras.deathwish&&this.auras.deathwish.firstuse&&this.auras.deathwish.timer&&this.auras.deathwish.end(),this.auras.cloudkeeper&&this.auras.cloudkeeper.firstuse&&this.auras.cloudkeeper.timer&&this.auras.cloudkeeper.end(),this.auras.voidmadness&&this.auras.voidmadness.firstuse&&this.auras.voidmadness.timer&&this.auras.voidmadness.end(),this.auras.gyromaticacceleration&&this.auras.gyromaticacceleration.firstuse&&this.auras.gyromaticacceleration.timer&&this.auras.gyromaticacceleration.end(),this.auras.gneurological&&this.auras.gneurological.firstuse&&this.auras.gneurological.timer&&this.auras.gneurological.end(),this.auras.coinflip&&this.auras.coinflip.timer&&this.auras.coinflip.end(),this.auras.flask&&this.auras.flask.firstuse&&this.auras.flask.timer&&this.auras.flask.end(),this.auras.bloodfury&&this.auras.bloodfury.firstuse&&this.auras.bloodfury.timer&&this.auras.bloodfury.end(),this.auras.berserking&&this.auras.berserking.firstuse&&this.auras.berserking.timer&&this.auras.berserking.end(),this.auras.slayer&&this.auras.slayer.firstuse&&this.auras.slayer.timer&&this.auras.slayer.end(),this.auras.spider&&this.auras.spider.firstuse&&this.auras.spider.timer&&this.auras.spider.end(),this.auras.gabbar&&this.auras.gabbar.firstuse&&this.auras.gabbar.timer&&this.auras.gabbar.end(),this.auras.earthstrike&&this.auras.earthstrike.firstuse&&this.auras.earthstrike.timer&&this.auras.earthstrike.end(),this.auras.roarguardian&&this.auras.roarguardian.firstuse&&this.auras.roarguardian.timer&&this.auras.roarguardian.end(),this.auras.pummeler&&this.auras.pummeler.firstuse&&this.auras.pummeler.timer&&this.auras.pummeler.end(),this.auras.swarmguard&&this.auras.swarmguard.firstuse&&this.auras.swarmguard.timer&&this.auras.swarmguard.end(),this.auras.zandalarian&&this.auras.zandalarian.firstuse&&this.auras.zandalarian.timer&&this.auras.zandalarian.end(),this.auras.relentlessstrength&&this.auras.relentlessstrength.firstuse&&this.auras.relentlessstrength.timer&&this.auras.relentlessstrength.end(),this.auras.rampage&&this.auras.rampage.timer&&this.auras.rampage.end(),this.auras.wreckingcrew&&this.auras.wreckingcrew.timer&&this.auras.wreckingcrew.end(),this.auras.freshmeat&&this.auras.freshmeat.timer&&this.auras.freshmeat.end(),this.auras.suddendeath&&this.auras.suddendeath.timer&&this.auras.suddendeath.end(),this.auras.voodoofrenzy&&this.auras.voodoofrenzy.timer&&this.auras.voodoofrenzy.end(),this.auras.battleshout&&this.auras.battleshout.timer&&this.auras.battleshout.end(),this.auras.echoeszerk&&this.auras.echoeszerk.timer&&this.auras.echoeszerk.end(),this.auras.echoesbattle&&this.auras.echoesbattle.timer&&this.auras.echoesbattle.end(),this.auras.echoesdef&&this.auras.echoesdef.timer&&this.auras.echoesdef.end(),this.auras.echoesglad&&this.auras.echoesglad.timer&&this.auras.echoesglad.end(),this.auras.battleforecast&&this.auras.battleforecast.timer&&this.auras.battleforecast.end(),this.auras.zerkforecast&&this.auras.zerkforecast.timer&&this.auras.zerkforecast.end(),this.auras.defforecast&&this.auras.defforecast.timer&&this.auras.defforecast.end(),this.auras.gladforecast&&this.auras.gladforecast.timer&&this.auras.gladforecast.end(),this.auras.defendersresolve&&this.auras.defendersresolve.timer&&this.auras.defendersresolve.end(),this.auras.singleminded&&this.auras.singleminded.timer&&this.auras.singleminded.end(),this.auras.moonstalkerfury&&this.auras.moonstalkerfury.timer&&this.auras.moonstalkerfury.end(),this.auras.demontaintedblood&&this.auras.demontaintedblood.timer&&this.auras.demontaintedblood.end(),this.auras.wrathwray&&this.auras.wrathwray.timer&&this.auras.wrathwray.end(),this.auras.jujuflurry&&this.auras.jujuflurry.timer&&this.auras.jujuflurry.end(),this.auras.grilekguard&&this.auras.grilekguard.timer&&this.auras.grilekguard.end(),this.auras.obsidianhaste&&this.auras.obsidianhaste.timer&&this.auras.obsidianhaste.end(),this.auras.obsidianstrength&&this.auras.obsidianstrength.timer&&this.auras.obsidianstrength.end(),this.mh.windfury&&this.mh.windfury.timer&&this.mh.windfury.end(),this.trinketproc1&&this.trinketproc1.spell&&this.trinketproc1.spell.timer&&this.trinketproc1.spell.end(),this.trinketproc2&&this.trinketproc2.spell&&this.trinketproc2.spell.timer&&this.trinketproc2.spell.end(),this.attackproc1&&this.attackproc1.spell&&this.attackproc1.spell.timer&&this.attackproc1.spell.end(),this.attackproc2&&this.attackproc2.spell&&this.attackproc2.spell.timer&&this.attackproc2.spell.end(),this.auras.flurry&&this.auras.flurry.timer&&this.auras.flurry.end(),this.auras.deepwounds&&this.auras.deepwounds.timer&&this.auras.deepwounds.end(),this.auras.deepwounds2&&this.auras.deepwounds2.timer&&this.auras.deepwounds2.end(),this.auras.deepwounds3&&this.auras.deepwounds3.timer&&this.auras.deepwounds3.end(),this.auras.deepwounds4&&this.auras.deepwounds4.timer&&this.auras.deepwounds4.end(),this.auras.rend&&this.auras.rend.timer&&this.auras.rend.end(),this.auras.berserkerrage&&this.auras.berserkerrage.timer&&this.auras.berserkerrage.end(),this.auras.consumedrage&&this.auras.consumedrage.timer&&this.auras.consumedrage.end(),this.auras.weaponbleedmh&&this.auras.weaponbleedmh.timer&&this.auras.weaponbleedmh.end(),this.auras.weaponbleedoh&&this.auras.weaponbleedoh.timer&&this.auras.weaponbleedoh.end()}rollweapon(s){let t=0,e=rng10k();return e<(t+=100*Math.max(this.nextswinghs?s.miss:s.dwmiss,0))?RESULT.MISS:e<(t+=100*s.dodge)?RESULT.DODGE:e<(t+=100*s.glanceChance)?RESULT.GLANCE:e<(t+=100*(this.crit+s.crit))?RESULT.CRIT:RESULT.HIT}rollmeleespell(s,t){t||(t=this.mh);let e=0,a=rng10k();if(a<(e+=100*Math.max(t.miss,0)))return RESULT.MISS;if(s.canDodge&&a<(e+=100*t.dodge))return RESULT.DODGE;s.weaponspell||(a=rng10k(),e=0);let i=this.crit+t.crit;return s instanceof Overpower&&(i+=this.talents.overpowercrit),a<(e+=100*i)&&!s.nocrit?RESULT.CRIT:RESULT.HIT}rollmagicspell(s){let t=this.target.misschance;return s.binaryspell&&(t=this.target.binaryresist),rng10k()0&&t.proc1.phantom&&(s+=this.phantomproc(t)),r+=s}this.logging&&this.log(`${t.name} proc ${r?"for "+~~r:""}`)}t.proc1&&t.proc1.extra&&!i&&rng10k()this.trinketproc1.usestep)&&(this.trinketproc1.cooldown&&(this.trinketproc1.usestep=step+this.trinketproc1.cooldown),s?this.batchedextras+=this.trinketproc1.extra:o=this.trinketproc1.extra,this.logging&&this.log("Trinket 1 proc")),this.trinketproc2&&!this.trinketproc2.extra&&rng10k()this.trinketproc2.usestep)&&(this.trinketproc2.cooldown&&(this.trinketproc2.usestep=step+this.trinketproc2.cooldown),s?this.batchedextras+=this.trinketproc2.extra:o=this.trinketproc2.extra,this.logging&&this.log("Trinket 2 proc")),this.attackproc1&&rng10k()0&&(t+=this.phantomproc(s)),s.proc2&&rng10k()1||s.indexOf("Global")>-1?t="Gray":s.indexOf("tick")>1?t="Tomato":s.indexOf(" for ")>-1?t="DarkOrchid":(s.indexOf("applied")>1||s.indexOf("removed")>-1)&&(t="#17A8B6"),console.log(`%c ${(step/1e3).toFixed(3).padStart(6," ")} | ${this.rage.toFixed(2).padStart(6," ")} | ${s}`,`color: ${t}`)}switch(s){let t=this.stance;this.stance=s,this.auras.battlestance.timer=0,this.auras.berserkerstance.timer=0,this.auras.defensivestance.timer=0,this.auras.gladiatorstance.timer=0,"battle"==s&&(this.auras.battlestance.timer=1),"zerk"==s&&(this.auras.berserkerstance.timer=1),"def"==s&&(this.auras.defensivestance.timer=1),"glad"==s&&(this.auras.gladiatorstance.timer=1),this.rage=Math.min(this.rage,this.talents.rageretained),this.auras["echoes"+t]&&this.auras["echoes"+t].use(),this.auras[this.stance+"forecast"]&&this.auras[this.stance+"forecast"].use(),this.ragemod=(this.base.ragemod||1)*("glad"!=this.stance||this.target.speed?1:1.5),this.switchrage&&(this.ragetimer=10),this.stancetimer=1e3,this.updateAuras(),this.logging&&this.log(`Switched to ${s} stance`)}isValidStance(s,t){return this.stance==s||"glad"==this.stance&&this.shield||"zerk"==s&&this.auras.echoeszerk&&this.auras.echoeszerk.timer||"battle"==s&&this.auras.echoesbattle&&this.auras.echoesbattle.timer||"def"==s&&this.auras.echoesdef&&this.auras.echoesdef.timer||this.auras.echoesglad&&this.auras.echoesglad.timer||t&&"zerk"==this.stance&&this.bloodfrenzy}isEnraged(){return this.auras.wreckingcrew&&this.auras.wreckingcrew.timer||this.auras.consumedrage&&this.auras.consumedrage.timer||this.auras.freshmeat&&this.auras.freshmeat.timer||this.auras.bloodrage&&this.auras.bloodrage.timer||this.auras.berserkerrage&&this.auras.berserkerrage.timer}} \ No newline at end of file diff --git a/js/classes/player.js b/js/classes/player.js index 3f5e4b77..13ba07e3 100644 --- a/js/classes/player.js +++ b/js/classes/player.js @@ -149,8 +149,8 @@ class Player { this.addRunes(); this.setSkills(); if (this.talents.flurry) this.auras.flurry = new Flurry(this); - if (this.talents.deepwounds && this.mode !== 'classic') this.auras.deepwounds = this.mode == "sod" ? new DeepWounds(this) : new OldDeepWounds(this); - if (this.adjacent && this.talents.deepwounds && this.mode !== 'classic') { + if (this.talents.deepwounds) this.auras.deepwounds = this.mode == "sod" ? new DeepWounds(this) : new OldDeepWounds(this); + if (this.adjacent && this.talents.deepwounds) { for (let i = 2; i <= (this.adjacent + 1); i++) this.auras['deepwounds' + i] = this.mode == "sod" ? new DeepWounds(this, null, i) : new OldDeepWounds(this, null, i); }