Jump to content

Orc or dummy


Bugreporter

Recommended Posts

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?

Link to comment
Share on other sites

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...".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...