aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRat <none@none>2010-09-20 10:19:20 +0200
committerRat <none@none>2010-09-20 10:19:20 +0200
commit2fb80e4a86a6006d5692e483880e4ec4370fe5f5 (patch)
tree81193faa0a36fcd358c7c9ff509123de03364411 /src
parent1d6d11d367f6176b9df5a93cc68e4834623a605f (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp12
-rw-r--r--src/server/game/Conditions/ConditionMgr.h5
-rw-r--r--src/server/game/Server/Protocol/Handlers/QuestHandler.cpp9
3 files changed, 23 insertions, 3 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 0f3cd4ec353..3a59ccc43b7 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -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;
}
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 2a8803a6c8d..1bc284eceb6 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -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
{
diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp
index 480f0983041..676184a9544 100644
--- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp
@@ -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)
{