mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
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);
|
||||
}
|
||||
|
||||
SendQuestGiverStatusMultiple();
|
||||
|
||||
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
||||
}
|
||||
|
||||
@@ -7438,6 +7440,50 @@ bool Player::CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const
|
||||
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
|
||||
Called by remove insignia spell effect */
|
||||
void Player::RemovedInsignia(Player* looterPlr)
|
||||
@@ -10928,6 +10974,7 @@ void Player::SendInitialPacketsAfterAddToMap()
|
||||
GetAurasForTarget(this);
|
||||
SendEnchantmentDurations(); // must be after add to map
|
||||
SendItemDurations(); // must be after add to map
|
||||
SendQuestGiverStatusMultiple();
|
||||
|
||||
// raid downscaling - send difficulty to player
|
||||
if (GetMap()->IsRaid())
|
||||
|
||||
Reference in New Issue
Block a user