public static float GetAvoidanceHealth(AvoidanceType type, float defaultValue) { //TODO : Make mapping between Type and Config LoadAvoidanceDictionary(false); IAvoidanceHealth avoidanceHealth = null; switch (GilesTrinity.PlayerStatus.ActorClass) { case ActorClass.Barbarian: avoidanceHealth = GilesTrinity.Settings.Combat.Barbarian; break; case ActorClass.Monk: avoidanceHealth = GilesTrinity.Settings.Combat.Monk; break; case ActorClass.Wizard: avoidanceHealth = GilesTrinity.Settings.Combat.Wizard; break; case ActorClass.WitchDoctor: avoidanceHealth = GilesTrinity.Settings.Combat.WitchDoctor; break; case ActorClass.DemonHunter: avoidanceHealth = GilesTrinity.Settings.Combat.DemonHunter; break; } if (avoidanceHealth != null) { switch (type) { case AvoidanceType.Arcane: return(avoidanceHealth.AvoidArcaneHealth); case AvoidanceType.AzmodanBody: return(avoidanceHealth.AvoidAzmoBodiesHealth); case AvoidanceType.AzmoFireball: return(avoidanceHealth.AvoidAzmoFireBallHealth); case AvoidanceType.AzmodanPool: return(avoidanceHealth.AvoidAzmoPoolsHealth); case AvoidanceType.BeeWasp: return(avoidanceHealth.AvoidBeesWaspsHealth); case AvoidanceType.Belial: return(avoidanceHealth.AvoidBelialHealth); case AvoidanceType.ButcherFloorPanel: return(avoidanceHealth.AvoidButcherFloorPanelHealth); case AvoidanceType.Desecrator: return(avoidanceHealth.AvoidDesecratorHealth); case AvoidanceType.DiabloMeteor: return(avoidanceHealth.AvoidDiabloMeteorHealth); case AvoidanceType.DiabloPrison: return(avoidanceHealth.AvoidDiabloPrisonHealth); case AvoidanceType.DiabloRingOfFire: return(avoidanceHealth.AvoidDiabloRingOfFireHealth); case AvoidanceType.GhomGas: return(avoidanceHealth.AvoidGhomGasHealth); case AvoidanceType.IceBall: return(avoidanceHealth.AvoidIceBallsHealth); case AvoidanceType.IceTrail: return(avoidanceHealth.AvoidIceTrailHealth); case AvoidanceType.MageFire: return(avoidanceHealth.AvoidMageFireHealth); case AvoidanceType.MaghdaProjectille: return(avoidanceHealth.AvoidMaghdaProjectilleHealth); case AvoidanceType.MoltenBall: return(avoidanceHealth.AvoidMoltenBallHealth); case AvoidanceType.MoltenCore: return(avoidanceHealth.AvoidMoltenCoreHealth); case AvoidanceType.MoltenTrail: return(avoidanceHealth.AvoidMoltenTrailHealth); case AvoidanceType.PlagueCloud: return(avoidanceHealth.AvoidPlagueCloudHealth); case AvoidanceType.PlagueHand: return(avoidanceHealth.AvoidPlagueHandsHealth); case AvoidanceType.PoisonTree: return(avoidanceHealth.AvoidPoisonTreeHealth); case AvoidanceType.SuccubusStar: return(avoidanceHealth.AvoidSuccubusStarHealth); case AvoidanceType.ShamanFire: return(avoidanceHealth.AvoidShamanFireHealth); case AvoidanceType.ZoltBubble: return(avoidanceHealth.AvoidZoltBubbleHealth); case AvoidanceType.ZoltTwister: return(avoidanceHealth.AvoidZoltTwisterHealth); default: { DbHelper.Log(TrinityLogLevel.Error, LogCategory.Avoidance, "Unknown Avoidance type in Health Switch! {0}", type.ToString()); return(defaultValue); } } } return(defaultValue); }
public static float GetAvoidanceHealth(AvoidanceType type, float defaultValue) { // Monks with Serenity up ignore all AOE's if (Trinity.Player.ActorClass == ActorClass.Monk && Trinity.Hotbar.Contains(SNOPower.Monk_Serenity) && Trinity.GetHasBuff(SNOPower.Monk_Serenity)) { // Monks with serenity are immune defaultValue *= V.F("Monk.Avoidance.Serenity"); Logger.Log(TrinityLogLevel.Debug, LogCategory.Avoidance, "Ignoring avoidance as a Monk with Serenity"); } // Witch doctors with spirit walk available and not currently Spirit Walking will subtly ignore ice balls, arcane, desecrator & plague cloud if (Trinity.Player.ActorClass == ActorClass.Witchdoctor && Trinity.Hotbar.Contains(SNOPower.Witchdoctor_SpiritWalk) && Trinity.GetHasBuff(SNOPower.Witchdoctor_SpiritWalk)) { if (type == AvoidanceType.IceBall || type == AvoidanceType.Arcane || type == AvoidanceType.Desecrator || type == AvoidanceType.PlagueCloud) { // Ignore ICE/Arcane/Desc/PlagueCloud altogether with spirit walk up or available defaultValue *= V.F("WitchDoctor.Avoidance.SpiritWalk"); Logger.Log(TrinityLogLevel.Debug, LogCategory.Avoidance, "Ignoring avoidance as a WitchDoctor with Spirit Walk"); } } // Remove ice balls if the barbarian has wrath of the berserker up, and reduce health from most other SNO avoidances if (Trinity.Player.ActorClass == ActorClass.Barbarian && Trinity.Settings.Combat.Barbarian.IgnoreAvoidanceInWOTB && Trinity.Hotbar.Contains(SNOPower.Barbarian_WrathOfTheBerserker) && Trinity.GetHasBuff(SNOPower.Barbarian_WrathOfTheBerserker)) { switch (type) { case AvoidanceType.IceBall: defaultValue *= V.F("Barbarian.Avoidance.WOTB.IceBall"); break; case AvoidanceType.Arcane: defaultValue *= V.F("Barbarian.Avoidance.WOTB.Arcane"); break; case AvoidanceType.Desecrator: defaultValue *= V.F("Barbarian.Avoidance.WOTB.Desecrator"); break; case AvoidanceType.Belial: defaultValue = V.F("Barbarian.Avoidance.WOTB.Belial"); break; case AvoidanceType.PoisonTree: defaultValue = V.F("Barbarian.Avoidance.WOTB.PoisonTree"); break; case AvoidanceType.BeastCharge: defaultValue = V.F("Barbarian.Avoidance.WOTB.BeastCharge"); break; case AvoidanceType.MoltenCore: defaultValue = V.F("Barbarian.Avoidance.WOTB.MoltenCore"); break; default: defaultValue *= V.F("Barbarian.Avoidance.WOTB.Other"); break; } } IAvoidanceHealth avoidanceHealth = null; switch (Trinity.Player.ActorClass) { case ActorClass.Barbarian: avoidanceHealth = Trinity.Settings.Combat.Barbarian; break; case ActorClass.Crusader: avoidanceHealth = Trinity.Settings.Combat.Crusader; break; case ActorClass.Monk: avoidanceHealth = Trinity.Settings.Combat.Monk; break; case ActorClass.Wizard: avoidanceHealth = Trinity.Settings.Combat.Wizard; break; case ActorClass.Witchdoctor: avoidanceHealth = Trinity.Settings.Combat.WitchDoctor; break; case ActorClass.DemonHunter: avoidanceHealth = Trinity.Settings.Combat.DemonHunter; break; } if (avoidanceHealth != null) { switch (type) { case AvoidanceType.Arcane: return(avoidanceHealth.AvoidArcaneHealth); case AvoidanceType.AzmoFireball: return(avoidanceHealth.AvoidAzmoFireBallHealth); case AvoidanceType.AzmodanBody: return(avoidanceHealth.AvoidAzmoBodiesHealth); case AvoidanceType.AzmodanPool: return(avoidanceHealth.AvoidAzmoPoolsHealth); case AvoidanceType.BeastCharge: return(1); case AvoidanceType.BeeWasp: return(avoidanceHealth.AvoidBeesWaspsHealth); case AvoidanceType.Belial: return(avoidanceHealth.AvoidBelialHealth); case AvoidanceType.ButcherFloorPanel: return(avoidanceHealth.AvoidButcherFloorPanelHealth); case AvoidanceType.Desecrator: return(avoidanceHealth.AvoidDesecratorHealth); case AvoidanceType.DiabloMeteor: return(avoidanceHealth.AvoidDiabloMeteorHealth); case AvoidanceType.DiabloPrison: return(avoidanceHealth.AvoidDiabloPrisonHealth); case AvoidanceType.DiabloRingOfFire: return(avoidanceHealth.AvoidDiabloRingOfFireHealth); case AvoidanceType.FireChains: return(0.8f); case AvoidanceType.FrozenPulse: return(avoidanceHealth.AvoidFrozenPulseHealth); case AvoidanceType.GhomGas: return(avoidanceHealth.AvoidGhomGasHealth); case AvoidanceType.Grotesque: return(avoidanceHealth.AvoidGrotesqueHealth); case AvoidanceType.IceBall: return(avoidanceHealth.AvoidIceBallsHealth); case AvoidanceType.IceTrail: return(avoidanceHealth.AvoidIceTrailHealth); case AvoidanceType.Orbiter: return(avoidanceHealth.AvoidOrbiterHealth); case AvoidanceType.MageFire: return(avoidanceHealth.AvoidMageFireHealth); case AvoidanceType.MaghdaProjectille: return(avoidanceHealth.AvoidMaghdaProjectilleHealth); case AvoidanceType.MoltenBall: return(avoidanceHealth.AvoidMoltenBallHealth); case AvoidanceType.MoltenCore: return(avoidanceHealth.AvoidMoltenCoreHealth); case AvoidanceType.MoltenTrail: return(avoidanceHealth.AvoidMoltenTrailHealth); case AvoidanceType.Mortar: return(0.25f); case AvoidanceType.PlagueCloud: return(avoidanceHealth.AvoidPlagueCloudHealth); case AvoidanceType.PlagueHand: return(avoidanceHealth.AvoidPlagueHandsHealth); case AvoidanceType.PoisonEnchanted: return(avoidanceHealth.AvoidPoisonEnchantedHealth); case AvoidanceType.PoisonTree: return(avoidanceHealth.AvoidPoisonTreeHealth); case AvoidanceType.ShamanFire: return(avoidanceHealth.AvoidShamanFireHealth); case AvoidanceType.Thunderstorm: return(avoidanceHealth.AvoidThunderstormHealth); case AvoidanceType.Wormhole: return(avoidanceHealth.AvoidWormholeHealth); case AvoidanceType.ZoltBubble: return(avoidanceHealth.AvoidZoltBubbleHealth); case AvoidanceType.ZoltTwister: return(avoidanceHealth.AvoidZoltTwisterHealth); default: { //Logger.Log(TrinityLogLevel.Error, LogCategory.Avoidance, "Unknown Avoidance type in Health Switch! {0}", type.ToString()); return(defaultValue); } } } return(defaultValue); }