From b39fe85a5119499a5ec186f538f9fd9d9c9a035b Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 18 Sep 2014 14:56:43 +0200 Subject: [PATCH] Implement fPCbaseMagickaMult and fNPCbaseMagickaMult --- apps/openmw/mwmechanics/actors.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 88e89a774..1ee498d84 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -397,8 +397,14 @@ namespace MWMechanics int agility = creatureStats.getAttribute(ESM::Attribute::Agility).getModified(); int endurance = creatureStats.getAttribute(ESM::Attribute::Endurance).getModified(); - double magickaFactor = - creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1 + 1; + float base = 1.f; + if (ptr.getCellRef().getRefId() == "player") + base = MWBase::Environment::get().getWorld()->getStore().get().find("fPCbaseMagickaMult")->getFloat(); + else + base = MWBase::Environment::get().getWorld()->getStore().get().find("fNPCbaseMagickaMult")->getFloat(); + + double magickaFactor = base + + creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1; DynamicStat magicka = creatureStats.getMagicka(); float diff = (static_cast(magickaFactor*intelligence)) - magicka.getBase();