January 19, 201412 yr I am very unhappy with the enemy detection. Without any changes my fight class profile will work on enemys and training dummys . But it try to attack friendly Enemys like the Orcs on the Netherwing Ledge. Also I have problems with the Brawl'gar Arena. (nothing happens). A workaround for the Brawl'gar Arena is to disable "only in combat" and using "targettargeting me" instead. A workaround for the Orcs is "unitisEnemy" and "UnitCanAttack", but with this , the Profile doesnt work on Training dummys. So i try to work on a lua-script solution like this: local L = MyLocalizationTable local frame = CreateFrame("Frame") DEFAULT_CHAT_FRAME:AddMessage("start") if (GetUnitName("target") == L["Training Dummy"]) or (GetUnitName("target") == L["Raider's Training Dummy"]) then DEFAULT_CHAT_FRAME:AddMessage("dummy") retV=1 else DEFAULT_CHAT_FRAME:AddMessage("target") retV=UnitIsEnemy("player","target") end DEFAULT_CHAT_FRAME:AddMessage("end") (frameoutput is for test only) if retV=1 all is fine But this displays only "start" on the chat-frame. no "end", no "dummy", no "target". And the conditon is never true at a dummy . Any Ideas?
January 21, 201412 yr Author retV=UnitIsFriend("player","target") is what i need. Very useful to identify friend and enemy
January 22, 201412 yr print("start") if (GetUnitName("target") == "Training Dummy") or (GetUnitName("target") == "Raider's Training Dummy") then print("dummy") retV=1 else print("target") retV=UnitIsEnemy("player","target") end print("end") ps: You can test your script and get lua error in "Tools" > "Development tools", copy your code in text zone and click on buton "Lua (retu...".
Create an account or sign in to comment