Jump to content

Orc or dummy


Bugreporter
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...