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:
@@ -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()));
|
||||
|
||||
+20
-32
@@ -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)
|
||||
{
|
||||
int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
|
||||
const QuestXPEntry *xpentry = sQuestXPStore.LookupEntry(quest_level);
|
||||
if (!xpentry)
|
||||
return 0;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user