Code:
function KillSequence(arg1, goat2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--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(21) -- # is your melee range spell slot number
--local a1,a2,a3,a4,a5,ASon = GetActionInfo(14) -- # is your Autoshot slot number
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 race = UnitRace("target")
local Beamoid = race == "Humanoid" or race == "Beast"
--Determine Class-Combo
mainClass, subClass = UnitClassToken( "player" )
--Silence Logic
local tSpell,tTime,tElapsed = UnitCastingTime("target")
local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
--Potion Checks
healthpot = healthpot or 0
manapot = manapot or 0
--Equipment and Pet Protection
if phealth <= .03 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
TargetUnit("")
return
end
--Begin Player Skill Sequences
--Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT,
--Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
-- Class: Warrior/Warden
if mainClass == "WARRIOR" and subClass == "WARDEN" then
--local SurpriseAttack = GetActionUsable(14)
--Potions and Buffs
Skill = {
{ name = "Survival Instinct", use = (phealth <= .49) },
{ name = "Action: "..healthpot, use = (phealth <= .60) },
{ name = "Action: "..manapot, use = (pctEB2 <= .40) },
{ name = "Briar Shield", use = (pctEB2 >= .05) and ((not pbuffs["Briar Shield"]) or (pbuffs["Briar Shield"].time <= 45)) },
{ name = "Battle Creed", use = (pctEB2 >= .05) and ((not pbuffs["Battle Creed"]) or (pbuffs["Battle Creed"].time <= 45)) },
}
--Combat
if enemy then
Skill2 = {
{ name = "Aggressiveness", use = boss },
{ name = "Savage Whirlwind", use = (pctEB2 >= .05) },
{ name = "Tactical Attack", use = ((tbuffs[500081]) and (EnergyBar1 >= 16)) },
{ name = "Attack Weakener", use = ((pctEB2 >= .05) and tbuffs["Vulnerable"] and (not pbuffs["Aggressiveness"])) },
{ name = "Open Flank", use = ((tbuffs["Vulnerable"]) and (EnergyBar1 >=11)) },
{ name = "Probing Attack", use = ((EnergyBar1 >= 21) and (tbuffs[500081])) },
{ name = "Slash", use = (EnergyBar1 >= 26), timer = "SSBleed", ignoretimer = (pbuffs["Aggressiveness"]) },
{ name = "Power of the Wood Spirit", use = (pctEB2 >= .05) },
{ name = "Attack", use = (thealth == 1) },
}
end
--Class: Priest/Warrior
elseif mainClass == "AUGUR" and subClass == "WARRIOR" then
--Potions and Buffs
Skill = {
{ name = "Regenerate", use = (phealth <= .90) and (pctEB2 >= .05) and (not pbuffs["Regenerate"]) },
{ name = "Action: "..healthpot, use = (phealth <= .70) },
{ name = "Blessed Spring Water", use = (pctEB2 >= .05) and ((not pbuffs["Blessed Spring Water"]) or (pbuffs["Blessed Spring Water"].time <= 45)) },
{ name = "Magic Barrier", use = (pctEB2 >= .05) and ((not pbuffs["Magic Barrier"]) or (pbuffs["Magic Barrier"].time <= 45)) },
{ name = "Amplified Attack", use = (pctEB2 >= .05) and ((not pbuffs["Amplified Attack"]) or (pbuffs["Amplified Attack"].time <= 45)) },
{ name = "Grace of Life", use = (pctEB2 >= .05) and ((not pbuffs["Grace of Life"]) or (pbuffs["Grace of Life"].time <= 45)) },
}
--Combat
if enemy then
Skill2 = {
{ name = "Battle Monk Stance", use = ((combat) and (not string.find(pbuffs,"Battle Monk Stance"))) },
{ name = "Enraged", use = ((boss) and (combat)) },
{ name = "Ascending Dragon Strike", use = (EnergyBar2 >= 30) },
{ name = "Slash", use = (EnergyBar2 >= 26), timer = "SSBleed" },
{ name = "Explosion of Fighting Spirit", use = ((not friendly) and (combat)) }
{ name = "Power Build-Up", use = (friendly and (not string.find(pbuffs,"Power Build-Up")) and (not combat)) }
{ name = "Attack", use = (thealth == 1) },
}
end
--ADD MORE CLASS COMBOS HERE.
--USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
--THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
--DO NOT POST 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("")
return
end
if mainClass == "RANGER" and (not party) then --To keep scouts from pulling mobs without meaning to.
if (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
elseif mainClass ~= "RANGER" then --Let all other classes auto target.
if (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
end
end