Findeh 34 Posted December 13, 2018 Share Posted December 13, 2018 Good day. I've got a List of WoWUnits, and i need to check, is there any WoWUnit with a specific creature type (lets say, humanoind, for example) in that List. Is is possible? Currently i can check the creature type of a target, but can't do the same for a WoWUnit from list. Thank you. Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/ Share on other sites More sharing options...
Matenia 628 Posted December 13, 2018 Share Posted December 13, 2018 (edited) List.Any(unit => unit.CreatureTypeTarget == "Humanoid" ) Basically like that (pseudo code) Edited December 14, 2018 by Matenia Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49901 Share on other sites More sharing options...
Findeh 34 Posted December 13, 2018 Author Share Posted December 13, 2018 Yeah, but there is no WoWUnit method like CreatureType, that's the problem. And the only lua code i was able to find returns creature type of my target also ? Im doing something like this: var mobsList = new List<WoWUnit>(); mobsList.AddRange(ObjectManager.GetObjectWoWUnit().Where(u => u.Type != WoWObjectType.Player && u.blah-blah-blah).ToList()); Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49902 Share on other sites More sharing options...
Matenia 628 Posted December 14, 2018 Share Posted December 14, 2018 Updated my code example Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49909 Share on other sites More sharing options...
Mykoplazma 24 Posted December 14, 2018 Share Posted December 14, 2018 You must 'touch' the unit to get the info. For Development Tools: Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + "-------------Start------------------" + "\")"); foreach (WoWUnit mob in wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit()) { var name = mob.Name; var baseAdress = mob.GetBaseAddress; wManager.Wow.Helpers.Interact.InteractGameObject(baseAdress,true,false); var type = mob.CreatureTypeTarget; Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + name + " " + type + "\")"); } Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + "-------------Stop------------------" + "\")"); There is another way to touch the unit ( without visible changing targets - nasty ye? ) You must use lua , focus and write the guid from scanning under focus then request the value. Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + "-------------Start------------------" + "\")"); foreach (WoWUnit mob in wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit()) { var name = mob.Name; var tmp = wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid; wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = mob.Guid; string type = Lua.LuaDoString<string>(@"creatureType = UnitCreatureType(""focus"")", "creatureType"); wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = tmp; Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + name + " " + type + "\")"); } Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage(\"" + "-------------Stop------------------" + "\")"); And this is working solution for that problem. Credits for @reapler for showing the method with guid replacement. Tested on 2.4.3 nightbane and works here. Findeh 1 Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49920 Share on other sites More sharing options...
Matenia 628 Posted December 14, 2018 Share Posted December 14, 2018 You can do the focus part in vanilla by using mouseover as the unit and writing the mouseover guid into memory. Use my vanilla fightclass framework as an example Findeh 1 Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49921 Share on other sites More sharing options...
Findeh 34 Posted December 16, 2018 Author Share Posted December 16, 2018 Thank you a lot guys for advice. Unfortunately my test accounts got banned, that i was going to use for that feature test at exact same day i've asked about this :). Will have to level new one first to continue with this idea. Link to comment https://wrobot.eu/forums/topic/10496-creature-type-of-wowunit/#findComment-49944 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