feat(Hooks/PlayerScript): ShouldBeRewardedWithMoneyInsteadOfExp (#4445)

This commit is contained in:
Francesco Borzì
2021-02-09 20:09:41 +01:00
committed by GitHub
parent 639d49509d
commit 8915ab1362
4 changed files with 21 additions and 3 deletions

View File

@@ -16071,10 +16071,14 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
AddPct(XP, (*i)->GetAmount());
int32 moneyRew = 0;
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
GiveXP(XP, nullptr);
else
if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(this))
{
moneyRew = int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY));
}
else
{
GiveXP(XP, nullptr);
}
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
if (quest->GetRewOrReqMoney())