init
This commit is contained in:
commit
fc8c55e1cc
51
OBWT.lua
Normal file
51
OBWT.lua
Normal file
@ -0,0 +1,51 @@
|
||||
function OBWT_OnLoad()
|
||||
this:RegisterEvent('PLAYER_ENTERING_WORLD')
|
||||
this:RegisterEvent('ADDON_LOADED')
|
||||
DEFAULT_CHAT_FRAME:AddMessage('One button warrior tanking. Type /obwt for usage.')
|
||||
SlashCmdList['OBWT'] = function()
|
||||
local msg = 'To use OBWT addon, create a macro and type /script obwt();'
|
||||
DEFAULT_CHAT_FRAME:AddMessage(msg)
|
||||
end;
|
||||
SLASH_OBWT1 = '/obwt'
|
||||
end
|
||||
|
||||
function obwt()
|
||||
local rage = UnitMana('player')
|
||||
local bloodthirst = 'Ability_Warrior_Bloodthirst'
|
||||
local revenge = 'Ability_Warrior_Revenge'
|
||||
local sunderArmor = 'Ability_Warrior_SunderArmor'
|
||||
local rend = 'Ability_Warrior_Rend'
|
||||
local battleShout = 'Ability_Warrior_BattleShout'
|
||||
local heroicStrike = 'Ability_Warrior_HeroicStrike'
|
||||
|
||||
TargetNearestEnemy()
|
||||
if UnitExists('target') and UnitCanAttack('player','target') then
|
||||
AttackTarget()
|
||||
if rage < 15 == nil and isUsable(bloodthirst) then
|
||||
CastSpellByName('Bloodthirst')
|
||||
elseif buffed('Battle Shout') == nil and isUsable(battleShout) then
|
||||
CastSpellByName('Battle Shout')
|
||||
elseif isUsable(revenge) then
|
||||
CastSpellByName('Revange')
|
||||
elseif isUsable(sunderArmor) then
|
||||
CastSpellByName('Sunder Armor')
|
||||
elseif rage > 50 and buffed('Rend', 'target') == nil and isUsable(rend) then
|
||||
CastSpellByName('Rend')
|
||||
elseif rage > 70 and isUsable(heroicStrike) then
|
||||
CastSpellByName('Heroic Strike')
|
||||
end
|
||||
end
|
||||
|
||||
local function isUsable(spellTexture)
|
||||
return IsUsableAction(getSlot(spellTexture))
|
||||
end
|
||||
|
||||
local function getSlot(spellTexture)
|
||||
for i = 1, 120, 1
|
||||
do
|
||||
if(GetActionTexture(i) ~= nil) then
|
||||
if(strfind(GetActionTexture(i), spellTexture)) then return i end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end;
|
7
OBWT.toc
Normal file
7
OBWT.toc
Normal file
@ -0,0 +1,7 @@
|
||||
## Interface: 11200
|
||||
## Title: OBWT |cff808080by cvtk
|
||||
## Author: cvtk
|
||||
## Notes: One button warrior tanking.
|
||||
## Version: GIT
|
||||
|
||||
main.lua
|
8
OBWT.xml
Normal file
8
OBWT.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<UI xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||
<Script file="OBWT.lua"/>
|
||||
<Frame name="OBWT" enableMouse="false" parent="UIParent">
|
||||
<Scripts>
|
||||
<OnLoad>OBWT_OnLoad();</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</UI>
|
Loading…
Reference in New Issue
Block a user