Use soulgem value rebalance formula from morrowind code patch

pull/436/head^2
declan-millar 7 years ago
parent ec900ef4ad
commit 4b1247597e

@ -84,8 +84,19 @@ namespace MWClass
if (ptr.getCellRef().getSoul() != "") if (ptr.getCellRef().getSoul() != "")
{ {
const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul()); const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul());
if (creature) if (creature) {
value *= creature->mData.mSoul; // 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; return value;

Loading…
Cancel
Save