public WoWSpecialization WowSpecialization(bool doOutput = false) { try { string specInfo = Others.GetRandomString(Others.Random(4, 10)); Lua.LuaDoString( "if GetSpecialization() ~= nil and GetSpecializationInfo(GetSpecialization()) ~= nil then id,name,description,icon,role,primary = GetSpecializationInfo(GetSpecialization()) " + specInfo + " = id .. \"^\" .. name .. \"^\" .. role .. \"^\" .. primary else " + specInfo + " = 0 end"); string[] specInfos = Lua.GetLocalizedText(specInfo).Split('^'); if (specInfos.Count() != 4) { if (doOutput) { Logging.WriteDebug("WoW Specialization not found"); } return(WoWSpecialization.None); } if (doOutput) { Logging.WriteDebug("WoW Specialization found: " + WowClass + " " + specInfos[1] + ", role: " + specInfos[2]); } WoWSpecialization rWoWSpecialization = (WoWSpecialization)Others.ToInt32(specInfos[0]); return(rWoWSpecialization); } catch (Exception e) { Logging.WriteError("WoWPlayer > WoWSpecialization: " + e); } return(WoWSpecialization.None); }
public override void Run() { Logging.Write("We have detected that your Wow Specialization has changed, reloading it."); _lastSpecialization = ObjectManager.ObjectManager.Me.WowSpecialization(); if (ObjectManager.ObjectManager.Me.Level >= 15 && nManagerSetting.CurrentSetting.AutoAssignTalents) { Talent.DoTalents(); // First talent at level 15. Level check kept as additional security, should be useless here. } SpellManager.UpdateSpellBook(); // It also reset Combat/Healer classes. }
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."); }
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."); }
public static void LoadWoWSpecialization() { while (ObjectManager.ObjectManager.Me.WowClass == WoWClass.None) { Thread.Sleep(10); } if (CombatClass.IsAliveCombatClass || HealerClass.IsAliveHealerClass) { return; } // This has low chance to be loaded after a CombatClass is started, but in case, // we prioritize CombatClass values. This is in order to get our spec if we don't start any product. WoWSpecialization mySpec = ObjectManager.ObjectManager.Me.WowSpecialization(true); if (mySpec != WoWSpecialization.None) { SetPlayerSpe(ObjectManager.ObjectManager.Me.WowSpecialization()); return; } switch (ObjectManager.ObjectManager.Me.WowClass) { case WoWClass.DeathKnight: SetPlayerSpe(WoWSpecialization.DeathknightUnholy); break; case WoWClass.Druid: SetPlayerSpe(WoWSpecialization.DruidBalance); break; case WoWClass.Hunter: SetPlayerSpe(WoWSpecialization.HunterMarksmanship); break; case WoWClass.Mage: SetPlayerSpe(WoWSpecialization.MageFrost); break; case WoWClass.Monk: SetPlayerSpe(WoWSpecialization.MonkBrewmaster); break; case WoWClass.Paladin: SetPlayerSpe(WoWSpecialization.PaladinRetribution); break; case WoWClass.Priest: SetPlayerSpe(WoWSpecialization.PriestShadow); break; case WoWClass.Rogue: SetPlayerSpe(WoWSpecialization.RogueOutlaw); break; case WoWClass.Shaman: SetPlayerSpe(WoWSpecialization.ShamanRestoration); break; case WoWClass.Warlock: SetPlayerSpe(WoWSpecialization.WarlockDemonology); break; case WoWClass.Warrior: SetPlayerSpe(WoWSpecialization.WarriorArms); break; } }
public static void SetPlayerSpe(WoWSpecialization spe) { InternalEquipableWeapons.Clear(); InternalEquipementStats.Clear(); // Template lists List <WoWStatistic> IntelBased = new List <WoWStatistic>() { WoWStatistic.INTELLECT, WoWStatistic.STAMINA, WoWStatistic.HASTE_RATING, WoWStatistic.CRIT_RATING, WoWStatistic.SPELL_POWER, WoWStatistic.MASTERY_RATING }; List <WoWStatistic> Heal = new List <WoWStatistic>() { WoWStatistic.SPIRIT }; Heal.AddRange(IntelBased); List <WoWStatistic> MagicDPS = new List <WoWStatistic>() { WoWStatistic.HIT_RATING }; MagicDPS.AddRange(IntelBased); List <WoWStatistic> AgilityBased = new List <WoWStatistic>() { WoWStatistic.AGILITY, WoWStatistic.STAMINA, WoWStatistic.HASTE_RATING, WoWStatistic.CRIT_RATING, WoWStatistic.ATTACK_POWER, WoWStatistic.MASTERY_RATING, WoWStatistic.HIT_RATING, WoWStatistic.EXPERTISE_RATING }; List <WoWStatistic> StrenghBased = new List <WoWStatistic>() { WoWStatistic.STRENGTH, WoWStatistic.STAMINA, WoWStatistic.HASTE_RATING, WoWStatistic.MASTERY_RATING, WoWStatistic.HIT_RATING, WoWStatistic.EXPERTISE_RATING }; List <WoWStatistic> StrenghDPS = new List <WoWStatistic>() { WoWStatistic.CRIT_RATING, WoWStatistic.ATTACK_POWER }; StrenghDPS.AddRange(StrenghBased); // Armor and weapons switch (spe) { case WoWSpecialization.DeathknightBlood: case WoWSpecialization.DeathknightUnholy: case WoWSpecialization.DeathknightFrost: InternalEquipableArmorItemType = WowItemSubClassArmor.Plate; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); break; case WoWSpecialization.MageArcane: case WoWSpecialization.MageFire: case WoWSpecialization.MageFrost: InternalEquipableArmorItemType = WowItemSubClassArmor.Cloth; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Wand); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); // + OffHand break; case WoWSpecialization.WarlockDemonology: case WoWSpecialization.WarlockAffliction: case WoWSpecialization.WarlockDestruction: InternalEquipableArmorItemType = WowItemSubClassArmor.Cloth; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Wand); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); // + OffHand break; case WoWSpecialization.DruidFeral: case WoWSpecialization.DruidGuardian: case WoWSpecialization.DruidBalance: case WoWSpecialization.DruidRestoration: InternalEquipableArmorItemType = WowItemSubClassArmor.Leather; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Fist); // + OffHand break; case WoWSpecialization.PaladinRetribution: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Plate; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); break; case WoWSpecialization.PaladinProtection: case WoWSpecialization.PaladinHoly: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Plate; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalHasShield = true; break; case WoWSpecialization.ShamanEnhancement: case WoWSpecialization.ShamanElemental: case WoWSpecialization.ShamanRestoration: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Leather; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Fist); InternalHasShield = true; break; case WoWSpecialization.PriestShadow: case WoWSpecialization.PriestDiscipline: case WoWSpecialization.PriestHoly: InternalEquipableArmorItemType = WowItemSubClassArmor.Cloth; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Wand); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); // + OffHand break; case WoWSpecialization.RogueOutlaw: case WoWSpecialization.RogueAssassination: case WoWSpecialization.RogueSubtlety: InternalEquipableArmorItemType = WowItemSubClassArmor.Leather; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Fist); // + Bows, Crossbows, Guns, Thrown break; case WoWSpecialization.WarriorArms: case WoWSpecialization.WarriorFury: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Plate; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace2); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); // + Staf, Dagger, Fist, Bow, Crossbow, Gun, Thrown break; case WoWSpecialization.WarriorProtection: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Plate; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Dagger); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Fist); InternalHasShield = true; break; case WoWSpecialization.HunterMarksmanship: case WoWSpecialization.HunterSurvival: case WoWSpecialization.HunterBeastMastery: if (ObjectManager.ObjectManager.Me.Level < 40) { InternalEquipableArmorItemType = WowItemSubClassArmor.Leather; } else { InternalEquipableArmorItemType = WowItemSubClassArmor.Mail; } InternalEquipableWeapons.Add(WowItemSubClassWeapon.Gun); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Bow); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Crossbow); // + lots of useless weapons break; case WoWSpecialization.MonkBrewmaster: case WoWSpecialization.MonkWindwalker: case WoWSpecialization.MonkMistweaver: InternalEquipableArmorItemType = WowItemSubClassArmor.Leather; InternalEquipableWeapons.Add(WowItemSubClassWeapon.Polearm); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Staff); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Axe); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Sword); InternalEquipableWeapons.Add(WowItemSubClassWeapon.Mace); break; default: InternalEquipableArmorItemType = WowItemSubClassArmor.Cloth; break; } // Statistics switch (spe) { case WoWSpecialization.DeathknightBlood: InternalEquipementStats.AddRange(StrenghBased); InternalEquipementStats.Add(WoWStatistic.PARRY_RATING); InternalEquipementStats.Add(WoWStatistic.DODGE_RATING); break; case WoWSpecialization.DeathknightUnholy: case WoWSpecialization.DeathknightFrost: InternalEquipementStats.AddRange(StrenghDPS); break; case WoWSpecialization.MageArcane: case WoWSpecialization.MageFire: case WoWSpecialization.MageFrost: InternalEquipementStats.AddRange(MagicDPS); break; case WoWSpecialization.WarlockDemonology: case WoWSpecialization.WarlockAffliction: case WoWSpecialization.WarlockDestruction: InternalEquipementStats.AddRange(MagicDPS); break; case WoWSpecialization.DruidFeral: InternalEquipementStats.AddRange(AgilityBased); break; case WoWSpecialization.DruidGuardian: InternalEquipementStats.AddRange(AgilityBased); InternalEquipementStats.Add(WoWStatistic.DODGE_RATING); break; case WoWSpecialization.DruidBalance: InternalEquipementStats.AddRange(MagicDPS); break; case WoWSpecialization.DruidRestoration: InternalEquipementStats.AddRange(Heal); break; case WoWSpecialization.PaladinRetribution: InternalEquipementStats.AddRange(StrenghDPS); break; case WoWSpecialization.PaladinProtection: InternalEquipementStats.AddRange(StrenghBased); InternalEquipementStats.Add(WoWStatistic.PARRY_RATING); InternalEquipementStats.Add(WoWStatistic.DODGE_RATING); break; case WoWSpecialization.PaladinHoly: InternalEquipementStats.AddRange(Heal); break; case WoWSpecialization.ShamanEnhancement: InternalEquipementStats.AddRange(AgilityBased); break; case WoWSpecialization.ShamanElemental: InternalEquipementStats.AddRange(MagicDPS); InternalEquipementStats.Add(WoWStatistic.SPIRIT); break; case WoWSpecialization.ShamanRestoration: InternalEquipementStats.AddRange(Heal); break; case WoWSpecialization.PriestShadow: InternalEquipementStats.AddRange(MagicDPS); InternalEquipementStats.Add(WoWStatistic.SPIRIT); break; case WoWSpecialization.PriestDiscipline: case WoWSpecialization.PriestHoly: InternalEquipementStats.AddRange(Heal); break; case WoWSpecialization.RogueOutlaw: case WoWSpecialization.RogueAssassination: case WoWSpecialization.RogueSubtlety: InternalEquipementStats.AddRange(AgilityBased); break; case WoWSpecialization.WarriorArms: case WoWSpecialization.WarriorFury: InternalEquipementStats.AddRange(StrenghDPS); break; case WoWSpecialization.WarriorProtection: InternalEquipementStats.AddRange(StrenghBased); InternalEquipementStats.Add(WoWStatistic.PARRY_RATING); InternalEquipementStats.Add(WoWStatistic.DODGE_RATING); InternalEquipementStats.Add(WoWStatistic.CRIT_RATING); break; case WoWSpecialization.HunterMarksmanship: case WoWSpecialization.HunterSurvival: case WoWSpecialization.HunterBeastMastery: InternalEquipementStats.AddRange(AgilityBased); break; case WoWSpecialization.MonkBrewmaster: InternalEquipementStats.AddRange(AgilityBased); InternalEquipementStats.Add(WoWStatistic.DODGE_RATING); break; case WoWSpecialization.MonkWindwalker: InternalEquipementStats.AddRange(AgilityBased); break; case WoWSpecialization.MonkMistweaver: InternalEquipementStats.AddRange(Heal); break; default: break; } }