mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-27 20:32:21 +01:00
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:
@@ -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*/)
|
||||
|
||||
Reference in New Issue
Block a user