What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

KeyNotFoundException: The specified spell could not be found: Death coil

wulf

Community Developer
Joined
Dec 29, 2010
Messages
1,832
Reaction score
118
Hi All,

Honorbuddy version: Latest!
Class: DeathKnight Unholy
Level: 85
Group: Solo
My Latency is: 200ms
My Computer is: All Powerful
Issue/Bug/Problem/Suggestion:


My CC returns a KeyNotFoundException for Death Coil and Suddon Doom, these are the ones that I am having issues with.


I assume it throws a KeyNotFoundException if the buff or spell is not present in the Me.Auras or SpellManager.Spells or SpellManager.RawSpells dictionary.


I have used the code below via HighVoltz Console to traverse the Spellmanager.Spells and the SpellManager.RawSpells and the Me.Auras collection


As you can see, I do have Death Coil and Suddon Doom listed.

Do I have to write additional code to handle a KeyNotFoundException?

At the moment I am wrapping it in a TryGetValue()


See my Spells class: CanCast method. Here. line 103 (whenever I call SpellManager)

Any help would be greatly appreciated.


Here is the code i use to check for death coil and suddon doom.

Code:
foreach (KeyValuePair<string, wowspell=""> sp in SpellManager.Spells)
{
    if (SpellManager.Spells.ContainsKey(sp.Key))
    {
        Log(sp.Key + " " + SpellManager.Spells[sp.Key]);
    }
    else
    {
        Log(sp.Key);
    }
}

foreach (WoWSpell sp in SpellManager.RawSpells)
{


   Log(sp.ToString());
}

foreach (KeyValuePair<string, wowaura=""> sp in Me.Auras)
{
    if (Me.Auras.ContainsKey(sp.Key))
    {
        Log(sp.Key + " " + Me.Auras[sp.Key].Flags.ToString());
    }
    else
    {
        Log(sp.Key);
    }
}

ERROR

Code:
[10:38:16 AM:623] [COLOR=#ff0000]System.Collections.Generic.KeyNotFoundException: The specified spell could not be found: Death coil[/COLOR]
   at Styx.Logic.Combat.SpellCollection.get_Item(String index)

[9:32:07 PM:203] [CanCast] Either I dont have Death coil or we just got a KeyNotFoundException.


Thanks All.</string,></string,>
 

Attachments

Last edited:
From a quick glance, it seems like you need to spell them right
Death Coil (with capital first letter in both Death and Coil)
Sudden Doom (not suddon)
 
From a quick glance, it seems like you need to spell them right
Death Coil (with capital first letter in both Death and Coil)
Sudden Doom (not suddon)

Inrego - You are a champion...I had Death coil instead of Death Coil.

I think its all those hours of coding sometimes a fresh set of eyes works wonders. Thank you and +rep.
 
Back
Top