May 18, 20196 yr I am trying to create a quester profile for the quest Leave our mark: https://www.wowhead.com/quest=12995/leave-our-mark I have been trying to use the "Use item on dead mob ( after looting)" from Snippets codes for quest profiles. I created the quest profile as KillAndLoot with proper hotspots and mobIds. So far I have this as the quest order: PickUp > LeaveOurMark (works fine) RunCode > Thread t = new Thread(() => { uint itemId = 42480; int questId = 12995; while (robotManager.Products.Products.IsStarted) { if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause) { if (!Quest.HasQuest(questId)) break; if (ObjectManager.Target.IsValid && ObjectManager.Target.IsDead) { ItemsManager.UseItem(itemId); } } Thread.Sleep(500); } }); t.Start(); Pulse > LeaveOurMark TurnIn > LeaveOurMark The profile just goes to the hotspots, kills the mobs, loots, and moves to next mob. What am I missing here?
May 18, 20196 yr Hello, try to add log to check if he try to use item or not (before "ItemsM anage r.UseItem (itemId);") You can also try to use lower "Thread.Sleep" if loot is very fast on your server. Or you can try this code (not tested): wManager.Events.LootingEvents.OnLootSuccessful += delegate(WoWUnit unit) { uint itemId = 42480; int questId = 12995; if (Quest.HasQuest(questId)) { ItemsManager.UseItem(itemId); Thread.Sleep(50); Usefuls.WaitIsCastingAndLooting(); } };
May 19, 20196 yr Author Thanks Droidz. I tried your code. I don't see the "UseItem(itemId);" anywhere in the log. I attached it to be sure I am not missing something. 19 May 2019 03H29.log.html
May 19, 20196 yr Author I solved it by creating two quests. One KillAndLoot to kill the NPCs and one InteractWithNPC to use the item on the dead mobs. I pulse them both and it works.
Create an account or sign in to comment