mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10660] Make quest for game event be independent of source
Create new table and convert existing data. Simplify how game event quests are activated during event by adding generic function to set quest active/inactive. Any quest in game_event_quest are disabled until event start (and deactivated once stopped) Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
1370ead743
commit
449a708728
12 changed files with 97 additions and 67 deletions
|
|
@ -13102,6 +13102,12 @@ void Player::PrepareQuestMenu(ObjectGuid guid)
|
|||
for(QuestRelationsMap::const_iterator itr = irbounds.first; itr != irbounds.second; ++itr)
|
||||
{
|
||||
uint32 quest_id = itr->second;
|
||||
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
|
||||
if (!pQuest || !pQuest->IsActive())
|
||||
continue;
|
||||
|
||||
QuestStatus status = GetQuestStatus(quest_id);
|
||||
|
||||
if (status == QUEST_STATUS_COMPLETE && !GetQuestRewardStatus(quest_id))
|
||||
|
|
@ -13115,9 +13121,10 @@ void Player::PrepareQuestMenu(ObjectGuid guid)
|
|||
for(QuestRelationsMap::const_iterator itr = rbounds.first; itr != rbounds.second; ++itr)
|
||||
{
|
||||
uint32 quest_id = itr->second;
|
||||
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
|
||||
if (!pQuest)
|
||||
if (!pQuest || !pQuest->IsActive())
|
||||
continue;
|
||||
|
||||
QuestStatus status = GetQuestStatus(quest_id);
|
||||
|
|
@ -13276,7 +13283,8 @@ bool Player::CanSeeStartQuest(Quest const *pQuest) const
|
|||
SatisfyQuestExclusiveGroup(pQuest, false) && SatisfyQuestReputation(pQuest, false) &&
|
||||
SatisfyQuestPreviousQuest(pQuest, false) && SatisfyQuestNextChain(pQuest, false) &&
|
||||
SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) &&
|
||||
SatisfyQuestMonth(pQuest, false))
|
||||
SatisfyQuestMonth(pQuest, false) &&
|
||||
pQuest->IsActive())
|
||||
{
|
||||
return getLevel() + sWorld.getConfig(CONFIG_UINT32_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
|
||||
}
|
||||
|
|
@ -13291,7 +13299,8 @@ bool Player::CanTakeQuest(Quest const *pQuest, bool msg) const
|
|||
SatisfyQuestSkill(pQuest, msg) && SatisfyQuestReputation(pQuest, msg) &&
|
||||
SatisfyQuestPreviousQuest(pQuest, msg) && SatisfyQuestTimed(pQuest, msg) &&
|
||||
SatisfyQuestNextChain(pQuest, msg) && SatisfyQuestPrevChain(pQuest, msg) &&
|
||||
SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg) && SatisfyQuestMonth(pQuest, msg);
|
||||
SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg) && SatisfyQuestMonth(pQuest, msg) &&
|
||||
pQuest->IsActive();
|
||||
}
|
||||
|
||||
bool Player::CanAddQuest(Quest const *pQuest, bool msg) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue