-- Title: DIY Combat Engine -- Version: 2.4.2 -- Description: Combat Engine to help with skill rotations, and maintaining buffs/debuffs for maximizing DPS. -- Author: Ghost Wolf local WHITE = "|cffffffff" local SILVER = "|cffc0c0c0" local GREEN = "|cff00ff00" local LTBLUE = "|cffa0a0ff" function DIYCE_DebugSkills(skillList) DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Skill List:") for i,v in ipairs(skillList) do DEFAULT_CHAT_FRAME:AddMessage(SILVER.." ["..WHITE..i..SILVER.."]: "..LTBLUE.."\" "..WHITE..v.name..LTBLUE.."\" use = "..WHITE..(v.use and "true" or "false")) end DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------") end function DIYCE_DebugBuffList(buffList) DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Buff List:") for k,v in pairs(buffList) do -- We ignore numbered entries because both the ID and name -- are stored in the list. This avoids doubling the output. if type(k) ~= "number" then DEFAULT_CHAT_FRAME:AddMessage(SILVER.." ["..WHITE..k..SILVER.."]: "..LTBLUE.."id: "..WHITE..v.id..LTBLUE.." stack: "..WHITE..v.stack..LTBLUE.." time: "..WHITE..(v.time or "none")) end end DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------") end arrowTime = 0 SlotRWB = 16 --Action Bar Slot # for Rune War Bow SlotMNB = 17 --Action Bar Slot # for your Main Bow local g_lastaction = "" local g_cnt = 0 function CustomAction(action) if CD(action) then if IsShiftKeyDown() then Msg("- "..action) end g_lastaction = action CastSpellByName(action) return true else return false end end --The Potion function is for using in a macro either by itself or combined with the KillSequence function. --I used it with my Priest in combo with the PartyHealer Addon to make sure to use potions when I needed them most. function Potion(healthpot,manapot) local Skill = {} local i = 0 local phealth = PctH("player") local pctmana = PctM("player") healthpot = healthpot or 0 manapot = manapot or 0 Skill = { { name = "Action: "..healthpot, use = (phealth <= .70) }, { name = "Action: "..manapot, use = (pctmana <= .40) }, } MyCombat(Skill,arg1) end --The main function of DIYCE. function KillSequence(arg1, mode, healthpot, manapot, Healslot, foodslot, speedpot, ragepot, HoTslot) --arg1 = "v1" or "v2" for debugging --mode = used for various purposes, such as setting custom sections for specific situation. (IE: Seige War/PvP) --healthpot = # of actionbar slot for health potions --manapot = # of actionbar slot for mana potions --foodslot = # of actionbar slot for food (add more args for more foodslots if needed) local Skill = {} local Skill2 = {} local i = 0 -- Player and target status. local combat = GetPlayerCombatState() local enemy = UnitCanAttack("player","target") local EnergyBar1 = UnitMana("player") local EnergyBar2 = UnitSkill("player") local pctEB1 = PctM("player") local pctEB2 = PctS("player") local tbuffs = BuffList("target") local pbuffs = BuffList("player") local tDead = UnitIsDeadOrGhost("target") local behind = (not UnitIsUnit("player", "targettarget")) local melee = GetActionUsable(13) -- # is your melee range spell slot number local a1,a2,a3,a4,a5,ASon = GetActionInfo(14) -- # is your Autoshot slot number local ammo = (GetEquipSlotInfo(10) ~= nil) local _,_,_,_,RWB,_ = GetActionInfo( SlotRWB ) local _,_,_,_,MNB,_ = GetActionInfo( SlotMNB ) local phealth = PctH("player") local thealth = PctH("target") local LockedOn = UnitExists("target") local boss = UnitSex("target") > 2 local elite = UnitSex("target") == 2 local party = GetNumPartyMembers() >= 2 local PsiPoints, PsiStatus = GetSoulPoint() local zoneid = (GetZoneID() % 1000) local SeigeWar = (zoneid == 402) -- The "Seige War" Zone --Determine Class-Combo mainClass, subClass = UnitClassToken( "player" ) --main, second = UnitClass("player") --Silence Logic local tSpell,tTime,tElapsed = UnitCastingTime("target") local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1) --Substitute Logic (for R/S combo) local subThis = tSpell and subList[tSpell] and ((tTime - tElapsed) > 0.1) --Potion & Food Checks healthpot = healthpot or 0 manapot = manapot or 0 speedpot = speedpot or 0 foodslot = foodslot or 0 --Equipment and Pet Protection if phealth <= .04 then --SwapEquipmentItem() --Note: Remove the first double dash to re-enable equipment protection. for i=1,6 do if (IsPetSummoned(i) == true) then ReturnPet(i); end end end --Check for level 1 mobs, if it is, drop target and acquire a new one. if (LockedOn and (UnitLevel("target") < 2)) then TargetNearestEnemy() return end --Begin Player Skill Sequences --Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT, --Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR --Warlock = HARPSYN, Champion = PSYRON -- Class: Warrior/Mage if mainClass == "WARRIOR" and subClass == "MAGE" then local SurpriseAttack = GetActionUsable(14) --Potions and Buffs Skill = { { name = "Action: "..healthpot, use = (phealth <= .70) }, { name = "Survival Instinct", use = (phealth <= .30) and combat }, { name = "Sense of Danger", use = (phealth <= .30) and combat }, { name = "Action: "..manapot, use = (pctEB2 <= .40) }, --{ name = "Action: "..Healslot, use = (phealth < .70) and (not combat) and (not party) }, --{ name = "Action: "..HoTslot, use = (phealth < .80) and (not party) }, { name = "Intensification", use = (pctEB2 >= .05) and (not pbuffs["Intensification"]) and boss and enemy }, { name = "Aggressiveness", use = boss and enemy }, { name = "Electric Attack", use = (pctEB2 >= .05) and ((not pbuffs["Electric Attack"]) or (pbuffs["Electric Attack"].time <= 45)) }, } --Combat if enemy then Skill2 = { { name = "Silence", use = (silenceThis) }, { name = "Fireball", use = (pctEB2 >= .05) and (not Boss) and (not melee) }, { name = "Thunder Sword", use = (pctEB2 >= .05) and (not melee) }, { name = "Surprise Attack", use = SurpriseAttack }, { name = "Enraged", use = (EnergyBar1 <= 30) and (boss or elite) }, { name = "Electrical Rage", use = (EnergyBar1 >= 15) and (pctEB2 >=.05) and (not pbuffs["High Voltage III"]) }, { name = "Thunder Sword", use = (pctEB2 >= .05) }, { name = "Lightning's Touch", use = (pctEB2 >= .05) }, { name = "Attack", use = (thealth == 1) }, } end --Champion/Warlock elseif mainClass == "PSYRON" and subClass == "HARPSYN" then Skill = { --{ name = "Action: "..healthpot, use = (phealth <= .70) } --{ name = "Action: "..manapot, use = (pctEB2 <= .40) } { name = "Forge", use = (not pbuffs["Forge"]) }, { name = "Soul Forge Mystery", use = (not pbuffs["Soul Forge Mystery"]) }, { name = "Rune Growth", use = boss and (pbuffs["Punisher Form"]) }, { name = "Feedback Defense", use = boss and (pbuffs["Punisher Form"]) }, { name = "Action: 46", use = (not pbuffs["Indomitable Spirit"]) and (EnergyBar1 >= 20) }, --Indomitable Spirit --{ name = "Heart Collection Rune", use = (EnergyBar2 >= 35) and (not pbuffs["Heart Collection Rune"]) }, --{ name = "Action: 19", use = (not pbuffs["Unimaginable Salad"]) and (not pbuffs["Roast Leg of Lamb"]) }, -- Unimaginable Salad --{ name = "Dark Energy Punishment", use = boss and combat and (phealth >= .3) and (not pbuffs["Dark Energy Punishment"]) } } if enemy then -- Stack sayısını kontrol et (Disassembling Stage) local stackCount = 0 if tbuffs["Disassembling Stage"] then stackCount = tbuffs["Disassembling Stage"].stack or 0 end Skill2 = { { name = "Warp Charge", use = (not pbuffs["Warp Charge"]) and (EnergyBar2 >= 50) }, { name = "Endless Pulse", use = boss and (phealth >= .65) and (EnergyBar2 >=20) }, { name = "Rune Siphon", use = (EnergyBar2 >=20) and (EnergyBar1 >=5) }, { name = "Electrocution", use = (not tbuffs["Electrocution"]) and (EnergyBar1 >= 10) }, { name = "Dark Energy Strike", use = (pbuffs[621308]) }, { name = "Rune Overload", use = (EnergyBar1 >= 30) and (not pbuffs["Rune Overload"]) }, { name = "Rune Pulse", use = (pbuffs["Chain Drive"]) }, { name = "Energy Influx Strike", use = (EnergyBar1 >= 15) and (tbuffs["Electrocution"]) }, { name = "Fearless Blow", use = true }, { name = "Action:11", use = (stackCount == 2) }, { name = "Action:10", use = true }, { name = "Heavy Bash", use = (EnergyBar1 <= 35) and (pbuffs["Rune Overload"]) }, { name = "Heavy Bash", use = (EnergyBar1 <= 15) }, { name = "Dark Energy Strike", use = true }, { name = "Attack", use = (thealth > 0) }, } end --Class: Knight/Priest elseif mainClass == "KNIGHT" and subClass == "AUGUR" then local LKBR = GetActionUsable(20) -- # is Lion King Battle Roar spell slot number --Potions and buffs Skill = { { name = "Enhanced Armor", use = (pctEB1 >= .05) and ((not pbuffs["Enhanced Armor"]) or (pbuffs["Enhanced Armor"].time <= 45)) }, { name = "Threaten", use = (pctEB1 >= .05) and ((not pbuffs["Threaten"]) or (pbuffs["Threaten"].time <= 45)) }, { name = "Regenerate", use = (pctEB1 >= .05) and ((not pbuffs["Regenerate"]) or (pbuffs["Regenerate"].time <= 3)) }, } --Combat if enemy then Skill2 = { { name = "Truth Shield Bash", use = boss and (pbuffs["Holy Power Explosion"]) }, { name = "Whirlwind Shield", use = true }, { name = "Holy Smite", use = (tbuffs["Holy Seal"]) and (phealth <= .70) }, { name = "Punishment", use = (tbuffs["Holy Seal"]) and boss }, { name = "Holy Seal", use = true and boss }, { name = "Action: 6", use = true }, { name = "Holy Strike", use = true }, { name = "Attack", use = (thealth == 1) }, } end --Class: Knight/Scout elseif mainClass == "KNIGHT" and subClass == "RANGER" then local LKBR = GetActionUsable(20) -- # is Lion King Battle Roar spell slot number --Potions and buffs Skill = { { name = "Enhanced Armor", use = (pctEB1 >= .05) and ((not pbuffs["Enhanced Armor"]) or (pbuffs["Enhanced Armor"].time <= 45)) }, { name = "Sacred Resistance", use = (pctEB1 >= .05) and ((not pbuffs["Sacred Resistance"]) or (pbuffs["Sacred Resistance"].time <= 1)) }, { name = "Threaten", use = (pctEB1 >= .05) and ((not pbuffs["Threaten"]) or (pbuffs["Threaten"].time <= 45)) }, } --Combat if enemy then Skill2 = { { name = "Shot", use = true and (not pbuffs["Sacred Reach"]) }, { name = "Truth Shield Bash", use = boss and (pbuffs["Holy Power Explosion"]) }, { name = "Whirlwind Shield", use = true }, { name = "Holy Seal", use = boss }, { name = "Punishment", use = (tbuffs["Holy Seal"]) and boss }, { name = "Action: 6", use = true }, { name = "Holy Chains", use = not boss and (pbuffs["Sacred Reach"])}, { name = "Holy Chains", use = true and boss }, { name = "Holy Strike", use = true }, { name = "Attack", use = (thealth == 1) }, } end --Class: Champion/Priest elseif mainClass == "PSYRON" and subClass == "AUGUR" then --Potions and buffs Skill = { { name = "Battle Defense Transfer", use = (pctEB1 >= .05) and ((not pbuffs["Battle Defense Transfer"]) or (pbuffs["Battle Defense Transfer"].time <= 45)) }, { name = "Rune Energy Influx", use = (pctEB1 >= .05) and ((not pbuffs["Rune Energy Influx"]) or (pbuffs["Rune Energy Influx"].time <= 45)) }, { name = "Forge", use = (pctEB1 >= .05) and ((not pbuffs["Forge"]) or (pbuffs["Forge"].time <= 45)) }, } --Combat if enemy then Skill2 = { { name = "Holy Aura", use = (tSpell == "Black Flame") }, { name = "Action: 6", use = true }, { name = "Action: 7", use = true }, { name = "Fearless Blow", use = (EnergyBar1 <= 30) }, { name = "Rune Overload", use = (EnergyBar1 >= 30) and (not pbuffs["Rune Overload"]) }, { name = "Light Pulse", use = true }, { name = "Shock Strike", use = true }, { name = "Electrocution", use = (not tbuffs["Electrocution"]) and boss }, { name = "Energy Influx Strike", use = (tbuffs["Electrocution"]) and boss }, { name = "Rune Pulse", use = boss and (pbuffs["Chain Drive"])}, { name = "Heavy Bash", use = true }, { name = "Attack", use = (thealth == 1) }, } end --Class: Rogue/Priest elseif mainClass == "THIEF" and subClass == "AUGUR" then --Potions and buffs Skill = { { name = "Shadow Traces", use = (pctEB1 >= .05) and ((not pbuffs["Shadow Traces"]) or (pbuffs["Shadow Traces"].time <= 45)) }, } --Combat if enemy then Skill2 = { { name = "Shadowstab", use = (not tbuffs["Bleed"])}, { name = "Low Blow", use = (not tbuffs["Grievous Wound"])}, { name = "Wound Attack", use = (EnergyBar1 >= 35) and ((tbuffs["Bleed"]) and (tbuffs["Grievous Wound"])) and (pbuffs["Premeditation"])}, { name = "Wound Attack", use = (EnergyBar1 >= 35) and ((tbuffs["Bleed"]) and (tbuffs["Grievous Wound"])) and (pbuffs["Premeditation"])}, { name = "Dusk Call", use = (EnergyBar1 >= 10) and ((pbuffs["Shadow Trace"]) and (pbuffs["Shadow Trace"].stack>4))and (not pbuffs["Premeditation"]) }, { name = "Premeditation", use = (pbuffs["Stealth"])and (not pbuffs["Premeditation"])}, { name = "Umbra Strike", use = (EnergyBar1 >= 35) and (pbuffs["Shadow Trace"])and (not pbuffs["Premeditation"])}, { name = "Low Blow", use = (EnergyBar1 >= 50)}, { name = "Combo Throw", use = true and (not pbuffs["Premeditation"]) }, { name = "Throw", use = true and (not pbuffs["Premeditation"]) }, { name = "Attack", use = (thealth == 1) }, } end --Class: Warrior/Rogue elseif mainClass == "WARRIOR" and subClass == "THIEF" then --Potions and buffs Skill = { { name = "Aggressiveness", use = (pctEB1 >= .05) and ((not pbuffs["Aggressiveness"]) or (pbuffs["Aggressiveness"].time <= 45)) }, } --Combat if enemy then Skill2 = { { name = "Action: 20", use = (EnergyBar1) >= 10}, { name = "Tactical Attack", use = (EnergyBar1) >= 81}, { name = "Blood Dance", use = ((tbuffs["SlashBleed"]) and (tbuffs["Excessive Bleeding"]))}, { name = "Shadowstab", use = (not tbuffs["Excessive Bleeding"])}, { name = "Slash", use = (not tbuffs["SlashBleed"])}, { name = "Keen Attack", use = (tbuffs["Vulnerable"]) and (not pbuffs["Increased Reflexes"])}, { name = "Splitting Chop", use = (tbuffs["Weakened"])}, { name = "Thunder", use = (tbuffs["Weakened"])}, { name = "Open Flank", use = (tbuffs["Vulnerable"])}, { name = "Probing Attack", use = true }, { name = "Slash", use = true }, { name = "Shadowstab", use = true }, { name = "Attack", use = (thealth == 1) }, } end --Class: Knight/Rogue elseif mainClass == "KNIGHT" and subClass == "THIEF" then --Potions and buffs Skill = { { name = "Leopard Instinct", use = (pctEB1 >= .05) and ((not pbuffs["Leopard Instinct"]) or (pbuffs["Leopard Instinct"].time <= 3)) and boss }, } --Combat if enemy then Skill2 = { { name = "Charge", use = boss and (pbuffs["Leopard Instinct"]) }, { name = "Holy Seal", use = (not tbuffs["Holy Seal"]) and boss }, { name = "Dance of Two Blades", use = (tbuffs["Holy Seal"].stack>3)}, { name = "Smash", use = (tbuffs["Holy Seal"].stack>3) and (pbuffs["Overflowing Light"].stack>2) }, { name = "Punishment", use = (tbuffs["Holy Seal"].stack>3)}, { name = "Shadowstab", use = (tbuffs["Holy Seal"].stack>3)}, { name = "Holy Strike", use = true }, { name = "Attack", use = (thealth == 1) }, } end --ADD MORE CLASS COMBOS ABOVE THIS LINE. --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS. --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS. --DO NOT ADD ANYTHING BELOW THE FOLLOWING "END" STATEMENT! end --End Player Skill Sequences if (arg1=="debugskills") then --Used for printing the skill table, and true/false usability DIYCE_DebugSkills(Skill) DIYCE_DebugSkills(Skill2) elseif (arg1=="debugpbuffs") then --Used for printing your buff names, and buffID DIYCE_DebugBuffList(pbuffs) elseif (arg1=="debugtbuffs") then --Used for printing target buff names, and buffID DIYCE_DebugBuffList(tbuffs) elseif (arg1=="debugall") then --Used for printing all of the above at the same time DIYCE_DebugSkills(Skill) DIYCE_DebugSkills(Skill2) DIYCE_DebugBuffList(pbuffs) DIYCE_DebugBuffList(tbuffs) end if (not MyCombat(Skill, arg1)) then MyCombat(Skill2, arg1) end --Select Next Enemy if (tDead) then TargetUnit("") g_lastaction = "" return end if SeigeWar then if (not LockedOn) or (not enemy) then for i=1,10 do if UnitIsPlayer("target") then break end TargetNearestEnemy() StopDIYCETimer("LBBleed") StopDIYCETimer("SSBleed") return end end elseif (not SeigeWar) then if mainClass == "RANGER" and (not party) then --To keep scouts from pulling mobs without meaning to. if (not LockedOn) or (not enemy) then TargetNearestEnemy() g_lastaction = "" StopDIYCETimer("LBBleed") StopDIYCETimer("SSBleed") return end elseif mainClass ~= "RANGER" then --Let all other classes auto target. if (not LockedOn) or (not enemy) then TargetNearestEnemy() g_lastaction = "" StopDIYCETimer("LBBleed") StopDIYCETimer("SSBleed") return end end end end