IEnumerable<WoWUnit> mLootableMobs = ObjectManager.GetObjectsOfType<WoWUnit>(false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();
WoWUnit.Interact();
Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();
Where do mobs instant respawn?
You need to make sure a unit is lootable before you do so. The easiest way to do it is probably a list of lootable units.
PHP:IEnumerable mLootableMobs = ObjectManager.GetObjectsOfType(false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();
To loot a target you first must interact with it, then signal HB to loot.
PHP:WoWUnit.Interact(); Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();
Of course putting the entire thing together isn't as easy. You need to iterate through the list, move to the the lootable target, and ensure that you're only attempting to loot one target at any one point. But the above code shows the basic commands you need to make it work.
dno - made my own loot method - I can post the code here tomorrow.
I just threw this together - I didn't have VS or HB so I can't promise anything - but I guess it should work as long as your CC doesn't do movement..
List<WoWUnit> lootable = ObjectManager.GetObjectsOfType<WoWUnit>(false, false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();
WoWUnit? target = lootable.FirstOrDefault<WoWUnit>();
zuabros, just the concepts:
Pulse() method is fired at each bot cycle (which means after the behavior tree of the BotBase). You have to check every pulse for lootable creatures. Then you'll have a list. For example
PHP:List lootable = ObjectManager.GetObjectsOfType(false, false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();
Then you take the first one:
(WoWUnit? stands for nullable, if I remember correctly. Haven't coded nullable things by a while in C#)PHP:WoWUnit? target = lootable.FirstOrDefault();
Check if the target is not null, cast it as WoWUnit in case it's not null and then generate a Navigator path and follow it. When you're distant less than 5 yards, interact with target.
EDIT: it's not kind to post multiple threads, even in the same forum, for the same reason: http://www.thebuddyforum.com/honorb...gin-request-loot-mobs-combat-please-help.html
I just threw this together - I didn't have VS or HB so I can't promise anything - but I guess it should work as long as your CC doesn't do movement..
slog("Moving to loot {0}.", lootTarget.name);
slog("Moving to loot {0}.", lootTarget.Name);
Updated with a fix for that typo. Let me know if it works - thanks!
I don't think so..Is there a way to have the Combat Looter plugin turn on and off in say questing profile?