TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

Phases are immediatelly updated on QuestStatus change

Open Lopfest opened this issue 7 years ago • 21 comments

Description: Before 91be2332e249147ce3169c46a7da77f0f8c2211d the phases were not updated when QuestStatus changed because the conditions where not checked at all (i think). Phases were updated with spells, scripts, area change or relog. Now phases are updated automatically when QuestStatus changes, which is not correct in some situations. https://youtu.be/_o2i6QtPiLs?t=45s

Current behaviour: When quest becomes complete (possibly also other statuses), the phases are updated.

Expected behaviour: Either phases should not be updated after QuestStatus change, or there should be an option in conditions table to not update phases immediately.

Steps to reproduce the problem:

  1. complete quest The Missing Driver
  2. phase 630 (used to see Min Dimwind near destroyed cart) is added immediatelly, but it shouldn't

Branch(es): master

TC rev. hash/commit: TrinityCore rev. 6db2f6abce24 2018-03-30 09:10:34 +0200 (testPhases branch) (Win64, Debug, Dynamic) Using SSL version: OpenSSL 1.0.2l 25 May 2017 (library: OpenSSL 1.0.2l 25 May2017) Using Boost version: 1.65.0 Using MySQL version: 5.6.28 Using CMake version: 3.9.5 Compiled on: Windows 6.1.7601 Automatic database updates are enabled for the following databases: Auth, Characters, World Worldserver listening connections on port 8085 Realmlist (Realm Id: 1) configured in port 8085 VMAPs status: Enabled. LineOfSight: 1, getHeight: 1, indoorCheck: 1 MMAPs status: Disabled maps directory located in ./maps. Total size: 826214003 bytes vmaps directory located in ./vmaps. Total size: 4981383659 bytes Using enUS DBC Locale as default. All available DBC locales: enUS Using World DB: TDB 735.00

Operating system: Win 7 x64

Lopfest avatar Mar 30 '18 09:03 Lopfest

Check if the quest has QUEST_FLAGS_UPDATE_PHASE_SHIFT (atm unhandled)

Shauren avatar Mar 30 '18 09:03 Shauren

no it doesn't have this flag. thx for quick explanation

Lopfest avatar Mar 30 '18 09:03 Lopfest

The phasing is handled by what in this case?

Killyana avatar Mar 30 '18 13:03 Killyana

conditions + phase_area i guess?

Shauren avatar Mar 30 '18 14:03 Shauren

yes

Lopfest avatar Mar 30 '18 14:03 Lopfest

void Player::SendQuestUpdate(uint32 questId)

This sends phaseupdate afaik

EDIT:

void Player::SendQuestUpdate(uint32 questId)
{
    uint32 zone = 0, area = 0;
    GetZoneAndAreaId(zone, area);

    SpellAreaForQuestAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestAreaMapBounds(area, questId);

    if (saBounds.first != saBounds.second)
    {
        for (SpellAreaForQuestAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
        {
            if (itr->second->flags & SPELL_AREA_FLAG_AUTOREMOVE && !itr->second->IsFitToRequirements(this, zone, area))
                RemoveAurasDueToSpell(itr->second->spellId);
            else if (itr->second->flags & SPELL_AREA_FLAG_AUTOCAST)
                if (!HasAura(itr->second->spellId))
                    CastSpell(this, itr->second->spellId, true);
        }
    }

    UpdateForQuestWorldObjects();
    PhasingHandler::OnConditionChange(this);
}

PhasingHandler::OnConditionChange(this); <--- what does this do ?

funjoker avatar Mar 30 '18 15:03 funjoker

Rechecks all phases for area

Shauren avatar Mar 30 '18 15:03 Shauren

you should fix the phases + conditions in db, updating/checking phases on every status change is fine, however that specific phase should only be active if the quest is rewarded and not when completed, lots of people confound rewarded vs completed

streetrat avatar Mar 31 '18 09:03 streetrat

no. that phase should be active when quest is complete - after an event where NPC walks to his destination. when you relog with quest complete, NOT REWARDED, you already have phase 630. i tested it milion times. what Shauren said should be the solution - implement QUEST_FLAGS_UPDATE_PHASE_SHIFT

Lopfest avatar Mar 31 '18 09:03 Lopfest

I believe that updating/checking phaes on every status change should be handled (if needed) by special effect (SPELL_EFFECT_UPDATE_PLAYER_PHASE). You can see it e.g. doing Farm quests in Halfhill.

akrom23 avatar Oct 19 '19 07:10 akrom23

No, because not every phase update is related to a spell.

Lopfest avatar Oct 19 '19 08:10 Lopfest

Okay - so can you check in your sniffs if there is any spell with this effect on this specific quest?

akrom23 avatar Oct 19 '19 08:10 akrom23

This is tricky because WotLK content doesn't use any spells for this and instead relies on quest status

Shauren avatar Oct 19 '19 09:10 Shauren

Yeah, but I don't remember any Northrend quest that updates phasing on quest status change in the same area immediately (when you change area, everything works okay).

akrom23 avatar Oct 19 '19 11:10 akrom23

There’s a quest turn in event in sholazar basin which I scripted previously I’ve forgotten name of quest but turning in this quest causes phase change and currently you only see event if you have gm mode on because of this

dr-j avatar Jan 20 '20 00:01 dr-j

maybe the quest A hero's Burden (Oracles / Frenzyheart Rep Swapping) ? Possibly related to issues with Forced Hand / The Mist Isn't Listening.

ghost avatar Jan 20 '20 00:01 ghost

Nope only present in camp there which hides flight master until 2 quests done. There’s no phasing related to area where Artruis is. Phasing works differently on retail to tc though if you leave area you get about 5 seconds before auras are removed if you move back into correct area within this then auras don’t get removed

dr-j avatar Jan 20 '20 09:01 dr-j

Maybe we could have a way of delaying aura applied/removed via spell area for specific spells/area and now remembered what issue was there spirit of gnomeregan appears as soon as quest is completed rather than after quest end script has completed

dr-j avatar Jan 20 '20 09:01 dr-j

For the quest "Have a Part, Give a Part" https://youtu.be/Kg7d8tv17Ps?t=106 the spell area is cast on quest rewarded. I don't know any case in wotlk where this issue is valid.

Killyana avatar Jan 20 '20 11:01 Killyana

Ok but theres still the issue of when moving between different areas phase changes should be delayed for a few seconds.

and Illfated rememberd what issue is with those quests now. theres issue about it its because of oracles/frenzyheart forcing peace forced until a rep change is made then you can attack them until you leave zone but upon returning or relogging you will find cant attack again thats why if you do and return daily where you dont have to kill opposite mobs first then the other dailies work fine as long as you dont leave zone.

Its the same with the intro quest chain if you do all in one go without relogging or leaving zone then all work as intended but if you relog then ye forced hand and the mist isnt listening cause issues with attacking mobs,

dr-j avatar Jan 20 '20 11:01 dr-j

the quest the missing driver is fixed in master, is just some weird blizz stuff that adds the phase and gets removed immediately and then added again when min dimwind reaches last wp

aquadeus avatar Jun 20 '24 15:06 aquadeus