mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-10 03:59:05 +01:00
Core/World: implement database support for default map and realm wide world states
Co-Authored-By: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -77,6 +77,7 @@ struct MapEntry;
|
||||
struct Position;
|
||||
struct QuestObjective;
|
||||
struct SceneTemplate;
|
||||
struct WorldStateTemplate;
|
||||
|
||||
namespace Trinity::ChatCommands { struct ChatCommandBuilder; }
|
||||
|
||||
@@ -987,6 +988,20 @@ class TC_GAME_API QuestScript : public ScriptObject
|
||||
virtual void OnQuestObjectiveChange(Player* /*player*/, Quest const* /*quest*/, QuestObjective const& /*objective*/, int32 /*oldAmount*/, int32 /*newAmount*/) { }
|
||||
};
|
||||
|
||||
class TC_GAME_API WorldStateScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
|
||||
WorldStateScript(char const* name);
|
||||
|
||||
public:
|
||||
|
||||
~WorldStateScript();
|
||||
|
||||
// Called when worldstate changes value, map is optional
|
||||
virtual void OnValueChange([[maybe_unused]] int32 worldStateId, [[maybe_unused]] int32 oldValue, [[maybe_unused]] int32 newValue, [[maybe_unused]] Map const* map) { }
|
||||
};
|
||||
|
||||
// Manages registration, loading, and execution of scripts.
|
||||
class TC_GAME_API ScriptMgr
|
||||
{
|
||||
@@ -1289,6 +1304,10 @@ class TC_GAME_API ScriptMgr
|
||||
void OnQuestAcknowledgeAutoAccept(Player* player, Quest const* quest);
|
||||
void OnQuestObjectiveChange(Player* player, Quest const* quest, QuestObjective const& objective, int32 oldAmount, int32 newAmount);
|
||||
|
||||
public: /* WorldStateScript */
|
||||
|
||||
void OnWorldStateValueChange(WorldStateTemplate const* worldStateTemplate, int32 oldValue, int32 newValue, Map const* map);
|
||||
|
||||
private:
|
||||
uint32 _scriptCount;
|
||||
bool _scriptIdUpdated;
|
||||
|
||||
Reference in New Issue
Block a user