Fixed display of quest rewarded xp in quest details menu, also in completion menu multiply xp gained by rates + code style

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-05-23 14:40:23 +02:00
parent e2020a587e
commit e658298053
3 changed files with 24 additions and 35 deletions
+3 -3
View File
@@ -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()));
+2 -14
View File
@@ -150,50 +150,38 @@ 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);
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)
@@ -204,8 +192,8 @@ uint32 Quest::XPValue(Player *pPlayer) const
xp = 50 * ((xp + 25) / 50);
return xp;
}
return 0;
}
+1
View File
@@ -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; }