mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10657] Separate quest_template.QuestFlags from SpecialFlags
Create enum for SpecialFlags (database flags and internally computed) Added related functions for specialFlags and update code accordingly. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
1210c6d978
commit
b6e367bf3c
8 changed files with 78 additions and 74 deletions
|
|
@ -635,7 +635,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
case ACTION_T_QUEST_EVENT:
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId))
|
||||
{
|
||||
if (!qid->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
|
||||
}
|
||||
else
|
||||
|
|
@ -677,7 +677,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId))
|
||||
{
|
||||
if (!qid->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
|||
data << uint32(questID);
|
||||
data << uint32(qItem.m_qIcon);
|
||||
data << int32(pQuest->GetQuestLevel());
|
||||
data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags
|
||||
data << uint32(pQuest->GetQuestFlags()); // 3.3.3 quest flags
|
||||
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
|
||||
std::string Title = pQuest->GetTitle();
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
|
|||
data << uint32(questID);
|
||||
data << uint32(qmi.m_qIcon);
|
||||
data << int32(pQuest->GetQuestLevel());
|
||||
data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags
|
||||
data << uint32(pQuest->GetQuestFlags()); // 3.3.3 quest flags
|
||||
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
|
||||
data << title;
|
||||
}
|
||||
|
|
@ -468,7 +468,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, ObjectGuid npcG
|
|||
data << Details;
|
||||
data << Objectives;
|
||||
data << uint8(ActivateAccept ? 1 : 0); // auto finish
|
||||
data << uint32(pQuest->GetFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetQuestFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetSuggestedPlayers());
|
||||
data << uint8(0); // IsFinished? value is sent back to server in quest accept packet
|
||||
|
||||
|
|
@ -632,7 +632,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||
data << float(pQuest->GetRewHonorMultiplier()); // new reward honor (multiplied by ~62 at client side)
|
||||
|
||||
data << uint32(pQuest->GetSrcItemId()); // source item id
|
||||
data << uint32(pQuest->GetFlags() & 0xFFFF); // quest flags
|
||||
data << uint32(pQuest->GetQuestFlags()); // quest flags
|
||||
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
|
||||
data << uint32(pQuest->GetPlayersSlain()); // players slain
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
|
|
@ -737,7 +737,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU
|
|||
data << OfferRewardText;
|
||||
|
||||
data << uint8(EnableNext ? 1 : 0); // Auto Finish
|
||||
data << uint32(pQuest->GetFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetQuestFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetSuggestedPlayers()); // SuggestedGroupNum
|
||||
|
||||
uint32 EmoteCount = 0;
|
||||
|
|
@ -864,7 +864,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, ObjectGuid npcG
|
|||
else
|
||||
data << uint32(0x00);
|
||||
|
||||
data << uint32(pQuest->GetFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetQuestFlags()); // 3.3.3 questFlags
|
||||
data << uint32(pQuest->GetSuggestedPlayers()); // SuggestedGroupNum
|
||||
|
||||
// Required Money
|
||||
|
|
|
|||
|
|
@ -3654,47 +3654,45 @@ void ObjectMgr::LoadQuests()
|
|||
sLog.outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.",qinfo->GetQuestId(),qinfo->GetQuestMethod());
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & ~QUEST_MANGOS_FLAGS_DB_ALLOWED)
|
||||
if (qinfo->SpecialFlags > QUEST_SPECIAL_FLAG_DB_ALLOWED)
|
||||
{
|
||||
sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
|
||||
qinfo->GetQuestId(),qinfo->QuestFlags >> 24,QUEST_MANGOS_FLAGS_DB_ALLOWED >> 24);
|
||||
qinfo->QuestFlags &= QUEST_MANGOS_FLAGS_DB_ALLOWED;
|
||||
sLog.outErrorDb("Quest %u has `SpecialFlags` = %u, above max flags not allowed for database.", qinfo->GetQuestId(), qinfo->SpecialFlags);
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->HasQuestFlag(QUEST_FLAGS_DAILY) && qinfo->HasQuestFlag(QUEST_FLAGS_WEEKLY))
|
||||
{
|
||||
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->HasQuestFlag(QUEST_FLAGS_DAILY))
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE))
|
||||
if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE))
|
||||
{
|
||||
sLog.outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_MANGOS_FLAGS_REPEATABLE;
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_WEEKLY)
|
||||
if (qinfo->HasQuestFlag(QUEST_FLAGS_WEEKLY))
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE))
|
||||
if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE))
|
||||
{
|
||||
sLog.outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_MANGOS_FLAGS_REPEATABLE;
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_MANGOS_FLAGS_MONTHLY)
|
||||
if (qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_MONTHLY))
|
||||
{
|
||||
if (!(qinfo->QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE))
|
||||
if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE))
|
||||
{
|
||||
sLog.outErrorDb("Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->QuestFlags |= QUEST_MANGOS_FLAGS_REPEATABLE;
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_REPEATABLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
if (qinfo->HasQuestFlag(QUEST_FLAGS_AUTO_REWARDED))
|
||||
{
|
||||
// at auto-reward can be rewarded only RewChoiceItemId[0]
|
||||
for(int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
|
|
@ -3896,7 +3894,7 @@ void ObjectMgr::LoadQuests()
|
|||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
qinfo->SetFlag(QUEST_MANGOS_FLAGS_DELIVER);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER);
|
||||
|
||||
if (!sItemStorage.LookupEntry<ItemPrototype>(id))
|
||||
{
|
||||
|
|
@ -3962,12 +3960,12 @@ void ObjectMgr::LoadQuests()
|
|||
|
||||
if (found)
|
||||
{
|
||||
if (!qinfo->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1);
|
||||
sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(qinfo)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(qinfo)->SetSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -4001,7 +3999,7 @@ void ObjectMgr::LoadQuests()
|
|||
{
|
||||
// In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast
|
||||
|
||||
qinfo->SetFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST | QUEST_SPECIAL_FLAG_SPEAKTO);
|
||||
|
||||
if (!qinfo->ReqCreatureOrGOCount[j])
|
||||
{
|
||||
|
|
@ -4205,10 +4203,10 @@ void ObjectMgr::LoadQuests()
|
|||
m_ExclusiveQuestGroups.insert(ExclusiveQuestGroupsMap::value_type(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
|
||||
|
||||
if (qinfo->LimitTime)
|
||||
qinfo->SetFlag(QUEST_MANGOS_FLAGS_TIMED);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAG_TIMED);
|
||||
}
|
||||
|
||||
// check QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
|
||||
// check QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
|
||||
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(i);
|
||||
|
|
@ -4228,15 +4226,15 @@ void ObjectMgr::LoadQuests()
|
|||
if (!quest)
|
||||
continue;
|
||||
|
||||
if (!quest->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest does not have SpecialFlags QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT (2) set. Quest SpecialFlags should be corrected to enable this objective.", spellInfo->Id, quest_id);
|
||||
sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest does not have SpecialFlags QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT (2) set. Quest SpecialFlags should be corrected to enable this objective.", spellInfo->Id, quest_id);
|
||||
|
||||
// The below forced alteration has been disabled because of spell 33824 / quest 10162.
|
||||
// A startup error will still occur with proper data in quest_template, but it will be possible to sucessfully complete the quest with the expected data.
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
// const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
|
||||
// const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4517,12 +4515,12 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!quest->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", tablename, tmp.questExplored.questId, tmp.id);
|
||||
sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", tablename, tmp.questExplored.questId, tmp.id);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest objective requirement set and command can be allowed
|
||||
}
|
||||
|
|
@ -5424,12 +5422,12 @@ void ObjectMgr::LoadQuestAreaTriggers()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!quest->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID);
|
||||
sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest modified to required objective and trigger can be allowed.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13344,7 +13344,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) const
|
|||
// incomplete quest have status data
|
||||
QuestStatusData const& q_status = q_itr->second;
|
||||
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
{
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
|
|
@ -13353,7 +13353,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) const
|
|||
}
|
||||
}
|
||||
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST | QUEST_SPECIAL_FLAG_SPEAKTO))
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
|
|
@ -13365,10 +13365,10 @@ bool Player::CanCompleteQuest(uint32 quest_id) const
|
|||
}
|
||||
}
|
||||
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT) && !q_status.m_explored)
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT) && !q_status.m_explored)
|
||||
return false;
|
||||
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED) && q_status.m_timer == 0)
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED) && q_status.m_timer == 0)
|
||||
return false;
|
||||
|
||||
if (qInfo->GetRewOrReqMoney() < 0)
|
||||
|
|
@ -13392,7 +13392,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const *pQuest) const
|
|||
if (!CanTakeQuest(pQuest, false))
|
||||
return false;
|
||||
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
if (pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i]))
|
||||
return false;
|
||||
|
|
@ -13418,7 +13418,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, bool msg) const
|
|||
return false;
|
||||
|
||||
// prevent receive reward with quest items in bank
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
{
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
|
|
@ -13501,13 +13501,13 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
|||
questStatusData.m_status = QUEST_STATUS_INCOMPLETE;
|
||||
questStatusData.m_explored = false;
|
||||
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
{
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.m_itemcount[i] = 0;
|
||||
}
|
||||
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST | QUEST_SPECIAL_FLAG_SPEAKTO))
|
||||
{
|
||||
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.m_creatureOrGOcount[i] = 0;
|
||||
|
|
@ -13522,7 +13522,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
|||
GetReputationMgr().SetVisible(factionEntry);
|
||||
|
||||
uint32 qtime = 0;
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED))
|
||||
{
|
||||
uint32 limittime = pQuest->GetLimitTime();
|
||||
|
||||
|
|
@ -13765,7 +13765,7 @@ void Player::FailQuest(uint32 questId)
|
|||
SetQuestSlotState(log_slot, QUEST_STATE_FAIL);
|
||||
}
|
||||
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED))
|
||||
{
|
||||
QuestStatusData& q_status = mQuestStatus[questId];
|
||||
|
||||
|
|
@ -13995,7 +13995,7 @@ bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg) const
|
|||
|
||||
bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) const
|
||||
{
|
||||
if (!m_timedquests.empty() && qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED))
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED);
|
||||
|
|
@ -14288,7 +14288,7 @@ uint32 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
|
|||
|
||||
void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& questStatusData )
|
||||
{
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
{
|
||||
for(int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
|
|
@ -14369,7 +14369,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
|
|||
continue;
|
||||
|
||||
Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid);
|
||||
if (!qInfo || !qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (!qInfo || !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
|
|
@ -14406,7 +14406,7 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
|
|||
Quest const* qInfo = sObjectMgr.GetQuestTemplate(questid);
|
||||
if ( !qInfo )
|
||||
continue;
|
||||
if (!qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_DELIVER))
|
||||
if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
|
|
@ -14464,7 +14464,7 @@ void Player::KilledMonsterCredit( uint32 entry, ObjectGuid guid )
|
|||
QuestStatusData& q_status = mQuestStatus[questid];
|
||||
if (q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid()))
|
||||
{
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST))
|
||||
{
|
||||
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
|
|
@ -14521,7 +14521,7 @@ void Player::CastedCreatureOrGO( uint32 entry, ObjectGuid guid, uint32 spell_id,
|
|||
if (!original_caster && !qInfo->HasQuestFlag(QUEST_FLAGS_SHARABLE))
|
||||
continue;
|
||||
|
||||
if (!qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST))
|
||||
if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST))
|
||||
continue;
|
||||
|
||||
QuestStatusData& q_status = mQuestStatus[questid];
|
||||
|
|
@ -14593,7 +14593,7 @@ void Player::TalkedToCreature( uint32 entry, ObjectGuid guid )
|
|||
|
||||
if ( q_status.m_status == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
if (qInfo->HasQuestFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAG_KILL_OR_CAST | QUEST_SPECIAL_FLAG_SPEAKTO))
|
||||
{
|
||||
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
|
|
@ -16159,7 +16159,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
|||
|
||||
time_t quest_time = time_t(fields[4].GetUInt64());
|
||||
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id) && questStatusData.m_status != QUEST_STATUS_NONE)
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED) && !GetQuestRewardStatus(quest_id) && questStatusData.m_status != QUEST_STATUS_NONE)
|
||||
{
|
||||
AddTimedQuest( quest_id );
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ Quest::Quest(Field * questRecord)
|
|||
SuggestedPlayers = questRecord[16].GetUInt32();
|
||||
LimitTime = questRecord[17].GetUInt32();
|
||||
QuestFlags = questRecord[18].GetUInt16();
|
||||
uint32 SpecialFlags = questRecord[19].GetUInt16();
|
||||
SpecialFlags = questRecord[19].GetUInt16();
|
||||
CharTitleId = questRecord[20].GetUInt32();
|
||||
PlayersSlain = questRecord[21].GetUInt32();
|
||||
BonusTalents = questRecord[22].GetUInt32();
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ enum QuestTypes
|
|||
QUEST_TYPE_RAID_25 = 89
|
||||
};
|
||||
|
||||
enum __QuestFlags
|
||||
enum QuestFlags
|
||||
{
|
||||
// Flags used at server and sent to client
|
||||
QUEST_FLAGS_NONE = 0x00000000,
|
||||
|
|
@ -158,21 +158,24 @@ enum __QuestFlags
|
|||
QUEST_FLAGS_UNK5 = 0x00020000, // has something to do with ReqItemId and SrcItemId
|
||||
QUEST_FLAGS_UNK6 = 0x00040000, // use Objective text as Complete text
|
||||
QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // quests in starting areas
|
||||
};
|
||||
|
||||
enum QuestSpecialFlags
|
||||
{
|
||||
// Mangos flags for set SpecialFlags in DB if required but used only at server
|
||||
QUEST_MANGOS_FLAGS_REPEATABLE = 0x001000000, // Set by 1 in SpecialFlags from DB
|
||||
QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x002000000, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL)
|
||||
QUEST_MANGOS_FLAGS_MONTHLY = 0x004000000, // 4 in SpecialFlags. Quest reset for player at beginning of month.
|
||||
QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFFFF |
|
||||
QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT | QUEST_MANGOS_FLAGS_MONTHLY,
|
||||
QUEST_SPECIAL_FLAG_REPEATABLE = 0x001, // |1 in SpecialFlags from DB
|
||||
QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT = 0x002, // |2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL)
|
||||
QUEST_SPECIAL_FLAG_MONTHLY = 0x004, // |4 in SpecialFlags. Quest reset for player at beginning of month.
|
||||
|
||||
// Mangos flags for internal use only
|
||||
QUEST_MANGOS_FLAGS_DELIVER = 0x008000000, // Internal flag computed only
|
||||
QUEST_MANGOS_FLAGS_SPEAKTO = 0x010000000, // Internal flag computed only
|
||||
QUEST_MANGOS_FLAGS_KILL_OR_CAST = 0x020000000, // Internal flag computed only
|
||||
QUEST_MANGOS_FLAGS_TIMED = 0x040000000, // Internal flag computed only
|
||||
QUEST_SPECIAL_FLAG_DELIVER = 0x008, // Internal flag computed only
|
||||
QUEST_SPECIAL_FLAG_SPEAKTO = 0x010, // Internal flag computed only
|
||||
QUEST_SPECIAL_FLAG_KILL_OR_CAST = 0x020, // Internal flag computed only
|
||||
QUEST_SPECIAL_FLAG_TIMED = 0x040, // Internal flag computed only
|
||||
};
|
||||
|
||||
#define QUEST_SPECIAL_FLAG_DB_ALLOWED (QUEST_SPECIAL_FLAG_REPEATABLE | QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAG_MONTHLY)
|
||||
|
||||
struct QuestLocale
|
||||
{
|
||||
QuestLocale() { ObjectiveText.resize(QUEST_OBJECTIVES_COUNT); }
|
||||
|
|
@ -197,8 +200,10 @@ class Quest
|
|||
Quest(Field * questRecord);
|
||||
uint32 XPValue( Player *pPlayer ) const;
|
||||
|
||||
uint32 GetQuestFlags() const { return QuestFlags; }
|
||||
bool HasQuestFlag(uint32 flag) const { return (QuestFlags & flag) != 0; }
|
||||
void SetFlag( uint32 flag ) { QuestFlags |= flag; }
|
||||
bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; }
|
||||
void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; }
|
||||
|
||||
// table data accessors:
|
||||
uint32 GetQuestId() const { return QuestId; }
|
||||
|
|
@ -254,12 +259,12 @@ class Quest
|
|||
uint32 GetCompleteEmote() const { return CompleteEmote; }
|
||||
uint32 GetQuestStartScript() const { return QuestStartScript; }
|
||||
uint32 GetQuestCompleteScript() const { return QuestCompleteScript; }
|
||||
bool IsRepeatable() const { return QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE; }
|
||||
|
||||
bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAG_REPEATABLE; }
|
||||
bool IsAutoComplete() const { return QuestMethod ? false : true; }
|
||||
uint32 GetFlags() const { return QuestFlags; }
|
||||
bool IsDaily() const { return QuestFlags & QUEST_FLAGS_DAILY; }
|
||||
bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; }
|
||||
bool IsMonthly() const { return QuestFlags & QUEST_MANGOS_FLAGS_MONTHLY; }
|
||||
bool IsMonthly() const { return SpecialFlags & QUEST_SPECIAL_FLAG_MONTHLY; }
|
||||
bool IsDailyOrWeekly() const { return QuestFlags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
|
||||
bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; }
|
||||
bool IsAllowedInRaid() const;
|
||||
|
|
@ -323,6 +328,7 @@ class Quest
|
|||
uint32 SuggestedPlayers;
|
||||
uint32 LimitTime;
|
||||
uint32 QuestFlags;
|
||||
uint32 SpecialFlags;
|
||||
uint32 CharTitleId;
|
||||
uint32 PlayersSlain;
|
||||
uint32 BonusTalents;
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
|
|||
|
||||
if (const Quest *pQuest = sObjectMgr.GetQuestTemplate(quest))
|
||||
{
|
||||
if (pQuest->HasQuestFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_TIMED))
|
||||
_player->RemoveTimedQuest(quest);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10656"
|
||||
#define REVISION_NR "10657"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue