mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/Quests: Fix an issue where auto-completed quests would not be automatically completed if the quest was added through either the SmartAI action_type SMART_ACTION_ADD_QUEST, the spell effect SPELL_EFFECT_QUEST_START or the opcode CMSG_QUEST_CONFIRM_ACCEPT. Also fixes auto-complete quests in the SAI and opcode case not calling the AI hook.
This commit is contained in:
@@ -369,7 +369,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (IsPlayer(*itr))
|
||||
if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest))
|
||||
{
|
||||
(*itr)->ToPlayer()->AddQuest(q, NULL);
|
||||
(*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u",
|
||||
(*itr)->GetGUIDLow(), e.action.quest.quest);
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
|
||||
return;
|
||||
|
||||
if (_player->CanAddQuest(quest, true))
|
||||
_player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running
|
||||
_player->AddQuestAndCheckCompletion(quest, NULL); // NULL, this prevent DB script from duplicate running
|
||||
|
||||
_player->SetDivider(0);
|
||||
}
|
||||
|
||||
@@ -5595,12 +5595,8 @@ void Spell::EffectQuestStart(SpellEffIndex effIndex)
|
||||
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(m_spellInfo->Effects[effIndex].MiscValue))
|
||||
{
|
||||
if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false))
|
||||
{
|
||||
player->AddQuest(qInfo, NULL);
|
||||
}
|
||||
}
|
||||
player->AddQuestAndCheckCompletion(qInfo, NULL);
|
||||
}
|
||||
|
||||
void Spell::EffectActivateRune(SpellEffIndex effIndex)
|
||||
|
||||
Reference in New Issue
Block a user