mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36:23 +00:00
refactor(Scripts/Commands): Update cs_quest to the new model (#9267)
This commit is contained in:
@@ -424,8 +424,9 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
data << uint32(0);
|
||||
}
|
||||
|
||||
data << uint32(quest->GetRewOrReqMoney(_session->GetPlayer()));
|
||||
data << uint32(quest->XPValue(_session->GetPlayer()) * _session->GetPlayer()->GetQuestRate());
|
||||
uint8 playerLevel = _session->GetPlayer() ? _session->GetPlayer()->getLevel() : 0;
|
||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||
data << uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
}
|
||||
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
@@ -506,7 +507,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
|
||||
data << uint32(0); // Hide money rewarded
|
||||
else
|
||||
data << uint32(quest->GetRewOrReqMoney(_session->GetPlayer())); // reward money (below max lvl)
|
||||
data << uint32(quest->GetRewOrReqMoney(_session->GetPlayer() ? _session->GetPlayer()->getLevel() : 0)); // reward money (below max lvl)
|
||||
|
||||
data << uint32(quest->GetRewMoneyMaxLevel()); // used in XP calculation at client
|
||||
data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0)
|
||||
@@ -650,8 +651,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
data << uint32(0);
|
||||
}
|
||||
|
||||
data << uint32(quest->GetRewOrReqMoney(_session->GetPlayer()));
|
||||
data << uint32(quest->XPValue(_session->GetPlayer()) * _session->GetPlayer()->GetQuestRate());
|
||||
uint8 playerLevel = _session->GetPlayer() ? _session->GetPlayer()->getLevel() : 0;
|
||||
|
||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||
data << uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
|
||||
|
||||
@@ -736,7 +736,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
bool rewarded = IsQuestRewarded(quest_id) && !quest->IsDFQuest();
|
||||
|
||||
// Not give XP in case already completed once repeatable quest
|
||||
uint32 XP = rewarded ? 0 : uint32(quest->XPValue(this) * GetQuestRate());
|
||||
uint32 XP = rewarded ? 0 : uint32(quest->XPValue(getLevel()) * GetQuestRate());
|
||||
|
||||
// handle SPELL_AURA_MOD_XP_QUEST_PCT auras
|
||||
Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_QUEST_PCT);
|
||||
@@ -754,7 +754,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
}
|
||||
|
||||
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
|
||||
if (int32 rewOrReqMoney = quest->GetRewOrReqMoney(this))
|
||||
if (int32 rewOrReqMoney = quest->GetRewOrReqMoney(getLevel()))
|
||||
{
|
||||
moneyRew += rewOrReqMoney;
|
||||
}
|
||||
@@ -2292,12 +2292,12 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
|
||||
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
data << uint32(XP);
|
||||
data << uint32(quest->GetRewOrReqMoney(this));
|
||||
data << uint32(quest->GetRewOrReqMoney(getLevel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint32(0);
|
||||
data << uint32(quest->GetRewOrReqMoney(this) + quest->GetRewMoneyMaxLevel());
|
||||
data << uint32(quest->GetRewOrReqMoney(getLevel()) + quest->GetRewMoneyMaxLevel());
|
||||
}
|
||||
|
||||
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
|
||||
|
||||
Reference in New Issue
Block a user