[11656] For not first repeating quest avoid reward money as xp replacement.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
mumion 2011-06-19 21:14:57 +04:00 committed by VladimirMangos
parent ba7ce1d7c3
commit 328a62f18f
2 changed files with 14 additions and 9 deletions

View file

@ -13930,16 +13930,21 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
QuestStatusData& q_status = mQuestStatus[quest_id];
// Not give XP in case already completed once repeatable quest
uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this)*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_QUEST));
uint32 xp = 0;
// Not give XP (and money replacement) in case already completed once repeatable quest
if (!q_status.m_rewarded)
{
xp = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this)*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_QUEST));
if (getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
GiveXP(XP , NULL);
GiveXP(xp , NULL);
else
{
uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
ModifyMoney( money );
ModifyMoney(money);
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money);
}
}
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
if (pQuest->GetRewOrReqMoney())
@ -13993,7 +13998,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
q_status.uState = QUEST_CHANGED;
if (announce)
SendQuestReward(pQuest, XP, questGiver);
SendQuestReward(pQuest, xp, questGiver);
bool handled = false;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11655"
#define REVISION_NR "11656"
#endif // __REVISION_NR_H__