refactor(Core/WorldState): Initial addition of world state definition file. (#21875)

Many world states had their enums from script's header and hardcoded values to their respective header file (WorldStateDefines.h)
Co-authored-by: Jelle Meeus <sogladev@gmail.com>
This commit is contained in:
Benjamin Jackson
2025-04-26 14:31:30 -04:00
committed by GitHub
parent d23e61b721
commit da55f05cfc
73 changed files with 1828 additions and 1789 deletions

View File

@@ -20,6 +20,7 @@
#include "InstanceMapScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "WorldStateDefines.h"
#include "trial_of_the_crusader.h"
std::map<uint32, bool> validDedicatedInsanityItems;
@@ -283,7 +284,7 @@ public:
Map::PlayerList const& pl = instance->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if (Player* plr = itr->GetSource())
plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft);
}
InstanceCleanup(true);
SaveToDB();
@@ -1379,11 +1380,11 @@ public:
if (instance->IsHeroic())
{
plr->SendUpdateWorldState(UPDATE_STATE_UI_SHOW, 1);
plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW, 1);
plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft);
}
else
plr->SendUpdateWorldState(UPDATE_STATE_UI_SHOW, 0);
plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW, 0);
if (DoNeedCleanup(plr))
{
@@ -1555,7 +1556,7 @@ public:
Map::PlayerList const& pl = instance->GetPlayers();
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
if (Player* plr = itr->GetSource())
plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
plr->SendUpdateWorldState(WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT, AttemptsLeft);
}
if (instance->IsHeroic() && AttemptsLeft == 0 )

View File

@@ -379,12 +379,6 @@ enum eAchievementCriteria
ACHIEV_CRITERIA_REALM_FIRST_GRAND_CRUSADER = 12350,
};
enum euiWorldStates
{
UPDATE_STATE_UI_SHOW = 4390,
UPDATE_STATE_UI_COUNT = 4389,
};
const uint32 dIIc = 405;
const uint32 dedicatedInsanityItems[405] =
{