diff --git a/src/AutoBalance.cpp b/src/AutoBalance.cpp index b4bc533..254488c 100644 --- a/src/AutoBalance.cpp +++ b/src/AutoBalance.cpp @@ -126,7 +126,7 @@ InflectionPoint, InflectionPointRaid, InflectionPointRaid10M, InflectionPointRai int GetValidDebugLevel() { - int debugLevel = sConfigMgr->GetIntDefault("AutoBalance.DebugLevel", 2); + int debugLevel = sConfigMgr->GetOption("AutoBalance.DebugLevel", 2); if ((debugLevel < 0) || (debugLevel > 3)) { @@ -197,46 +197,46 @@ class AutoBalance_WorldScript : public WorldScript void SetInitialWorldSettings() { forcedCreatureIds.clear(); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.ForcedID40", ""), 40); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.ForcedID25", ""), 25); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.ForcedID10", ""), 10); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.ForcedID5", ""), 5); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.ForcedID2", ""), 2); - LoadForcedCreatureIdsFromString(sConfigMgr->GetStringDefault("AutoBalance.DisabledID", ""), 0); - - enabled = sConfigMgr->GetBoolDefault("AutoBalance.enable", 1); - LevelEndGameBoost = sConfigMgr->GetBoolDefault("AutoBalance.LevelEndGameBoost", 1); - DungeonsOnly = sConfigMgr->GetBoolDefault("AutoBalance.DungeonsOnly", 1); - PlayerChangeNotify = sConfigMgr->GetBoolDefault("AutoBalance.PlayerChangeNotify", 1); - LevelUseDb = sConfigMgr->GetBoolDefault("AutoBalance.levelUseDbValuesWhenExists", 1); - rewardEnabled = sConfigMgr->GetBoolDefault("AutoBalance.reward.enable", 1); - DungeonScaleDownXP = sConfigMgr->GetBoolDefault("AutoBalance.DungeonScaleDownXP", 0); - - LevelScaling = sConfigMgr->GetIntDefault("AutoBalance.levelScaling", 1); - PlayerCountDifficultyOffset = sConfigMgr->GetIntDefault("AutoBalance.playerCountDifficultyOffset", 0); - higherOffset = sConfigMgr->GetIntDefault("AutoBalance.levelHigherOffset", 3); - lowerOffset = sConfigMgr->GetIntDefault("AutoBalance.levelLowerOffset", 0); - rewardRaid = sConfigMgr->GetIntDefault("AutoBalance.reward.raidToken", 49426); - rewardDungeon = sConfigMgr->GetIntDefault("AutoBalance.reward.dungeonToken", 47241); - MinPlayerReward = sConfigMgr->GetFloatDefault("AutoBalance.reward.MinPlayerReward", 1); - - InflectionPoint = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPoint", 0.5f); - InflectionPointRaid = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaid", InflectionPoint); - InflectionPointRaid25M = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaid25M", InflectionPointRaid); - InflectionPointRaid10M = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaid10M", InflectionPointRaid); - InflectionPointHeroic = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointHeroic", InflectionPoint); - InflectionPointRaidHeroic = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaidHeroic", InflectionPointRaid); - InflectionPointRaid25MHeroic = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaid25MHeroic", InflectionPointRaid25M); - InflectionPointRaid10MHeroic = sConfigMgr->GetFloatDefault("AutoBalance.InflectionPointRaid10MHeroic", InflectionPointRaid10M); - BossInflectionMult = sConfigMgr->GetFloatDefault("AutoBalance.BossInflectionMult", 1.0f); - globalRate = sConfigMgr->GetFloatDefault("AutoBalance.rate.global", 1.0f); - healthMultiplier = sConfigMgr->GetFloatDefault("AutoBalance.rate.health", 1.0f); - manaMultiplier = sConfigMgr->GetFloatDefault("AutoBalance.rate.mana", 1.0f); - armorMultiplier = sConfigMgr->GetFloatDefault("AutoBalance.rate.armor", 1.0f); - damageMultiplier = sConfigMgr->GetFloatDefault("AutoBalance.rate.damage", 1.0f); - MinHPModifier = sConfigMgr->GetFloatDefault("AutoBalance.MinHPModifier", 0.1f); - MinManaModifier = sConfigMgr->GetFloatDefault("AutoBalance.MinManaModifier", 0.1f); - MinDamageModifier = sConfigMgr->GetFloatDefault("AutoBalance.MinDamageModifier", 0.1f); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.ForcedID40", ""), 40); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.ForcedID25", ""), 25); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.ForcedID10", ""), 10); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.ForcedID5", ""), 5); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.ForcedID2", ""), 2); + LoadForcedCreatureIdsFromString(sConfigMgr->GetOption("AutoBalance.DisabledID", ""), 0); + + enabled = sConfigMgr->GetOption("AutoBalance.enable", 1); + LevelEndGameBoost = sConfigMgr->GetOption("AutoBalance.LevelEndGameBoost", 1); + DungeonsOnly = sConfigMgr->GetOption("AutoBalance.DungeonsOnly", 1); + PlayerChangeNotify = sConfigMgr->GetOption("AutoBalance.PlayerChangeNotify", 1); + LevelUseDb = sConfigMgr->GetOption("AutoBalance.levelUseDbValuesWhenExists", 1); + rewardEnabled = sConfigMgr->GetOption("AutoBalance.reward.enable", 1); + DungeonScaleDownXP = sConfigMgr->GetOption("AutoBalance.DungeonScaleDownXP", 0); + + LevelScaling = sConfigMgr->GetOption("AutoBalance.levelScaling", 1); + PlayerCountDifficultyOffset = sConfigMgr->GetOption("AutoBalance.playerCountDifficultyOffset", 0); + higherOffset = sConfigMgr->GetOption("AutoBalance.levelHigherOffset", 3); + lowerOffset = sConfigMgr->GetOption("AutoBalance.levelLowerOffset", 0); + rewardRaid = sConfigMgr->GetOption("AutoBalance.reward.raidToken", 49426); + rewardDungeon = sConfigMgr->GetOption("AutoBalance.reward.dungeonToken", 47241); + MinPlayerReward = sConfigMgr->GetOption("AutoBalance.reward.MinPlayerReward", 1); + + InflectionPoint = sConfigMgr->GetOption("AutoBalance.InflectionPoint", 0.5f); + InflectionPointRaid = sConfigMgr->GetOption("AutoBalance.InflectionPointRaid", InflectionPoint); + InflectionPointRaid25M = sConfigMgr->GetOption("AutoBalance.InflectionPointRaid25M", InflectionPointRaid); + InflectionPointRaid10M = sConfigMgr->GetOption("AutoBalance.InflectionPointRaid10M", InflectionPointRaid); + InflectionPointHeroic = sConfigMgr->GetOption("AutoBalance.InflectionPointHeroic", InflectionPoint); + InflectionPointRaidHeroic = sConfigMgr->GetOption("AutoBalance.InflectionPointRaidHeroic", InflectionPointRaid); + InflectionPointRaid25MHeroic = sConfigMgr->GetOption("AutoBalance.InflectionPointRaid25MHeroic", InflectionPointRaid25M); + InflectionPointRaid10MHeroic = sConfigMgr->GetOption("AutoBalance.InflectionPointRaid10MHeroic", InflectionPointRaid10M); + BossInflectionMult = sConfigMgr->GetOption("AutoBalance.BossInflectionMult", 1.0f); + globalRate = sConfigMgr->GetOption("AutoBalance.rate.global", 1.0f); + healthMultiplier = sConfigMgr->GetOption("AutoBalance.rate.health", 1.0f); + manaMultiplier = sConfigMgr->GetOption("AutoBalance.rate.mana", 1.0f); + armorMultiplier = sConfigMgr->GetOption("AutoBalance.rate.armor", 1.0f); + damageMultiplier = sConfigMgr->GetOption("AutoBalance.rate.damage", 1.0f); + MinHPModifier = sConfigMgr->GetOption("AutoBalance.MinHPModifier", 0.1f); + MinManaModifier = sConfigMgr->GetOption("AutoBalance.MinManaModifier", 0.1f); + MinDamageModifier = sConfigMgr->GetOption("AutoBalance.MinDamageModifier", 0.1f); } }; @@ -250,7 +250,7 @@ class AutoBalance_PlayerScript : public PlayerScript void OnLogin(Player *Player) override { - if (sConfigMgr->GetBoolDefault("AutoBalanceAnnounce.enable", true)) { + if (sConfigMgr->GetOption("AutoBalanceAnnounce.enable", true)) { ChatHandler(Player->GetSession()).SendSysMessage("This server is running the |cff4CFF00AutoBalance |rmodule."); } }