Ejemplo n.º 1
0
 public static SpellConfig GetSpellConfig(this SpellData spell, SpellConfigControl control)
 {
     return new SpellConfig
     {
         DangerLevel = spell.Dangerlevel,
         Dodge = true,
         Draw = true,
         Radius = spell.Radius,
         PlayerName = spell.CharName
     };
 }
Ejemplo n.º 2
0
        public void LoadSpellDictionary()
        {
            LoadSpecialSpellPlugins();
            foreach (var hero in EntityManager.Heroes.AllHeroes)
            {
                try
                {

                    if (hero.IsMe)
                    {
                        foreach (var spell in SpellWindupDatabase.Spells.Where(
                            s => (s.CharName == hero.ChampionName)))
                        {
                            if (!WindupSpells.ContainsKey(spell.SpellName))
                            {
                                WindupSpells.Add(spell.SpellName, spell);
                            }
                        }
                    }
                    if (hero.Team != MyHero.Team)
                    {
                        ConsoleDebug.WriteLine("        Hero Found: " + hero.ChampionName);
                        foreach (var spell in SpellDatabase.Spells.Where(
                            s => (s.CharName == hero.ChampionName) || (s.CharName == Constants.AllChampions)))
                        {
                            ConsoleDebug.WriteLine("            Hero Spell Found: " + spell.SpellName);

                            if (!(spell.SpellType == SpellType.Circular
                                  || spell.SpellType == SpellType.Line
                                  || spell.SpellType == SpellType.Arc))
                                continue;

                            if (spell.CharName == Constants.AllChampions)
                            {
                                SpellSlot slot = hero.GetSpellSlotFromName(spell.SpellName);
                                if (slot == SpellSlot.Unknown)
                                {
                                    ConsoleDebug.WriteLineColor("           {0}: Not Found!", ConsoleColor.Yellow, false, spell.SpellName);
                                    continue;
                                }
                            }

                            if (!OnProcessSpells.ContainsKey(spell.SpellName))
                            {
                                if (spell.MissileName == "")
                                    spell.MissileName = spell.SpellName;

                                OnProcessSpells.Add(spell.SpellName, spell);
                                OnMissileSpells.Add(spell.MissileName, spell);

                                if (spell.ExtraSpellNames != null)
                                {
                                    foreach (string spellName in spell.ExtraSpellNames)
                                    {
                                        OnProcessSpells.Add(spellName, spell);
                                    }
                                }

                                if (spell.ExtraMissileNames != null)
                                {
                                    foreach (string spellName in spell.ExtraMissileNames)
                                    {
                                        OnMissileSpells.Add(spellName, spell);
                                    }
                                }

                                LoadSpecialSpell(spell);
                                if (!Config.Properties.Spells.Any(x => x.Key == spell.SpellName))
                                {
                                    string menuName = spell.CharName + " (" + spell.SpellKey + ") Settings";
                                    var enableSpell = !spell.DefaultOff;
                                    var spellConfig = new SpellConfigControl(SpellMenu, menuName, spell, enableSpell);
                                    spellConfig.AddToMenu();

                                    Config.Properties.SetSpell(spell.SpellName, spell.GetSpellConfig(spellConfig));
                                }
                            }

                        }
                    }
                }
                catch (Exception ex)
                {
                    
                    ConsoleDebug.WriteLine(ex.ToString(), ConsoleColor.Red);
                    throw;
                }
            }
        }