Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Creature type of WoWUnit

Featured Replies

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.

  • Author

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());

 

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.

  • Author

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.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.