diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp
index e6dd74dbd7..25e5260684 100644
--- a/apps/launcher/advancedpage.cpp
+++ b/apps/launcher/advancedpage.cpp
@@ -95,6 +95,7 @@ bool Launcher::AdvancedPage::loadSettings()
loadSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
loadSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
loadSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
+ loadSettingBool(classicCalmSpellsCheckBox, "classic calm spells behavior", "Game");
loadSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
loadSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
loadSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
@@ -257,6 +258,7 @@ void Launcher::AdvancedPage::saveSettings()
saveSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game");
saveSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game");
saveSettingBool(classicReflectedAbsorbSpellsCheckBox, "classic reflected absorb spells behavior", "Game");
+ saveSettingBool(classicCalmSpellsCheckBox, "classic calm spells behavior", "Game");
saveSettingBool(requireAppropriateAmmunitionCheckBox, "only appropriate ammunition bypasses resistance", "Game");
saveSettingBool(uncappedDamageFatigueCheckBox, "uncapped damage fatigue", "Game");
saveSettingBool(normaliseRaceSpeedCheckBox, "normalise race speed", "Game");
diff --git a/apps/openmw/mwmechanics/activespells.cpp b/apps/openmw/mwmechanics/activespells.cpp
index e9c72f884f..91b49c6dc5 100644
--- a/apps/openmw/mwmechanics/activespells.cpp
+++ b/apps/openmw/mwmechanics/activespells.cpp
@@ -150,7 +150,7 @@ namespace MWMechanics
{
if (mIterating)
return;
- const auto& creatureStats = ptr.getClass().getCreatureStats(ptr);
+ auto& creatureStats = ptr.getClass().getCreatureStats(ptr);
assert(&creatureStats.getActiveSpells() == this);
IterationGuard guard{*this};
// Erase no longer active spells and effects
@@ -308,6 +308,15 @@ namespace MWMechanics
}
++spellIt;
}
+
+ static const bool keepCalm = Settings::Manager::getBool("classic calm spells behavior", "Game");
+ if (keepCalm)
+ {
+ ESM::MagicEffect::Effects effect
+ = ptr.getClass().isNpc() ? ESM::MagicEffect::CalmHumanoid : ESM::MagicEffect::CalmCreature;
+ if (creatureStats.getMagicEffects().get(effect).getMagnitude() > 0.f)
+ creatureStats.getAiSequence().stopCombat();
+ }
}
void ActiveSpells::addToSpells(const MWWorld::Ptr& ptr, const ActiveSpellParams& spell)
diff --git a/files/settings-default.cfg b/files/settings-default.cfg
index 779739eae5..9f7e6df347 100644
--- a/files/settings-default.cfg
+++ b/files/settings-default.cfg
@@ -263,6 +263,9 @@ actors processing range = 7168
# Make reflected Absorb spells have no practical effect, like in Morrowind.
classic reflected absorb spells behavior = true
+# Make Calm spells stop combat on every frame
+classic calm spells behavior = true
+
# Show duration of magic effect and lights in the spells window.
show effect duration = false
diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui
index 6a50fc8a9b..47c17aca03 100644
--- a/files/ui/advancedpage.ui
+++ b/files/ui/advancedpage.ui
@@ -43,7 +43,7 @@
- -
+
-
<html><head/><body><p>If enabled NPCs apply evasion maneuver to avoid collisions with others.</p></body></html>
@@ -83,6 +83,16 @@
+ -
+
+
+ <html><head/><body><p>Make stealing items from NPCs that were knocked down possible during combat.</p></body></html>
+
+
+ Always allow stealing from knocked out actors
+
+
+
-
@@ -143,18 +153,18 @@
+ -
+
+
+ <html><head/><body><p>Stops combat with NPCs affected by Calm spells every frame -- like in Morrowind without the MCP.</p></body></html>
+
+
+ Classic Calm spells behavior
+
+
+
- -
-
-
- <html><head/><body><p>Make stealing items from NPCs that were knocked down possible during combat.</p></body></html>
-
-
- Always allow stealing from knocked out actors
-
-
-
-