7.08.25
This commit is contained in:
parent
88aa521360
commit
cd09e395a0
70
OBWT.lua
70
OBWT.lua
@ -16,6 +16,8 @@ textures['Overpower'] = 'Ability_MeleeDamage'
|
||||
textures['Whirlwind'] = 'Ability_Whirlwind'
|
||||
textures['Bloodthirst'] = 'Spell_Nature_BloodLust'
|
||||
textures['Berserker Rage'] = 'Spell_Nature_AncestralGuardian'
|
||||
textures['Berserking'] = 'Racial_Troll_Berserk'
|
||||
textures['Throw'] = 'Ability_Throw'
|
||||
|
||||
local function getTexture(spellName)
|
||||
if textures[spellName] ~= nil then
|
||||
@ -28,7 +30,9 @@ local function getSlot(spellTexture)
|
||||
for i = 1, 120, 1 do
|
||||
if GetActionTexture(i) ~= nil then
|
||||
-- print(GetActionTexture(i))
|
||||
if(strfind(GetActionTexture(i), spellTexture)) then return i end
|
||||
if (strfind(GetActionTexture(i), spellTexture)) then
|
||||
return i
|
||||
end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
@ -49,7 +53,9 @@ end
|
||||
local function debuffIndex(spellTexture)
|
||||
for i = 1, 40 do
|
||||
local texturePath = UnitDebuff('target', i)
|
||||
if texturePath ~= nil and strfind(texturePath, spellTexture) then return i end
|
||||
if texturePath ~= nil and strfind(texturePath, spellTexture) then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
@ -58,7 +64,11 @@ local function debuffStacks(spellName)
|
||||
local spellTexture = getTexture(spellName)
|
||||
if spellTexture then
|
||||
local _, stacks = UnitDebuff('target', debuffIndex(spellTexture))
|
||||
if stacks == nill then return 0 else return stacks end
|
||||
if stacks == nill then
|
||||
return 0
|
||||
else
|
||||
return stacks
|
||||
end
|
||||
else
|
||||
print(spellName)
|
||||
return false
|
||||
@ -67,17 +77,17 @@ end
|
||||
|
||||
function onCooldown(spellName)
|
||||
local spellID = 1
|
||||
local name, _ = GetSpellName(spellID, "BOOKTYPE_SPELL")
|
||||
local name, _ = GetSpellName(spellID, 'BOOKTYPE_SPELL')
|
||||
while (name) do
|
||||
if spellName == name then
|
||||
if GetSpellCooldown(spellID, "BOOKTYPE_SPELL") == 0 then
|
||||
if GetSpellCooldown(spellID, 'BOOKTYPE_SPELL') == 0 then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
spellID = spellID + 1
|
||||
name, _ = GetSpellName(spellID, "BOOKTYPE_SPELL")
|
||||
name, _ = GetSpellName(spellID, 'BOOKTYPE_SPELL')
|
||||
end
|
||||
end
|
||||
|
||||
@ -98,10 +108,14 @@ local function tank(cmd)
|
||||
local rage = UnitMana('player')
|
||||
local health = UnitHealth('player')
|
||||
|
||||
if UnitExists('target') and UnitCanAttack('player','target') then
|
||||
if (not PlayerFrame.inCombat) then AttackTarget() end
|
||||
if UnitExists('target') and UnitCanAttack('player', 'target') then
|
||||
if (not PlayerFrame.inCombat) then
|
||||
AttackTarget()
|
||||
end
|
||||
|
||||
if health < 400 then panic() end
|
||||
if health < 400 then
|
||||
panic()
|
||||
end
|
||||
|
||||
if isUsable('Bloodrage') and not onCooldown('Bloodrage') and rage < 30 then
|
||||
cast('Bloodrage')
|
||||
@ -140,10 +154,14 @@ local function dps(cmd)
|
||||
local rage = UnitMana('player')
|
||||
local health = UnitHealth('player')
|
||||
|
||||
if UnitExists('target') and UnitCanAttack('player','target') then
|
||||
if (not PlayerFrame.inCombat) then AttackTarget() end
|
||||
if UnitExists('target') and UnitCanAttack('player', 'target') then
|
||||
if (not PlayerFrame.inCombat) then
|
||||
AttackTarget()
|
||||
end
|
||||
|
||||
if health < 400 then panic() end
|
||||
if health < 400 then
|
||||
panic()
|
||||
end
|
||||
|
||||
if isUsable('Bloodrage') and not onCooldown('Bloodrage') and rage < 30 then
|
||||
cast('Bloodrage')
|
||||
@ -157,7 +175,6 @@ local function dps(cmd)
|
||||
elseif isUsable('Battle Shout') and not buffed('Battle Shout') then
|
||||
cast('Battle Shout')
|
||||
|
||||
|
||||
elseif isUsable('Sunder Armor') and debuffStacks('Sunder Armor') < 5 then
|
||||
cast('Sunder Armor')
|
||||
|
||||
@ -173,9 +190,26 @@ local function dps(cmd)
|
||||
end
|
||||
end
|
||||
|
||||
function OBWT_OnLoad()
|
||||
SlashCmdList["OBWT"] = tank
|
||||
SlashCmdList["OBWF"] = dps
|
||||
SLASH_OBWT1 = "/obwt"
|
||||
SLASH_OBWF1 = "/obwf"
|
||||
local function throw(cmd)
|
||||
local rage = UnitMana('player')
|
||||
local health = UnitHealth('player')
|
||||
|
||||
if GetUnitName('target') == nil then
|
||||
TargetNearestEnemy()
|
||||
end
|
||||
if GetUnitName('target') ~= nil and CheckInteractDistance('target', 4) == 1 and CheckInteractDistance('target', 1) ==
|
||||
nil then
|
||||
cast("Throw")
|
||||
else
|
||||
ClearTarget();
|
||||
end
|
||||
end
|
||||
|
||||
function OBWT_OnLoad()
|
||||
SlashCmdList['OBWT'] = tank
|
||||
SlashCmdList['OBWF'] = dps
|
||||
SlashCmdList['HYPE'] = throw
|
||||
SLASH_OBWT1 = '/obwt'
|
||||
SLASH_OBWF1 = '/obwf'
|
||||
SLASH_HYPE1 = '/obw_throw'
|
||||
end
|
Loading…
Reference in New Issue
Block a user