Alright, im fairly new to coding although im use to some LUA coding (mainly RDX bossmods) so i know some of the stuff. I browse through WoWWiki LUA events/api and their XML guides, but i always end up with trouble. One thing that has been pestering was my Hunter Feign Death retarget.
Here is the code:
Code:
local tarClass, engClass = UnitClass("target");
function Test_OnLoad()
this:RegisterEvent("PLAYER_TARGET_CHANGED");
if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage("Retarget Loaded");
end
end
function Test_OnEvent()
if (engClass == "HUNTER") and UnitCanAttack("target", "player") then
if (event == "PLAYER_TARGET_CHANGED") then TargetLastTarget();
end
end
Alright, I can get it to start up fine, no errors or anything, but when I duel a hunter and he feign deaths, nothing happens. It just doesnt retarget like it should. Im just wondering what im doing wrong.
Here is my XML incase it may be this:
Code:
<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/">
<Script file="Test.lua"/>
<Frame name="TestMainFrame" parent="UIParent" hidden="true">
<Scripts>
<OnLoad>Test_OnLoad();</OnLoad>
<OnUpdate>Test_OnUpdate();</OnUpdate>
<OnEvent>Test_OnEvent();</OnEvent>
</Scripts>
</Frame></Ui>