Skip to content

Commit

Permalink
[11656] For not first repeating quest avoid reward money as xp replac…
Browse files Browse the repository at this point in the history
…ement.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
mumion authored and VladimirMangos committed Jun 19, 2011
1 parent 78cc8ab commit 4ee3cf9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions src/game/Player.cpp
Expand Up @@ -13930,15 +13930,20 @@ 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;

if (getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
GiveXP(XP , NULL);
else
// Not give XP (and money replacement) in case already completed once repeatable quest
if (!q_status.m_rewarded)
{
uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_MONEY));
ModifyMoney( money );
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money);
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);
else
{
uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11655"
#define REVISION_NR "11656"
#endif // __REVISION_NR_H__

0 comments on commit 4ee3cf9

Please sign in to comment.