Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Core/Spell): EffectQuestComplete, set quest to rewarded instead of complete #20358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ class Player : public Unit, public GridObject<Player>
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;
Expand Down
9 changes: 7 additions & 2 deletions src/server/game/Entities/Player/PlayerQuest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4744,8 +4744,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.
}
}

Expand Down
Loading