From b150172521636fa5646489688e53d03f0773b9be Mon Sep 17 00:00:00 2001 From: linencloth Date: Sun, 26 Dec 2010 04:16:18 +0100 Subject: Core/QuestStatus: - Separate rewarded quests from active quests, and store them in a new table to reduce database size - Drop the no longer needed `rewarded` column from character_queststatus for smaller table size - Prevent filling the database with dropped quests - Delete useless records - Implement queststatus save "queues" instead of states - Minor optimizations WARNING: Backup your database! --HG-- branch : trunk --- src/server/scripts/Commands/cs_quest.cpp | 6 +----- src/server/scripts/Kalimdor/silithus.cpp | 1 - src/server/scripts/Outland/shadowmoon_valley.cpp | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index a083b62f973..25bfc1c6f45 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -142,11 +142,7 @@ public: } } - // set quest status to not started (will updated in DB at next save) - player->SetQuestStatus(entry, QUEST_STATUS_NONE); - - // reset rewarded for restart repeatable quest - player->getQuestStatusMap()[entry].m_rewarded = false; + player->RemoveQuest(entry); handler->SendSysMessage(LANG_COMMAND_QUEST_REMOVED); return true; diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 4971000fa09..53d47072e51 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -1023,7 +1023,6 @@ public: if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) { GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); - GroupMember->SetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, QUEST_STATUS_NONE); ++FailedMemberCount; } ++GroupMemberCount; diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index f4d6cd4a687..d98a90d6b33 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1464,7 +1464,6 @@ public: if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) { GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); - GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); ++FailedMemberCount; } ++GroupMemberCount; @@ -1489,7 +1488,6 @@ public: if (GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) { GroupMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); - GroupMember->SetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, QUEST_STATUS_NONE); } } Failed = true; -- cgit v1.2.3