diff options
| author | Nay <dnpd.dd@gmail.com> | 2012-08-18 21:08:21 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-08-18 21:08:21 +0100 |
| commit | 6c14a51fe4e44c0ef3eedeba655fa854a8469bfa (patch) | |
| tree | c608140d7c784bccc58af20d64d69e19a9376e01 /src/server/game/Quests | |
| parent | 1939f6d4485b33e669753519d58b0070f3447af8 (diff) | |
Core/Quests: Split Flags and SpecialFlags
Diffstat (limited to 'src/server/game/Quests')
| -rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 17 | ||||
| -rwxr-xr-x | src/server/game/Quests/QuestDef.h | 43 |
2 files changed, 36 insertions, 24 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index f259d57d839..c694e964e20 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -61,7 +61,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(); MinimapTargetMark = questRecord[39].GetUInt8(); RewardTitleId = questRecord[40].GetUInt8(); RequiredPlayerKills = questRecord[41].GetUInt8(); @@ -171,8 +171,7 @@ Quest::Quest(Field* questRecord) // int32 WDBVerified = questRecord[174].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; @@ -182,27 +181,27 @@ Quest::Quest(Field* questRecord) m_rewCurrencyCount = 0; m_reqCurrencyCount = 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; - for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) if (RequiredNpcOrGo[i]) ++m_reqNpcOrGoCount; - for (int i=0; i < QUEST_REWARDS_COUNT; ++i) + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) if (RewardItemId[i]) ++m_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; - for (int i=0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) if (RewardCurrencyId[i]) ++m_rewCurrencyCount; - for (int i=0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) if (RequiredCurrencyId[i]) ++m_reqCurrencyCount; diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index d0441879041..c51ba3248a6 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -149,20 +149,27 @@ 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_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST, - - // 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_OR_CAST = 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_REPEATABLE = 0x001, + QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT = 0x002, // if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) + QUEST_SPECIAL_FLAGS_AUTO_ACCEPT = 0x004, // quest is to be auto-accepted. + QUEST_SPECIAL_FLAGS_DF_QUEST = 0x008, // quest is used by Dungeon Finder. + + // room for more custom flags + + 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_DELIVER = 0x080, // Internal flag computed only + QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only + QUEST_SPECIAL_FLAGS_KILL_OR_CAST = 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 @@ -197,6 +204,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) { Flags |= flag; } + // table data accessors: uint32 GetQuestId() const { return Id; } uint32 GetQuestMethod() const { return Method; } @@ -261,10 +271,11 @@ class Quest uint32 GetCompleteEmote() const { return EmoteOnComplete; } uint32 GetQuestStartScript() const { return StartScript; } uint32 GetQuestCompleteScript() const { return CompleteScript; } - 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; } + uint32 GetSpecialFlags() const { return SpecialFlags; } uint32 GetMinimapTargetMark() const { return MinimapTargetMark; } uint32 GetRewardSkillId() const { return RewardSkillId; } uint32 GetRewardSkillPoints() const { return RewardSkillPoints; } @@ -277,7 +288,7 @@ class Quest bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } bool IsAllowedInRaid() 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 @@ -402,6 +413,8 @@ class Quest std::string QuestTurnTargetName; uint32 SoundAccept; uint32 SoundTurnIn; + + uint32 SpecialFlags; // custom flags, not sniffed/WDB }; struct QuestStatusData |
