public static int GetHighestDetectedSpellId() { int highest = 0; foreach (var spell in Spells) { highest = Math.Max(highest, spell.Key); } return highest; }