aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests/QuestDef.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-05-10 22:45:54 +0200
committerShauren <shauren.trinity@gmail.com>2021-05-10 22:45:54 +0200
commit6352a84bf78a7afe0ea8d8caccee33dd09e09694 (patch)
treefcc56a9d49d9725450860eaa5ad75b9d0fa1b2b7 /src/server/game/Quests/QuestDef.h
parent5bef47f1e9bff85fa297d4d00f27772c47a747cc (diff)
Core/Quests: Unify quest objective updating into one function and replace iterating entire quest log to find objective with direct {type, id} lookup
Diffstat (limited to 'src/server/game/Quests/QuestDef.h')
-rw-r--r--src/server/game/Quests/QuestDef.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index bb2ab57fcc3..9b74cbb978e 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -373,6 +373,26 @@ struct QuestObjective
std::string Description;
std::vector<int32> VisualEffects;
+ bool IsStoringValue() const
+ {
+ switch (Type)
+ {
+ case QUEST_OBJECTIVE_MONSTER:
+ case QUEST_OBJECTIVE_ITEM:
+ case QUEST_OBJECTIVE_GAMEOBJECT:
+ case QUEST_OBJECTIVE_TALKTO:
+ case QUEST_OBJECTIVE_PLAYERKILLS:
+ case QUEST_OBJECTIVE_WINPVPPETBATTLES:
+ case QUEST_OBJECTIVE_HAVE_CURRENCY:
+ case QUEST_OBJECTIVE_OBTAIN_CURRENCY:
+ case QUEST_OBJECTIVE_INCREASE_REPUTATION:
+ return true;
+ default:
+ break;
+ }
+ return false;
+ }
+
bool IsStoringFlag() const
{
switch (Type)
@@ -389,6 +409,25 @@ struct QuestObjective
}
return false;
}
+
+ static constexpr bool CanAlwaysBeProgressedInRaid(QuestObjectiveType type)
+ {
+ switch (type)
+ {
+ case QUEST_OBJECTIVE_ITEM:
+ case QUEST_OBJECTIVE_CURRENCY:
+ case QUEST_OBJECTIVE_LEARNSPELL:
+ case QUEST_OBJECTIVE_MIN_REPUTATION:
+ case QUEST_OBJECTIVE_MAX_REPUTATION:
+ case QUEST_OBJECTIVE_MONEY:
+ case QUEST_OBJECTIVE_HAVE_CURRENCY:
+ case QUEST_OBJECTIVE_INCREASE_REPUTATION:
+ return true;
+ default:
+ break;
+ }
+ return false;
+ }
};
using QuestObjectives = std::vector<QuestObjective>;