diff options
| author | funjoker <funjoker109@gmail.com> | 2024-01-09 00:10:25 +0100 |
|---|---|---|
| committer | funjoker <funjoker109@gmail.com> | 2024-01-09 00:35:58 +0100 |
| commit | 2a8f1feef6dfd585bec3e1232888fb0807fcaf12 (patch) | |
| tree | c631a95cebd896bc8f05192843284870dfc04e46 /src/server/game/Quests/QuestDef.cpp | |
| parent | a08ab8364a12239c93a04efeb26002d2854d06f9 (diff) | |
Core/Misc: Build fixes
Closes #29572
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
| -rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index fa219749f9b..703f5f0708b 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -389,21 +389,19 @@ uint32 Quest::XPValue(Player const* player) const if (!player) return 0; - QuestXPEntry const* questXp = sQuestXPStore.LookupEntry(questLevel); + int32 quest_level = (questLevel == -1 ? player->GetLevel() : questLevel); + + QuestXPEntry const* questXp = sQuestXPStore.LookupEntry(quest_level); if (!questXp || xpDifficulty >= 10) return 0; - float multiplier = 1.0f; - if (questLevel != player->GetLevel()) - multiplier = sXpGameTable.GetRow(std::min<int32>(player->GetLevel(), questLevel))->Divisor / sXpGameTable.GetRow(player->GetLevel())->Divisor; - - int32 diffFactor = 2 * (questLevel - player->GetLevel()) + 20; + int32 diffFactor = 2 * (quest_level - player->GetLevel()) + 20; if (diffFactor < 1) diffFactor = 1; else if (diffFactor > 10) diffFactor = 10; - uint32 xp = RoundXPValue(diffFactor * questXp->Difficulty[xpDifficulty] / 10 * multiplier); + uint32 xp = RoundXPValue(diffFactor * questXp->Difficulty[xpDifficulty] / 10); if (sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO)) { uint32 minScaledXP = RoundXPValue(questXp->Difficulty[xpDifficulty] * xpMultiplier) * sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO) / 100; |
