diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-11-20 13:02:56 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-11-20 13:02:56 +0100 |
commit | 8c072b93af3a4efcbde21cc85fedcf7fa48fa7b4 (patch) | |
tree | 31e60f6a4c597bc11f578b64452881acbbe5f083 /src/server/game/Globals/ObjectMgr.cpp | |
parent | 36a64884054f0bf34e815b62157be61c3476127a (diff) |
Core/Scripts: Add start/fail asset values from criteria to valid game event ids
Closes #29447
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e882198834a..2f4573c7ee0 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5873,26 +5873,18 @@ void ObjectMgr::LoadEventSet() } // Load all possible event ids from spells - for (SpellNameEntry const* spellNameEntry : sSpellNameStore) - if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellNameEntry->ID, DIFFICULTY_NONE)) - for (SpellEffectInfo const& spellEffectInfo : spell->GetEffects()) - if (spellEffectInfo.IsEffect(SPELL_EFFECT_SEND_EVENT)) - if (spellEffectInfo.MiscValue) - _eventStore.insert(spellEffectInfo.MiscValue); + for (SpellEffectEntry const* spellEffect : sSpellEffectStore) + if (spellEffect->Effect == SPELL_EFFECT_SEND_EVENT && spellEffect->EffectMiscValue[0]) + _eventStore.insert(spellEffect->EffectMiscValue[0]); // Load all possible event ids from taxi path nodes - for (size_t path_idx = 0; path_idx < sTaxiPathNodesByPath.size(); ++path_idx) + for (TaxiPathNodeEntry const* node : sTaxiPathNodeStore) { - for (size_t node_idx = 0; node_idx < sTaxiPathNodesByPath[path_idx].size(); ++node_idx) - { - TaxiPathNodeEntry const* node = sTaxiPathNodesByPath[path_idx][node_idx]; - - if (node->ArrivalEventID) - _eventStore.insert(node->ArrivalEventID); + if (node->ArrivalEventID) + _eventStore.insert(node->ArrivalEventID); - if (node->DepartureEventID) - _eventStore.insert(node->DepartureEventID); - } + if (node->DepartureEventID) + _eventStore.insert(node->DepartureEventID); } // Load all possible event ids from criterias @@ -5914,6 +5906,14 @@ void ObjectMgr::LoadEventSet() for (ScenarioEntry const* scenario : sScenarioStore) for (CriteriaType criteriaType : eventCriteriaTypes) addCriteriaEventsToStore(sCriteriaMgr->GetScenarioCriteriaByTypeAndScenario(criteriaType, scenario->ID)); + + for (auto const& [gameEventId, _] : sCriteriaMgr->GetCriteriaByStartEvent(CriteriaStartEvent::SendEvent)) + if (gameEventId) + _eventStore.insert(gameEventId); + + for (auto const& [gameEventId, _] : sCriteriaMgr->GetCriteriaByFailEvent(CriteriaFailEvent::SendEvent)) + if (gameEventId) + _eventStore.insert(gameEventId); } void ObjectMgr::LoadEventScripts() |