public void Initialize(bool configOnly, bool resetSettings = false)
    {
        try
        {
            if (!InternalLoop)
            {
                InternalLoop = true;
            }
            Logging.WriteFight("Loading combat system.");
            WoWSpecialization wowSpecialization = ObjectManager.Me.WowSpecialization(true);
            switch (ObjectManager.Me.WowClass)
            {
                #region TEMPLATE_CLASS Specialisation checking

            case WoWClass.TEMPLATE_CLASS:

                if (wowSpecialization == WoWSpecialization.TEMPLATE_SPEC || wowSpecialization == WoWSpecialization.None)
                {
                    if (configOnly)
                    {
                        string currentSettingsFile = Application.StartupPath + "\\CombatClasses\\Settings\\TEMPLATE_SPEC.xml";
                        var    currentSetting      = new TEMPLATE_SPEC.TEMPLATE_SPECSettings();
                        if (File.Exists(currentSettingsFile) && !resetSettings)
                        {
                            currentSetting = Settings.Load <TEMPLATE_SPEC.TEMPLATE_SPECSettings>(currentSettingsFile);
                        }
                        currentSetting.ToForm();
                        currentSetting.Save(currentSettingsFile);
                    }
                    else
                    {
                        Logging.WriteFight("Loading TEMPLATE_SPEC Combat class...");
                        EquipmentAndStats.SetPlayerSpe(WoWSpecialization.TEMPLATE_SPEC);
                        new TEMPLATE_CLASS();
                    }
                    break;
                }
                break;

                #endregion

            default:
                Dispose();
                break;
            }
        }
        catch
        {
        }
        Logging.WriteFight("Combat system stopped.");
    }
Exemple #2
0
    public void Initialize(bool configOnly, bool resetSettings = false)
    {
        try
        {
            if (!InternalLoop)
            {
                InternalLoop = true;
            }
            Logging.WriteFight("Loading combat system.");
            WoWSpecialization wowSpecialization = ObjectManager.Me.WowSpecialization(true);
            switch (ObjectManager.Me.WowClass)
            {
                #region DemonHunter Specialisation checking

            case WoWClass.DemonHunter:

                if (wowSpecialization == WoWSpecialization.DemonHunterVengeance || wowSpecialization == WoWSpecialization.None)
                {
                    if (configOnly)
                    {
                        string currentSettingsFile = Application.StartupPath + "\\CombatClasses\\Settings\\DemonHunter_Vengeance.xml";
                        var    currentSetting      = new DemonHunterVengeance.DemonHunterVengeanceSettings();
                        if (File.Exists(currentSettingsFile) && !resetSettings)
                        {
                            currentSetting = Settings.Load <DemonHunterVengeance.DemonHunterVengeanceSettings>(currentSettingsFile);
                        }
                        currentSetting.ToForm();
                        currentSetting.Save(currentSettingsFile);
                    }
                    else
                    {
                        Logging.WriteFight("Loading DemonHunter Vengeance Combat class...");
                        EquipmentAndStats.SetPlayerSpe(WoWSpecialization.DemonHunterVengeance);
                        new DemonHunterVengeance();
                    }
                    break;
                }
                if (wowSpecialization == WoWSpecialization.DemonHunterHavoc)
                {
                    if (configOnly)
                    {
                        string currentSettingsFile = Application.StartupPath + "\\CombatClasses\\Settings\\DemonHunter_Havoc.xml";
                        var    currentSetting      = new DemonHunterHavoc.DemonHunterHavocSettings();
                        if (File.Exists(currentSettingsFile) && !resetSettings)
                        {
                            currentSetting = Settings.Load <DemonHunterHavoc.DemonHunterHavocSettings>(currentSettingsFile);
                        }
                        currentSetting.ToForm();
                        currentSetting.Save(currentSettingsFile);
                    }
                    else
                    {
                        Logging.WriteFight("Loading DemonHunter Havoc Combat class...");
                        EquipmentAndStats.SetPlayerSpe(WoWSpecialization.DemonHunterHavoc);
                        new DemonHunterHavoc();
                    }
                    break;
                }
                break;

                #endregion

            default:
                Dispose();
                break;
            }
        }
        catch
        {
        }
        Logging.WriteFight("Combat system stopped.");
    }