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