knights 8 Posted October 30, 2016 Share Posted October 30, 2016 Is there anyway to check if the unit targetted is Hostile in CSharp code? something like below? return ObjectManager.GetWoWUnitHostile() Not really an issue now but the bot is always trying to cast spell on vendor... the spell is supposed to be an opening before combat Link to comment Share on other sites More sharing options...
Bugreporter 93 Posted October 30, 2016 Share Posted October 30, 2016 In my profile I don't check "hostily", I check if "not friendly" thats a different. And npc's wouldn't attack if UnitExists("target") and not UnitIsFriend("player", "target") then ... end Its LUA, but I think, there is an option in C# also Link to comment Share on other sites More sharing options...
knights 8 Posted October 30, 2016 Author Share Posted October 30, 2016 3 hours ago, Bugreporter said: In my profile I don't check "hostily", I check if "not friendly" thats a different. And npc's wouldn't attack if UnitExists("target") and not UnitIsFriend("player", "target") then ... end Its LUA, but I think, there is an option in C# also I did tried your version, but it still kept casting... Link to comment Share on other sites More sharing options...
Droidz 2737 Posted November 2, 2016 Share Posted November 2, 2016 Hello, you can check Reaction: wManager.Wow.ObjectManager.ObjectManager.Target.Reaction Quote Hated, Hostile, Unfriendly, Neutral, Friendly, Honored, Revered, Exalted, You can also use: wManager.Wow.ObjectManager.ObjectManager.Target.IsAttackable or use this lua code: Lua.LuaDoString<bool>("return UnitCanAttack('player', 'target');") Pudge 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now