Project

General

Profile

Bug #3995

Dispel cancels every temporary magic effect

Added by Vladimir Ulisko 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Game Mechanics
Target version:
Start date:
08/05/2017
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

The Dispel effect should only cancel the temporary effects from spells (effects from abilities, potions, enchanted items, scrolls and diseases must all unaffected).

Associated revisions

Revision 1e983604 (diff)
Added by Andrei Kortunov 3 months ago

Dispel only effects from spells (bug #3995)

History

#1 Updated by Vladimir Ulisko 3 months ago

For version 0.42 this issue actual.

#2 Updated by Alexei Dobrohotov 3 months ago

  • Subject changed from Dispel effect randomly cancels temporary effects NOT from spells (v0.41) to Dispel cancels every temporary magic effect

#3 Updated by Dark Locq 3 months ago

Yep. UESPwiki confirms that spells-only is the intent of the Dispel effect. They're pretty good at carefully verifying this stuff in the CS.

Though this raises a question: If you've used the fast-levitation shrine atop the Vivec Temple canton, the effect of which lasts 40-odd minutes, what can you do about it if you need it to stop, other than leave the game running and go make dinner?

#4 Updated by Andrei Kortunov 3 months ago

other than leave the game running and go make dinner?

Rest in any bed, for example.

#5 Updated by Godfried Schegbouwer 3 months ago

Dark Locq wrote:

Yep. UESPwiki confirms that spells-only is the intent of the Dispel effect. They're pretty good at carefully verifying this stuff in the CS.

Though this raises a question: If you've used the fast-levitation shrine atop the Vivec Temple canton, the effect of which lasts 40-odd minutes, what can you do about it if you need it to stop, other than leave the game running and go make dinner?

The magic effect from a blessing is actually the result of a spell that is cast by the altar on the player. So, if only spell effects are affected by dispel, the altar blessings will be affected as well.

#6 Updated by Andrei Kortunov 3 months ago

  • Status changed from New to Confirmed
  • Reproducibility changed from Random to Always

IMO we can modify ActiveSpells::purgeAll() to check if an active effect source is a spell (search in game spells). But I am not sure about performance cost of this solution.

#7 Updated by Andrei Kortunov 3 months ago

Maybe non-optimized, but working version:

void ActiveSpells::purgeAll(float chance, bool spellOnly)
{
    for (TContainer::iterator it = mSpells.begin(); it != mSpells.end(); )
    {
        const std::string spellId = it->first;

        // if spellOnly is true, dispell only spells. Leave potions, enchanted items etc.
        if (spellOnly && !MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(spellId))
        {
            ++it;
            continue;
        }

        if (Misc::Rng::roll0to99() < chance)
            mSpells.erase(it++);
        else
            ++it;
    }
    mSpellsChanged = true;
}

Note: this change will change will break combat AI behaviour - actors still will try to dispel effects from potions, magic items, etc.
If this function itself is OK, we can change also numEffectsToDispel() to take this change in account.

#8 Updated by Andrei Kortunov 3 months ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Andrei Kortunov
  • Target version set to openmw-0.43
  • % Done changed from 0 to 100

#9 Updated by Alexei Dobrohotov 3 months ago

  • Status changed from Resolved to Closed

#10 Updated by scrawl . 2 months ago

  • Target version changed from openmw-0.43 to openmw-1.0

#11 Updated by Andrei Kortunov 2 months ago

Why openmw-1.0? This issue was already closed.

#12 Updated by scrawl . 2 months ago

  • Target version changed from openmw-1.0 to openmw-0.43

Oops.

Also available in: Atom PDF