Core/Quests: implemented MSG_QUEST_PUSH_RESULT notifications

- Allow to share already completed (but not rewarded) quests, restriction was unblizzlike

thanks Cannix for the heads up
This commit is contained in:
ariel-
2020-02-20 01:55:48 +01:00
committed by Ovahlord
parent d6e7cc52a8
commit d28be94e4a
4 changed files with 25 additions and 19 deletions

View File

@@ -552,7 +552,10 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
Group* group = sender->GetGroup();
if (!group)
{
sender->SendPushToPartyResponse(sender, QUEST_PARTY_MSG_NOT_IN_PARTY);
return;
}
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
@@ -573,6 +576,12 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
continue;
}
if (!receiver->SatisfyQuestDay(quest, false))
{
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_NOT_ELIGIBLE_TODAY);
continue;
}
if (!receiver->CanTakeQuest(quest, false))
{
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
@@ -615,21 +624,17 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
TC_LOG_DEBUG("network", "WORLD: Received MSG_QUEST_PUSH_RESULT");
if (_player->GetPlayerSharingQuest())
if (!_player->GetPlayerSharingQuest())
return;
if (_player->GetPlayerSharingQuest() == guid)
{
if (_player->GetPlayerSharingQuest() == guid)
{
Player* player = ObjectAccessor::FindPlayer(_player->GetPlayerSharingQuest());
if (player)
{
WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 4 + 1);
data << uint64(_player->GetGUID());
data << uint8(msg); // valid values: 0-8
player->SendDirectMessage(&data);
}
}
_player->ClearQuestSharingInfo();
Player* player = ObjectAccessor::FindPlayer(guid);
if (player)
player->SendPushToPartyResponse(_player, msg);
}
_player->ClearQuestSharingInfo();
}
void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPackets::Quest::QuestGiverStatusMultipleQuery& /*packet*/)