mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/ConditionMgr: You can now hide/show the quest marks with conditions (! ?)
note: check only runs at quest giver query! Using together with CONDITION_SOURCE_TYPE_QUEST_ACCEPT you can totally hide quests --HG-- branch : trunk
This commit is contained in:
@@ -910,7 +910,17 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mSourceEntry);
|
||||
if (!Quest)
|
||||
{
|
||||
sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUESTID specifies non-existing quest (%u), skipped", cond->mSourceEntry);
|
||||
sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->mSourceEntry);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK:
|
||||
{
|
||||
Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mSourceEntry);
|
||||
if (!Quest)
|
||||
{
|
||||
sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->mSourceEntry);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,10 +80,11 @@ enum ConditionSourceType
|
||||
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,//DONE
|
||||
CONDITION_SOURCE_TYPE_SPELL = 17,//DONE
|
||||
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,//DONE
|
||||
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20//DONE
|
||||
};
|
||||
|
||||
#define MAX_CONDITIONSOURCETYPE 20
|
||||
#define MAX_CONDITIONSOURCETYPE 21
|
||||
|
||||
struct Condition
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ConditionMgr.h"
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
@@ -602,6 +603,10 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
if (!pQuest) continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
|
||||
if (!sConditionMgr.IsPlayerMeetToConditions(pPlayer, conditions))
|
||||
continue;
|
||||
|
||||
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
|
||||
if ((status == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(quest_id)) ||
|
||||
(pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)))
|
||||
@@ -626,6 +631,10 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
|
||||
if (!pQuest)
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
|
||||
if (!sConditionMgr.IsPlayerMeetToConditions(pPlayer, conditions))
|
||||
continue;
|
||||
|
||||
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
|
||||
if (status == QUEST_STATUS_NONE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user