diff options
author | n0n4m3 <none@none> | 2010-04-15 08:26:30 +0400 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-04-15 08:26:30 +0400 |
commit | 8abcca0a06d48d4c9d7039bf7a6b27c57f7eb878 (patch) | |
tree | 849deb42364506716453fd34131d4fea0af972f8 /src/game/ObjectMgr.cpp | |
parent | 6bcb297de4d5231373a3e2bf2b40e527b91cdf46 (diff) |
Another fix quest flags, Implement support weekly quests cooldowns(Original patch by GriffonHeart), also code cleanups.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index beb4ca2839e..d1b2b1c525b 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3653,26 +3653,41 @@ void ObjectMgr::LoadQuests() sLog.outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.",qinfo->GetQuestId(),qinfo->GetQuestMethod()); } - if (qinfo->GetFlags() & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) + if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(),qinfo->GetFlags(),QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); + qinfo->GetQuestId(),qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; } - if (qinfo->GetFlags() & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY)) + if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) { - if (!(qinfo->GetFlags() & QUEST_TRINITY_FLAGS_REPEATABLE)) + sLog.outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.",qinfo->GetQuestId()); + qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY; + } + + if (qinfo->QuestFlags & QUEST_FLAGS_DAILY) + { + if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) { sLog.outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); - qinfo->SetFlag(QUEST_TRINITY_FLAGS_REPEATABLE); + qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; + } + } + + if (qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) + { + if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) + { + sLog.outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); + qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } - if (qinfo->GetFlags() & QUEST_FLAGS_AUTO_REWARDED) + if (qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED) { // at auto-reward can be rewarded only RewChoiceItemId[0] - for (uint8 j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j) + for(int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j ) { if (uint32 id = qinfo->RewChoiceItemId[j]) { @@ -4450,7 +4465,6 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) continue; } - // if (!objmgr.GetMangosStringLocale(tmp.dataint)) will checked after db_script_string loading break; } |