mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 03:22:40 -04:00
Core/Quests: Split Flags and SpecialFlags
This commit is contained in:
@@ -676,7 +676,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_CALL_GROUPEVENTHAPPENS:
|
||||
if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest))
|
||||
{
|
||||
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
|
||||
return false;
|
||||
|
||||
@@ -14686,7 +14686,7 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
@@ -14695,7 +14695,7 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
}
|
||||
}
|
||||
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
@@ -14707,14 +14707,14 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
}
|
||||
}
|
||||
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL))
|
||||
if (qInfo->GetPlayersSlain() != 0 && q_status.PlayerCount < qInfo->GetPlayersSlain())
|
||||
return false;
|
||||
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored)
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored)
|
||||
return false;
|
||||
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && q_status.Timer == 0)
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && q_status.Timer == 0)
|
||||
return false;
|
||||
|
||||
if (qInfo->GetRewOrReqMoney() < 0)
|
||||
@@ -14741,7 +14741,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest)
|
||||
if (!CanTakeQuest(quest, false))
|
||||
return false;
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i]))
|
||||
return false;
|
||||
@@ -14767,7 +14767,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
|
||||
return false;
|
||||
|
||||
// prevent receive reward with quest items in bank
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
@@ -14844,19 +14844,19 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
|
||||
questStatusData.Explored = false;
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.ItemCount[i] = 0;
|
||||
}
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
questStatusData.CreatureOrGOCount[i] = 0;
|
||||
}
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL))
|
||||
questStatusData.PlayerCount = 0;
|
||||
|
||||
GiveQuestSourceItem(quest);
|
||||
@@ -14871,7 +14871,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||
GetReputationMgr().SetVisible(factionEntry);
|
||||
|
||||
uint32 qtime = 0;
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
|
||||
{
|
||||
uint32 limittime = quest->GetLimitTime();
|
||||
|
||||
@@ -15139,7 +15139,7 @@ void Player::FailQuest(uint32 questId)
|
||||
SetQuestSlotState(log_slot, QUEST_STATE_FAIL);
|
||||
}
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
|
||||
{
|
||||
QuestStatusData& q_status = m_QuestStatus[questId];
|
||||
|
||||
@@ -15394,7 +15394,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg)
|
||||
|
||||
bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg)
|
||||
{
|
||||
if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED);
|
||||
@@ -15703,7 +15703,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
|
||||
|
||||
void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData)
|
||||
{
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
{
|
||||
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
@@ -15780,7 +15780,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count)
|
||||
continue;
|
||||
|
||||
Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid);
|
||||
if (!qInfo || !qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (!qInfo || !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
continue;
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
@@ -15819,7 +15819,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count)
|
||||
Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid);
|
||||
if (!qInfo)
|
||||
continue;
|
||||
if (!qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
|
||||
if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
|
||||
continue;
|
||||
|
||||
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
|
||||
@@ -15888,7 +15888,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
|
||||
QuestStatusData& q_status = m_QuestStatus[questid];
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid()))
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST))
|
||||
{
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
@@ -15943,7 +15943,7 @@ void Player::KilledPlayerCredit()
|
||||
QuestStatusData& q_status = m_QuestStatus[questid];
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid()))
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL))
|
||||
{
|
||||
uint32 reqkill = qInfo->GetPlayersSlain();
|
||||
uint16 curkill = q_status.PlayerCount;
|
||||
@@ -15985,7 +15985,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
|
||||
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST))
|
||||
{
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
@@ -16062,7 +16062,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid)
|
||||
|
||||
if (q_status.Status == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))
|
||||
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO))
|
||||
{
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
@@ -17900,7 +17900,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
|
||||
|
||||
time_t quest_time = time_t(fields[3].GetUInt32());
|
||||
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id))
|
||||
{
|
||||
AddTimedQuest(quest_id);
|
||||
|
||||
|
||||
@@ -3474,11 +3474,11 @@ void ObjectMgr::LoadQuests()
|
||||
if (qinfo->GetQuestMethod() >= 3)
|
||||
sLog->outError(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
|
||||
|
||||
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
|
||||
if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
|
||||
qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
|
||||
qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
|
||||
qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED);
|
||||
qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED;
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
@@ -3489,19 +3489,19 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_DAILY)
|
||||
{
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (qinfo->Flags & QUEST_FLAGS_WEEKLY)
|
||||
{
|
||||
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
|
||||
if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
|
||||
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
|
||||
qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3725,7 +3725,7 @@ void ObjectMgr::LoadQuests()
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER);
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
{
|
||||
@@ -3793,12 +3793,12 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
if (found)
|
||||
{
|
||||
if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
|
||||
sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(qinfo)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3832,7 +3832,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_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO);
|
||||
|
||||
if (!qinfo->RequiredNpcOrGoCount[j])
|
||||
{
|
||||
@@ -4165,12 +4165,12 @@ void ObjectMgr::LoadQuests()
|
||||
if (qinfo->ExclusiveGroup)
|
||||
mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
|
||||
if (qinfo->LimitTime)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED);
|
||||
if (qinfo->RequiredPlayerKills)
|
||||
qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL);
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL);
|
||||
}
|
||||
|
||||
// check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
|
||||
// check QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
|
||||
for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
|
||||
@@ -4190,12 +4190,12 @@ void ObjectMgr::LoadQuests()
|
||||
if (!quest)
|
||||
continue;
|
||||
|
||||
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
|
||||
sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4371,13 +4371,13 @@ void ObjectMgr::LoadScripts(ScriptsType type)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
|
||||
tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id);
|
||||
|
||||
// this will prevent quest completing without objective
|
||||
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest objective requirement set and command can be allowed
|
||||
}
|
||||
@@ -5297,12 +5297,12 @@ void ObjectMgr::LoadQuestAreaTriggers()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_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_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
|
||||
const_cast<Quest*>(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT);
|
||||
|
||||
// continue; - quest modified to required objective and trigger can be allowed.
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
|
||||
|
||||
if (const Quest *quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
|
||||
if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
|
||||
_player->RemoveTimedQuest(questId);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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_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.
|
||||
|
||||
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,
|
||||
// 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_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_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
|
||||
|
||||
Reference in New Issue
Block a user