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;