mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/SAI: Implemented new action SMART_ACTION_COMPLETE_QUEST (#30048)
This commit is contained in:
@@ -3690,11 +3690,17 @@ void Spell::EffectQuestComplete()
|
||||
if (!quest)
|
||||
return;
|
||||
|
||||
uint16 logSlot = player->FindQuestSlot(questId);
|
||||
if (logSlot < MAX_QUEST_LOG_SIZE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
else if (quest->HasFlag(QUEST_FLAGS_TRACKING_EVENT)) // Check if the quest is used as a serverside flag.
|
||||
player->SetRewardedQuest(questId); // If so, set status to rewarded without broadcasting it to client.
|
||||
QuestStatus questStatus = player->GetQuestStatus(questId);
|
||||
if (questStatus == QUEST_STATUS_REWARDED)
|
||||
return;
|
||||
|
||||
if (quest->HasFlag(QUEST_FLAGS_COMPLETION_EVENT) || quest->HasFlag(QUEST_FLAGS_COMPLETION_AREA_TRIGGER))
|
||||
{
|
||||
if (questStatus == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
}
|
||||
else if (quest->HasFlag(QUEST_FLAGS_TRACKING_EVENT)) // Check if the quest is used as a serverside flag
|
||||
player->CompleteQuest(questId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user