[DiscordArchive] void Battleground::UpdateWorldState(uint32 variable, uint32 value)
[DiscordArchive] void Battleground::UpdateWorldState(uint32 variable, uint32 value)
Archived author: haidee • Posted: 2024-04-18T06:40:34.372000+00:00
Original source
void Battleground::UpdateWorldState(uint32 variable, uint32 value)
{
WorldPackets::WorldState::UpdateWorldState worldstate;
worldstate.VariableID = variable;
worldstate.Value = value;
SendPacketToAll(worldstate.Write());
}
Hello everyone, I have a question. Which DBC does the variable value obtained by the UpdateWorldState function correspond to?
Archived author: Anchy • Posted: 2024-04-18T06:53:59.795000+00:00
Original source
Value is not stored in the DBC, it's a dynamic value that is updated by the core
Archived author: Anchy • Posted: 2024-04-18T06:54:33.050000+00:00
Original source
the Variable however is stored in WorldStateUI.dbc
Archived author: haidee • Posted: 2024-04-18T06:58:13.423000+00:00
Original source
<@228769085834395648>enum BG_EY_WorldStates
{
EY_ALLIANCE_RESOURCES = 2749,
EY_HORDE_RESOURCES = 2750,
}
void BattlegroundEY::AddPoints(TeamId teamId, uint32 points)
{
uint8 honorRewards = uint8(m_TeamScores[teamId] / _honorTics);
m_TeamScores[teamId] += points;
if (m_TeamScores[teamId] > BG_EY_MAX_TEAM_SCORE)
m_TeamScores[teamId] = BG_EY_MAX_TEAM_SCORE;
for (; honorRewards < uint8(m_TeamScores[teamId] / _honorTics); ++honorRewards)
RewardHonorToTeam(GetBonusHonorFromKill(1), teamId);
UpdateWorldState(teamId == TEAM_ALLIANCE ? EY_ALLIANCE_RESOURCES : EY_HORDE_RESOURCES, std::min<uint32>(m_TeamScores[teamId], BG_EY_MAX_TEAM_SCORE));
if (m_TeamScores[teamId] >= BG_EY_MAX_TEAM_SCORE)
EndBattleground(teamId);
}
For example, in the enumeration, EY_ALLIANCE_RESOURCES = 2749. Where is this 2749 corresponding setting value referenced?
Archived author: Anchy • Posted: 2024-04-18T06:59:35.739000+00:00
Original source
I'm not sure what you mean, the `EY_ALLIANCE_RESOURCES` is a key for an entry in `WorldStateUI.dbc` for the client, the server sends the client a new WorldPacket containing the key and the new value for the world state
Archived author: haidee • Posted: 2024-04-18T07:02:55.303000+00:00
Original source
Thank you very much for your answer, but there is no entry like 2749 in WorldStateUI.dbc
Archived author: Anchy • Posted: 2024-04-18T07:04:24.842000+00:00
Original source
I do believe that not all world states are inside of WorldStateUI.dbc
Archived author: Anchy • Posted: 2024-04-18T07:05:37.349000+00:00
Original source
I can't remember