aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-02-26 16:57:11 +0100
committerShauren <shauren.trinity@gmail.com>2013-02-26 16:57:11 +0100
commite3e5d14d52da6ab6005f28acca6492ff805fe6a0 (patch)
tree22b1f3303699372e2ed11cd3aa3974545e49e043 /src
parent2286de02f8a2470134035294352afea22730f1f0 (diff)
Core/Quests: Updated quest flags and implemented QUEST_FLAGS_NO_MONEY_FROM_XP - experience reward from quests using this flag is not converted into money at max level.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp4
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp4
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp2
-rw-r--r--src/server/game/Quests/QuestDef.cpp8
-rw-r--r--src/server/game/Quests/QuestDef.h44
5 files changed, 35 insertions, 27 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index a8a500c093a..467604960ed 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -15067,7 +15067,7 @@ void Player::CompleteQuest(uint32 quest_id)
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id))
{
- if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED))
+ if (qInfo->HasFlag(QUEST_FLAGS_TRACKING))
RewardQuest(qInfo, 0, this, false);
else
SendQuestComplete(quest_id);
@@ -21361,7 +21361,7 @@ void Player::UpdatePvPState(bool onlyFFA)
else // in friendly area
{
if (IsPvP() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) && pvpInfo.endTimer == 0)
- pvpInfo.endTimer = time(0); // start toggle-off
+ pvpInfo.endTimer = time(NULL); // start toggle-off
}
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 3b71d11757c..c82ea46f0f7 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3813,14 +3813,14 @@ void ObjectMgr::LoadQuests()
}
}
- if (qinfo->Flags & QUEST_FLAGS_AUTO_REWARDED)
+ if (qinfo->Flags & QUEST_FLAGS_TRACKING)
{
// at auto-reward can be rewarded only RewardChoiceItemId[0]
for (int j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
{
if (uint32 id = qinfo->RewardChoiceItemId[j])
{
- sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_TRACKING.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest ignore this data
}
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 4e5dbb306fa..b9301347afb 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -425,7 +425,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
if (!_player->TakeQuestSourceItem(questId, true))
return; // can't un-equip some items, reject quest cancel
- if (const Quest *quest = sObjectMgr->GetQuestTemplate(questId))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
_player->RemoveTimedQuest(questId);
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 8bc628b853d..3fefa812489 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -207,6 +207,14 @@ int32 Quest::GetRewOrReqMoney() const
return int32(RewardOrRequiredMoney * sWorld->getRate(RATE_DROP_MONEY));
}
+uint32 Quest::GetRewMoneyMaxLevel() const
+{
+ if (HasFlag(QUEST_FLAGS_NO_MONEY_FROM_XP))
+ return 0;
+
+ return RewardMoneyMaxLevel;
+}
+
bool Quest::IsAutoAccept() const
{
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : (Flags & QUEST_FLAGS_AUTO_ACCEPT);
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 9073c5d1441..a447f4a8f52 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -124,27 +124,27 @@ enum __QuestGiverStatus
enum QuestFlags
{
// Flags used at server and sent to client
- QUEST_FLAGS_NONE = 0x00000000,
- QUEST_FLAGS_STAY_ALIVE = 0x00000001, // Not used currently
- QUEST_FLAGS_PARTY_ACCEPT = 0x00000002, // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
- QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently
- QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest()
- //QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently
- QUEST_FLAGS_EPIC = 0x00000020, // Not used currently: Unsure of content
- QUEST_FLAGS_RAID = 0x00000040, // Not used currently
- QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only
- QUEST_FLAGS_DELIVER_MORE = 0x00000100, // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
- QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
- QUEST_FLAGS_AUTO_REWARDED = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
- QUEST_FLAGS_TBC_RACES = 0x00000800, // Not used currently: Blood elf/Draenei starting zone quests
- QUEST_FLAGS_DAILY = 0x00001000, // Used to know quest is Daily one
- QUEST_FLAGS_REPEATABLE = 0x00002000, // Used on repeatable quests (3.0.0+)
- QUEST_FLAGS_UNAVAILABLE = 0x00004000, // Used on quests that are not generically available
- QUEST_FLAGS_WEEKLY = 0x00008000,
- QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete
- QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with RequiredItemId and SourceItemId
- 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.
+ QUEST_FLAGS_NONE = 0x00000000,
+ QUEST_FLAGS_STAY_ALIVE = 0x00000001, // Not used currently
+ QUEST_FLAGS_PARTY_ACCEPT = 0x00000002, // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
+ QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently
+ QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest()
+ QUEST_FLAGS_HAS_CONDITION = 0x00000010, // Not used currently
+ QUEST_FLAGS_HIDE_REWARD_POI = 0x00000020, // Not used currently: Unsure of content
+ QUEST_FLAGS_RAID = 0x00000040, // Not used currently
+ QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only
+ QUEST_FLAGS_NO_MONEY_FROM_XP = 0x00000100, // Not used currently: Experience is not converted to gold at max level
+ QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
+ QUEST_FLAGS_TRACKING = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
+ QUEST_FLAGS_DEPRECATE_REPUTATION = 0x00000800, // Not used currently
+ QUEST_FLAGS_DAILY = 0x00001000, // Used to know quest is Daily one
+ QUEST_FLAGS_FLAGS_PVP = 0x00002000, // Having this quest in log forces PvP flag
+ QUEST_FLAGS_UNAVAILABLE = 0x00004000, // Used on quests that are not generically available
+ QUEST_FLAGS_WEEKLY = 0x00008000,
+ QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete
+ QUEST_FLAGS_DISPLAY_ITEM_IN_TRACKER = 0x00020000, // Displays usable item in quest tracker
+ 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.
// 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
@@ -234,7 +234,7 @@ class Quest
int32 GetRewOrReqMoney() const;
uint32 GetRewHonorAddition() const { return RewardHonor; }
float GetRewHonorMultiplier() const { return RewardHonorMultiplier; }
- uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } // use in XP calculation at client
+ uint32 GetRewMoneyMaxLevel() const; // use in XP calculation at client
uint32 GetRewSpell() const { return RewardSpell; }
int32 GetRewSpellCast() const { return RewardSpellCast; }
uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; }