mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Commands: Add failure state for quest remove (#20611)
Add more verbose messaging to the .quest remove command
This commit is contained in:
@@ -128,32 +128,40 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove all quest entries for 'entry' from quest log
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
if (player->GetQuestStatus(entry) != QUEST_STATUS_NONE)
|
||||
{
|
||||
uint32 logQuest = player->GetQuestSlotQuestId(slot);
|
||||
if (logQuest == entry)
|
||||
// remove all quest entries for 'entry' from quest log
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
{
|
||||
player->SetQuestSlot(slot, 0);
|
||||
|
||||
// we ignore unequippable quest items in this case, its' still be equipped
|
||||
player->TakeQuestSourceItem(logQuest, false);
|
||||
|
||||
if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP))
|
||||
uint32 logQuest = player->GetQuestSlotQuestId(slot);
|
||||
if (logQuest == entry)
|
||||
{
|
||||
player->pvpInfo.IsHostile = player->pvpInfo.IsInHostileArea || player->HasPvPForcingQuest();
|
||||
player->UpdatePvPState();
|
||||
player->SetQuestSlot(slot, 0);
|
||||
|
||||
// we ignore unequippable quest items in this case, its' still be equipped
|
||||
player->TakeQuestSourceItem(logQuest, false);
|
||||
|
||||
if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP))
|
||||
{
|
||||
player->pvpInfo.IsHostile = player->pvpInfo.IsInHostileArea || player->HasPvPForcingQuest();
|
||||
player->UpdatePvPState();
|
||||
}
|
||||
}
|
||||
}
|
||||
player->RemoveActiveQuest(entry, false);
|
||||
player->RemoveRewardedQuest(entry);
|
||||
|
||||
sScriptMgr->OnQuestStatusChange(player, entry);
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_QUEST_REMOVED);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_QUEST_NOTFOUND);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
player->RemoveActiveQuest(entry, false);
|
||||
player->RemoveRewardedQuest(entry);
|
||||
|
||||
sScriptMgr->OnQuestStatusChange(player, entry);
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_QUEST_REMOVED);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleQuestComplete(ChatHandler* handler, char const* args)
|
||||
|
||||
Reference in New Issue
Block a user