diff --git a/conf/mod-profession-experience.conf.dist b/conf/mod-profession-experience.conf.dist index 21ce81f..b2e4795 100644 --- a/conf/mod-profession-experience.conf.dist +++ b/conf/mod-profession-experience.conf.dist @@ -26,10 +26,11 @@ ProfessionExperience.MultOrange = 1.25 # # ProfessionExperience.*.Enabled -# Description: Enable experience gain when crafting or gathering with this profession. Enchanting governs both Enchanting and Disenchanting +# Description: Enable experience gain when crafting or gathering with this profession # Default: 0 - (Disabled, ProfessionExperience.Alchemy.Enabled) # 0 - (Disabled, ProfessionExperience.Blacksmith.Enabled) # 0 - (Disabled, ProfessionExperience.Cooking.Enabled) +# 0 - (Disabled, ProfessionExperience.Disenchanting.Enabled) # 0 - (Disabled, ProfessionExperience.Enchanting.Enabled) # 0 - (Disabled, ProfessionExperience.Engineering.Enabled) # 1 - (Enabled, ProfessionExperience.Fishing.Enabled) @@ -39,9 +40,7 @@ ProfessionExperience.MultOrange = 1.25 # 0 - (Disabled, ProfessionExperience.Jewelcrafting.Enabled) # 0 - (Disabled, ProfessionExperience.Leatherworking.Enabled) # 0 - (Disabled, ProfessionExperience.Lockpick.Enabled) -# 0 - (Disabled, ProfessionExperience.Milling.Enabled) # 1 - (Enabled, ProfessionExperience.Mining.Enabled) -# 0 - (Disabled, ProfessionExperience.Prospecting.Enabled) # 0 - (Disabled, ProfessionExperience.Skinning.Enabled) # 0 - (Disabled, ProfessionExperience.Smelting.Enabled) # 0 - (Disabled, ProfessionExperience.Tailoring.Enabled) @@ -49,6 +48,7 @@ ProfessionExperience.MultOrange = 1.25 ProfessionExperience.Alchemy.Enabled = 0 ProfessionExperience.Blacksmith.Enabled = 0 ProfessionExperience.Cooking.Enabled = 0 +ProfessionExperience.Disenchanting.Enabled = 0 ProfessionExperience.Enchanting.Enabled = 0 ProfessionExperience.Engineering.Enabled = 0 ProfessionExperience.Fishing.Enabled = 1 @@ -58,9 +58,7 @@ ProfessionExperience.Inscription.Enabled = 0 ProfessionExperience.Jewelcrafting.Enabled = 0 ProfessionExperience.Leatherworking.Enabled = 0 ProfessionExperience.Lockpick.Enabled = 0 -ProfessionExperience.Milling.Enabled = 0 ProfessionExperience.Mining.Enabled = 1 -ProfessionExperience.Prospecting.Enabled = 0 ProfessionExperience.Skinning.Enabled = 0 ProfessionExperience.Smelting.Enabled = 0 ProfessionExperience.Tailoring.Enabled = 0 @@ -74,6 +72,7 @@ ProfessionExperience.Tailoring.Enabled = 0 ProfessionExperience.Alchemy.Experience = 0.01 ProfessionExperience.Blacksmith.Experience = 0.01 ProfessionExperience.Cooking.Experience = 0.01 +ProfessionExperience.Disenchanting.Experience = 0.01 ProfessionExperience.Enchanting.Experience = 0.01 ProfessionExperience.Engineering.Experience = 0.01 ProfessionExperience.Fishing.Experience = 0.01 @@ -83,9 +82,7 @@ ProfessionExperience.Inscription.Experience = 0.01 ProfessionExperience.Jewelcrafting.Experience = 0.01 ProfessionExperience.Leatherworking.Experience = 0.01 ProfessionExperience.Lockpick.Experience = 0.01 -ProfessionExperience.Milling.Experience = 0.01 ProfessionExperience.Mining.Experience = 0.01 -ProfessionExperience.Prospecting.Experience = 0.01 ProfessionExperience.Skinning.Experience = 0.01 ProfessionExperience.Smelting.Experience = 0.01 ProfessionExperience.Tailoring.Experience = 0.01 diff --git a/src/ProfessionExp.cpp b/src/ProfessionExp.cpp index 3acbbc6..d27df5c 100644 --- a/src/ProfessionExp.cpp +++ b/src/ProfessionExp.cpp @@ -16,6 +16,8 @@ enum class PEConfig BLACKSMITH_EXPERIENCE, COOKING_ENABLED, COOKING_EXPERIENCE, + DISENCHANTING_ENABLED, + DISENCHANTING_EXPERIENCE, ENCHANTING_ENABLED, ENCHANTING_EXPERIENCE, ENGINEERING_ENABLED, @@ -46,7 +48,7 @@ enum class PEConfig SMELTING_EXPERIENCE, TAILORING_ENABLED, TAILORING_EXPERIENCE, - MULT_GREY, + MULT_GRAY, MULT_GREEN, MULT_YELLOW, MULT_ORANGE, @@ -70,6 +72,9 @@ public: SetConfigValue(PEConfig::COOKING_ENABLED, "ProfessionExperience.Cooking.Enabled", false); SetConfigValue(PEConfig::COOKING_EXPERIENCE, "ProfessionExperience.Cooking.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); + SetConfigValue(PEConfig::DISENCHANTING_ENABLED, "ProfessionExperience.Disenchanting.Enabled", false); + SetConfigValue(PEConfig::DISENCHANTING_EXPERIENCE, "ProfessionExperience.Disenchanting.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); + SetConfigValue(PEConfig::ENCHANTING_ENABLED, "ProfessionExperience.Enchanting.Enabled", false); SetConfigValue(PEConfig::ENCHANTING_EXPERIENCE, "ProfessionExperience.Enchanting.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); @@ -97,15 +102,9 @@ public: SetConfigValue(PEConfig::LOCKPICK_ENABLED, "ProfessionExperience.Lockpick.Enabled", false); SetConfigValue(PEConfig::LOCKPICK_EXPERIENCE, "ProfessionExperience.Lockpick.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); - SetConfigValue(PEConfig::MILLING_ENABLED, "ProfessionExperience.Milling.Enabled", false); - SetConfigValue(PEConfig::MILLING_EXPERIENCE, "ProfessionExperience.Milling.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); - SetConfigValue(PEConfig::MINING_ENABLED, "ProfessionExperience.Mining.Enabled", true); SetConfigValue(PEConfig::MINING_EXPERIENCE, "ProfessionExperience.Mining.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); - SetConfigValue(PEConfig::PROSPECTING_ENABLED, "ProfessionExperience.Prospecting.Enabled", false); - SetConfigValue(PEConfig::PROSPECTING_EXPERIENCE, "ProfessionExperience.Prospecting.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); - SetConfigValue(PEConfig::SKINNING_ENABLED, "ProfessionExperience.Skinning.Enabled", false); SetConfigValue(PEConfig::SKINNING_EXPERIENCE, "ProfessionExperience.Skinning.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); @@ -115,7 +114,7 @@ public: SetConfigValue(PEConfig::TAILORING_ENABLED, "ProfessionExperience.Tailoring.Enabled", false); SetConfigValue(PEConfig::TAILORING_EXPERIENCE, "ProfessionExperience.Tailoring.Experience", 0.01, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value > 0.0f; }, "> 0"); - SetConfigValue(PEConfig::MULT_GREY, "ProfessionExperience.MultGrey", 0.0f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0"); + SetConfigValue(PEConfig::MULT_GRAY, "ProfessionExperience.MultGray", 0.0f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0"); SetConfigValue(PEConfig::MULT_GREEN, "ProfessionExperience.MultGreen", 0.75f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0"); SetConfigValue(PEConfig::MULT_YELLOW, "ProfessionExperience.MultYellow", 1.0f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0"); SetConfigValue(PEConfig::MULT_ORANGE, "ProfessionExperience.MultOrange", 1.25f, ConfigValueCache::Reloadable::Yes, [](float const& value) { return value >= 0.0f; }, ">= 0"); @@ -162,14 +161,6 @@ RewardExperienceScript() : PlayerScript("RewardExperienceScript", { enabledSetting = PEConfig::LOCKPICK_ENABLED; experienceSetting = PEConfig::LOCKPICK_EXPERIENCE; break; - case SKILL_JEWELCRAFTING: - enabledSetting = PEConfig::PROSPECTING_ENABLED; - experienceSetting = PEConfig::PROSPECTING_EXPERIENCE; - break; - case SKILL_INSCRIPTION: - enabledSetting = PEConfig::MILLING_ENABLED; - experienceSetting = PEConfig::MILLING_EXPERIENCE; - break; default: return; } @@ -197,8 +188,16 @@ RewardExperienceScript() : PlayerScript("RewardExperienceScript", { experienceSetting = PEConfig::COOKING_EXPERIENCE; break; case SKILL_ENCHANTING: - enabledSetting = PEConfig::ENCHANTING_ENABLED; - experienceSetting = PEConfig::ENCHANTING_EXPERIENCE; + if (skill->Spell == 13262) + { + enabledSetting = PEConfig::DISENCHANTING_ENABLED; + experienceSetting = PEConfig::DISENCHANTING_EXPERIENCE; + } + else + { + enabledSetting = PEConfig::ENCHANTING_ENABLED; + experienceSetting = PEConfig::ENCHANTING_EXPERIENCE; + } break; case SKILL_ENGINEERING: enabledSetting = PEConfig::ENGINEERING_ENABLED; @@ -244,7 +243,7 @@ RewardExperienceScript() : PlayerScript("RewardExperienceScript", { { uint32 xp = player->GetUInt32Value(PLAYER_NEXT_LEVEL_XP) * xpFraction; if (currentLevel >= gray) - xp = xp * peConfigData.GetConfigValue(PEConfig::MULT_GREY); + xp = xp * peConfigData.GetConfigValue(PEConfig::MULT_GRAY); else if (currentLevel >= green) xp = xp * peConfigData.GetConfigValue(PEConfig::MULT_GREEN); else if (currentLevel >= yellow)