diff --git a/CHANGELOG.md b/CHANGELOG.md index 687e421fa..c2f05c3c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Feature #5362: Show the soul gems' trapped soul in count dialog Feature #5445: Handle NiLines Feature #5457: Realistic diagonal movement + Feature #5486: Fixes trainers to choose their training skills based on their base skill points Task #5480: Drop Qt4 support 0.46.0 diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index 866cec728..e9db74cae 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -90,6 +90,7 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); } loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game"); + loadSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game"); // Input Settings loadSettingBool(grabCursorCheckBox, "grab cursor", "Input"); @@ -155,6 +156,7 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(weaponSheathingCheckBox, "weapon sheathing", "Game"); saveSettingBool(shieldSheathingCheckBox, "shield sheathing", "Game"); saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game"); + saveSettingBool(trainersTrainingSkillsBasedOnBaseSkillCheckBox, "trainers training skills based on base skill", "Game"); // Input Settings saveSettingBool(grabCursorCheckBox, "grab cursor", "Input"); diff --git a/apps/openmw/mwgui/trainingwindow.cpp b/apps/openmw/mwgui/trainingwindow.cpp index e4e4bae5a..d0176ece4 100644 --- a/apps/openmw/mwgui/trainingwindow.cpp +++ b/apps/openmw/mwgui/trainingwindow.cpp @@ -14,6 +14,8 @@ #include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/actorutil.hpp" +#include + #include "tooltips.hpp" namespace @@ -40,6 +42,7 @@ namespace MWGui TrainingWindow::TrainingWindow() : WindowBase("openmw_trainingwindow.layout") , mTimeAdvancer(0.05f) + , mTrainingSkillBasedOnBaseSkill(Settings::Manager::getBool("trainers training skills based on base skill", "Game")) { getWidget(mTrainingOptions, "TrainingOptions"); getWidget(mCancelButton, "CancelButton"); @@ -76,9 +79,10 @@ namespace MWGui // NPC can train you in his best 3 skills std::vector< std::pair > skills; + MWMechanics::NpcStats const& actorStats(actor.getClass().getNpcStats(actor)); for (int i=0; i player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId)) return; - if (mPtr.getClass().getSkill(mPtr, skillId) <= pcStats.getSkill (skillId).getBase ()) + if (getSkillForTraining(mPtr.getClass().getNpcStats(mPtr), skillId) <= pcStats.getSkill(skillId).getBase()) { MWBase::Environment::get().getWindowManager()->messageBox ("#{sServiceTrainingWords}"); return; @@ -195,6 +199,13 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode(); } + float TrainingWindow::getSkillForTraining(const MWMechanics::NpcStats& stats, int skillId) const + { + if (mTrainingSkillBasedOnBaseSkill) + return stats.getSkill(skillId).getBase(); + return stats.getSkill(skillId).getModified(); + } + void TrainingWindow::onFrame(float dt) { checkReferenceAvailable(); diff --git a/apps/openmw/mwgui/trainingwindow.hpp b/apps/openmw/mwgui/trainingwindow.hpp index 2edad1f27..955615516 100644 --- a/apps/openmw/mwgui/trainingwindow.hpp +++ b/apps/openmw/mwgui/trainingwindow.hpp @@ -6,6 +6,11 @@ #include "timeadvancer.hpp" #include "waitdialog.hpp" +namespace MWMechanics +{ + class NpcStats; +} + namespace MWGui { @@ -35,12 +40,17 @@ namespace MWGui void onTrainingProgressChanged(int cur, int total); void onTrainingFinished(); + // Retrieve the base skill value if the setting 'training skills based on base skill' is set; + // otherwise returns the modified skill + float getSkillForTraining(const MWMechanics::NpcStats& stats, int skillId) const; + MyGUI::Widget* mTrainingOptions; MyGUI::Button* mCancelButton; MyGUI::TextBox* mPlayerGold; WaitDialogProgressBar mProgressBar; TimeAdvancer mTimeAdvancer; + bool mTrainingSkillBasedOnBaseSkill; //corresponds to the setting 'training skills based on base skill' }; } diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index c27796aec..9cac845a5 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -330,3 +330,18 @@ If disabled then the whole character's body is pointed to the direction of view. If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it also changes straight right and straight left movement. This setting can only be configured by editing the settings configuration file. + +trainers training skills based on base skill +----------------------- + +:Type: boolean +:Range: True/False +:Default: False + +The trainers in Morrowind choose their proposed training skills based on their 3 best attributes. + +If disabled then the 3 best skills of trainers and the training limits take into account fortified/drained trainer skill. + +If enabled then the 3 best skills of trainers and the training limits are based on the trainer base skills. + +This setting can be controlled in Advanced tab of the launcher. diff --git a/files/settings-default.cfg b/files/settings-default.cfg index b7bebd2b8..494b06092 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -310,6 +310,9 @@ uncapped damage fatigue = false # Turn lower body to movement direction. 'true' makes diagonal movement more realistic. turn to movement direction = false +# Make the training skills proposed by a trainer based on its base attribute instead of its modified ones +trainers training skills based on base skill = false + [General] # Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16). diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 03b011b47..142cd7259 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -236,6 +236,16 @@ + + + + <html><head/><body><p>Trainers now only choose which skills to train using their base skill points, allowing mercantile improving effects to be used without making mercantile an offered skill.</p></body></html> + + + Trainers choose their training skills based on their base skill points + + +