From 4b1247597ea82c9c77cfe40ff2e88db885e84fe4 Mon Sep 17 00:00:00 2001 From: declan-millar Date: Sun, 20 May 2018 17:06:26 +0100 Subject: [PATCH] Use soulgem value rebalance formula from morrowind code patch --- apps/openmw/mwclass/misc.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 5a933d535..4b1a8844d 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -84,8 +84,19 @@ namespace MWClass if (ptr.getCellRef().getSoul() != "") { const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get().search(ref->mRef.getSoul()); - if (creature) - value *= creature->mData.mSoul; + if (creature) { + // value *= creature->mData.mSoul; + + // use soulgem value rebalance formula from morrowind code patch + int soul = creature->mData.mSoul; + float soul_value = 0.0001 * pow(soul, 3) + 2 * soul; + + // for Azura's star add the unfilled value + if (Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "Misc_SoulGem_Azura")) + value += soul_value; + else + value = soul_value; + } } return value;