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

@@ -1714,6 +1714,17 @@ bool ScriptMgr::CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGu
return ret;
}
bool ScriptMgr::ShouldBeRewardedWithMoneyInsteadOfExp(Player* player)
{
bool ret = false; // return false by default if not scripts
FOR_SCRIPTS_RET(PlayerScript, itr, end, ret)
if (itr->second->ShouldBeRewardedWithMoneyInsteadOfExp(player))
ret = true; // we change ret value only when a script returns true
return ret;
}
void ScriptMgr::OnBeforeTempSummonInitStats(Player* player, TempSummon* tempSummon, uint32& duration)
{
FOREACH_SCRIPT(PlayerScript)->OnBeforeTempSummonInitStats(player, tempSummon, duration);