fix/feat: (Core/PacketIO): updated sound and creature addon (#10813)

* fix\feat: (Core/PacketIO): updated sound and creature addon

updated SMSG_PLAY_SOUND, SMSG_PLAY_MUSIC and SMSG_PLAY_OBJECT_SOUND via tc cherry pick
https://github.com/TrinityCore/TrinityCore/pull/2363 and https://github.com/TrinityCore/TrinityCore/commit/0f1f7ef4017ac32df669ceee120489321da680aa by @joschiwald  and @ForesterDev
This so far a attempt to align atleast with sound with tc, and correct a potentional issue of hearing creature sounds that is not in visible range. I notice PlaySound was being defined in some weird dependency as it isnt with tc so I renamed it to Playsound. Notice a isLarge still being used in the creature addon when it was depreciated, so i removed that a that seem to of interfered with visibilitydistanceType.

Co-Authored-By: joschiwald <736792+joschiwald@users.noreply.github.com>
Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
This commit is contained in:
acidmanifesto
2022-02-26 10:05:58 -05:00
committed by GitHub
parent ea497f2b6e
commit 69e2f2e3aa
20 changed files with 120 additions and 104 deletions
@@ -278,7 +278,7 @@ void BattlefieldWG::OnBattleStart()
// Initialize vehicle counter
UpdateCounterVehicle(true);
// Send start warning to all players
SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_START);
SendWarning(BATTLEFIELD_WG_TEXT_START);
// Xinef: reset tenacity counter
m_tenacityStack = 0;
@@ -476,9 +476,9 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
m_PlayersInWar[TEAM_HORDE].clear();
if (!endByTimer) // win alli/horde
SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : (BATTLEFIELD_WG_TEXT_WIN_KEEP + 2));
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : (BATTLEFIELD_WG_TEXT_WIN_KEEP + 2));
else // defend alli/horde
SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : (BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 2));
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : (BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 2));
}
// *******************************************************
@@ -488,7 +488,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
void BattlefieldWG::OnStartGrouping()
{
if (!IsWarTime())
SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_WILL_START);
SendWarning(BATTLEFIELD_WG_TEXT_WILL_START);
}
uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) const
@@ -757,7 +757,7 @@ void BattlefieldWG::PromotePlayer(Player* killer)
{
killer->RemoveAura(SPELL_RECRUIT);
killer->CastSpell(killer, SPELL_CORPORAL, true);
SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_FIRSTRANK);
SendWarning(BATTLEFIELD_WG_TEXT_FIRSTRANK, killer);
}
else
{
@@ -770,7 +770,7 @@ void BattlefieldWG::PromotePlayer(Player* killer)
{
killer->RemoveAura(SPELL_CORPORAL);
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_SECONDRANK);
SendWarning(BATTLEFIELD_WG_TEXT_SECONDRANK, killer);
}
else
{
@@ -1170,7 +1170,7 @@ struct BfWGGameObjectBuilding
// Send warning message
if (m_damagedText) // tower damage + name
m_WG->SendWarningToAllInZone(m_damagedText);
m_WG->SendWarning(m_damagedText);
for (GuidUnorderedSet::const_iterator itr = m_CreatureTopList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureTopList[m_WG->GetAttackerTeam()].end(); ++itr)
if (Creature* creature = m_WG->GetCreature(*itr))
@@ -1193,7 +1193,7 @@ struct BfWGGameObjectBuilding
// Warn players
if (m_destroyedText)
m_WG->SendWarningToAllInZone(m_destroyedText);
m_WG->SendWarning(m_destroyedText);
switch (m_Type)
{
@@ -1467,7 +1467,7 @@ struct WGWorkshop
{
// Send warning message to all player to inform a faction attack to a workshop
// alliance / horde attacking a workshop
bf->SendWarningToAllInZone(teamControl ? WorkshopsData[workshopId].attackText : (WorkshopsData[workshopId].attackText + 2));
bf->SendWarning(teamControl ? WorkshopsData[workshopId].attackText : (WorkshopsData[workshopId].attackText + 2));
break;
}
case TEAM_ALLIANCE:
@@ -1479,7 +1479,7 @@ struct WGWorkshop
// Warning message
if (!init) // workshop taken - alliance
bf->SendWarningToAllInZone(team == TEAM_ALLIANCE ? WorkshopsData[workshopId].takenText : (WorkshopsData[workshopId].takenText + 2));
bf->SendWarning(team == TEAM_ALLIANCE ? WorkshopsData[workshopId].takenText : (WorkshopsData[workshopId].takenText + 2));
// Found associate graveyard and update it
if (workshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)