Core/Pooling: Quest pooling rewrite: (PR#23627)

- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests
This commit is contained in:
Treeston
2019-08-04 12:22:57 +02:00
committed by GitHub
parent 15e85f882f
commit a5e73e41c0
25 changed files with 714 additions and 659 deletions

View File

@@ -38,6 +38,8 @@ EndScriptData */
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "PoolMgr.h"
#include "QuestPools.h"
#include "RBAC.h"
#include "SpellMgr.h"
#include "Transport.h"
@@ -1718,21 +1720,20 @@ public:
else
return false;
time_t const now = GameTime::GetGameTime();
if (daily)
{
sWorld->m_NextDailyQuestReset = now;
handler->SendSysMessage("Daily quest reset scheduled for next tick.");
sWorld->ResetDailyQuests();
handler->PSendSysMessage("Daily quests have been reset. Next scheduled reset: %s", TimeToHumanReadable(sWorld->getWorldState(WS_DAILY_QUEST_RESET_TIME)).c_str());
}
if (weekly)
{
sWorld->m_NextWeeklyQuestReset = now;
handler->SendSysMessage("Weekly quest reset scheduled for next tick.");
sWorld->ResetWeeklyQuests();
handler->PSendSysMessage("Weekly quests have been reset. Next scheduled reset: %s", TimeToHumanReadable(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME)).c_str());
}
if (monthly)
{
sWorld->m_NextMonthlyQuestReset = now;
handler->SendSysMessage("Monthly quest reset scheduled for next tick.");
sWorld->ResetMonthlyQuests();
handler->PSendSysMessage("Monthly quests have been reset. Next scheduled reset: %s", TimeToHumanReadable(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME)).c_str());
}
return true;

View File

@@ -22,7 +22,7 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "PoolMgr.h"
#include "QuestPools.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
@@ -512,7 +512,7 @@ class boss_lady_deathwhisper : public CreatureScript
uint8 addIndexOther = uint8(addIndex ^ 1);
// Summon first add, replace it with Darnavan if weekly quest is active
if (_waveCounter || !sPoolMgr->IsSpawnedObject<Quest>(QUEST_DEPROGRAMMING))
if (_waveCounter || !sQuestPoolMgr->IsQuestActive(QUEST_DEPROGRAMMING))
Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3]);
else
Summon(NPC_DARNAVAN, SummonPositions[addIndex * 3]);

View File

@@ -23,7 +23,7 @@
#include "Map.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "PoolMgr.h"
#include "QuestPools.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
#include "Transport.h"
@@ -346,7 +346,7 @@ class instance_icecrown_citadel : public InstanceMapScript
if (WeeklyQuestData[questIndex].creatureEntry == entry)
{
uint8 diffIndex = uint8(instance->GetSpawnMode() & 1);
if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[questIndex].questId[diffIndex]))
if (!sQuestPoolMgr->IsQuestActive(WeeklyQuestData[questIndex].questId[diffIndex]))
return 0;
break;
}
@@ -974,7 +974,7 @@ class instance_icecrown_citadel : public InstanceMapScript
case DATA_VALITHRIA_DREAMWALKER:
if (state == DONE)
{
if (sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[8].questId[instance->GetSpawnMode() & 1]))
if (sQuestPoolMgr->IsQuestActive(WeeklyQuestData[8].questId[instance->GetSpawnMode() & 1]))
instance->SummonCreature(NPC_VALITHRIA_DREAMWALKER_QUEST, ValithriaSpawnPos);
if (GameObject* teleporter = instance->GetGameObject(TeleporterSindragosaGUID))
SetTeleporterState(teleporter, true);
@@ -1070,7 +1070,7 @@ class instance_icecrown_citadel : public InstanceMapScript
break;
// 5 is the index of Blood Quickening
if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[5].questId[instance->GetSpawnMode() & 1]))
if (!sQuestPoolMgr->IsQuestActive(WeeklyQuestData[5].questId[instance->GetSpawnMode() & 1]))
break;
switch (data)