local AddonName,SAO=... local Module="deathknight" local DK_SPEC_BLOOD=SAO.TALENT.SPEC_1 local DK_SPEC_FROST=SAO.TALENT.SPEC_2 local DK_SPEC_UNHOLY=SAO.TALENT.SPEC_3 local DK_STANCE_BLOOD=48263 local DK_STANCE_FROST=48266 local DK_STANCE_UNHOLY=48265 local bloodBoil=48721 local boneShield=49222 local darkTransformation=63560 local deathCoil=47541 local deathStrike=49998 local frostStrike=49143 local howlingBlast=49184 local icyTouch=45477 local obliterate=49020 local runeStrike=56815 local runeTap=48982 local soulReaperBlood=114866 local soulReaperFrost=130735 local soulReaperUnholy=130736 local bloodTap=45529 local bloodCharge=114851 local function useRuneStrike() SAO:CreateEffect( "rune_strike", SAO.WRATH, runeStrike, "counter", {useName=false} ) end local function useBoneShield() SAO:CreateEffect( "bone_shield", SAO.CATA + SAO.MOP, boneShield, "aura", { requireTalent=true, talent={ [SAO.CATA]=boneShield, [SAO.MOP]=DK_SPEC_BLOOD, }, actionUsable=true, combatOnly=true, button={stacks=-1,spellID=boneShield}, } ) end local function useRime() SAO:CreateEffect( "rime", SAO.WRATH + SAO.CATA + SAO.MOP, 59052, "aura", { talent={ [SAO.WRATH + SAO.CATA]=49188, [SAO.MOP]=59057, }, overlay={texture="rime",position="Top"}, buttons={ [SAO.WRATH]=howlingBlast, [SAO.CATA]={howlingBlast,icyTouch}, }, } ) end local function useKillingMachine() SAO:CreateEffect( "killing_machine", SAO.WRATH + SAO.CATA + SAO.MOP, 51124, "aura", { talent={ [SAO.WRATH + SAO.CATA]=51123, [SAO.MOP]=51128, }, overlay={texture="killing_machine",position="Left + Right (Flipped)"}, buttons={ [SAO.WRATH]={icyTouch,frostStrike,howlingBlast}, [SAO.CATA]={frostStrike,obliterate}, }, } ) end local function useCrimsonScourge() SAO:CreateEffect( "crimson_scourge", SAO.CATA + SAO.MOP, 81141, "aura", { talent={ [SAO.CATA]=81135, [SAO.MOP]=81136, }, overlay={texture="blood_boil",position="Left + Right (Flipped)"}, buttons={ [SAO.CATA]=bloodBoil, }, } ) end local function useDarkTransformation() SAO:CreateEffect( "dark_transformation", SAO.CATA + SAO.MOP, 93426, "native", { overlay={texture="dark_transformation",position="Top"}, buttons={ [SAO.CATA]=darkTransformation, } } ) end local function useSuddenDoom() SAO:CreateEffect( "sudden_doom", SAO.CATA + SAO.MOP, 81340, "aura", { talent={ [SAO.CATA]=81340, [SAO.MOP]=49530, }, overlay={texture="sudden_doom",position="Left + Right (Flipped)"}, buttons={ [SAO.CATA]=deathCoil, }, } ) end local function useWotn() SAO:CreateEffect( "wotn", SAO.CATA + SAO.MOP, 96171, "aura", { talent={ [SAO.CATA]=52284, [SAO.MOP]=81164, }, overlay={texture="necropolis",position="Top"}, buttons={ [SAO.CATA]=runeTap, }, } ) end local function useDarkSuccor() SAO:CreateEffect( "dark_succor", SAO.CATA + SAO.MOP, 101568, "aura", { useStance=true, stances={DK_STANCE_FROST,DK_STANCE_UNHOLY}, button=deathStrike, } ) end local function useBloodTap(self) if SAO.IsMoP()then local handler={ onAboutToApplyHash=function(hashCalculator) local mustRefresh=false local currentStacks=hashCalculator:getAuraStacks() if type(currentStacks)=='number' and currentStacks > 5 then hashCalculator:setAuraStacks(5) if hashCalculator.lastAuraStacks~=currentStacks then mustRefresh=true end end hashCalculator.lastAuraStacks=currentStacks return mustRefresh end, } SAO:CreateEffect( "blood_tap", SAO.MOP, bloodCharge, "aura", { button={stacks=5,spellID=bloodTap}, handler=handler, } ) end end local function useSoulReaper() local buttons={} local addSoulReaperButton=function(spellID,spec) table.insert(buttons,{spellID=spellID,itemSetEquipped=true,option={spellSubText=SAO:GetSpecNameFunction(spec),hideTalentText=true}}) table.insert(buttons,{spellID=spellID,itemSetEquipped=false,option=false}) end addSoulReaperButton(soulReaperBlood,1) addSoulReaperButton(soulReaperFrost,2) addSoulReaperButton(soulReaperUnholy,3) SAO:CreateEffect( "soul_reaper", SAO.MOP_AND_ONWARD, soulReaperUnholy, "execute", { execThreshold=35, useItemSet=true, itemSet={ items={95825,96569,95225,95826,96570,95226,96571,95227,95827,95828,96572,95228,96573,95829,95229}, minimum=4, }, buttons=buttons, handler={ onVariableChanged={ ItemSetEquipped=function(hashCalculator,oldValue,newValue,bucket) if newValue==true then SAO:Debug(Module, "Soul Reaper execute threshold increased to 45% thanks to item set") bucket:importExecute(45) else if oldValue~=nil then SAO:Debug(Module, "Soul Reaper execute threshold restored to 35% due to item set removal") end bucket:importExecute(35) end end, }, }, } ) end local function registerClass(self) useRuneStrike() useBoneShield() useWotn() useCrimsonScourge() useRime() useKillingMachine() useDarkTransformation() useSuddenDoom() useSoulReaper() useBloodTap() useDarkSuccor() end SAO.Class["DEATHKNIGHT"]={ ["Register"]=registerClass, }