|
|
|
@ -554,16 +554,11 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
// Avoid applying absorb effects if the caster is the target
|
|
|
|
|
// We still need the spell to be added
|
|
|
|
|
if (caster == target)
|
|
|
|
|
if (caster == target
|
|
|
|
|
&& effectIt->mEffectID >= ESM::MagicEffect::AbsorbAttribute
|
|
|
|
|
&& effectIt->mEffectID <= ESM::MagicEffect::AbsorbSkill)
|
|
|
|
|
{
|
|
|
|
|
for (int i=0; i<5; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (effectIt->mEffectID == ESM::MagicEffect::AbsorbAttribute+i)
|
|
|
|
|
{
|
|
|
|
|
effect.mMagnitude = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
effect.mMagnitude = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hasDuration = !(magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration);
|
|
|
|
@ -614,22 +609,19 @@ namespace MWMechanics
|
|
|
|
|
// magnitude, since we're transferring stats from the target to the caster
|
|
|
|
|
if (!caster.isEmpty() && caster != target && caster.getClass().isActor())
|
|
|
|
|
{
|
|
|
|
|
for (int i=0; i<5; ++i)
|
|
|
|
|
if (effectIt->mEffectID >= ESM::MagicEffect::AbsorbAttribute &&
|
|
|
|
|
effectIt->mEffectID <= ESM::MagicEffect::AbsorbSkill)
|
|
|
|
|
{
|
|
|
|
|
if (effectIt->mEffectID == ESM::MagicEffect::AbsorbAttribute+i)
|
|
|
|
|
{
|
|
|
|
|
std::vector<ActiveSpells::ActiveEffect> absorbEffects;
|
|
|
|
|
ActiveSpells::ActiveEffect effect_ = effect;
|
|
|
|
|
effect_.mMagnitude *= -1;
|
|
|
|
|
absorbEffects.push_back(effect_);
|
|
|
|
|
if (reflected && Settings::Manager::getBool("classic reflected absorb spells behavior", "Game"))
|
|
|
|
|
target.getClass().getCreatureStats(target).getActiveSpells().addSpell("", true,
|
|
|
|
|
absorbEffects, mSourceName, caster.getClass().getCreatureStats(caster).getActorId());
|
|
|
|
|
else
|
|
|
|
|
caster.getClass().getCreatureStats(caster).getActiveSpells().addSpell("", true,
|
|
|
|
|
absorbEffects, mSourceName, target.getClass().getCreatureStats(target).getActorId());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
std::vector<ActiveSpells::ActiveEffect> absorbEffects;
|
|
|
|
|
ActiveSpells::ActiveEffect effect_ = effect;
|
|
|
|
|
effect_.mMagnitude *= -1;
|
|
|
|
|
absorbEffects.push_back(effect_);
|
|
|
|
|
if (reflected && Settings::Manager::getBool("classic reflected absorb spells behavior", "Game"))
|
|
|
|
|
target.getClass().getCreatureStats(target).getActiveSpells().addSpell("", true,
|
|
|
|
|
absorbEffects, mSourceName, caster.getClass().getCreatureStats(caster).getActorId());
|
|
|
|
|
else
|
|
|
|
|
caster.getClass().getCreatureStats(caster).getActiveSpells().addSpell("", true,
|
|
|
|
|
absorbEffects, mSourceName, target.getClass().getCreatureStats(target).getActorId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|