diff --git a/dist/js/classes/spell.min.js b/dist/js/classes/spell.min.js index 8859ff53..345424cd 100644 --- a/dist/js/classes/spell.min.js +++ b/dist/js/classes/spell.min.js @@ -1 +1 @@ -class Spell{constructor(t,s,e){this.id=s,this.timer=0,this.cost=0,this.cooldown=0,this.player=t,this.refund=!0,this.canDodge=!0,this.totaldmg=0,this.data=[0,0,0,0,0],this.name=e||this.constructor.name,this.useonly=!1,this.maxdelay=this.player.reactionmin,this.weaponspell=!0,this.defenseType=DEFENSETYPE.MELEE,this.school=SCHOOL.PHYSICAL,this.minrage=0,this.offensive=!0;let i=spells.filter(t=>t.id==this.id)[0];i&&(i.minrageactive&&(this.minrage=parseInt(i.minrage)),i.maxrageactive&&(this.maxrage=parseInt(i.maxrage)),i.maincdactive&&(this.maincd=1e3*parseInt(i.maincd)),i.cooldown&&(this.cooldown=parseInt(i.cooldown)||0),i.durationactive&&(this.cooldown=Math.max(parseInt(i.duration),this.cooldown)),i.value1&&(this.value1=parseInt(i.value1)),i.value2&&(this.value2=parseInt(i.value2)),i.priorityapactive&&(this.priorityap=parseInt(i.priorityap)),i.consumedrage&&(this.consumedrage=i.consumedrage),i.unqueueactive&&(this.unqueue=parseInt(i.unqueue)),i.exmacro&&(this.exmacro=i.exmacro),i.globalsactive&&(this.globals=i.globals),i.afterswing&&(this.afterswing=i.afterswing),i.swingreset&&(this.swingreset=i.swingreset),i.timetoendactive&&(this.timetoend=1e3*parseInt(i.timetoend)),i.timetostartactive&&(this.timetostart=1e3*parseInt(i.timetostart)),i.zerkerpriority&&(this.zerkerpriority=i.zerkerpriority),i.swordboard&&(this.swordboard=i.swordboard),i.resolve&&(this.resolve=i.resolve),i.switchstart&&(this.switchstart=i.switchstart),i.switchtimeactive&&(this.switchtime=1e3*parseFloat(i.switchtime)),i.switchtimeactive&&(this.switchrage=parseInt(i.switchrage)),i.switchtimeactive&&(this.switchtimeactive=i.switchtimeactive),i.switchdefault&&(this.switchdefault=i.switchdefault),i.durationactive&&(this.duration=parseInt(i.duration)),i.swingtimeractive&&(this.swingtimer=1e3*parseFloat(i.swingtimer)),i.priority&&(this.priority=parseInt(i.priority)),i.expriority&&(this.expriority=parseInt(i.expriority)),i.switchechoesactive&&(this.switchechoestime=1e3*parseFloat(i.switchechoestime)),i.switchechoesactive&&(this.switchechoesswing=1e3*parseFloat(i.switchechoesswing)),i.switchechoesactive&&(this.switchechoesactive=i.switchechoesactive),i.switchoractive&&(this.switchortime=1e3*parseFloat(i.switchortime)),i.switchoractive&&(this.switchorrage=parseInt(i.switchorrage)),i.switchoractive&&(this.switchoractive=i.switchoractive),i.secondarystance&&(this.secondarystance=i.secondarystance))}dmg(){return 0}use(){this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}step(t){return this.timer<=t?(this.timer=0,this.player.logging&&this.player.log(`${this.name} off cooldown`)):this.timer-=t,this.timer}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}failed(){}}class Bloodthirst extends Spell{constructor(t,s){super(t,s),this.cost=30-t.ragecostbonus,this.cooldown=6,this.weaponspell=!1}dmg(){let t;return(t=.45*this.player.stats.ap)*this.player.stats.dmgmod*this.player.mainspelldmg}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}}class Whirlwind extends Spell{constructor(t,s){super(t,s),this.cost=25-t.ragecostbonus-(t.whirlwindcost||0),this.cooldown=10,this.refund=!1}dmg(){let t;return this.player.auras.consumedrage&&this.player.auras.consumedrage.timer&&(this.offhandhit=!0),t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.isValidStance("zerk")||this.player.switch("zerk"),this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(this.player.isValidStance("zerk")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("zerk")||this.player.rage<=this.maxrage)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Overpower extends Spell{constructor(t,s){super(t,s),this.cost=5-t.ragecostbonus,this.cooldown=5,this.canDodge=!1}dmg(){let t;return t=this.value1+rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.isValidStance("battle")||this.player.switch("battle"),this.player.timer=1500,this.player.dodgetimer=0,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.rage-=this.cost}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.dodgetimer&&(this.player.isValidStance("battle")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("battle")||this.player.rage<=this.maxrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Execute extends Spell{constructor(t,s){super(t,s),this.cost=15-t.talents.executecost-t.ragecostbonus,this.usedrage=0,this.totalusedrage=0,this.refund=!1,this.weaponspell=!1}dmg(){let t;return(t=this.value1+this.value2*this.usedrage)*this.player.stats.dmgmod}use(t){if(!this.player.isValidStance("zerk")&&!this.player.isValidStance("battle")){let t="zerk";"battle"==this.player.basestance?t="battle":this.player.spells.unstoppablemight&&"battle"==this.player.spells.unstoppablemight.secondarystance&&(t="battle"),this.player.switch(t)}t&&t.exmacro&&(t.canUse()?(this.player.cast(t),this.player.heroicdelay=0):t instanceof Cleave&&t.backupheroic&&t.backupheroic.canUse()&&(this.player.cast(t.backupheroic),this.player.heroicdelay=0)),this.player.timer=1500,this.player.rage-=this.cost,this.usedrage=~~this.player.rage,this.totalusedrage+=this.usedrage-(this.player.auras.suddendeath&&this.player.auras.suddendeath.timer?10:0),this.timer=1-step%1,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}step(t){return this.timer<=t?this.timer=0:this.timer-=t,this.timer}canUse(){return!this.player.timer&&this.cost<=this.player.rage&&(!this.swingtimer||this.player.mh.timer<=this.swingtimer)&&(!this.minrage||this.player.rage>=this.minrage)&&(step>=this.executestep||this.player.auras.suddendeath&&this.player.auras.suddendeath.timer)}}class Bloodrage extends Spell{constructor(t,s){super(t,s),this.cost=0,this.rage=10+t.talents.bloodragebonus,this.cooldown=60,this.useonly=!0,this.offensive=!1,"glad"==t.basestance&&t.gladbloodrage&&(this.cooldown-=30)}use(){this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.rage=Math.min(this.player.rage+this.rage,100),this.player.auras.bloodrage.use(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return!this.timer&&step>=this.usestep}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}}class HeroicStrike extends Spell{constructor(t,s){super(t,s,"Heroic Strike"),this.cost=15-t.talents.impheroicstrike-t.ragecostbonus,this.bonus=this.value1,this.useonly=!0,this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}use(){this.player.nextswinghs=!0,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.player.nextswinghs&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)&&(!this.unqueue||this.player.mh.timer>this.unqueuetimer)}}class Cleave extends Spell{constructor(t,s){if(super(t,s),this.cost=20-t.ragecostbonus,this.bonus=this.value1*(1+this.player.talents.cleavebonus/100),this.useonly=!0,this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax),this.exmacro)for(let s of spells){let e=parseInt(s.minlevel||0),i=parseInt(s.maxlevel||60);"Heroic Strike"==s.name&&t.level>=e&&t.level<=i&&(this.backupheroic=new HeroicStrike(t,s.id),this.backupheroic.exmacro=!0)}}use(){this.player.nextswinghs=!0,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.player.nextswinghs&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)&&(!this.unqueue||this.player.mh.timer>this.unqueuetimer)}}class MortalStrike extends Spell{constructor(t,s){super(t,s,"Mortal Strike"),this.cost=30-t.ragecostbonus,this.cooldown=6}dmg(){let t;return t=this.value1+rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod*this.player.mainspelldmg}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}}class SunderArmor extends Spell{constructor(t,s){super(t,s,"Sunder Armor"),this.cost=15-t.talents.impsunderarmor-t.ragecostbonus,this.stacks=0,this.nocrit=!0}use(){this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.stacks=Math.min(6,this.stacks+1),(this.player.homunculi||this.player.exposed)&&(this.stacks=6),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}dmg(){if(!this.devastate)return 0;let t=1.5*(1+.1*(this.stacks-1));return((this.player.mh.mindmg+this.player.mh.maxdmg)/2+this.player.stats.ap/14*this.player.mh.speed)/this.player.mh.speed*t*this.player.stats.dmgmod}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.globals||this.stacks=this.minrage)&&(this.player.furiousthunder||this.player.isValidStance("battle"))}}class VictoryRush extends Spell{constructor(t,s){super(t,s,"Victory Rush"),this.cost=0,this.stacks=0,this.weaponspell=!1}use(){this.stacks++,this.player.timer=1500,this.player.rage-=this.cost,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}dmg(){let t;return(t=.45*this.player.stats.ap)*this.player.stats.dmgmod}canUse(){return!this.player.timer&&!this.stacks}}class RagingBlow extends Spell{constructor(t,s){super(t,s,"Raging Blow"),this.cost=0,this.cooldown=8}dmg(){let t;return t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}canUse(){return!this.timer&&!this.player.timer&&this.player.isEnraged()}reduce(t){this.timer&&this.player.isEnraged()&&t&&t!=this&&t.offensive&&(this.timer=Math.max(0,this.timer-1e3))}}class BerserkerRage extends Spell{constructor(t,s){super(t,s),this.cost=0,this.rage=t.talents.berserkerbonus,this.cooldown=30,this.useonly=!0,this.offensive=!1}use(){this.player.timer=1500,this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.isValidStance("zerk")||this.player.switch("zerk"),this.player.rage=Math.min(this.player.rage+this.rage,100),this.player.auras.berserkerrage.use(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return 0==this.timer&&!this.player.timer&&(!this.maxrage||this.player.isValidStance("zerk")||this.player.rage<=this.maxrage)}}class QuickStrike extends Spell{constructor(t,s){super(t,s,"Quick Strike"),this.cost=20-t.talents.impheroicstrike-t.ragecostbonus,this.cooldown=0}dmg(){let t,s=1;return t=~~rng(.25*this.player.stats.ap,.35*this.player.stats.ap)+this.player.stats.moddmgdone,this.player.heroicbonus&&(s=1.1),t*this.player.stats.dmgmod*s}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class RagePotion extends Spell{constructor(t,s){super(t,s,"Rage Potion"),this.cost=0,this.minrage=80,this.cooldown=120,this.useonly=!0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.rage=Math.min(this.player.rage+~~rng(this.value1,this.value2),100),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return 0==this.timer&&this.player.rage=this.usestep}}class Slam extends Spell{constructor(t,s){super(t,s),this.cost=15-t.ragecostbonus,this.casttime=t.precisetiming?0:1500-100*t.talents.impslam,this.cooldown=t.precisetiming?6:0,this.mhthreshold=0}dmg(t){let s;return t||(t=this.player.mh),s=this.value1+rng(t.mindmg+t.bonusdmg,t.maxdmg+t.bonusdmg),(s+=this.player.stats.ap/14*t.speed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.freeslam&&(this.offhandhit=!0),this.player.freeslam||(this.player.rage-=this.cost),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.casttime&&!this.player.freeslam&&(this.player.mh.use(),this.player.oh&&this.player.oh.use()),this.player.freeslam=!1,this.timer=1e3*this.cooldown,this.player.logging&&this.player.log(`${this.name} done casting`)}canUse(){return!this.timer&&!this.player.timer&&this.player.mh.timer>=this.mhthreshold&&(this.player.freeslam||this.cost<=this.player.rage)&&(!this.player.bloodsurge||this.player.freeslam)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Fireball extends Spell{constructor(t,s){super(t,s),this.useonly=!0,this.proc={magicdmg:371},this.idmg=0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1;let t=this.player.magicproc(this.proc);this.idmg+=t,this.player.logging&&this.player.log(`Fireball hit for ${t}`)}canUse(){return!this.timer&&step>=this.usestep}}class GunAxe extends Spell{constructor(t,s){super(t,s),this.useonly=!0,this.proc={magicdmg:225},this.idmg=0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1;let t=this.player.magicproc(this.proc);this.idmg+=t,this.player.logging&&this.player.log(`Gun Axe hit for ${t}`)}canUse(){return!this.timer&&step>=this.usestep}}class BlademasterFury extends Spell{constructor(t,s){super(t,s,"Blademaster's Fury"),this.cooldown=120}dmg(){let t;return t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.timer=1500,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.spells.whirlwind&&(this.player.spells.whirlwind.timer=0,this.player.logging&&this.player.log(`${this.player.spells.whirlwind.name} off cooldown`))}canUse(){return!this.timer&&!this.player.timer&&(!this.player.spells.whirlwind||this.player.spells.whirlwind.timer>0)}}class ShieldSlam extends Spell{constructor(t,s){super(t,s,"Shield Slam"),this.cost=20-t.ragecostbonus,t.items.includes(231350)&&(this.cost-=5),this.cooldown=6-(t.shieldslamcd||0),this.duration&&(this.cooldown=Math.max(this.cooldown,this.duration)),this.swordboard&&(this.cost=0)}dmg(){let t,s=this.player.stats.ap+(this.player.auras.defendersresolve&&!this.player.auras.defendersresolve.timer?4*this.player.stats.defense:0);return(t=rng(this.value1,this.value2)+2*this.player.stats.block+~~(.15*s))*this.player.stats.dmgmod*this.player.mainspelldmg}use(){this.player.timer=1500,this.player.freeshieldslam||(this.player.rage-=this.cost),this.timer=1e3*this.cooldown,this.player.freeshieldslam=!1,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return this.player.shield&&!this.timer&&!this.player.timer&&(this.player.freeshieldslam||this.cost<=this.player.rage)&&(this.player.freeshieldslam||this.player.rage>=this.minrage)&&(!this.resolve||this.player.auras.defendersresolve&&!this.player.auras.defendersresolve.timer)&&(!this.swordboard||this.player.freeshieldslam)}}class Shockwave extends Spell{constructor(t,s){super(t,s),this.cost=15-t.ragecostbonus,this.cooldown=20,this.canDodge=!1}dmg(){return this.player.stats.ap/2*this.player.stats.dmgmod}use(){this.player.isValidStance("def")||this.player.switch("def"),this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return this.player.shield&&!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(this.player.isValidStance("def")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("def")||this.player.rage<=this.maxrage)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class TheMoltenCore extends Spell{constructor(t,s){super(t,s,"The Molten Core"),this.useonly=!0,this.proc={magicdmg:20},this.idmg=0,this.offensive=!1}use(){let t=this.player.magicproc(this.proc);for(let s=0;s=60&&this.player.auras.consumedrage.use()}canUse(){return!this.player.itemtimer&&!this.timer&&step>=this.usestep}}class Aura{constructor(t,s,e){this.id=s,this.timer=0,this.starttimer=0,this.stats={},this.mult_stats={},this.player=t,this.firstuse=!0,this.duration=0,this.stacks=0,this.uptime=0,this.name=e||this.constructor.name,this.maxdelay=this.player.reactionmin,this.useonly=!0,this.offensive=!1;let i=spells.filter(t=>t.id==this.id)[0];i||(i=buffs.filter(t=>t.id==this.id)[0]),i&&(i.durationactive&&(this.duration=parseInt(i.duration)),i.timetoendactive&&(this.timetoend=1e3*parseInt(i.timetoend)),i.timetostartactive&&(this.timetostart=1e3*parseInt(i.timetostart)),i.crusaders&&(this.crusaders=parseInt(i.crusaders)),i.haste&&(this.mult_stats={haste:parseInt(i.haste)}),i.value1&&(this.value1=i.value1),i.value2&&(this.value2=i.value2),i.minlevel&&(this.minlevel=i.minlevel),i.procblock&&(this.procblock=i.procblock),i.rageblockactive&&(this.rageblock=parseInt(i.rageblock)),i.erageblockactive&&(this.erageblock=parseInt(i.erageblock)),i.chargeblockactive&&(this.chargeblock=parseInt(i.chargeblock)),i.echargeblockactive&&(this.echargeblock=parseInt(i.echargeblock)),i.wfap&&(this.wfap=parseInt(i.wfap)),i.wfapperc&&(this.wfapperc=parseInt(i.wfapperc)),i.alwaystails&&(this.alwaystails=i.alwaystails),i.alwaysheads&&(this.alwaysheads=i.alwaysheads),i.item&&(this.item=i.item),i.noitemcd&&(this.noitemcd=i.noitemcd),i.maxrageactive&&(this.maxrage=parseInt(i.maxrage)),i.priority&&(this.priority=parseInt(i.priority)),i.expriority&&(this.expriority=parseInt(i.expriority)))}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0}prep(t,s){if(void 0!==this.timetostart&&(this.usestep=this.timetostart),void 0!==this.timetoend){if(this.item&&!this.noitemcd)return this.usestep=Math.max(Math.min(t-this.timetoend,t-s-1e3*this.duration),0),1e3*this.duration;this.usestep=Math.max(t-this.timetoend,0)}return 0}remove(){this.timer&&(this.uptime+=step-this.starttimer,this.timer=0,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Recklessness extends Aura{constructor(t,s){super(t,s),this.duration=12,this.stats={crit:"sod"==this.player.mode?50:100},this.cooldown="sod"==this.player.mode?300:1800}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.player.timer=1500,this.starttimer=step,this.player.isValidStance("zerk")||this.player.switch("zerk"),this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Flurry extends Aura{constructor(t,s){super(t,s),this.duration=12,this.mult_stats={haste:t.talents.flurry}}proc(){this.stacks--,this.stacks||(this.uptime+=step-this.starttimer,this.timer=0,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}use(){this.timer=1,this.stacks||(this.starttimer=step,this.player.updateHaste()),this.stacks=3,this.player.logging&&this.player.log(`${this.name} applied`)}}class DeepWounds extends Aura{constructor(t,s,e){super(t,s,"Deep Wounds"+(e?" "+e:"")),this.duration=12,this.idmg=0,this.totaldmg=0,this.saveddmg=0,this.ticksleft=0}tickdmg(t){let s,e;t?(s=this.player.oh.mindmg+this.player.oh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.oh.speed,e=this.player.oh.maxdmg+this.player.oh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.oh.speed):(s=this.player.mh.mindmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed,e=this.player.mh.maxdmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed);let i=(s+e)/2;return i*=(t?this.player.oh.modifier:this.player.mh.modifier)*this.player.stats.dmgmod*this.player.talents.deepwounds*this.player.bleedmod}step(){for(;step>=this.nexttick;){this.player.stepauras(!0);let t=this.saveddmg/this.ticksleft;this.saveddmg-=t,this.idmg+=t,this.totaldmg+=t,this.ticksleft--,this.player.logging&&this.player.log(`${this.name} tick for ${t.toFixed(2)}`),this.nexttick+=3e3}step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.nexttick=0,this.firstuse=!1,this.saveddmg=0,this.player.logging&&this.player.log(`${this.name} removed`))}use(t){this.timer&&(this.uptime+=step-this.starttimer),this.ticksleft=4,this.saveddmg+=this.tickdmg(t),this.nexttick?this.timer=this.nexttick-3e3+1e3*this.duration:(this.nexttick=step+3e3,this.timer=step+1e3*this.duration),this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class OldDeepWounds extends Aura{constructor(t,s,e){super(t,s,"Deep Wounds"+(e?" "+e:"")),this.duration=12,this.idmg=0,this.totaldmg=0}step(){for(;step>=this.nexttick;){let t=(this.player.mh.mindmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed+(this.player.mh.maxdmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed))/2;t*=this.player.mh.modifier*this.player.stats.dmgmod*this.player.talents.deepwounds*this.player.bleedmod,this.idmg+=t/4,this.totaldmg+=t/4,this.player.logging&&this.player.log(`${this.name} tick for ${(t/4).toFixed(2)}`),this.nexttick+=3e3}step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1)}use(){this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+3e3,this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class Crusader extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={str:100}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Cloudkeeper extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={ap:100}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.player.itemtimer&&!this.timer&&step>=this.usestep}}class Felstriker extends Aura{constructor(t,s){super(t,s),this.duration=3,this.stats={crit:100,hit:100}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.update(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.update(),this.player.logging&&this.player.log(`${this.name} removed`))}}class DeathWish extends Aura{constructor(t,s){super(t,s,"Death Wish"),this.duration=30,this.mult_stats={dmgmod:20},this.cooldown=180}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.player.rage-=10,this.player.timer=1500,this.starttimer=step-s,this.player.updateDmgMod(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&this.player.rage>=10&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BattleStance extends Aura{constructor(t,s){super(t,s,"Battle Stance"),this.stats={}}}class DefensiveStance extends Aura{constructor(t,s){super(t,s,"Defensive Stance"),this.mult_stats={dmgmod:-10,spelldmgmod:-10}}}class BerserkerStance extends Aura{constructor(t,s){super(t,s,"Berserker Stance"),this.stats={crit:3}}}class GladiatorStance extends Aura{constructor(t,s){super(t,s,"Gladiator Stance"),this.mult_stats={dmgmod:t.shield?10:0}}}class MightyRagePotion extends Aura{constructor(t,s){super(t,s,"Mighty Rage Potion"),this.stats={str:60},this.duration=20}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer);let e=this.player.rage;this.player.rage=Math.min(this.player.rage+~~rng(this.value1,this.value2),100),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&e<60&&this.player.rage>=60&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BloodFury extends Aura{constructor(t,s){super(t,s,"Blood Fury"),this.duration=15,this.mult_stats={baseapmod:25}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.timer=1500,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.timer&&step>=this.usestep}}class Berserking extends Aura{constructor(t,s){super(t,s),this.duration=10}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.rage-=5,this.player.updateHaste(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&this.player.rage>=5&&step>=this.usestep}}class Empyrean extends Aura{constructor(t,s){super(t,s),this.duration=10,this.mult_stats={haste:20},this.name="Empyrean Haste"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Eskhandar extends Aura{constructor(t,s){super(t,s),this.duration=5,this.mult_stats={haste:30},this.name="Eskhandar Haste"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Zeal extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={moddmgdone:10}}use(){this.player.timer&&this.player.timer<1500||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Annihilator extends Aura{constructor(t,s){super(t,s),this.duration=45,this.armor=200,this.stacks=0}use(){this.player.faeriefire||rng10k()2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Rivenspike extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=200,this.stacks=0}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=this.stacks>2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Bonereaver extends Aura{constructor(t,s){super(t,s),this.duration=10,this.armor=700,this.stacks=0}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=this.stacks>2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Destiny extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stats={str:200}}}class Untamed extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={str:300},this.name="The Untamed Blade"}}class Pummeler extends Aura{constructor(t,s){super(t,s),this.duration=30,this.mult_stats={haste:50},this.name="Manual Crowd Pummeler"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Windfury extends Aura{constructor(t,s){super(t,s),this.wfap&&(this.stats={ap:this.wfap}),this.wfapperc&&(this.mult_stats={apmod:this.wfapperc})}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1500,this.starttimer=step,this.mintime=step%batching,this.stacks=2,this.player.updateAP(),this.player.extraattacks++,this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stacks<2?(step=this.timer||0==this.stacks)&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Swarmguard extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=200,this.stacks=0,this.chance=~~(10*t.mh.speed/.006)}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stacks=0,this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}proc(){this.stacks=Math.min(this.stacks+1,6),this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} proc`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Flask extends Aura{constructor(t,s){super(t,s),this.duration=60,this.stats={str:75},this.name="Diamond Flask"}use(t,s=0){this.player.timer=1500,this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.timer&&!this.player.itemtimer&&step>=this.usestep}}class Slayer extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:260},this.name="Slayer's Crest"}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Spider extends Aura{constructor(t,s){super(t,s),this.duration=15,this.mult_stats={haste:20},this.name="Kiss of the Spider"}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Earthstrike extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:280}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Gabbar extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:65},this.name="Jom Gabbar"}use(t,s=0){this.stats.ap=65,this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){(step-this.starttimer)%2e3==0&&(this.stats.ap+=65,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} tick`)),step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class PrimalBlessing extends Aura{constructor(t,s){super(t,s,"Primal Blessing"),this.duration=12,this.stats={ap:300},this.cooldown=240,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class PrimalBlessing2 extends Aura{constructor(t,s){super(t,s,"Primal Blessing 2"),this.duration=12,this.stats={ap:300},this.cooldown=72,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class BloodrageAura extends Aura{constructor(t,s){super(t,s),this.duration=10,this.name="Bloodrage"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){return(step-this.starttimer)%1e3==0&&(this.player.rage=Math.min(this.player.rage+1,100),this.player.auras.consumedrage&&this.player.rage>=60&&this.player.rage<81&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} tick`)),step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`)),this.timer}}class Zandalarian extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={moddmgdone:40}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stats.moddmgdone=40,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stats.moddmgdone-=2,this.player.updateBonusDmg(),this.stats.moddmgdone<=0&&(this.timer=step,this.step())}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Avenger extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stats={ap:200},this.name="Argent Avenger"}}class BerserkerRageAura extends Aura{constructor(t,s){super(t,s),this.duration=10,this.name="Berserker Rage"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`))}}class BattleShout extends Aura{constructor(t,s){super(t,s),this.duration=120+36*this.player.talents.boomingvoice,this.cost=10-2*this.player.talents.boomingvoice,this.name="Battle Shout";let e=~~((this.player.level-this.minlevel)*this.value2);this.stats.ap=~~((this.value1+e+(this.player.enhancedbs?30:0))*(1+this.player.talents.impbattleshout))}use(t){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,t||(this.player.rage-=this.cost,this.player.timer=1500),this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage}}class ConsumedRage extends Aura{constructor(t,s){super(t,s,"Consumed by Rage"),this.duration=12}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Rend extends Aura{constructor(t,s){super(t,s);let e=3*this.value2;this.duration=Math.max(this.duration||e,e),this.cost=10-t.ragecostbonus,this.idmg=0,this.totaldmg=0,this.data=[0,0,0,0,0],this.canDodge=!0,this.nocrit=!0,this.dmgmod=1+this.player.talents.rendmod/100,this.tfbstep=-6e3,this.offensive=!0}step(){for(;step>=this.nexttick&&this.stacks;)this.idmg+=this.tickdmg,this.totaldmg+=this.tickdmg,this.player.logging&&this.player.log(`${this.name} tick for ${this.tickdmg.toFixed(2)}`),this.nexttick+=3e3,this.stacks--,this.stacks||(this.uptime+=step-this.starttimer,this.player.logging&&this.player.log(`${this.name} removed`)),this.player.tasteforblood&&this.tfbstep+6e3<=step&&(this.player.dodgetimer=9e3,this.tfbstep=step,this.player.logging&&this.player.log("Taste of Blood applied"));step>=this.timer&&(this.timer=0,this.firstuse=!1)}use(){let t=this.player.rollmeleespell(this);if(this.data[t]++,t==RESULT.MISS)return;if(t==RESULT.DODGE)return void(this.player.dodgetimer=5e3);this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+3e3,this.timer=step+1e3*this.duration,this.player.timer=1500,this.starttimer=step,this.stacks=this.value2,this.player.isValidStance("def",!0)||this.player.isValidStance("battle",!0)||this.player.switch("battle"),this.player.rage-=this.cost;let s=this.value1;this.player.bloodfrenzy&&(s+=this.value1+~~(.03*this.player.stats.ap*this.value2));let e=s*this.player.stats.dmgmod*this.dmgmod*this.player.bleedmod;this.tickdmg=e/this.value2,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&this.player.rage>=this.cost&&(this.player.isValidStance("battle",!0)||this.player.isValidStance("def",!0)||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("battle",!0)||this.player.isValidStance("def",!0)||this.player.rage<=this.maxrage)}end(){this.stacks&&(this.uptime+=step-this.starttimer),this.timer=0,this.stacks=0,this.tfbstep=-6e3}refresh(){this.timer=this.nexttick-3e3+1e3*this.duration,this.stacks=this.value2,this.player.logging&&this.player.log(`${this.name} refreshed`)}}class Vibroblade extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=100}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Ultrasonic extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=160}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class VoidMadness extends Aura{constructor(t,s){super(t,s,"Void Madness"),this.duration=10,this.mult_stats={haste:10}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class WeaponBleed extends Aura{constructor(t,s,e,i,r,a){super(t,s,"Weapon Bleed"+(a?" OH":" MH")),this.duration=parseInt(e)/1e3,this.interval=parseInt(i),this.ticks=e/i,this.dmg=parseInt(r)*this.player.bleedmod,this.idmg=0,this.totaldmg=0}step(){for(;step>=this.nexttick;)this.idmg+=this.dmg,this.totaldmg+=this.dmg,this.player.logging&&this.player.log(`${this.name} tick for ${this.dmg}`),this.nexttick+=this.interval;step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1)}use(){this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+this.interval,this.timer=step+1e3*this.duration,this.starttimer=step}}class Ragehammer extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={ap:20},this.mult_stats={haste:5}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BlisteringRagehammer extends Aura{constructor(t,s){super(t,s,"Blistering Ragehammer"),this.duration=15,this.stats={moddmgdone:30},this.mult_stats={haste:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Jackhammer extends Aura{constructor(t,s){super(t,s),this.duration=10,this.mult_stats={haste:30}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class LordGeneral extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={ap:50}}}class Stoneslayer extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={moddmgdone:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class CleaveArmor extends Aura{constructor(t,s){super(t,s),this.duration=20,this.armor=300}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class StrengthChampion extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={str:120}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class MildlyIrradiated extends Aura{constructor(t,s){super(t,s,"Mildly Irradiated"),this.duration=15,this.stats={ap:40}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class GyromaticAcceleration extends Aura{constructor(t,s){super(t,s,"Gyromatic Acceleration"),this.duration=20,this.mult_stats={haste:5}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class Spicy extends Aura{constructor(t,s){super(t,s,"Spicy!"),this.duration=30,this.mult_stats={haste:4}}use(){this.firstuse&&(this.timer=step+1e3*this.duration,this.starttimer=step,this.firstuse=!1,this.player.updateHaste(),this.player.updateHasteDamage(),this.player.attackproc1||(this.player.attackproc1={chance:500,magicdmg:7,spicy:!0}),this.player.attackproc2||(this.player.attackproc2={chance:500,magicdmg:7,spicy:!0}),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateHaste(),this.player.updateHasteDamage(),this.player.attackproc1&&this.player.attackproc1.spicy&&delete this.player.attackproc1,this.player.attackproc2&&this.player.attackproc2.spicy&&delete this.player.attackproc2,this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHasteDamage(),this.player.attackproc1&&this.player.attackproc1.spicy&&delete this.player.attackproc1,this.player.attackproc2&&this.player.attackproc2.spicy&&delete this.player.attackproc2}}class GneuroLogical extends Aura{constructor(t,s){super(t,s,"Gneuro-Logical Shock"),this.duration=10,this.mult_stats={haste:20}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class CoinFlip extends Aura{constructor(t,s){super(t,s,"Coin Flip"),this.duration=30,this.stats={crit:3}}use(t,s=0){this.firstuse=!1,this.alwaystails||(this.alwaysheads||rng10k()<5e3)&&(this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} Crit applied`))}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class Rampage extends Aura{constructor(t,s){super(t,s),this.duration=30,this.mult_stats={apmod:10},this.cooldown=120}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&this.player.isEnraged()&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class WreckingCrew extends Aura{constructor(t,s){super(t,s,"Wrecking Crew"),this.duration=12}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.mainspelldmg=1.1,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.mainspelldmg=1,this.player.logging&&this.player.log(`${this.name} removed`))}}class SerpentAscension extends Aura{constructor(t,s){super(t,s,"Serpent's Ascension"),this.duration=12,this.stats={ap:150},this.cooldown=120,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class VoodooFrenzy extends Aura{constructor(t,s){super(t,s,"Voodoo Frenzy"),this.duration=10,this.cooldown=40,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.stats.str>=this.player.stats.agi?this.stats={str:35}:this.stats={agi:35},this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} applied`))}}class RoarGuardian extends Aura{constructor(t,s){super(t,s,"Roar of the Guardian"),this.duration=20,this.stats={ap:70}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class RelentlessStrength extends Aura{constructor(t,s){super(t,s,"Relentless Strength"),this.duration=20,this.stats={moddmgdone:20}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stats.moddmgdone=20,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stats.moddmgdone-=1,this.player.updateBonusDmg(),this.stats.moddmgdone<=0&&(this.timer=step,this.step())}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class EchoesDread extends Aura{constructor(t,s){super(t,s,"Echoes of Dread"),this.duration=10,this.stats={ap:50},this.mult_stats={haste:5},this.cooldown=40,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`))}}class FreshMeat extends Aura{constructor(t,s){super(t,s,"Fresh Meat"),this.duration=12,this.mult_stats={dmgmod:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateDmgMod(),this.firstuse=!1,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class SuddenDeath extends Aura{constructor(t,s){super(t,s,"Sudden Death"),this.duration=10}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`))}remove(){this.uptime+=step-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`)}}class WarriorsResolve extends Aura{constructor(t,s){super(t,s,"Warrior's Resolve")}use(){let t=this.player.rage;this.player.rage=Math.min(this.player.rage+10,100),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} proc`)}}class EchoesBattle extends Aura{constructor(t,s){super(t,s,"Echoes of Battle Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesZerk extends Aura{constructor(t,s){super(t,s,"Echoes of Berserker Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesDef extends Aura{constructor(t,s){super(t,s,"Echoes of Defensive Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesGlad extends Aura{constructor(t,s){super(t,s,"Echoes of Gladiator Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class BattleForecast extends Aura{constructor(t,s){super(t,s,"Battle Forecast"),this.mult_stats={dmgmod:5},this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.gladforecast.remove(),this.player.logging&&this.player.log(`${this.name} applied`)}}class ZerkForecast extends Aura{constructor(t,s){super(t,s,"Berserker Forecast"),this.stats={crit:5},this.duration=15}}class DefForecast extends Aura{constructor(t,s){super(t,s,"Defensive Forecast"),this.duration=15}}class GladForecast extends Aura{constructor(t,s){super(t,s,"Gladiator Forecast"),this.mult_stats={dmgmod:5},this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.battleforecast.remove(),this.player.logging&&this.player.log(`${this.name} applied`)}}class DefendersResolve extends Aura{constructor(t,s){super(t,s,"Defender's Resolve"),this.duration=15}use(){this.stats={ap:4*this.player.stats.defense},this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class MeltArmor extends Aura{constructor(t,s){super(t,s,"Melt Armor"),this.duration=10,this.stats.moddmgtaken=10}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}}class SingleMinded extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stacks=0,this.mult_stats={haste:2}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=Math.min(5,this.stacks+1),this.mult_stats={haste:2*this.stacks},this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class DemonTaintedBlood extends Aura{constructor(t,s){super(t,s,"Demon-Tainted Blood"),this.duration=20,this.stats={str:80}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class MoonstalkerFury extends Aura{constructor(t,s){super(t,s,"Moonstalker Fury"),this.duration=15,this.stats={str:60}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class MagmadarsReturn extends Aura{constructor(t,s){super(t,s,"Magmadar's Return"),this.duration=12,this.mult_stats={haste:10},this.cooldown=60,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`))}}class JujuFlurry extends Aura{constructor(t,s){super(t,s,"Juju Flurry"),this.duration=20,this.cooldown=60,this.mult_stats={haste:3}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHasteDamage(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateHasteDamage(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHasteDamage()}}class WrathWray extends Aura{constructor(t,s){super(t,s,"Wrath of Wray"),this.duration=20,this.stats={str:92}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class CrusaderZeal extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={moddmgdone:15},this.mult_stats={haste:30},this.name="Crusader's Zeal"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class GrilekGuard extends Aura{constructor(t,s){super(t,s,"Gri'lek's Guard"),this.duration=20,this.stats={block:200}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}} \ No newline at end of file +class Spell{constructor(t,s,e){this.id=s,this.timer=0,this.cost=0,this.cooldown=0,this.player=t,this.refund=!0,this.canDodge=!0,this.totaldmg=0,this.data=[0,0,0,0,0],this.name=e||this.constructor.name,this.useonly=!1,this.maxdelay=this.player.reactionmin,this.weaponspell=!0,this.defenseType=DEFENSETYPE.MELEE,this.school=SCHOOL.PHYSICAL,this.minrage=0,this.offensive=!0;let i=spells.filter(t=>t.id==this.id)[0];i&&(i.minrageactive&&(this.minrage=parseInt(i.minrage)),i.maxrageactive&&(this.maxrage=parseInt(i.maxrage)),i.maincdactive&&(this.maincd=1e3*parseInt(i.maincd)),i.cooldown&&(this.cooldown=parseInt(i.cooldown)||0),i.durationactive&&(this.cooldown=Math.max(parseInt(i.duration),this.cooldown)),i.value1&&(this.value1=parseInt(i.value1)),i.value2&&(this.value2=parseInt(i.value2)),i.priorityapactive&&(this.priorityap=parseInt(i.priorityap)),i.consumedrage&&(this.consumedrage=i.consumedrage),i.unqueueactive&&(this.unqueue=parseInt(i.unqueue)),i.exmacro&&(this.exmacro=i.exmacro),i.globalsactive&&(this.globals=i.globals),i.afterswing&&(this.afterswing=i.afterswing),i.swingreset&&(this.swingreset=i.swingreset),i.timetoendactive&&(this.timetoend=1e3*parseInt(i.timetoend)),i.timetostartactive&&(this.timetostart=1e3*parseInt(i.timetostart)),i.zerkerpriority&&(this.zerkerpriority=i.zerkerpriority),i.swordboard&&(this.swordboard=i.swordboard),i.resolve&&(this.resolve=i.resolve),i.switchstart&&(this.switchstart=i.switchstart),i.switchtimeactive&&(this.switchtime=1e3*parseFloat(i.switchtime)),i.switchtimeactive&&(this.switchrage=parseInt(i.switchrage)),i.switchtimeactive&&(this.switchtimeactive=i.switchtimeactive),i.switchdefault&&(this.switchdefault=i.switchdefault),i.durationactive&&(this.duration=parseInt(i.duration)),i.swingtimeractive&&(this.swingtimer=1e3*parseFloat(i.swingtimer)),i.priority&&(this.priority=parseInt(i.priority)),i.expriority&&(this.expriority=parseInt(i.expriority)),i.switchechoesactive&&(this.switchechoestime=1e3*parseFloat(i.switchechoestime)),i.switchechoesactive&&(this.switchechoesswing=1e3*parseFloat(i.switchechoesswing)),i.switchechoesactive&&(this.switchechoesactive=i.switchechoesactive),i.switchoractive&&(this.switchortime=1e3*parseFloat(i.switchortime)),i.switchoractive&&(this.switchorrage=parseInt(i.switchorrage)),i.switchoractive&&(this.switchoractive=i.switchoractive),i.secondarystance&&(this.secondarystance=i.secondarystance))}dmg(){return 0}use(){this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}step(t){return this.timer<=t?(this.timer=0,this.player.logging&&this.player.log(`${this.name} off cooldown`)):this.timer-=t,this.timer}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}failed(){}}class Bloodthirst extends Spell{constructor(t,s){super(t,s),this.cost=30-t.ragecostbonus,this.cooldown=6,this.weaponspell=!1}dmg(){let t;return(t=.45*this.player.stats.ap)*this.player.stats.dmgmod*this.player.mainspelldmg}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}}class Whirlwind extends Spell{constructor(t,s){super(t,s),this.cost=25-t.ragecostbonus-(t.whirlwindcost||0),this.cooldown=10,this.refund=!1}dmg(){let t;return this.player.auras.consumedrage&&this.player.auras.consumedrage.timer&&(this.offhandhit=!0),t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){if(!this.player.isValidStance("zerk")){let t="zerk";this.player.switchdelay&&"glad"==this.player.stance&&(t="glad"==this.player.basestance?this.player.spells.unstoppablemight.secondarystance:this.player.basestance),this.player.switch(t)}this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(this.player.isValidStance("zerk")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("zerk")||this.player.rage<=this.maxrage)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Overpower extends Spell{constructor(t,s){super(t,s),this.cost=5-t.ragecostbonus,this.cooldown=5,this.canDodge=!1}dmg(){let t;return t=this.value1+rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){if(!this.player.isValidStance("battle")){let t="battle";this.player.switchdelay&&"glad"==this.player.stance&&(t="glad"==this.player.basestance?this.player.spells.unstoppablemight.secondarystance:this.player.basestance),this.player.switch(t)}this.player.timer=1500,this.player.dodgetimer=0,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.rage-=this.cost}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.dodgetimer&&(this.player.isValidStance("battle")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("battle")||this.player.rage<=this.maxrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Execute extends Spell{constructor(t,s){super(t,s),this.cost=15-t.talents.executecost-t.ragecostbonus,this.usedrage=0,this.totalusedrage=0,this.refund=!1,this.weaponspell=!1}dmg(){let t;return(t=this.value1+this.value2*this.usedrage)*this.player.stats.dmgmod}use(t){if(!this.player.isValidStance("zerk")&&!this.player.isValidStance("battle")){let t="zerk";this.player.switchdelay&&"glad"==this.player.stance?t="glad"==this.player.basestance?this.player.spells.unstoppablemight.secondarystance:this.player.basestance:"battle"==this.player.basestance?t="battle":this.player.spells.unstoppablemight&&"battle"==this.player.spells.unstoppablemight.secondarystance&&(t="battle"),this.player.switch(t)}t&&t.exmacro&&(t.canUse()?(this.player.cast(t),this.player.heroicdelay=0):t instanceof Cleave&&t.backupheroic&&t.backupheroic.canUse()&&(this.player.cast(t.backupheroic),this.player.heroicdelay=0)),this.player.timer=1500,this.player.rage-=this.cost,this.usedrage=~~this.player.rage,this.totalusedrage+=this.usedrage-(this.player.auras.suddendeath&&this.player.auras.suddendeath.timer?10:0),this.timer=1-step%1,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}step(t){return this.timer<=t?this.timer=0:this.timer-=t,this.timer}canUse(){return!this.player.timer&&this.cost<=this.player.rage&&(!this.swingtimer||this.player.mh.timer<=this.swingtimer)&&(!this.minrage||this.player.rage>=this.minrage)&&(step>=this.executestep||this.player.auras.suddendeath&&this.player.auras.suddendeath.timer)}}class Bloodrage extends Spell{constructor(t,s){super(t,s),this.cost=0,this.rage=10+t.talents.bloodragebonus,this.cooldown=60,this.useonly=!0,this.offensive=!1,"glad"==t.basestance&&t.gladbloodrage&&(this.cooldown-=30)}use(){this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.rage=Math.min(this.player.rage+this.rage,100),this.player.auras.bloodrage.use(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return!this.timer&&step>=this.usestep}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}}class HeroicStrike extends Spell{constructor(t,s){super(t,s,"Heroic Strike"),this.cost=15-t.talents.impheroicstrike-t.ragecostbonus,this.bonus=this.value1,this.useonly=!0,this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}use(){this.player.nextswinghs=!0,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.player.nextswinghs&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)&&(!this.unqueue||this.player.mh.timer>this.unqueuetimer)}}class Cleave extends Spell{constructor(t,s){if(super(t,s),this.cost=20-t.ragecostbonus,this.bonus=this.value1*(1+this.player.talents.cleavebonus/100),this.useonly=!0,this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax),this.exmacro)for(let s of spells){let e=parseInt(s.minlevel||0),i=parseInt(s.maxlevel||60);"Heroic Strike"==s.name&&t.level>=e&&t.level<=i&&(this.backupheroic=new HeroicStrike(t,s.id),this.backupheroic.exmacro=!0)}}use(){this.player.nextswinghs=!0,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.unqueuetimer=300+rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return!this.player.nextswinghs&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)&&(!this.unqueue||this.player.mh.timer>this.unqueuetimer)}}class MortalStrike extends Spell{constructor(t,s){super(t,s,"Mortal Strike"),this.cost=30-t.ragecostbonus,this.cooldown=6}dmg(){let t;return t=this.value1+rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod*this.player.mainspelldmg}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage}}class SunderArmor extends Spell{constructor(t,s){super(t,s,"Sunder Armor"),this.cost=15-t.talents.impsunderarmor-t.ragecostbonus,this.stacks=0,this.nocrit=!0}use(){this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.stacks=Math.min(6,this.stacks+1),(this.player.homunculi||this.player.exposed)&&(this.stacks=6),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}dmg(){if(!this.devastate)return 0;let t=1.5*(1+.1*(this.stacks-1));return((this.player.mh.mindmg+this.player.mh.maxdmg)/2+this.player.stats.ap/14*this.player.mh.speed)/this.player.mh.speed*t*this.player.stats.dmgmod}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&this.player.rage>=this.minrage&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.globals||this.stacks=this.minrage)&&(this.player.furiousthunder||this.player.isValidStance("battle"))}}class VictoryRush extends Spell{constructor(t,s){super(t,s,"Victory Rush"),this.cost=0,this.stacks=0,this.weaponspell=!1}use(){this.stacks++,this.player.timer=1500,this.player.rage-=this.cost,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}dmg(){let t;return(t=.45*this.player.stats.ap)*this.player.stats.dmgmod}canUse(){return!this.player.timer&&!this.stacks}}class RagingBlow extends Spell{constructor(t,s){super(t,s,"Raging Blow"),this.cost=0,this.cooldown=8}dmg(){let t;return t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}canUse(){return!this.timer&&!this.player.timer&&this.player.isEnraged()}reduce(t){this.timer&&this.player.isEnraged()&&t&&t!=this&&t.offensive&&(this.timer=Math.max(0,this.timer-1e3))}}class BerserkerRage extends Spell{constructor(t,s){super(t,s),this.cost=0,this.rage=t.talents.berserkerbonus,this.cooldown=30,this.useonly=!0,this.offensive=!1}use(){this.player.timer=1500,this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.isValidStance("zerk")||this.player.switch("zerk"),this.player.rage=Math.min(this.player.rage+this.rage,100),this.player.auras.berserkerrage.use(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return 0==this.timer&&!this.player.timer&&(!this.maxrage||this.player.isValidStance("zerk")||this.player.rage<=this.maxrage)}}class QuickStrike extends Spell{constructor(t,s){super(t,s,"Quick Strike"),this.cost=20-t.talents.impheroicstrike-t.ragecostbonus,this.cooldown=0}dmg(){let t,s=1;return t=~~rng(.25*this.player.stats.ap,.35*this.player.stats.ap)+this.player.stats.moddmgdone,this.player.heroicbonus&&(s=1.1),t*this.player.stats.dmgmod*s}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(!this.minrage&&!this.maincd||this.minrage&&this.player.rage>=this.minrage||this.maincd&&this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.maincd&&this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class RagePotion extends Spell{constructor(t,s){super(t,s,"Rage Potion"),this.cost=0,this.minrage=80,this.cooldown=120,this.useonly=!0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1e3*this.cooldown;let t=this.player.rage;this.player.rage=Math.min(this.player.rage+~~rng(this.value1,this.value2),100),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use()}canUse(){return 0==this.timer&&this.player.rage=this.usestep}}class Slam extends Spell{constructor(t,s){super(t,s),this.cost=15-t.ragecostbonus,this.casttime=t.precisetiming?0:1500-100*t.talents.impslam,this.cooldown=t.precisetiming?6:0,this.mhthreshold=0}dmg(t){let s;return t||(t=this.player.mh),s=this.value1+rng(t.mindmg+t.bonusdmg,t.maxdmg+t.bonusdmg),(s+=this.player.stats.ap/14*t.speed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.freeslam&&(this.offhandhit=!0),this.player.freeslam||(this.player.rage-=this.cost),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.casttime&&!this.player.freeslam&&(this.player.mh.use(),this.player.oh&&this.player.oh.use()),this.player.freeslam=!1,this.timer=1e3*this.cooldown,this.player.logging&&this.player.log(`${this.name} done casting`)}canUse(){return!this.timer&&!this.player.timer&&this.player.mh.timer>=this.mhthreshold&&(this.player.freeslam||this.cost<=this.player.rage)&&(!this.player.bloodsurge||this.player.freeslam)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class Fireball extends Spell{constructor(t,s){super(t,s),this.useonly=!0,this.proc={magicdmg:371},this.idmg=0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1;let t=this.player.magicproc(this.proc);this.idmg+=t,this.player.logging&&this.player.log(`Fireball hit for ${t}`)}canUse(){return!this.timer&&step>=this.usestep}}class GunAxe extends Spell{constructor(t,s){super(t,s),this.useonly=!0,this.proc={magicdmg:225},this.idmg=0,this.offensive=!1}prep(t){return void 0!==this.timetoend&&(this.usestep=Math.max(t-this.timetoend,0)),void 0!==this.timetostart&&(this.usestep=this.timetostart),0}use(){this.timer=1;let t=this.player.magicproc(this.proc);this.idmg+=t,this.player.logging&&this.player.log(`Gun Axe hit for ${t}`)}canUse(){return!this.timer&&step>=this.usestep}}class BlademasterFury extends Spell{constructor(t,s){super(t,s,"Blademaster's Fury"),this.cooldown=120}dmg(){let t;return t=rng(this.player.mh.mindmg+this.player.mh.bonusdmg,this.player.mh.maxdmg+this.player.mh.bonusdmg),(t+=this.player.stats.ap/14*this.player.mh.normSpeed+this.player.stats.moddmgdone)*this.player.stats.dmgmod}use(){this.player.timer=1500,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.spells.whirlwind&&(this.player.spells.whirlwind.timer=0,this.player.logging&&this.player.log(`${this.player.spells.whirlwind.name} off cooldown`))}canUse(){return!this.timer&&!this.player.timer&&(!this.player.spells.whirlwind||this.player.spells.whirlwind.timer>0)}}class ShieldSlam extends Spell{constructor(t,s){super(t,s,"Shield Slam"),this.cost=20-t.ragecostbonus,t.items.includes(231350)&&(this.cost-=5),this.cooldown=6-(t.shieldslamcd||0),this.duration&&(this.cooldown=Math.max(this.cooldown,this.duration)),this.swordboard&&(this.cost=0)}dmg(){let t,s=this.player.stats.ap+(this.player.auras.defendersresolve&&!this.player.auras.defendersresolve.timer?4*this.player.stats.defense:0);return(t=rng(this.value1,this.value2)+2*this.player.stats.block+~~(.15*s))*this.player.stats.dmgmod*this.player.mainspelldmg}use(){this.player.timer=1500,this.player.freeshieldslam||(this.player.rage-=this.cost),this.timer=1e3*this.cooldown,this.player.freeshieldslam=!1,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return this.player.shield&&!this.timer&&!this.player.timer&&(this.player.freeshieldslam||this.cost<=this.player.rage)&&(this.player.freeshieldslam||this.player.rage>=this.minrage)&&(!this.resolve||this.player.auras.defendersresolve&&!this.player.auras.defendersresolve.timer)&&(!this.swordboard||this.player.freeshieldslam)}}class Shockwave extends Spell{constructor(t,s){super(t,s),this.cost=15-t.ragecostbonus,this.cooldown=20,this.canDodge=!1}dmg(){return this.player.stats.ap/2*this.player.stats.dmgmod}use(){this.player.isValidStance("def")||this.player.switch("def"),this.player.timer=1500,this.player.rage-=this.cost,this.timer=1e3*this.cooldown,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax)}canUse(){return this.player.shield&&!this.timer&&!this.player.timer&&this.cost<=this.player.rage&&(this.player.isValidStance("def")||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("def")||this.player.rage<=this.maxrage)&&(!this.minrage||this.player.rage>=this.minrage)&&(!this.maincd||this.player.spells.bloodthirst&&this.player.spells.bloodthirst.timer>=this.maincd||this.player.spells.mortalstrike&&this.player.spells.mortalstrike.timer>=this.maincd)}}class TheMoltenCore extends Spell{constructor(t,s){super(t,s,"The Molten Core"),this.useonly=!0,this.proc={magicdmg:20},this.idmg=0,this.offensive=!1}use(){let t=this.player.magicproc(this.proc);for(let s=0;s=60&&this.player.auras.consumedrage.use()}canUse(){return!this.player.itemtimer&&!this.timer&&step>=this.usestep}}class Aura{constructor(t,s,e){this.id=s,this.timer=0,this.starttimer=0,this.stats={},this.mult_stats={},this.player=t,this.firstuse=!0,this.duration=0,this.stacks=0,this.uptime=0,this.name=e||this.constructor.name,this.maxdelay=this.player.reactionmin,this.useonly=!0,this.offensive=!1;let i=spells.filter(t=>t.id==this.id)[0];i||(i=buffs.filter(t=>t.id==this.id)[0]),i&&(i.durationactive&&(this.duration=parseInt(i.duration)),i.timetoendactive&&(this.timetoend=1e3*parseInt(i.timetoend)),i.timetostartactive&&(this.timetostart=1e3*parseInt(i.timetostart)),i.crusaders&&(this.crusaders=parseInt(i.crusaders)),i.haste&&(this.mult_stats={haste:parseInt(i.haste)}),i.value1&&(this.value1=i.value1),i.value2&&(this.value2=i.value2),i.minlevel&&(this.minlevel=i.minlevel),i.procblock&&(this.procblock=i.procblock),i.rageblockactive&&(this.rageblock=parseInt(i.rageblock)),i.erageblockactive&&(this.erageblock=parseInt(i.erageblock)),i.chargeblockactive&&(this.chargeblock=parseInt(i.chargeblock)),i.echargeblockactive&&(this.echargeblock=parseInt(i.echargeblock)),i.wfap&&(this.wfap=parseInt(i.wfap)),i.wfapperc&&(this.wfapperc=parseInt(i.wfapperc)),i.alwaystails&&(this.alwaystails=i.alwaystails),i.alwaysheads&&(this.alwaysheads=i.alwaysheads),i.item&&(this.item=i.item),i.noitemcd&&(this.noitemcd=i.noitemcd),i.maxrageactive&&(this.maxrage=parseInt(i.maxrage)),i.priority&&(this.priority=parseInt(i.priority)),i.expriority&&(this.expriority=parseInt(i.expriority)))}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0}prep(t,s){if(void 0!==this.timetostart&&(this.usestep=this.timetostart),void 0!==this.timetoend){if(this.item&&!this.noitemcd)return this.usestep=Math.max(Math.min(t-this.timetoend,t-s-1e3*this.duration),0),1e3*this.duration;this.usestep=Math.max(t-this.timetoend,0)}return 0}remove(){this.timer&&(this.uptime+=step-this.starttimer,this.timer=0,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Recklessness extends Aura{constructor(t,s){super(t,s),this.duration=12,this.stats={crit:"sod"==this.player.mode?50:100},this.cooldown="sod"==this.player.mode?300:1800}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.player.timer=1500,this.starttimer=step,this.player.isValidStance("zerk")||this.player.switch("zerk"),this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Flurry extends Aura{constructor(t,s){super(t,s),this.duration=12,this.mult_stats={haste:t.talents.flurry}}proc(){this.stacks--,this.stacks||(this.uptime+=step-this.starttimer,this.timer=0,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}use(){this.timer=1,this.stacks||(this.starttimer=step,this.player.updateHaste()),this.stacks=3,this.player.logging&&this.player.log(`${this.name} applied`)}}class DeepWounds extends Aura{constructor(t,s,e){super(t,s,"Deep Wounds"+(e?" "+e:"")),this.duration=12,this.idmg=0,this.totaldmg=0,this.saveddmg=0,this.ticksleft=0}tickdmg(t){let s,e;t?(s=this.player.oh.mindmg+this.player.oh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.oh.speed,e=this.player.oh.maxdmg+this.player.oh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.oh.speed):(s=this.player.mh.mindmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed,e=this.player.mh.maxdmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed);let i=(s+e)/2;return i*=(t?this.player.oh.modifier:this.player.mh.modifier)*this.player.stats.dmgmod*this.player.talents.deepwounds*this.player.bleedmod}step(){for(;step>=this.nexttick;){this.player.stepauras(!0);let t=this.saveddmg/this.ticksleft;this.saveddmg-=t,this.idmg+=t,this.totaldmg+=t,this.ticksleft--,this.player.logging&&this.player.log(`${this.name} tick for ${t.toFixed(2)}`),this.nexttick+=3e3}step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.nexttick=0,this.firstuse=!1,this.saveddmg=0,this.player.logging&&this.player.log(`${this.name} removed`))}use(t){this.timer&&(this.uptime+=step-this.starttimer),this.ticksleft=4,this.saveddmg+=this.tickdmg(t),this.nexttick?this.timer=this.nexttick-3e3+1e3*this.duration:(this.nexttick=step+3e3,this.timer=step+1e3*this.duration),this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class OldDeepWounds extends Aura{constructor(t,s,e){super(t,s,"Deep Wounds"+(e?" "+e:"")),this.duration=12,this.idmg=0,this.totaldmg=0}step(){for(;step>=this.nexttick;){let t=(this.player.mh.mindmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed+(this.player.mh.maxdmg+this.player.mh.bonusdmg+this.player.stats.moddmgdone+this.player.stats.ap/14*this.player.mh.speed))/2;t*=this.player.mh.modifier*this.player.stats.dmgmod*this.player.talents.deepwounds*this.player.bleedmod,this.idmg+=t/4,this.totaldmg+=t/4,this.player.logging&&this.player.log(`${this.name} tick for ${(t/4).toFixed(2)}`),this.nexttick+=3e3}step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1)}use(){this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+3e3,this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class Crusader extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={str:100}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Cloudkeeper extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={ap:100}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.player.itemtimer&&!this.timer&&step>=this.usestep}}class Felstriker extends Aura{constructor(t,s){super(t,s),this.duration=3,this.stats={crit:100,hit:100}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.update(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.update(),this.player.logging&&this.player.log(`${this.name} removed`))}}class DeathWish extends Aura{constructor(t,s){super(t,s,"Death Wish"),this.duration=30,this.mult_stats={dmgmod:20},this.cooldown=180}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.player.rage-=10,this.player.timer=1500,this.starttimer=step-s,this.player.updateDmgMod(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&this.player.rage>=10&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BattleStance extends Aura{constructor(t,s){super(t,s,"Battle Stance"),this.stats={}}}class DefensiveStance extends Aura{constructor(t,s){super(t,s,"Defensive Stance"),this.mult_stats={dmgmod:-10,spelldmgmod:-10}}}class BerserkerStance extends Aura{constructor(t,s){super(t,s,"Berserker Stance"),this.stats={crit:3}}}class GladiatorStance extends Aura{constructor(t,s){super(t,s,"Gladiator Stance"),this.mult_stats={dmgmod:t.shield?10:0}}}class MightyRagePotion extends Aura{constructor(t,s){super(t,s,"Mighty Rage Potion"),this.stats={str:60},this.duration=20}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer);let e=this.player.rage;this.player.rage=Math.min(this.player.rage+~~rng(this.value1,this.value2),100),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.consumedrage&&e<60&&this.player.rage>=60&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BloodFury extends Aura{constructor(t,s){super(t,s,"Blood Fury"),this.duration=15,this.mult_stats={baseapmod:25}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.timer=1500,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.timer&&step>=this.usestep}}class Berserking extends Aura{constructor(t,s){super(t,s),this.duration=10}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.rage-=5,this.player.updateHaste(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&this.player.rage>=5&&step>=this.usestep}}class Empyrean extends Aura{constructor(t,s){super(t,s),this.duration=10,this.mult_stats={haste:20},this.name="Empyrean Haste"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Eskhandar extends Aura{constructor(t,s){super(t,s),this.duration=5,this.mult_stats={haste:30},this.name="Eskhandar Haste"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Zeal extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={moddmgdone:10}}use(){this.player.timer&&this.player.timer<1500||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Annihilator extends Aura{constructor(t,s){super(t,s),this.duration=45,this.armor=200,this.stacks=0}use(){this.player.faeriefire||rng10k()2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Rivenspike extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=200,this.stacks=0}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=this.stacks>2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Bonereaver extends Aura{constructor(t,s){super(t,s),this.duration=10,this.armor=700,this.stacks=0}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=this.stacks>2?3:this.stacks+1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Destiny extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stats={str:200}}}class Untamed extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={str:300},this.name="The Untamed Blade"}}class Pummeler extends Aura{constructor(t,s){super(t,s),this.duration=30,this.mult_stats={haste:50},this.name="Manual Crowd Pummeler"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Windfury extends Aura{constructor(t,s){super(t,s),this.wfap&&(this.stats={ap:this.wfap}),this.wfapperc&&(this.mult_stats={apmod:this.wfapperc})}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1500,this.starttimer=step,this.mintime=step%batching,this.stacks=2,this.player.updateAP(),this.player.extraattacks++,this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stacks<2?(step=this.timer||0==this.stacks)&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Swarmguard extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=200,this.stacks=0,this.chance=~~(10*t.mh.speed/.006)}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stacks=0,this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}proc(){this.stacks=Math.min(this.stacks+1,6),this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} proc`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.firstuse=!1,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Flask extends Aura{constructor(t,s){super(t,s),this.duration=60,this.stats={str:75},this.name="Diamond Flask"}use(t,s=0){this.player.timer=1500,this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.timer&&!this.player.itemtimer&&step>=this.usestep}}class Slayer extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:260},this.name="Slayer's Crest"}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Spider extends Aura{constructor(t,s){super(t,s),this.duration=15,this.mult_stats={haste:20},this.name="Kiss of the Spider"}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Earthstrike extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:280}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class Gabbar extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={ap:65},this.name="Jom Gabbar"}use(t,s=0){this.stats.ap=65,this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){(step-this.starttimer)%2e3==0&&(this.stats.ap+=65,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} tick`)),step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class PrimalBlessing extends Aura{constructor(t,s){super(t,s,"Primal Blessing"),this.duration=12,this.stats={ap:300},this.cooldown=240,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class PrimalBlessing2 extends Aura{constructor(t,s){super(t,s,"Primal Blessing 2"),this.duration=12,this.stats={ap:300},this.cooldown=72,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class BloodrageAura extends Aura{constructor(t,s){super(t,s),this.duration=10,this.name="Bloodrage"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){return(step-this.starttimer)%1e3==0&&(this.player.rage=Math.min(this.player.rage+1,100),this.player.auras.consumedrage&&this.player.rage>=60&&this.player.rage<81&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} tick`)),step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`)),this.timer}}class Zandalarian extends Aura{constructor(t,s){super(t,s),this.duration=20,this.stats={moddmgdone:40}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stats.moddmgdone=40,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stats.moddmgdone-=2,this.player.updateBonusDmg(),this.stats.moddmgdone<=0&&(this.timer=step,this.step())}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Avenger extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stats={ap:200},this.name="Argent Avenger"}}class BerserkerRageAura extends Aura{constructor(t,s){super(t,s),this.duration=10,this.name="Berserker Rage"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`))}}class BattleShout extends Aura{constructor(t,s){super(t,s),this.duration=120+36*this.player.talents.boomingvoice,this.cost=10-2*this.player.talents.boomingvoice,this.name="Battle Shout";let e=~~((this.player.level-this.minlevel)*this.value2);this.stats.ap=~~((this.value1+e+(this.player.enhancedbs?30:0))*(1+this.player.talents.impbattleshout))}use(t){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,t||(this.player.rage-=this.cost,this.player.timer=1500),this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return!this.timer&&!this.player.timer&&this.cost<=this.player.rage}}class ConsumedRage extends Aura{constructor(t,s){super(t,s,"Consumed by Rage"),this.duration=12}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Rend extends Aura{constructor(t,s){super(t,s);let e=3*this.value2;this.duration=Math.max(this.duration||e,e),this.cost=10-t.ragecostbonus,this.idmg=0,this.totaldmg=0,this.data=[0,0,0,0,0],this.canDodge=!0,this.nocrit=!0,this.dmgmod=1+this.player.talents.rendmod/100,this.tfbstep=-6e3,this.offensive=!0}step(){for(;step>=this.nexttick&&this.stacks;)this.idmg+=this.tickdmg,this.totaldmg+=this.tickdmg,this.player.logging&&this.player.log(`${this.name} tick for ${this.tickdmg.toFixed(2)}`),this.nexttick+=3e3,this.stacks--,this.stacks||(this.uptime+=step-this.starttimer,this.player.logging&&this.player.log(`${this.name} removed`)),this.player.tasteforblood&&this.tfbstep+6e3<=step&&(this.player.dodgetimer=9e3,this.tfbstep=step,this.player.logging&&this.player.log("Taste of Blood applied"));step>=this.timer&&(this.timer=0,this.firstuse=!1)}use(){let t=this.player.rollmeleespell(this);if(this.data[t]++,t==RESULT.MISS)return;if(t==RESULT.DODGE)return void(this.player.dodgetimer=5e3);if(this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+3e3,this.timer=step+1e3*this.duration,this.player.timer=1500,this.starttimer=step,this.stacks=this.value2,!this.player.isValidStance("def",!0)&&!this.player.isValidStance("battle",!0)){let t="battle";this.player.switchdelay&&"glad"==this.player.stance&&(t="glad"==this.player.basestance?this.player.spells.unstoppablemight.secondarystance:this.player.basestance),this.player.switch(t)}this.player.rage-=this.cost;let s=this.value1;this.player.bloodfrenzy&&(s+=this.value1+~~(.03*this.player.stats.ap*this.value2));let e=s*this.player.stats.dmgmod*this.dmgmod*this.player.bleedmod;this.tickdmg=e/this.value2,this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&!this.player.timer&&this.player.rage>=this.cost&&(this.player.isValidStance("battle",!0)||this.player.isValidStance("def",!0)||this.player.talents.rageretained>=this.cost)&&(!this.maxrage||this.player.isValidStance("battle",!0)||this.player.isValidStance("def",!0)||this.player.rage<=this.maxrage)}end(){this.stacks&&(this.uptime+=step-this.starttimer),this.timer=0,this.stacks=0,this.tfbstep=-6e3}refresh(){this.timer=this.nexttick-3e3+1e3*this.duration,this.stacks=this.value2,this.player.logging&&this.player.log(`${this.name} refreshed`)}}class Vibroblade extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=100}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class Ultrasonic extends Aura{constructor(t,s){super(t,s),this.duration=30,this.armor=160}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class VoidMadness extends Aura{constructor(t,s){super(t,s,"Void Madness"),this.duration=10,this.mult_stats={haste:10}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class WeaponBleed extends Aura{constructor(t,s,e,i,r,a){super(t,s,"Weapon Bleed"+(a?" OH":" MH")),this.duration=parseInt(e)/1e3,this.interval=parseInt(i),this.ticks=e/i,this.dmg=parseInt(r)*this.player.bleedmod,this.idmg=0,this.totaldmg=0}step(){for(;step>=this.nexttick;)this.idmg+=this.dmg,this.totaldmg+=this.dmg,this.player.logging&&this.player.log(`${this.name} tick for ${this.dmg}`),this.nexttick+=this.interval;step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1)}use(){this.timer&&(this.uptime+=step-this.starttimer),this.nexttick=step+this.interval,this.timer=step+1e3*this.duration,this.starttimer=step}}class Ragehammer extends Aura{constructor(t,s){super(t,s),this.duration=15,this.stats={ap:20},this.mult_stats={haste:5}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class BlisteringRagehammer extends Aura{constructor(t,s){super(t,s,"Blistering Ragehammer"),this.duration=15,this.stats={moddmgdone:30},this.mult_stats={haste:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class Jackhammer extends Aura{constructor(t,s){super(t,s),this.duration=10,this.mult_stats={haste:30}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class LordGeneral extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={ap:50}}}class Stoneslayer extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={moddmgdone:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class CleaveArmor extends Aura{constructor(t,s){super(t,s),this.duration=20,this.armor=300}use(){this.player.faeriefire||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateArmorReduction(),this.player.logging&&this.player.log(`${this.name} removed`))}}class StrengthChampion extends Aura{constructor(t,s){super(t,s),this.duration=30,this.stats={str:120}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}}class MildlyIrradiated extends Aura{constructor(t,s){super(t,s,"Mildly Irradiated"),this.duration=15,this.stats={ap:40}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class GyromaticAcceleration extends Aura{constructor(t,s){super(t,s,"Gyromatic Acceleration"),this.duration=20,this.mult_stats={haste:5}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class Spicy extends Aura{constructor(t,s){super(t,s,"Spicy!"),this.duration=30,this.mult_stats={haste:4}}use(){this.firstuse&&(this.timer=step+1e3*this.duration,this.starttimer=step,this.firstuse=!1,this.player.updateHaste(),this.player.updateHasteDamage(),this.player.attackproc1||(this.player.attackproc1={chance:500,magicdmg:7,spicy:!0}),this.player.attackproc2||(this.player.attackproc2={chance:500,magicdmg:7,spicy:!0}),this.player.logging&&this.player.log(`${this.name} applied`))}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateHaste(),this.player.updateHasteDamage(),this.player.attackproc1&&this.player.attackproc1.spicy&&delete this.player.attackproc1,this.player.attackproc2&&this.player.attackproc2.spicy&&delete this.player.attackproc2,this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHasteDamage(),this.player.attackproc1&&this.player.attackproc1.spicy&&delete this.player.attackproc1,this.player.attackproc2&&this.player.attackproc2.spicy&&delete this.player.attackproc2}}class GneuroLogical extends Aura{constructor(t,s){super(t,s,"Gneuro-Logical Shock"),this.duration=10,this.mult_stats={haste:20}}use(t,s=0){this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class CoinFlip extends Aura{constructor(t,s){super(t,s,"Coin Flip"),this.duration=30,this.stats={crit:3}}use(t,s=0){this.firstuse=!1,this.alwaystails||(this.alwaysheads||rng10k()<5e3)&&(this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} Crit applied`))}canUse(){return this.firstuse&&!this.timer&&step>=this.usestep}}class Rampage extends Aura{constructor(t,s){super(t,s),this.duration=30,this.mult_stats={apmod:10},this.cooldown=120}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&this.player.isEnraged()&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class WreckingCrew extends Aura{constructor(t,s){super(t,s,"Wrecking Crew"),this.duration=12}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.mainspelldmg=1.1,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.mainspelldmg=1,this.player.logging&&this.player.log(`${this.name} removed`))}}class SerpentAscension extends Aura{constructor(t,s){super(t,s,"Serpent's Ascension"),this.duration=12,this.stats={ap:150},this.cooldown=120,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`))}}class VoodooFrenzy extends Aura{constructor(t,s){super(t,s,"Voodoo Frenzy"),this.duration=10,this.cooldown=40,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.stats.str>=this.player.stats.agi?this.stats={str:35}:this.stats={agi:35},this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} applied`))}}class RoarGuardian extends Aura{constructor(t,s){super(t,s,"Roar of the Guardian"),this.duration=20,this.stats={ap:70}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class RelentlessStrength extends Aura{constructor(t,s){super(t,s,"Relentless Strength"),this.duration=20,this.stats={moddmgdone:20}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.stats.moddmgdone=20,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}proc(){this.stats.moddmgdone-=1,this.player.updateBonusDmg(),this.stats.moddmgdone<=0&&(this.timer=step,this.step())}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class EchoesDread extends Aura{constructor(t,s){super(t,s,"Echoes of Dread"),this.duration=10,this.stats={ap:50},this.mult_stats={haste:5},this.cooldown=40,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateAP(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`))}}class FreshMeat extends Aura{constructor(t,s){super(t,s,"Fresh Meat"),this.duration=12,this.mult_stats={dmgmod:10}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateDmgMod(),this.firstuse=!1,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateDmgMod(),this.player.logging&&this.player.log(`${this.name} removed`))}}class SuddenDeath extends Aura{constructor(t,s){super(t,s,"Sudden Death"),this.duration=10}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`))}remove(){this.uptime+=step-this.starttimer,this.timer=0,this.player.logging&&this.player.log(`${this.name} removed`)}}class WarriorsResolve extends Aura{constructor(t,s){super(t,s,"Warrior's Resolve")}use(){let t=this.player.rage;this.player.rage=Math.min(this.player.rage+10,100),this.player.auras.consumedrage&&t<60&&this.player.rage>=60&&this.player.auras.consumedrage.use(),this.player.logging&&this.player.log(`${this.name} proc`)}}class EchoesBattle extends Aura{constructor(t,s){super(t,s,"Echoes of Battle Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesZerk extends Aura{constructor(t,s){super(t,s,"Echoes of Berserker Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesDef extends Aura{constructor(t,s){super(t,s,"Echoes of Defensive Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class EchoesGlad extends Aura{constructor(t,s){super(t,s,"Echoes of Gladiator Stance"),this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.logging&&this.player.log(`${this.name} applied`)}}class BattleForecast extends Aura{constructor(t,s){super(t,s,"Battle Forecast"),this.mult_stats={dmgmod:5},this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.gladforecast.remove(),this.player.logging&&this.player.log(`${this.name} applied`)}}class ZerkForecast extends Aura{constructor(t,s){super(t,s,"Berserker Forecast"),this.stats={crit:5},this.duration=15}}class DefForecast extends Aura{constructor(t,s){super(t,s,"Defensive Forecast"),this.duration=15}}class GladForecast extends Aura{constructor(t,s){super(t,s,"Gladiator Forecast"),this.mult_stats={dmgmod:5},this.duration=15}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAuras(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.auras.battleforecast.remove(),this.player.logging&&this.player.log(`${this.name} applied`)}}class DefendersResolve extends Aura{constructor(t,s){super(t,s,"Defender's Resolve"),this.duration=15}use(){this.stats={ap:4*this.player.stats.defense},this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateAP(),this.maxdelay=rng(this.player.reactionmin,this.player.reactionmax),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateAP(),this.player.logging&&this.player.log(`${this.name} removed`))}}class MeltArmor extends Aura{constructor(t,s){super(t,s,"Melt Armor"),this.duration=10,this.stats.moddmgtaken=10}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.player.updateBonusDmg(),this.player.logging&&this.player.log(`${this.name} removed`))}}class SingleMinded extends Aura{constructor(t,s){super(t,s),this.duration=10,this.stacks=0,this.mult_stats={haste:2}}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.stacks=Math.min(5,this.stacks+1),this.mult_stats={haste:2*this.stacks},this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}}class DemonTaintedBlood extends Aura{constructor(t,s){super(t,s,"Demon-Tainted Blood"),this.duration=20,this.stats={str:80}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class MoonstalkerFury extends Aura{constructor(t,s){super(t,s,"Moonstalker Fury"),this.duration=15,this.stats={str:60}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class MagmadarsReturn extends Aura{constructor(t,s){super(t,s,"Magmadar's Return"),this.duration=12,this.mult_stats={haste:10},this.cooldown=60,this.cooldowntimer=0}use(){this.cooldowntimer>step||(this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.cooldowntimer=step+1e3*this.cooldown,this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`))}}class JujuFlurry extends Aura{constructor(t,s){super(t,s,"Juju Flurry"),this.duration=20,this.cooldown=60,this.mult_stats={haste:3}}use(t,s=0){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateHasteDamage(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}canUse(){return!this.timer&&step>=this.usestep}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.usestep=this.starttimer+1e3*this.cooldown,this.player.updateHasteDamage(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateHasteDamage()}}class WrathWray extends Aura{constructor(t,s){super(t,s,"Wrath of Wray"),this.duration=20,this.stats={str:92}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateStrength(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}}class CrusaderZeal extends Aura{constructor(t,s){super(t,s),this.duration=8,this.stats={moddmgdone:15},this.mult_stats={haste:30},this.name="Crusader's Zeal"}use(){this.timer&&(this.uptime+=step-this.starttimer),this.timer=step+1e3*this.duration,this.starttimer=step,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateBonusDmg(),this.player.updateHaste(),this.player.logging&&this.player.log(`${this.name} removed`))}end(){this.uptime+=step-this.starttimer,this.timer=0,this.stacks=0,this.player.updateBonusDmg()}}class GrilekGuard extends Aura{constructor(t,s){super(t,s,"Gri'lek's Guard"),this.duration=20,this.stats={block:200}}use(t,s=0){this.player.itemtimer=1e3*this.duration-s,this.timer=step+1e3*this.duration-s,this.starttimer=step-s,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} applied`)}step(){step>=this.timer&&(this.uptime+=this.timer-this.starttimer,this.timer=0,this.firstuse=!1,this.player.updateAuras(),this.player.logging&&this.player.log(`${this.name} removed`))}canUse(){return this.firstuse&&!this.timer&&!this.player.itemtimer&&step>=this.usestep}} \ No newline at end of file diff --git a/dist/js/settings.min.js b/dist/js/settings.min.js index e6af5048..1fb67038 100644 --- a/dist/js/settings.min.js +++ b/dist/js/settings.min.js @@ -1 +1 @@ -var SIM=SIM||{};SIM.SETTINGS={init:function(){this.variables(),this.events(),this.buildSpells(),this.buildBuffs(),this.buildTalents(),this.buildRunes()},variables:function(){this.body=$("body"),this.buffs=this.body.find("article.buffs"),this.fight=this.body.find("article.fight"),this.rotation=this.body.find("article.rotation"),this.talents=this.body.find("article.talents"),this.filter=this.body.find("article.filter"),this.runes=this.body.find("article.runes"),this.close=this.body.find("section.settings .btn-close"),this.bg=this.body.find("section.sidebar .bg")},events:function(){var e=this;e.close.click(function(t){t.preventDefault(),$(".js-settings").removeClass("active"),$("section.settings").removeClass("active"),e.body.addClass("sidebar-mobile-open")}),e.buffs.on("click",".icon",function(t){let a=$(this).toggleClass("active");a.hasClass("active")&&(a.data("group")&&a.siblings().filter('[data-group="'+a.data("group")+'"]').removeClass("active"),a.data("disable-spell")&&$('.rotation [data-id="'+a.data("disable-spell")+'"]').removeClass("active"));for(let t of buffs)t.active=e.buffs.find('[data-id="'+t.id+'"]').hasClass("active");t.stopPropagation(),t.preventDefault(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.talents.on("click",".icon",function(t){let a=e.getTalent($(this));if(e.getTalentTotal($(this))<5*a.y)return;let i=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),s=parseInt(i.level),n=0;for(let e of talents)for(let t of e.t)n+=t.c;Math.max(s-9-n,0)<=0||(a.c=a.c=a.m&&$(this).addClass("maxed"),a.enable&&$('.rotation [data-id="'+a.enable+'"]').removeClass("hidden"),a.enablename&&$('.rotation [data-name="'+a.enablename+'"]').removeClass("hidden"),$(this).find("a").attr("href",WEB_DB_URL+"spell="+a.s[0==a.c?0:a.c-1]),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells())}),e.talents.on("contextmenu",".icon",function(t){t.preventDefault();let a=e.getTalent($(this));if(a.c<1)return;a.c--;let i=!0,s=[],n=$(this).parents("table").index()-2;for(let e of talents[n].t)s[e.y]=(s[e.y]||0)+e.c;for(let e=0;es[e.y-1]&&(i=!1);if(i){if($(this).attr("data-count",a.c),$(this).removeClass("maxed"),0==a.c&&a.enable){$('.rotation [data-id="'+a.enable+'"]').removeClass("active").addClass("hidden");for(let e of spells)e.id==a.enable&&(e.active=!1)}if(0==a.c&&a.enablename){$('.rotation [data-name="'+a.enablename+'"]').removeClass("active").addClass("hidden");for(let e of spells)e.name==a.enablename&&(e.active=!1)}$(this).find("a").attr("href",WEB_DB_URL+"spell="+a.s[0==a.c?0:a.c-1]),SIM.UI.updateSession(),SIM.UI.updateSidebar()}else a.c++}),e.talents.on("click",".js-talents-reset",function(t){t.preventDefault();for(let e of talents)for(let t of e.t)t.c=0;SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildTalents(),e.buildSpells()}),e.filter.on("click",".sources > li",function(t){if($(this).toggleClass("active"),$(this).hasClass("active")){let t=$(this).data("id");e.filter.find(`.phases [data-sources*="${t}"]`).addClass("active")}SIM.UI.updateSession(),SIM.UI.filterGear(),t.preventDefault()}),e.filter.on("click",".js-toggle, li ul",function(e){if(e.stopPropagation(),this.classList.contains("js-toggle")){var t=this.getAttribute("data-id");$("."+t).toggleClass("hidden")}}),e.filter.on("click",".phases li",function(t){$(this).toggleClass("active");let a=$(this).data("sources").split(","),i=$(this).hasClass("active");for(let t of a)i?e.filter.find('.sources [data-id="'+t+'"]').addClass("active"):e.filter.find('.sources [data-id="'+t+'"]').removeClass("active");SIM.UI.updateSession(),SIM.UI.filterGear()}),e.buffs.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.rotation.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.fight.on("click","label",function(e){$(this.parentElement).find("ul").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.talents.on("click","label",function(e){$(this.parentElement).find("table").toggleClass("hidden").end().find("#top").toggleClass("hidden top"),SIM.SETTINGS.toggleArticle(this)}),e.runes.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.filter.on("click","label",function(e){$(this.parentElement).find("ul").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.fight.on("input",".slider",function(e){var t=$(this).val();$(this).next().val(t),$(this).next().trigger("keyup")}),e.fight.on("change",'select[name="race"]',function(t){var a=$(this).val();e.bg.attr("data-race",a),t.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells()}),e.fight.on("change",'select[name="aqbooks"]',function(t){t.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells(),e.buildBuffs()}),e.fight.on("change",'select[name="bleedreduction"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("change",'select[name="spellqueueing"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("keyup",'input[type="text"]',function(t){t.stopPropagation(),e.body.find('.active[data-type="profiles"]').length||SIM.UI.filterGear(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildBuffs(),e.buildSpells()}),e.fight.on("change",'select[name="batching"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("input",'input[name="targetcustomarmor"]',function(e){e.stopPropagation();let t=$('select[name="targetbasearmor"]').get(0);t.options[t.options.length-1].innerHTML=$(this).val(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("change",'select[name="targetbasearmor"]',function(e){e.stopPropagation();let t=$('input[name="targetcustomarmor"]');this.selectedOptions[0].dataset.custom?(this.selectedOptions[0].innerHTML="",t.val(0),t.addClass("focus"),t.focus()):(this.options[this.options.length-1].innerHTML="Custom Value",t.val(""),t.removeClass("focus")),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.rotation.on("click",".spell a",function(t){t.stopPropagation(),t.preventDefault();let a=$(this).closest(".spell"),i=a.data("id");a.toggleClass("open"),a.removeClass("fade");let s=a.hasClass("open");s?(a.siblings().addClass("fade"),a.siblings(".open").each(function(){$(this).removeClass("open"),e.hideSpellDetails($(this))})):a.siblings().removeClass("fade");for(let t of spells)t.id==i&&(s?e.buildSpellDetails(t,a):e.hideSpellDetails(a))}),e.rotation.on("click",".details li:not(.nobox)",function(t){if("LI"!==t.target.nodeName)return;$(this).toggleClass("active");let a,i=$(this).hasClass("active"),s=$(this).parents(".details").data("id");for(let e of spells)e.id==s&&(a=e);if("active"==$(this).data("id")||"timetoendactive"==$(this).data("id")||"timetostartactive"==$(this).data("id")){if(t.originalEvent&&t.originalEvent.isTrusted&&e.rotation.find(`.spell[data-id="${s}"]`).toggleClass("active",i),i&&"Heroic Strike"==a.name)for(let t of spells)"Cleave"==t.name&&t.active&&(t.active=!1,e.rotation.find(`.spell[data-id="${t.id}"]`).removeClass("active"));if(i&&"Cleave"==a.name)for(let t of spells)"Heroic Strike"==t.name&&t.active&&(t.active=!1,e.rotation.find(`.spell[data-id="${t.id}"]`).removeClass("active"))}i&&$(this).data("group")&&$(this).siblings(`.active[data-group="${$(this).data("group")}"]`).click(),a[$(this).data("id")]=i,t.originalEvent&&t.originalEvent.isTrusted&&("timetoendactive"==$(this).data("id")||"timetostartactive"==$(this).data("id"))&&(a.active=i),SIM.UI.updateSession()}),e.rotation.on("keyup",".details input",function(e){let t=$(this).parents(".details").data("id");for(let e of spells)e.id==t&&(e[$(this).attr("name")]=$(this).val());SIM.UI.updateSession()}),e.rotation.on("change",".details select",function(e){let t=$(this).parents(".details").data("id");for(let e of spells)e.id==t&&(e[$(this).attr("name")]=$(this).val());SIM.UI.updateSession()})},buildSpells:function(){let e=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),t=parseInt(e.level),a=this.rotation.find("div:first");a.empty(),this.rotation.find(".open")&&this.hideSpellDetails(this.rotation.find(".open"));let i="",s="";for(let n of spells){if(n.sod&&"sod"!==mode){n.active=!1;continue}if(26296==n.id&&"Troll"!==e.race){n.active=!1;continue}if(20572==n.id&&"Orc"!==e.race){n.active=!1;continue}let l,o,d=parseInt(n.minlevel||0),r=parseInt(n.maxlevel||60);if(tr){n.active=!1;continue}for(let e of talents)for(let t of e.t)t.n==n.name&&(l=t);if(l&&l.enable&&0==l.c){n.active=!1;continue}if("undefined"!=typeof runes){for(let e in runes)for(let t of runes[e])t.enable==n.id&&(o=t);if(o&&!o.selected){n.active=!1;continue}}else if(n.rune){n.active=!1;continue}if(0==e.adjacent&&"Cleave"==n.name){n.active=!1;continue}if("Yes"==e.aqbooks&&void 0!==n.aq&&!1===n.aq){n.active=!1;continue}if("No"==e.aqbooks&&n.aq){n.active=!1;continue}if(n.item){let e;for(let t in gear)for(let a of gear[t])n.id==a.id&&a.selected&&(e=a);if(!e){n.active=!1;continue}(n.timetoendactive||n.timetostartactive)&&(n.active=!0)}if(n.itemblock){let e=0,t=[226499,226497,226494,226495,226493,226492,226498,226496,232251,232249,232254,232247,232252,232248,232250,232253];for(let a in gear)for(let i of gear[a])i.selected&&t.includes(i.id)&&e++;if(e<6){n.active=!1;continue}n.active=!0}let c=$(`
\n ${n.name}\n \n
`);n.buff?i+=c[0].outerHTML:n.item||n.itemblock?s+=c[0].outerHTML:a.append(c)}a.append($('
Buffs
')),a.append(i),s.length>0&&(a.append($('
Items
')),a.append(s))},buildSpellDetails(e,t){let a=this.rotation.find(".details");a.data("id",e.id),a.empty(),a.append(``);let i=$("
    ");void 0!==e.haste&&i.append(`
  • Attack speed set at %
  • `),void 0!==e.priority&&i.append(`
  • Priority
  • `),void 0!==e.expriority&&i.append(`
  • Execute phase
  • `),void 0!==e.timetoend||e.noactiveoption||i.append(`
  • Enabled
  • `),void 0!==e.afterswing&&i.append(`
  • Use only after a swing reset
  • `),void 0!==e.minrage&&11597!=e.id&&i.append(`
  • ${"Heroic Strike"==e.name?"Queue":"Use"} when above rage
  • `),void 0!==e.minrage&&11597==e.id&&i.append(`
  • Only use when above rage
  • `),void 0!==e.maxrage&&i.append(`
  • Don't switch stance when above rage
  • `),void 0!==e.maincd&&i.append(`
  • Don't ${"Heroic Strike"==e.name?"queue":"use"} if BT / MS cooldown shorter than seconds
  • `),void 0!==e.duration&&i.append(`
  • Only use every seconds
  • `),void 0!==e.unqueue&&i.append(`
  • Unqueue if below rage before MH swing
  • `),void 0!==e.exmacro&&i.append(`
  • Always queue when casting Execute
  • `),void 0!==e.timetostart&&i.append(`
  • Use seconds from the start of the fight
  • `),void 0!==e.timetoend&&i.append(`
  • Use seconds from the end of the fight
  • `),void 0!==e.priorityap&&i.append(`
  • Don't use if Attack Power is higher than
  • `),void 0!==e.procblock&&i.append(`
  • Don't use rage until it procs
  • `),void 0!==e.rageblock&&i.append(`
  • Don't use rage below rage
  • `),void 0!==e.globals&&i.append(`
  • Only use on first globals
  • `),void 0!==e.chargeblock&&i.append(`
  • Don't use rage below CbR charges
  • `),void 0!==e.erageblock&&i.append(`
    Execute Phase:
  • Don't use rage below rage
  • `),void 0!==e.echargeblock&&i.append(`
  • Don't use rage below CbR charges
  • `),void 0!==e.alwaysheads&&i.append(`
  • Always heads
  • `),void 0!==e.alwaystails&&i.append(`
  • Always tails
  • `),void 0!==e.zerkerpriority&&i.append(`
  • Prioritize over Bloodrage
  • `),void 0!==e.resolve&&i.append(`
  • Only use if Defender's Resolve is not up
  • `),void 0!==e.swordboard&&i.append(`
  • Only use after a Sword & Board proc
  • `),void 0!==e.swingtimer&&i.append(`
  • Don't use if swing timer longer than secs
  • `),void 0!==e.secondarystance&&i.append(`
  • Secondary stance
  • `),void 0!==e.switchstart&&i.append(`
  • Switch stance at fight start
  • `),void 0!==e.switchtimeactive&&i.append(`
  • Switch if any Forecast shorter than secs AND rage below
  • `),void 0!==e.switchoractive&&i.append(`
  • Switch if any Forecast shorter than secs OR rage below
  • `),void 0!==e.switchdefault&&i.append(`
  • Switch back to default stance as soon as possible
  • `),a.css("visibility","hidden"),a.append(i);let s=a.height();setTimeout(function(){a.css("visibility",""),t.css("margin-bottom",s+30+"px"),a.css("top",t.position().top+74+"px"),a.addClass("visible")},200)},hideSpellDetails(e){this.rotation.find(".details").removeClass("visible"),e.css("margin-bottom","0px")},toggleArticle:function(e){e.classList.contains("active")?(e.classList.add("inactive"),e.classList.remove("active")):(e.classList.add("active"),e.classList.remove("inactive"))},buildBuffs:function(){this.buffs.empty(),this.buffs.append('');let e=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),t=parseInt(e.level),a="",i="",s="",n="",l="",o="";for(let d of buffs){let r,c=parseInt(d.minlevel||0),p=parseInt(d.maxlevel||60);if(tp){d.active=!1;continue}if("Yes"==e.aqbooks&&void 0!==d.aq&&!1===d.aq){d.active=!1;continue}if("No"==e.aqbooks&&d.aq){d.active=!1;continue}if("sod"!==mode&&d.sod){d.active=!1;continue}if("undefined"!=typeof runes){for(let e in runes)for(let t of runes[e])t.enable==d.id&&(r=t);if(r&&!r.selected){d.active=!1;continue}}else if(d.rune){d.active=!1;continue}let u=d.id;413479==d.id&&(u=412513);let f=d.spellid?"spell":"item",v=d.active?"active":"",h=d.group?`data-group="${d.group}"`:"",m=d.disableSpell?`data-disable-spell="${d.disableSpell}"`:"",g=`
    \n ${d.name}\n \n
    `;d.worldbuff?a+=g:d.stance?l+=g:d.consume?i+=g:d.other?s+=g:d.armor||d.improvedexposed?n+=g:d.skill?o+=g:this.buffs.append(g)}this.buffs.append('
    Consumables
    '),this.buffs.append(i),this.buffs.append('
    World Buffs
    '),this.buffs.append(a),this.buffs.append('
    Other
    '),this.buffs.append(s),this.buffs.append('
    Target\'s Armor (Current: )
    '),this.buffs.append(n),this.buffs.append('
    Default Stance
    '),this.buffs.append(l),this.buffs.append('
    Skill Specialization
    '),this.buffs.append(o),SIM.UI.updateSession(),SIM.UI.updateSidebar()},buildTalents:function(){this.talents.find("table").remove();for(let e of talents){let t=$('
    '+e.n+"
    ");for(let e=0;e<7;e++)t.prepend("");for(let a of e.t){let e=$('
    ');e.html(''+a.n+''),a.c>=a.m&&e.addClass("maxed"),e.append(`'),t.find("tr").eq(a.y).children().eq(a.x).append(e)}this.talents.append(t)}},buildRunes:function(){if("undefined"!=typeof runes){this.runes.find("#runes-area").empty();for(let e in runes)for(let t in runes[e]){let a=runes[e][t];a.enable&&a.selected&&this.rotation.find('[data-id="'+a.enable+'"]').removeClass("hidden"),a.enable&&!a.selected&&this.rotation.find('[data-id="'+a.enable+'"]').addClass("hidden"),a.selected&&a.gladstance&&this.buffs.find('[data-id="'+a.enable+'"]').removeClass("hidden"),!a.selected&&a.gladstance&&this.buffs.find('[data-id="'+a.enable+'"]').addClass("hidden")}var e=$("nav > ul > li").map(function(){return $(this).data("type")}).get();for(let t of e)if(runes.hasOwnProperty(t)){let e=$(""),a=$(""),i=$(``);for(let e=0;e"),n=$(`
    `),l=$(`
    `),o=a.id;413479==o&&(o=412513),l.html(`${a.name}`),l.append(``),n.append(l),s.append(n),i.append(s)}let s=$("
    "),n=$(``);s.append(n),e.append(s).append(i),a.append(e),this.runes.find("#runes-area").append(a),$("#move").mouseenter(function(){$(this).animate({top:300*Math.random()},100),$(this).animate({left:300*Math.random()},100)})}else;}},getTalent:function(e){let t=e.parents("table").index()-1,a=e.data("x"),i=e.data("y");for(let e of talents[t-1].t)if(e.x==a&&e.y==i)return e},getTalentTotal:function(e){let t=e.parents("table").index()-1,a=0;for(let e of talents[t-1].t)a+=parseInt(e.c);return a}}; \ No newline at end of file +var SIM=SIM||{};SIM.SETTINGS={init:function(){this.variables(),this.events(),this.buildSpells(),this.buildBuffs(),this.buildTalents(),this.buildRunes()},variables:function(){this.body=$("body"),this.buffs=this.body.find("article.buffs"),this.fight=this.body.find("article.fight"),this.rotation=this.body.find("article.rotation"),this.talents=this.body.find("article.talents"),this.filter=this.body.find("article.filter"),this.runes=this.body.find("article.runes"),this.close=this.body.find("section.settings .btn-close"),this.bg=this.body.find("section.sidebar .bg")},events:function(){var e=this;e.close.click(function(t){t.preventDefault(),$(".js-settings").removeClass("active"),$("section.settings").removeClass("active"),e.body.addClass("sidebar-mobile-open")}),e.buffs.on("click",".icon",function(t){let a=$(this).toggleClass("active");a.hasClass("active")&&(a.data("group")&&a.siblings().filter('[data-group="'+a.data("group")+'"]').removeClass("active"),a.data("disable-spell")&&$('.rotation [data-id="'+a.data("disable-spell")+'"]').removeClass("active"));for(let t of buffs)t.active=e.buffs.find('[data-id="'+t.id+'"]').hasClass("active");t.stopPropagation(),t.preventDefault(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.talents.on("click",".icon",function(t){let a=e.getTalent($(this));if(e.getTalentTotal($(this))<5*a.y)return;let i=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),s=parseInt(i.level),n=0;for(let e of talents)for(let t of e.t)n+=t.c;Math.max(s-9-n,0)<=0||(a.c=a.c=a.m&&$(this).addClass("maxed"),a.enable&&$('.rotation [data-id="'+a.enable+'"]').removeClass("hidden"),a.enablename&&$('.rotation [data-name="'+a.enablename+'"]').removeClass("hidden"),$(this).find("a").attr("href",WEB_DB_URL+"spell="+a.s[0==a.c?0:a.c-1]),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells())}),e.talents.on("contextmenu",".icon",function(t){t.preventDefault();let a=e.getTalent($(this));if(a.c<1)return;a.c--;let i=!0,s=[],n=$(this).parents("table").index()-2;for(let e of talents[n].t)s[e.y]=(s[e.y]||0)+e.c;for(let e=0;es[e.y-1]&&(i=!1);if(i){if($(this).attr("data-count",a.c),$(this).removeClass("maxed"),0==a.c&&a.enable){$('.rotation [data-id="'+a.enable+'"]').removeClass("active").addClass("hidden");for(let e of spells)e.id==a.enable&&(e.active=!1)}if(0==a.c&&a.enablename){$('.rotation [data-name="'+a.enablename+'"]').removeClass("active").addClass("hidden");for(let e of spells)e.name==a.enablename&&(e.active=!1)}$(this).find("a").attr("href",WEB_DB_URL+"spell="+a.s[0==a.c?0:a.c-1]),SIM.UI.updateSession(),SIM.UI.updateSidebar()}else a.c++}),e.talents.on("click",".js-talents-reset",function(t){t.preventDefault();for(let e of talents)for(let t of e.t)t.c=0;SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildTalents(),e.buildSpells()}),e.filter.on("click",".sources > li",function(t){if($(this).toggleClass("active"),$(this).hasClass("active")){let t=$(this).data("id");e.filter.find(`.phases [data-sources*="${t}"]`).addClass("active")}SIM.UI.updateSession(),SIM.UI.filterGear(),t.preventDefault()}),e.filter.on("click",".js-toggle, li ul",function(e){if(e.stopPropagation(),this.classList.contains("js-toggle")){var t=this.getAttribute("data-id");$("."+t).toggleClass("hidden")}}),e.filter.on("click",".phases li",function(t){$(this).toggleClass("active");let a=$(this).data("sources").split(","),i=$(this).hasClass("active");for(let t of a)i?e.filter.find('.sources [data-id="'+t+'"]').addClass("active"):e.filter.find('.sources [data-id="'+t+'"]').removeClass("active");SIM.UI.updateSession(),SIM.UI.filterGear()}),e.buffs.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.rotation.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.fight.on("click","label",function(e){$(this.parentElement).find("ul").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.talents.on("click","label",function(e){$(this.parentElement).find("table").toggleClass("hidden").end().find("#top").toggleClass("hidden top"),SIM.SETTINGS.toggleArticle(this)}),e.runes.on("click","label",function(e){$(this.parentElement).find("div").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.filter.on("click","label",function(e){$(this.parentElement).find("ul").toggleClass("hidden"),SIM.SETTINGS.toggleArticle(this)}),e.fight.on("input",".slider",function(e){var t=$(this).val();$(this).next().val(t),$(this).next().trigger("keyup")}),e.fight.on("change",'select[name="race"]',function(t){var a=$(this).val();e.bg.attr("data-race",a),t.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells()}),e.fight.on("change",'select[name="aqbooks"]',function(t){t.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildSpells(),e.buildBuffs()}),e.fight.on("change",'select[name="bleedreduction"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("change",'select[name="spellqueueing"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("keyup",'input[type="text"]',function(t){t.stopPropagation(),e.body.find('.active[data-type="profiles"]').length||SIM.UI.filterGear(),SIM.UI.updateSession(),SIM.UI.updateSidebar(),e.buildBuffs(),e.buildSpells()}),e.fight.on("change",'select[name="batching"]',function(e){e.stopPropagation(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("input",'input[name="targetcustomarmor"]',function(e){e.stopPropagation();let t=$('select[name="targetbasearmor"]').get(0);t.options[t.options.length-1].innerHTML=$(this).val(),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.fight.on("change",'select[name="targetbasearmor"]',function(e){e.stopPropagation();let t=$('input[name="targetcustomarmor"]');this.selectedOptions[0].dataset.custom?(this.selectedOptions[0].innerHTML="",t.val(0),t.addClass("focus"),t.focus()):(this.options[this.options.length-1].innerHTML="Custom Value",t.val(""),t.removeClass("focus")),SIM.UI.updateSession(),SIM.UI.updateSidebar()}),e.rotation.on("click",".spell a",function(t){t.stopPropagation(),t.preventDefault();let a=$(this).closest(".spell"),i=a.data("id");a.toggleClass("open"),a.removeClass("fade");let s=a.hasClass("open");s?(a.siblings().addClass("fade"),a.siblings(".open").each(function(){$(this).removeClass("open"),e.hideSpellDetails($(this))})):a.siblings().removeClass("fade");for(let t of spells)t.id==i&&(s?e.buildSpellDetails(t,a):e.hideSpellDetails(a))}),e.rotation.on("click",".details li:not(.nobox)",function(t){if("LI"!==t.target.nodeName)return;$(this).toggleClass("active");let a,i=$(this).hasClass("active"),s=$(this).parents(".details").data("id");for(let e of spells)e.id==s&&(a=e);if("active"==$(this).data("id")||"timetoendactive"==$(this).data("id")||"timetostartactive"==$(this).data("id")){if(t.originalEvent&&t.originalEvent.isTrusted&&e.rotation.find(`.spell[data-id="${s}"]`).toggleClass("active",i),i&&"Heroic Strike"==a.name)for(let t of spells)"Cleave"==t.name&&t.active&&(t.active=!1,e.rotation.find(`.spell[data-id="${t.id}"]`).removeClass("active"));if(i&&"Cleave"==a.name)for(let t of spells)"Heroic Strike"==t.name&&t.active&&(t.active=!1,e.rotation.find(`.spell[data-id="${t.id}"]`).removeClass("active"))}i&&$(this).data("group")&&$(this).siblings(`.active[data-group="${$(this).data("group")}"]`).click(),a[$(this).data("id")]=i,t.originalEvent&&t.originalEvent.isTrusted&&("timetoendactive"==$(this).data("id")||"timetostartactive"==$(this).data("id"))&&(a.active=i),SIM.UI.updateSession()}),e.rotation.on("keyup",".details input",function(e){let t=$(this).parents(".details").data("id");for(let e of spells)e.id==t&&(e[$(this).attr("name")]=$(this).val());SIM.UI.updateSession()}),e.rotation.on("change",".details select",function(e){let t=$(this).parents(".details").data("id");for(let e of spells)e.id==t&&(e[$(this).attr("name")]=$(this).val());SIM.UI.updateSession()})},buildSpells:function(){let e=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),t=parseInt(e.level),a=this.rotation.find("div:first");a.empty(),this.rotation.find(".open")&&this.hideSpellDetails(this.rotation.find(".open"));let i="",s="";for(let n of spells){if(n.sod&&"sod"!==mode){n.active=!1;continue}if(26296==n.id&&"Troll"!==e.race){n.active=!1;continue}if(20572==n.id&&"Orc"!==e.race){n.active=!1;continue}let l,o,d=parseInt(n.minlevel||0),r=parseInt(n.maxlevel||60);if(tr){n.active=!1;continue}for(let e of talents)for(let t of e.t)t.n==n.name&&(l=t);if(l&&l.enable&&0==l.c){n.active=!1;continue}if("undefined"!=typeof runes){for(let e in runes)for(let t of runes[e])t.enable==n.id&&(o=t);if(o&&!o.selected){n.active=!1;continue}}else if(n.rune){n.active=!1;continue}if(0==e.adjacent&&"Cleave"==n.name){n.active=!1;continue}if("Yes"==e.aqbooks&&void 0!==n.aq&&!1===n.aq){n.active=!1;continue}if("No"==e.aqbooks&&n.aq){n.active=!1;continue}if(n.item){let e;for(let t in gear)for(let a of gear[t])n.id==a.id&&a.selected&&(e=a);if(!e){n.active=!1;continue}(n.timetoendactive||n.timetostartactive)&&(n.active=!0)}if(n.itemblock){let e=0,t=[226499,226497,226494,226495,226493,226492,226498,226496,232251,232249,232254,232247,232252,232248,232250,232253];for(let a in gear)for(let i of gear[a])i.selected&&t.includes(i.id)&&e++;if(e<4){n.active=!1;continue}n.active=!0}let c=$(`
    \n ${n.name}\n \n
    `);n.buff?i+=c[0].outerHTML:n.item||n.itemblock?s+=c[0].outerHTML:a.append(c)}a.append($('
    Buffs
    ')),a.append(i),s.length>0&&(a.append($('
    Items
    ')),a.append(s))},buildSpellDetails(e,t){let a=this.rotation.find(".details");a.data("id",e.id),a.empty(),a.append(``);let i=$("
      ");void 0!==e.haste&&i.append(`
    • Attack speed set at %
    • `),void 0!==e.priority&&i.append(`
    • Priority
    • `),void 0!==e.expriority&&i.append(`
    • Execute phase
    • `),void 0!==e.timetoend||e.noactiveoption||i.append(`
    • Enabled
    • `),void 0!==e.afterswing&&i.append(`
    • Use only after a swing reset
    • `),void 0!==e.minrage&&11597!=e.id&&i.append(`
    • ${"Heroic Strike"==e.name?"Queue":"Use"} when above rage
    • `),void 0!==e.minrage&&11597==e.id&&i.append(`
    • Only use when above rage
    • `),void 0!==e.maxrage&&i.append(`
    • Don't switch stance when above rage
    • `),void 0!==e.maincd&&i.append(`
    • Don't ${"Heroic Strike"==e.name?"queue":"use"} if BT / MS cooldown shorter than seconds
    • `),void 0!==e.duration&&i.append(`
    • Only use every seconds
    • `),void 0!==e.unqueue&&i.append(`
    • Unqueue if below rage before MH swing
    • `),void 0!==e.exmacro&&i.append(`
    • Always queue when casting Execute
    • `),void 0!==e.timetostart&&i.append(`
    • Use seconds from the start of the fight
    • `),void 0!==e.timetoend&&i.append(`
    • Use seconds from the end of the fight
    • `),void 0!==e.priorityap&&i.append(`
    • Don't use if Attack Power is higher than
    • `),void 0!==e.procblock&&i.append(`
    • Don't use rage until it procs
    • `),void 0!==e.rageblock&&i.append(`
    • Don't use rage below rage
    • `),void 0!==e.globals&&i.append(`
    • Only use on first globals
    • `),void 0!==e.chargeblock&&i.append(`
    • Don't use rage below CbR charges
    • `),void 0!==e.erageblock&&i.append(`
      Execute Phase:
    • Don't use rage below rage
    • `),void 0!==e.echargeblock&&i.append(`
    • Don't use rage below CbR charges
    • `),void 0!==e.alwaysheads&&i.append(`
    • Always heads
    • `),void 0!==e.alwaystails&&i.append(`
    • Always tails
    • `),void 0!==e.zerkerpriority&&i.append(`
    • Prioritize over Bloodrage
    • `),void 0!==e.resolve&&i.append(`
    • Only use if Defender's Resolve is not up
    • `),void 0!==e.swordboard&&i.append(`
    • Only use after a Sword & Board proc
    • `),void 0!==e.swingtimer&&i.append(`
    • Don't use if swing timer longer than secs
    • `),void 0!==e.secondarystance&&i.append(`
    • Secondary stance
    • `),void 0!==e.switchstart&&i.append(`
    • Switch stance at fight start
    • `),void 0!==e.switchtimeactive&&i.append(`
    • Switch if any Forecast shorter than secs AND rage below
    • `),void 0!==e.switchoractive&&i.append(`
    • Switch if any Forecast shorter than secs OR rage below
    • `),void 0!==e.switchdefault&&i.append(`
    • Switch back to default stance as soon as possible
    • `),a.css("visibility","hidden"),a.append(i);let s=a.height();setTimeout(function(){a.css("visibility",""),t.css("margin-bottom",s+30+"px"),a.css("top",t.position().top+74+"px"),a.addClass("visible")},200)},hideSpellDetails(e){this.rotation.find(".details").removeClass("visible"),e.css("margin-bottom","0px")},toggleArticle:function(e){e.classList.contains("active")?(e.classList.add("inactive"),e.classList.remove("active")):(e.classList.add("active"),e.classList.remove("inactive"))},buildBuffs:function(){this.buffs.empty(),this.buffs.append('');let e=JSON.parse(localStorage[mode+(globalThis.profileid||0)]),t=parseInt(e.level),a="",i="",s="",n="",l="",o="";for(let d of buffs){let r,c=parseInt(d.minlevel||0),p=parseInt(d.maxlevel||60);if(tp){d.active=!1;continue}if("Yes"==e.aqbooks&&void 0!==d.aq&&!1===d.aq){d.active=!1;continue}if("No"==e.aqbooks&&d.aq){d.active=!1;continue}if("sod"!==mode&&d.sod){d.active=!1;continue}if("undefined"!=typeof runes){for(let e in runes)for(let t of runes[e])t.enable==d.id&&(r=t);if(r&&!r.selected){d.active=!1;continue}}else if(d.rune){d.active=!1;continue}let u=d.id;413479==d.id&&(u=412513);let f=d.spellid?"spell":"item",v=d.active?"active":"",h=d.group?`data-group="${d.group}"`:"",m=d.disableSpell?`data-disable-spell="${d.disableSpell}"`:"",g=`
      \n ${d.name}\n \n
      `;d.worldbuff?a+=g:d.stance?l+=g:d.consume?i+=g:d.other?s+=g:d.armor||d.improvedexposed?n+=g:d.skill?o+=g:this.buffs.append(g)}this.buffs.append('
      Consumables
      '),this.buffs.append(i),this.buffs.append('
      World Buffs
      '),this.buffs.append(a),this.buffs.append('
      Other
      '),this.buffs.append(s),this.buffs.append('
      Target\'s Armor (Current: )
      '),this.buffs.append(n),this.buffs.append('
      Default Stance
      '),this.buffs.append(l),this.buffs.append('
      Skill Specialization
      '),this.buffs.append(o),SIM.UI.updateSession(),SIM.UI.updateSidebar()},buildTalents:function(){this.talents.find("table").remove();for(let e of talents){let t=$('
      ${t.toString().charAt(0).toUpperCase()}${t.slice(1).toString().replace("1","")}
      '+e.n+"
      ");for(let e=0;e<7;e++)t.prepend("");for(let a of e.t){let e=$('
      ');e.html(''+a.n+''),a.c>=a.m&&e.addClass("maxed"),e.append(`'),t.find("tr").eq(a.y).children().eq(a.x).append(e)}this.talents.append(t)}},buildRunes:function(){if("undefined"!=typeof runes){this.runes.find("#runes-area").empty();for(let e in runes)for(let t in runes[e]){let a=runes[e][t];a.enable&&a.selected&&this.rotation.find('[data-id="'+a.enable+'"]').removeClass("hidden"),a.enable&&!a.selected&&this.rotation.find('[data-id="'+a.enable+'"]').addClass("hidden"),a.selected&&a.gladstance&&this.buffs.find('[data-id="'+a.enable+'"]').removeClass("hidden"),!a.selected&&a.gladstance&&this.buffs.find('[data-id="'+a.enable+'"]').addClass("hidden")}var e=$("nav > ul > li").map(function(){return $(this).data("type")}).get();for(let t of e)if(runes.hasOwnProperty(t)){let e=$(""),a=$(""),i=$(``);for(let e=0;e"),n=$(`
      `),l=$(`
      `),o=a.id;413479==o&&(o=412513),l.html(`${a.name}`),l.append(``),n.append(l),s.append(n),i.append(s)}let s=$("
      "),n=$(``);s.append(n),e.append(s).append(i),a.append(e),this.runes.find("#runes-area").append(a),$("#move").mouseenter(function(){$(this).animate({top:300*Math.random()},100),$(this).animate({left:300*Math.random()},100)})}else;}},getTalent:function(e){let t=e.parents("table").index()-1,a=e.data("x"),i=e.data("y");for(let e of talents[t-1].t)if(e.x==a&&e.y==i)return e},getTalentTotal:function(e){let t=e.parents("table").index()-1,a=0;for(let e of talents[t-1].t)a+=parseInt(e.c);return a}}; \ No newline at end of file diff --git a/js/classes/spell.js b/js/classes/spell.js index 411e9e25..d89dc4cf 100644 --- a/js/classes/spell.js +++ b/js/classes/spell.js @@ -114,7 +114,12 @@ class Whirlwind extends Spell { return dmg * this.player.stats.dmgmod; } use() { - if (!this.player.isValidStance('zerk')) this.player.switch('zerk'); + if (!this.player.isValidStance('zerk')) { + let stance = 'zerk'; + if (this.player.switchdelay && this.player.stance == 'glad') + stance = this.player.basestance == 'glad' ? this.player.spells.unstoppablemight.secondarystance : this.player.basestance; + this.player.switch(stance); + } this.player.timer = 1500; this.player.rage -= this.cost; this.timer = this.cooldown * 1000; @@ -145,7 +150,13 @@ class Overpower extends Spell { return dmg * this.player.stats.dmgmod; } use() { - if (!this.player.isValidStance('battle')) this.player.switch('battle'); + if (!this.player.isValidStance('battle')) { + let stance = 'battle'; + if (this.player.switchdelay && this.player.stance == 'glad') + stance = this.player.basestance == 'glad' ? this.player.spells.unstoppablemight.secondarystance : this.player.basestance; + this.player.switch(stance); + } + this.player.timer = 1500; this.player.dodgetimer = 0; this.timer = this.cooldown * 1000; @@ -178,10 +189,12 @@ class Execute extends Spell { } use(delayedheroic) { if (!this.player.isValidStance('zerk') && !this.player.isValidStance('battle')) { - let newstance = 'zerk'; - if (this.player.basestance == 'battle') newstance = 'battle'; - else if (this.player.spells.unstoppablemight && this.player.spells.unstoppablemight.secondarystance == 'battle') newstance = 'battle'; - this.player.switch(newstance); + let stance = 'zerk'; + if (this.player.switchdelay && this.player.stance == 'glad') + stance = this.player.basestance == 'glad' ? this.player.spells.unstoppablemight.secondarystance : this.player.basestance; + else if (this.player.basestance == 'battle') stance = 'battle'; + else if (this.player.spells.unstoppablemight && this.player.spells.unstoppablemight.secondarystance == 'battle') stance = 'battle'; + this.player.switch(stance); } // HS + Execute macro @@ -1940,11 +1953,14 @@ class Rend extends Aura { this.starttimer = step; this.stacks = this.value2; - if (!this.player.isValidStance('def', true) && !this.player.isValidStance('battle', true)) - this.player.switch('battle'); + if (!this.player.isValidStance('def', true) && !this.player.isValidStance('battle', true)) { + let stance = 'battle'; + if (this.player.switchdelay && this.player.stance == 'glad') + stance = this.player.basestance == 'glad' ? this.player.spells.unstoppablemight.secondarystance : this.player.basestance; + this.player.switch(stance); + } this.player.rage -= this.cost; - let basedmg = this.value1; if (this.player.bloodfrenzy) basedmg += this.value1 + ~~(this.player.stats.ap * 0.03 * this.value2); diff --git a/js/settings.js b/js/settings.js index 5dc59f6b..a2a13b96 100644 --- a/js/settings.js +++ b/js/settings.js @@ -468,7 +468,7 @@ SIM.SETTINGS = { for (let type in gear) for (let g of gear[type]) if (g.selected && items.includes(g.id)) count++; - if (count < 6) { + if (count < 4) { spell.active = false; continue; }
      ${t.toString().charAt(0).toUpperCase()}${t.slice(1).toString().replace("1","")}