#include "Config.h" #include "MythicPlus.h" #include "MpDataStore.h" #include "MpLogger.h" #include "Player.h" #include "ScriptMgr.h" class MythicPlus_WorldScript : public WorldScript { public: MythicPlus_WorldScript() : WorldScript("MythicPlus_WorldScript") { } void OnAfterConfigLoad(bool /*reload*/) override { // Global Settings sMythicPlus->Enabled = sConfigMgr->GetOption("MythicPlus.Enabled", 1); sMythicPlus->EnableItemRewards = sConfigMgr->GetOption("MythicPlus.EnableItemRewards", 1); sMythicPlus->EnableDeathLimits = sConfigMgr->GetOption("MythicPlus.EnableDeathLimits", 1); /** @todo Add these back in once I write the parsers for handling the different configuration values. */ // sMythicPlus->enabledDifficulties = sConfigMgr->GetOption>("MythicPlus.EnabledDifficulties", {"mythic", "legendary", "ascendant"}); // sMythicPlus->disabledDungeons = sConfigMgr->GetOption>("MythicPlus.DisabledDungeons", {}); // Mythic Difficulty Modifiers sMythicPlus->mythicDungeonModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonHealth", 1.25f), .melee = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonMelee", 1.25f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBaseDamage", 1.5f), .spell = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonSpell", 1.15f), .armor = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonArmor", 1.25f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonAvgLevel", 83) }; sMythicPlus->mythicBossModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossHealth", 1.50f), .melee = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossMelee", 1.35f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossBaseDamage", 2.0f), .spell = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossSpell", 1.25f), .armor = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossArmor", 1.35f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Mythic.DungeonBossLevel", 85) }; // Legendary Difficulty Modifiers sMythicPlus->legendaryDungeonModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonHealth", 2.25f), .melee = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonMelee", 2.25f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBaseDamage", 2.75f), .spell = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonSpell", 2.25f), .armor = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonArmor", 2.25f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonAvgLevel", 85) }; sMythicPlus->legendaryBossModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossHealth", 2.25f), .melee = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossMelee", 2.25f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossBaseDamage", 4.0f), .spell = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossSpell", 2.25f), .armor = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossArmor", 3.25f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Legendary.DungeonBossLevel", 87) }; sMythicPlus->ascendantDungeonModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonHealth", 3.25f), .melee = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonMelee", 3.25f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBaseDamage", 4.75f), .spell = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonSpell", 3.25f), .armor = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonArmor", 3.25f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonAvgLevel", 87) }; sMythicPlus->ascendantBossModifiers = { .health = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossHealth", 3.25f), .melee = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossMelee", 3.25f), .baseDamage = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossBaseDamage", 6.0f), .spell = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossSpell", 3.25f), .armor = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossArmor", 3.25f), .avgLevel = sConfigMgr->GetOption("MythicPlus.Ascendant.DungeonBossLevel", 90) }; // Death Allowances sMythicPlus->mythicDeathAllowance = sConfigMgr->GetOption("MythicPlus.Mythic.DeathAllowance", 1000); sMythicPlus->legendaryDeathAllowance = sConfigMgr->GetOption("MythicPlus.Legendary.DeathAllowance", 30); sMythicPlus->ascendantDeathAllowance = sConfigMgr->GetOption("MythicPlus.Ascendant.DeathAllowance", 15); // Itemization Offsets sMythicPlus->mythicItemOffset = sConfigMgr->GetOption("MythicPlus.Mythic.ItemOffset", 20000000); sMythicPlus->legendaryItemOffset = sConfigMgr->GetOption("MythicPlus.Legendary.ItemOffset", 21000000); sMythicPlus->ascendantItemOffset = sConfigMgr->GetOption("MythicPlus.Ascendant.ItemOffset", 22000000); sMythicPlus->meleeAttackPowerDampener = sConfigMgr->GetOption("MythicPlus.MeleeAttackPowerDampener", 800); sMythicPlus->meleeAttackPowerStart = sConfigMgr->GetOption("MythicPlus.MeleeAttackPowerStart", 3000); } void OnStartup() override { int32 size = sMpDataStore->LoadScaleFactors(); MpLogger::info("Loaded {} Mythic+ Scaling Factors from database...", size); } }; void Add_MP_WorldScripts() { MpLogger::debug("Add_MP_WorldScripts()"); new MythicPlus_WorldScript(); }