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->GetRewOrReqMoney());
|
||||||
|
data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
data << uint32(0);
|
|
||||||
// rewarded honor points. Multiply with 10 to satisfy client
|
// rewarded honor points. Multiply with 10 to satisfy client
|
||||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||||
data << float(0); // new 3.3.0, honor multiplier?
|
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->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(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))
|
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
|
||||||
data << uint32(0); // Hide money rewarded
|
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->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
|
// rewarded honor points. Multiply with 10 to satisfy client
|
||||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
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;
|
m_rewchoiceitemscount = 0;
|
||||||
|
|
||||||
for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||||
{
|
|
||||||
if (ReqItemId[i])
|
if (ReqItemId[i])
|
||||||
++m_reqitemscount;
|
++m_reqitemscount;
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||||
{
|
|
||||||
if (ReqCreatureOrGOId[i])
|
if (ReqCreatureOrGOId[i])
|
||||||
++m_reqCreatureOrGOcount;
|
++m_reqCreatureOrGOcount;
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i < QUEST_REWARDS_COUNT; ++i)
|
for (int i=0; i < QUEST_REWARDS_COUNT; ++i)
|
||||||
{
|
|
||||||
if (RewItemId[i])
|
if (RewItemId[i])
|
||||||
++m_rewitemscount;
|
++m_rewitemscount;
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||||
{
|
|
||||||
if (RewChoiceItemId[i])
|
if (RewChoiceItemId[i])
|
||||||
++m_rewchoiceitemscount;
|
++m_rewchoiceitemscount;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Quest::XPValue(Player *pPlayer) const
|
uint32 Quest::XPValue(Player *pPlayer) const
|
||||||
{
|
{
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
{
|
{
|
||||||
|
int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
|
||||||
|
const QuestXPEntry *xpentry = sQuestXPStore.LookupEntry(quest_level);
|
||||||
|
if (!xpentry)
|
||||||
|
return 0;
|
||||||
|
|
||||||
const QuestXPEntry *xpentry;
|
int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
|
||||||
int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
|
if (diffFactor < 1)
|
||||||
xpentry = sQuestXPStore.LookupEntry(quest_level);
|
diffFactor = 1;
|
||||||
if (!xpentry)
|
else if (diffFactor > 10)
|
||||||
return 0;
|
diffFactor = 10;
|
||||||
|
|
||||||
int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
|
uint32 xp = diffFactor * xpentry->Exp[XPId] / 10;
|
||||||
|
if (xp <= 100)
|
||||||
if (diffFactor < 1)
|
xp = 5 * ((xp + 2) / 5);
|
||||||
diffFactor = 1;
|
else if (xp <= 500)
|
||||||
else if (diffFactor > 10)
|
xp = 10 * ((xp + 5) / 10);
|
||||||
diffFactor = 10;
|
else if (xp <= 1000)
|
||||||
|
xp = 25 * ((xp + 12) / 25);
|
||||||
uint32 xp = diffFactor * xpentry->Exp[XPId] / 10;
|
else
|
||||||
|
xp = 50 * ((xp + 25) / 50);
|
||||||
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 xp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ class Quest
|
|||||||
uint32 GetPlayersSlain() const { return PlayersSlain; }
|
uint32 GetPlayersSlain() const { return PlayersSlain; }
|
||||||
uint32 GetBonusTalents() const { return BonusTalents; }
|
uint32 GetBonusTalents() const { return BonusTalents; }
|
||||||
int32 GetRewArenaPoints() const {return RewArenaPoints; }
|
int32 GetRewArenaPoints() const {return RewArenaPoints; }
|
||||||
|
uint32 GetXPId() const { return XPId; }
|
||||||
uint32 GetSrcItemId() const { return SrcItemId; }
|
uint32 GetSrcItemId() const { return SrcItemId; }
|
||||||
uint32 GetSrcItemCount() const { return SrcItemCount; }
|
uint32 GetSrcItemCount() const { return SrcItemCount; }
|
||||||
uint32 GetSrcSpell() const { return SrcSpell; }
|
uint32 GetSrcSpell() const { return SrcSpell; }
|
||||||
|
|||||||
Reference in New Issue
Block a user