|
|
@ -645,7 +645,8 @@ namespace MWMechanics
|
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
const ESM::MagicEffect *magiceffect = store.get<ESM::MagicEffect>().find(effectId);
|
|
|
|
const ESM::MagicEffect *magiceffect = store.get<ESM::MagicEffect>().find(effectId);
|
|
|
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target);
|
|
|
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target);
|
|
|
|
animation->addSpellCastGlow(magiceffect);
|
|
|
|
if (animation)
|
|
|
|
|
|
|
|
animation->addSpellCastGlow(magiceffect);
|
|
|
|
if (target.getCellRef().getLockLevel() < magnitude) //If the door is not already locked to a higher value, lock it to spell magnitude
|
|
|
|
if (target.getCellRef().getLockLevel() < magnitude) //If the door is not already locked to a higher value, lock it to spell magnitude
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (caster == getPlayer())
|
|
|
|
if (caster == getPlayer())
|
|
|
@ -659,14 +660,16 @@ namespace MWMechanics
|
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
const ESM::MagicEffect *magiceffect = store.get<ESM::MagicEffect>().find(effectId);
|
|
|
|
const ESM::MagicEffect *magiceffect = store.get<ESM::MagicEffect>().find(effectId);
|
|
|
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target);
|
|
|
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target);
|
|
|
|
animation->addSpellCastGlow(magiceffect);
|
|
|
|
if (animation)
|
|
|
|
|
|
|
|
animation->addSpellCastGlow(magiceffect);
|
|
|
|
if (target.getCellRef().getLockLevel() <= magnitude)
|
|
|
|
if (target.getCellRef().getLockLevel() <= magnitude)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (target.getCellRef().getLockLevel() > 0)
|
|
|
|
if (target.getCellRef().getLockLevel() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f);
|
|
|
|
MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f);
|
|
|
|
if (!caster.isEmpty() && caster.getClass().isActor())
|
|
|
|
if (!caster.isEmpty())
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->objectOpened(caster, target);
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target);
|
|
|
|
|
|
|
|
// Use the player instead of the caster for vanilla crime compatibility
|
|
|
|
|
|
|
|
|
|
|
|
if (caster == getPlayer())
|
|
|
|
if (caster == getPlayer())
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}");
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}");
|
|
|
|