fix(Scripts/Commands): Re-spawn pool quests after reload quest starters (#24696)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-13 02:42:13 -06:00
committed by GitHub
parent 504f5a186e
commit 7fc57744d9
4 changed files with 319 additions and 0 deletions

View File

@@ -1038,6 +1038,20 @@ void PoolMgr::ChangeWeeklyQuests()
SaveQuestsToDB(false, true, false);
}
void PoolMgr::ReSpawnPoolQuests()
{
for (auto& [questId, poolId] : mQuestSearchMap)
{
if (IsSpawnedObject<Quest>(questId))
{
PoolObject tempObj(questId, 0.0f);
auto it = mPoolQuestGroups.find(poolId);
if (it != mPoolQuestGroups.end())
it->second.Spawn1Object(&tempObj);
}
}
}
// Call to spawn a pool, if cache if true the method will spawn only if cached entry is different
// If it's same, the creature is respawned only (added back to map)
template<>

View File

@@ -130,10 +130,12 @@ public:
void ChangeDailyQuests();
void ChangeWeeklyQuests();
void ReSpawnPoolQuests();
PooledQuestRelation mQuestCreatureRelation;
PooledQuestRelation mQuestGORelation;
friend class PoolQuestReloadFixTest;
private:
template<typename T>
void SpawnPool(uint32 pool_id, uint32 db_guid_or_pool_id);