mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
fix(Core/Spell): EffectQuestComplete, set quest to rewarded instead of complete (#20358)
set quest to rewarded instead of complete when targetted by SPELL_EFFECT_QUEST_COMPLETE Prevents people from ending up with strange quests in their quest logs. https://github.com/TrinityCore/TrinityCore/commit/6d62f852acf3e1a3ee57cde2442832280aee814 Co-authored-by: SnapperRy <snapperryen@gmail.com>
This commit is contained in:
@@ -1433,6 +1433,7 @@ public:
|
||||
void CompleteQuest(uint32 quest_id);
|
||||
void IncompleteQuest(uint32 quest_id);
|
||||
void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true, bool isLFGReward = false);
|
||||
void SetRewardedQuest(uint32 quest_id);
|
||||
void FailQuest(uint32 quest_id);
|
||||
bool SatisfyQuestSkill(Quest const* qInfo, bool msg) const;
|
||||
bool SatisfyQuestLevel(Quest const* qInfo, bool msg) const;
|
||||
|
||||
@@ -819,8 +819,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
SetSeasonalQuestStatus(quest_id);
|
||||
|
||||
RemoveActiveQuest(quest_id, false);
|
||||
m_RewardedQuests.insert(quest_id);
|
||||
m_RewardedQuestsSave[quest_id] = true;
|
||||
SetRewardedQuest(quest_id);
|
||||
|
||||
if (announce)
|
||||
SendQuestReward(quest, XP);
|
||||
@@ -877,6 +876,12 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
sScriptMgr->OnPlayerCompleteQuest(this, quest);
|
||||
}
|
||||
|
||||
void Player::SetRewardedQuest(uint32 quest_id)
|
||||
{
|
||||
m_RewardedQuests.insert(quest_id);
|
||||
m_RewardedQuestsSave[quest_id] = true;
|
||||
}
|
||||
|
||||
void Player::FailQuest(uint32 questId)
|
||||
{
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
|
||||
@@ -4771,8 +4771,8 @@ void Spell::EffectQuestComplete(SpellEffIndex effIndex)
|
||||
uint16 logSlot = player->FindQuestSlot(questId);
|
||||
if (logSlot < MAX_QUEST_LOG_SIZE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
else if (player->CanTakeQuest(quest, false)) // never rewarded before
|
||||
player->CompleteQuest(questId); // quest not in log - for internal use
|
||||
else if (player->CanTakeQuest(quest, false)) // Check if the quest has already been turned in.
|
||||
player->SetRewardedQuest(questId); // If not, set status to rewarded without broadcasting it to client.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user