Example #1
0
 public static EvadeSpellConfig GetEvadeSpell(string key)
 {
     if (EvadeSpells.Any(i => i.Key == key))
     {
         return(EvadeSpells[key]);
     }
     ConsoleDebug.WriteLineColor("EzEvade Spell: " + key + " Not Found, Returning: DO NOT USE", ConsoleColor.Red);
     return(new EvadeSpellConfig {
         DangerLevel = SpellDangerLevel.Low, SpellMode = SpellModes.Undodgeable, Use = false
     });
 }
        public static void MoveTo(int index, bool relative = false, bool dontSaveSelection = false)
        {
            try
            {
                if (relative)
                {
                    index += SelectedIndex;
                }
                if (index > Configs.Count)
                {
                    index = 0;
                }

                if (SelectedPreset != null)
                {
                    ConsoleDebug.WriteLine("Unloading Previous Preset...");
                    SelectedPreset.UnLoadConfig();
                }
                if (!dontSaveSelection)
                {
                    SelectedIndex = index;
                }
                SelectedPreset = Configs.ElementAt(index).Value;

                ConsoleDebug.WriteLine("Selected Config Plugin: " + SelectedPreset.GetAttribute().Name);


                ConsoleDebug.WriteLine("Changing Preset Menu Items...");
                DisableAllInMenu();
                var menu = Menus[SelectedPreset.GetAttribute()];
                menu.DisplayName   = "* " + menu.DisplayName;
                SelectedPresetMenu = menu;

                _blockChangedEvent = true;
                menu.Get <CheckBox>("Enabled").CurrentValue = true;
                _blockChangedEvent = false;

                ConsoleDebug.WriteLine("Initiating Preset...");
                SelectedPreset.InitiateConfig(ref Properties.Values);
                ConsoleDebug.WriteLine("Loading Preset...");
                SelectedPreset.LoadConfig();

                _lastChangedTime = Game.Time;
            }
            catch (Exception ex)
            {
                ConsoleDebug.WriteLineColor("Problem Loading Preset!", ConsoleColor.Red, true);
                ConsoleDebug.WriteLine(ex, true);
            }
        }
Example #3
0
 public static SpellConfig GetSpell(string key)
 {
     if (Spells.Any(i => i.Key == key))
     {
         ConsoleDebug.WriteLineColor(string.Format("Spell Found: {0}", Spells[key]), ConsoleColor.Yellow);
         return(Spells[key]);
     }
     if (ConfigValue.EnableSpellTester.GetBool())
     {
         if (SpellDatabase.Spells.Any(x => x.SpellName == key))
         {
             var spellfromdb = SpellDatabase.Spells.First(x => x.SpellName == key);
             return(new SpellConfig {
                 DangerLevel = spellfromdb.Dangerlevel, Radius = spellfromdb.Radius, Dodge = true, Draw = true, EvadeSpellMode = SpellModes.Always
             });
         }
     }
     ConsoleDebug.WriteLineColor("Spell: " + key + " Not Found, Returning: DO NOT DODGE", ConsoleColor.Red);
     return(new SpellConfig {
         DangerLevel = SpellDangerLevel.Normal, Dodge = false, Draw = true, EvadeSpellMode = SpellModes.Undodgeable, Radius = 20
     });
 }