Trying to expand on the 60 -70 profile work that has already been done but i've run into this error a couple of times on other quests and I was hoping someone could point me in the right direction for resolving it. One of the quests is "The Fallen Sisters", use Lurielle's Pendant on 7 Chill Nymphs quest id 11314; The Fallen Sisters - Quest - World of Warcraft Pendant id; Lurielle's Pendant - Item - World of Warcraft nymphs id; Chill Nymph - NPC - World of Warcraft The code i'm using is; <while Condition="HasQuest(11314) && !IsQuestCompleted(11314)"> PHP: <While Condition="HasQuest(11314) && !IsQuestCompleted(11314)" > <CustomBehavior File="UseItemOn" QuestId="11314" ObjectType="Npc" MobId="23678" ItemId="33606" NumOfTimes="7" /></While> </while> The Error being thrown out by HB is; [09:13:59:679] System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Styx.Bot.Quest_Behaviors.UseItemOn..ctor(Dictionary`2 args) in c:\Users\jon\Downloads\Wow progs\Honorbuddy_2.0.0.4354\Quest Behaviors\UseItemOn.cs:line 181 Any help or guidance would be appreciated
Hi, jonti666, Looking at the source to UseItemOn, it requires a set of X/Y/Z coordinates, also: PHP: <CustomBehavior File="UseItemOn" QuestId="11314" ObjectType="Npc" MobId="23678" ItemId="33606" NumOfTimes="7" X="4817.195" Y="849.9298" Z="161.0393" /> cheers, chinajade
thanks for the response Doh! for some reason i had in my head the xyz was an optional. now not erroring but killing the mobs before using the item.
UseItemOn also takes a HpLeftAmount. Code: /// <summary> /// UseItemOn by Nesox /// Allows you to use items on nearby gameobjects/npc's /// ##Syntax## /// QuestId: The id of the quest. /// MobId: The id of the object. /// ItemId: The id of the item to use. /// NumOfTimes: Number of times to use said item. /// [Optional]WaitTime: Time to wait after using an item. DefaultValue: 1500 ms /// [Optional]CollectionDistance: The distance it will use to collect objects. DefaultValue:100 yards /// [Optional]HasAura: If a unit has a certian aura to check before using item. (By: j0achim) /// [Optional]Range: The range to object that it will use the item /// [Optional]NpcState: The state of the npc -> Dead, Alive, BelowHp. None is default /// [Optional]HpLeftAmount: Will only be used when NpcState is BelowHp /// ObjectType: the type of object to interact with, expected value: Npc/Gameobject /// X,Y,Z: The general location where theese objects can be found /// </summary> cheers, chinajade
tried NpcState, HpLeftAmount but ended up hacking the mob into the ground without trying, added a range setting and it worked a treat. PHP: <CustomBehavior File="UseItemOn" QuestId="11314" ObjectType="Npc" MobId="23678" ItemId="33606" Range="25" NpcState="Alive" X="2022.445" Y="-4518.297" Z="207.865" /> Not sure if it would still work with the NpcState removed, i'll try it next time. thanks for the help