aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-05-23 14:40:23 +0200
committerShauren <none@none>2010-05-23 14:40:23 +0200
commite658298053046537515a8e6ed26cac2446c142c5 (patch)
tree39f7ab4a45836fd83bb3ec16800a90422da31204 /src
parente2020a587e9ddb724a43cffcdcb5aeb90714ef38 (diff)
Fixed display of quest rewarded xp in quest details menu, also in completion menu multiply xp gained by rates + code style
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GossipDef.cpp6
-rw-r--r--src/game/QuestDef.cpp58
-rw-r--r--src/game/QuestDef.h1
3 files changed, 27 insertions, 38 deletions
diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp
index 8060b05c54a..3e0fec52bc7 100644
--- a/src/game/GossipDef.cpp
+++ b/src/game/GossipDef.cpp
@@ -518,9 +518,9 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
}
data << uint32(pQuest->GetRewOrReqMoney());
+ data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST));
}
- data << uint32(0);
// rewarded honor points. Multiply with 10 to satisfy client
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
data << float(0); // new 3.3.0, honor multiplier?
@@ -604,7 +604,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
data << uint32(pQuest->GetRepObjectiveValue2()); // shown in quest log as part of quest objective OPPOSITE faction
data << uint32(pQuest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0
- data << uint32(0); // unk 3.3.0
+ data << uint32(pQuest->GetXPId()); // used for calculating rewarded experience
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
data << uint32(0); // Hide money rewarded
@@ -772,7 +772,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
}
data << uint32(pQuest->GetRewOrReqMoney());
- data << uint32(pQuest->XPValue(pSession->GetPlayer()));
+ data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST));
// rewarded honor points. Multiply with 10 to satisfy client
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp
index c308f498ff0..2fdd1c58e9b 100644
--- a/src/game/QuestDef.cpp
+++ b/src/game/QuestDef.cpp
@@ -150,62 +150,50 @@ Quest::Quest(Field * questRecord)
m_rewchoiceitemscount = 0;
for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
- {
if (ReqItemId[i])
++m_reqitemscount;
- }
for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
- {
if (ReqCreatureOrGOId[i])
++m_reqCreatureOrGOcount;
- }
for (int i=0; i < QUEST_REWARDS_COUNT; ++i)
- {
if (RewItemId[i])
++m_rewitemscount;
- }
for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- {
if (RewChoiceItemId[i])
++m_rewchoiceitemscount;
- }
}
uint32 Quest::XPValue(Player *pPlayer) const
{
if (pPlayer)
{
-
- const QuestXPEntry *xpentry;
- int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
- xpentry = sQuestXPStore.LookupEntry(quest_level);
- if (!xpentry)
- return 0;
-
- int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
-
- if (diffFactor < 1)
- diffFactor = 1;
- else if (diffFactor > 10)
- diffFactor = 10;
-
- uint32 xp = diffFactor * xpentry->Exp[XPId] / 10;
-
- if (xp <= 100)
- xp = 5 * ((xp + 2) / 5);
- else if (xp <= 500)
- xp = 10 * ((xp + 5) / 10);
- else if (xp <= 1000)
- xp = 25 * ((xp + 12) / 25);
- else
- xp = 50 * ((xp + 25) / 50);
-
- return xp;
-
+ int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
+ const QuestXPEntry *xpentry = sQuestXPStore.LookupEntry(quest_level);
+ if (!xpentry)
+ return 0;
+
+ int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
+ if (diffFactor < 1)
+ diffFactor = 1;
+ else if (diffFactor > 10)
+ diffFactor = 10;
+
+ uint32 xp = diffFactor * xpentry->Exp[XPId] / 10;
+ if (xp <= 100)
+ xp = 5 * ((xp + 2) / 5);
+ else if (xp <= 500)
+ xp = 10 * ((xp + 5) / 10);
+ else if (xp <= 1000)
+ xp = 25 * ((xp + 12) / 25);
+ else
+ xp = 50 * ((xp + 25) / 50);
+
+ return xp;
}
+
return 0;
}
diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h
index 5872b2622b8..20d4ca3d28d 100644
--- a/src/game/QuestDef.h
+++ b/src/game/QuestDef.h
@@ -210,6 +210,7 @@ class Quest
uint32 GetPlayersSlain() const { return PlayersSlain; }
uint32 GetBonusTalents() const { return BonusTalents; }
int32 GetRewArenaPoints() const {return RewArenaPoints; }
+ uint32 GetXPId() const { return XPId; }
uint32 GetSrcItemId() const { return SrcItemId; }
uint32 GetSrcItemCount() const { return SrcItemCount; }
uint32 GetSrcSpell() const { return SrcSpell; }