fix(Core/Quest): Refresh SMSG_QUESTGIVER_STATUS_MULTIPLE after a quest change (#8902)
Co-authored-by: Malcrom <malcromdev@gmail.com>
This commit is contained in:
@@ -2470,6 +2470,8 @@ void Player::GiveLevel(uint8 level)
|
|||||||
SetByteFlag(PLAYER_FIELD_BYTES, 1, 0x01);
|
SetByteFlag(PLAYER_FIELD_BYTES, 1, 0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendQuestGiverStatusMultiple();
|
||||||
|
|
||||||
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7438,6 +7440,50 @@ bool Player::CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::SendQuestGiverStatusMultiple()
|
||||||
|
{
|
||||||
|
uint32 count = 0;
|
||||||
|
|
||||||
|
WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
|
||||||
|
data << uint32(count); // placeholder
|
||||||
|
|
||||||
|
for (GuidUnorderedSet::const_iterator itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
|
||||||
|
{
|
||||||
|
uint32 questStatus = DIALOG_STATUS_NONE;
|
||||||
|
|
||||||
|
if ((*itr).IsAnyTypeCreature())
|
||||||
|
{
|
||||||
|
// need also pet quests case support
|
||||||
|
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
|
||||||
|
if (!questgiver || questgiver->IsHostileTo(this))
|
||||||
|
continue;
|
||||||
|
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
questStatus = GetQuestDialogStatus(questgiver);
|
||||||
|
|
||||||
|
data << questgiver->GetGUID();
|
||||||
|
data << uint8(questStatus);
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
else if ((*itr).IsGameObject())
|
||||||
|
{
|
||||||
|
GameObject* questgiver = GetMap()->GetGameObject(*itr);
|
||||||
|
if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
questStatus = GetQuestDialogStatus(questgiver);
|
||||||
|
|
||||||
|
data << questgiver->GetGUID();
|
||||||
|
data << uint8(questStatus);
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.put<uint32>(0, count); // write real count
|
||||||
|
GetSession()->SendPacket(&data);
|
||||||
|
}
|
||||||
|
|
||||||
/* If in a battleground a player dies, and an enemy removes the insignia, the player's bones is lootable
|
/* If in a battleground a player dies, and an enemy removes the insignia, the player's bones is lootable
|
||||||
Called by remove insignia spell effect */
|
Called by remove insignia spell effect */
|
||||||
void Player::RemovedInsignia(Player* looterPlr)
|
void Player::RemovedInsignia(Player* looterPlr)
|
||||||
@@ -10928,6 +10974,7 @@ void Player::SendInitialPacketsAfterAddToMap()
|
|||||||
GetAurasForTarget(this);
|
GetAurasForTarget(this);
|
||||||
SendEnchantmentDurations(); // must be after add to map
|
SendEnchantmentDurations(); // must be after add to map
|
||||||
SendItemDurations(); // must be after add to map
|
SendItemDurations(); // must be after add to map
|
||||||
|
SendQuestGiverStatusMultiple();
|
||||||
|
|
||||||
// raid downscaling - send difficulty to player
|
// raid downscaling - send difficulty to player
|
||||||
if (GetMap()->IsRaid())
|
if (GetMap()->IsRaid())
|
||||||
|
|||||||
@@ -2743,6 +2743,7 @@ public:
|
|||||||
|
|
||||||
RewardedQuestSet m_RewardedQuests;
|
RewardedQuestSet m_RewardedQuests;
|
||||||
QuestStatusSaveMap m_RewardedQuestsSave;
|
QuestStatusSaveMap m_RewardedQuestsSave;
|
||||||
|
void SendQuestGiverStatusMultiple();
|
||||||
|
|
||||||
SkillStatusMap mSkillStatus;
|
SkillStatusMap mSkillStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -859,6 +859,8 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
|||||||
|
|
||||||
SendQuestUpdate(quest_id);
|
SendQuestUpdate(quest_id);
|
||||||
|
|
||||||
|
SendQuestGiverStatusMultiple();
|
||||||
|
|
||||||
//lets remove flag for delayed teleports
|
//lets remove flag for delayed teleports
|
||||||
SetMustDelayTeleport(false);
|
SetMustDelayTeleport(false);
|
||||||
|
|
||||||
|
|||||||
@@ -329,7 +329,10 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData)
|
|||||||
_player->DestroyItemCount(pItem, i_count, true);
|
_player->DestroyItemCount(pItem, i_count, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
_player->DestroyItem(bag, slot, true);
|
_player->DestroyItem(bag, slot, true);
|
||||||
|
}
|
||||||
|
_player->SendQuestGiverStatusMultiple();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemTemplate::HasStat(ItemModType stat) const
|
bool ItemTemplate::HasStat(ItemModType stat) const
|
||||||
|
|||||||
@@ -640,46 +640,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
|||||||
{
|
{
|
||||||
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
|
LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
|
||||||
|
|
||||||
uint32 count = 0;
|
_player->SendQuestGiverStatusMultiple();
|
||||||
|
|
||||||
WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
|
|
||||||
data << uint32(count); // placeholder
|
|
||||||
|
|
||||||
for (GuidUnorderedSet::const_iterator itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr)
|
|
||||||
{
|
|
||||||
uint32 questStatus = DIALOG_STATUS_NONE;
|
|
||||||
|
|
||||||
if ((*itr).IsAnyTypeCreature())
|
|
||||||
{
|
|
||||||
// need also pet quests case support
|
|
||||||
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(), *itr);
|
|
||||||
if (!questgiver || questgiver->IsHostileTo(_player))
|
|
||||||
continue;
|
|
||||||
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
questStatus = _player->GetQuestDialogStatus(questgiver);
|
|
||||||
|
|
||||||
data << questgiver->GetGUID();
|
|
||||||
data << uint8(questStatus);
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
else if ((*itr).IsGameObject())
|
|
||||||
{
|
|
||||||
GameObject* questgiver = GetPlayer()->GetMap()->GetGameObject(*itr);
|
|
||||||
if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
questStatus = _player->GetQuestDialogStatus(questgiver);
|
|
||||||
|
|
||||||
data << questgiver->GetGUID();
|
|
||||||
data << uint8(questStatus);
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.put<uint32>(0, count); // write real count
|
|
||||||
SendPacket(&data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleQueryQuestsCompleted(WorldPacket& /*recvData*/)
|
void WorldSession::HandleQueryQuestsCompleted(WorldPacket& /*recvData*/)
|
||||||
|
|||||||
Reference in New Issue
Block a user