From 342bd7d6ada3d95903e1e35b4912648fd4a19b0e Mon Sep 17 00:00:00 2001 From: Mordred Date: Tue, 21 Dec 2021 00:13:50 +0100 Subject: [PATCH] Changed quest exp logic and fixed a bug in gain exp message --- src/world/Actor/Player.cpp | 2 +- src/world/Actor/PlayerQuest.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index dcc6b914..b3de384b 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -831,7 +831,7 @@ void Sapphire::Entity::Player::gainExp( uint32_t amount ) else { setExp( currentExp + amount ); - Service< World::Manager::PlayerMgr >::ref().onGainExp( *this, currentExp + amount ); + Service< World::Manager::PlayerMgr >::ref().onGainExp( *this, amount ); } } diff --git a/src/world/Actor/PlayerQuest.cpp b/src/world/Actor/PlayerQuest.cpp index 386e0954..2936bf41 100644 --- a/src/world/Actor/PlayerQuest.cpp +++ b/src/world/Actor/PlayerQuest.cpp @@ -179,9 +179,8 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti auto paramGrowth = exdData.getRow< Component::Excel::ParamGrow >( questInfo->data().ClassLevel ); - // TODO: use the correct formula, this one is wrong uint32_t exp = - ( questInfo->data().Reward.ExpBonus * paramGrowth->data().EventExpRate * ( 45 + 5 * questInfo->data().ClassLevel ) ) / 100; + ( questInfo->data().Reward.ExpBonus * paramGrowth->data().BaseExp * paramGrowth->data().EventExpRate ) / 100; //exp = questInfo->data().Reward.ExpBonus;