aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Quests
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-08-18 21:08:21 +0100
committerVincent-Michael <Vincent_Michael@gmx.de>2013-08-30 23:08:40 +0200
commit7ecf4fdec147af7da51541aae9de4d91aff05ad6 (patch)
treea345ce2b1221bdab34b4edcfff1819c005b97e79 /src/server/game/Quests
parent081ee8f5d8ac9bf73c1b54a56f5fbda2fb365609 (diff)
Core/Quests: Split Flags and SpecialFlags
Diffstat (limited to 'src/server/game/Quests')
-rw-r--r--src/server/game/Quests/QuestDef.cpp29
-rw-r--r--src/server/game/Quests/QuestDef.h65
2 files changed, 52 insertions, 42 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 7345dcafe92..f2e80bdb996 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -60,7 +60,7 @@ Quest::Quest(Field* questRecord)
SourceItemIdCount = questRecord[35].GetUInt8();
SourceSpellid = questRecord[36].GetUInt32();
Flags = questRecord[37].GetUInt32();
- uint32 SpecialFlags = questRecord[38].GetUInt8();
+ SpecialFlags = questRecord[38].GetUInt8();
RewardTitleId = questRecord[39].GetUInt8();
RequiredPlayerKills = questRecord[40].GetUInt8();
RewardTalents = questRecord[41].GetUInt8();
@@ -139,30 +139,29 @@ Quest::Quest(Field* questRecord)
//int32 WDBVerified = questRecord[140].GetInt32();
- Flags |= SpecialFlags << 20;
- if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT)
+ if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
- m_reqitemscount = 0;
- m_reqCreatureOrGOcount = 0;
- m_rewitemscount = 0;
- m_rewchoiceitemscount = 0;
+ _reqItemsCount = 0;
+ _reqCreatureOrGOcount = 0;
+ _rewItemsCount = 0;
+ _rewChoiceItemsCount = 0;
- for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
+ for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
if (RequiredItemId[i])
- ++m_reqitemscount;
+ ++_reqItemsCount;
- for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
+ for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
if (RequiredNpcOrGo[i])
- ++m_reqCreatureOrGOcount;
+ ++_reqCreatureOrGOcount;
- for (int i=0; i < QUEST_REWARDS_COUNT; ++i)
+ for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
if (RewardItemId[i])
- ++m_rewitemscount;
+ ++_rewItemsCount;
- for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
+ for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
if (RewardChoiceItemId[i])
- ++m_rewchoiceitemscount;
+ ++_rewChoiceItemsCount;
}
uint32 Quest::XPValue(Player* player) const
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index b2796652a01..88a4ddfcad9 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -75,7 +75,7 @@ enum QuestShareMessages
QUEST_PARTY_MSG_NOT_IN_PARTY = 10
};
-enum __QuestTradeSkill
+enum QuestTradeSkill
{
QUEST_TRSKILL_NONE = 0,
QUEST_TRSKILL_ALCHEMY = 1,
@@ -106,7 +106,7 @@ enum QuestStatus
MAX_QUEST_STATUS
};
-enum __QuestGiverStatus
+enum QuestGiverStatus
{
DIALOG_STATUS_NONE = 0,
DIALOG_STATUS_UNAVAILABLE = 1,
@@ -146,22 +146,28 @@ enum QuestFlags
QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text
QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
+ // ... 4.x added flags up to 0x80000000 - all unknown for now
+};
+
+enum QuestSpecialFlags
+{
+ QUEST_SPECIAL_FLAGS_NONE = 0x000,
// Trinity flags for set SpecialFlags in DB if required but used only at server
- QUEST_TRINITY_FLAGS_REPEATABLE = 0x00100000, // Set by 1 in SpecialFlags from DB
- QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT = 0x00200000, // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script)
- QUEST_TRINITY_FLAGS_AUTO_ACCEPT = 0x00400000, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted.
- QUEST_TRINITY_FLAGS_DF_QUEST = 0x00800000, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder.
- QUEST_TRINITY_FLAGS_MONTHLY = 0x01000000, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month
- QUEST_TRINITY_FLAGS_CAST = 0x02000000, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast)
-
- QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST | QUEST_TRINITY_FLAGS_MONTHLY | QUEST_TRINITY_FLAGS_CAST,
+ QUEST_SPECIAL_FLAGS_REPEATABLE = 0x001, // Set by 1 in SpecialFlags from DB
+ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT = 0x002, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `FECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script)
+ QUEST_SPECIAL_FLAGS_AUTO_ACCEPT = 0x004, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted.
+ QUEST_SPECIAL_FLAGS_DF_QUEST = 0x008, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder.
+ QUEST_SPECIAL_FLAGS_MONTHLY = 0x010, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month
+ QUEST_SPECIAL_FLAGS_CAST = 0x020, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast)
+ // room for more custom flags
- // Trinity flags for internal use only
- QUEST_TRINITY_FLAGS_DELIVER = 0x04000000, // Internal flag computed only
- QUEST_TRINITY_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only
- QUEST_TRINITY_FLAGS_KILL = 0x10000000, // Internal flag computed only
- QUEST_TRINITY_FLAGS_TIMED = 0x20000000, // Internal flag computed only
- QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000 // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST | QUEST_SPECIAL_FLAGS_MONTHLY | QUEST_SPECIAL_FLAGS_CAST,
+
+ QUEST_SPECIAL_FLAGS_DELIVER = 0x080, // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_KILL = 0x200, // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_TIMED = 0x400, // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800 // Internal flag computed only
};
struct QuestLocale
@@ -191,6 +197,9 @@ class Quest
bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; }
void SetFlag(uint32 flag) { Flags |= flag; }
+ bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; }
+ void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; }
+
// table data accessors:
uint32 GetQuestId() const { return Id; }
uint32 GetQuestMethod() const { return Method; }
@@ -246,18 +255,18 @@ class Quest
uint32 GetPointOpt() const { return PointOption; }
uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; }
uint32 GetCompleteEmote() const { return EmoteOnComplete; }
- bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; }
+ bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; }
bool IsAutoAccept() const;
bool IsAutoComplete() const;
uint32 GetFlags() const { return Flags; }
bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; }
bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; }
- bool IsMonthly() const { return Flags & QUEST_TRINITY_FLAGS_MONTHLY; }
+ bool IsMonthly() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY; }
bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); }
bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
bool IsRaidQuest(Difficulty difficulty) const;
bool IsAllowedInRaid(Difficulty difficulty) const;
- bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; }
+ bool IsDFQuest() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST; }
uint32 CalculateHonorGain(uint8 level) const;
// multiple values
@@ -280,10 +289,10 @@ class Quest
uint32 OfferRewardEmote[QUEST_EMOTE_COUNT];
uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT];
- uint32 GetReqItemsCount() const { return m_reqitemscount; }
- uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; }
- uint32 GetRewChoiceItemsCount() const { return m_rewchoiceitemscount; }
- uint32 GetRewItemsCount() const { return m_rewitemscount; }
+ uint32 GetReqItemsCount() const { return _reqItemsCount; }
+ uint32 GetReqCreatureOrGOcount() const { return _reqCreatureOrGOcount; }
+ uint32 GetRewChoiceItemsCount() const { return _rewChoiceItemsCount; }
+ uint32 GetRewItemsCount() const { return _rewItemsCount; }
typedef std::vector<int32> PrevQuests;
PrevQuests prevQuests;
@@ -292,10 +301,10 @@ class Quest
// cached data
private:
- uint32 m_reqitemscount;
- uint32 m_reqCreatureOrGOcount;
- uint32 m_rewchoiceitemscount;
- uint32 m_rewitemscount;
+ uint32 _reqItemsCount;
+ uint32 _reqCreatureOrGOcount;
+ uint32 _rewChoiceItemsCount;
+ uint32 _rewItemsCount;
// table data
protected:
@@ -354,6 +363,8 @@ class Quest
uint32 PointOption;
uint32 EmoteOnIncomplete;
uint32 EmoteOnComplete;
+
+ uint32 SpecialFlags; // custom flags, not sniffed/WDB
};
struct QuestStatusData