EverWrath/src/server/game/Scripting/ScriptDefines/AllMapScript.h
sudlud 60be029e4c
fix(Core/Scripting): fix OnBeforeCreateInstanceScript hook (#19252)
- to me this hook should obviously provide an option to overwrite
  the InstanceScript pointer
- this is e.g. beeing used by mod-eluna (but currently broken)
2024-07-03 14:54:45 -03:00

87 lines
3 KiB
C++

/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCRIPT_OBJECT_ALL_MAP_SCRIPT_H_
#define SCRIPT_OBJECT_ALL_MAP_SCRIPT_H_
#include "ScriptObject.h"
class AllMapScript : public ScriptObject
{
protected:
AllMapScript(const char* name);
public:
/**
* @brief This hook called when a player enters any Map
*
* @param map Contains information about the Map
* @param player Contains information about the Player
*/
virtual void OnPlayerEnterAll(Map* /*map*/, Player* /*player*/) { }
/**
* @brief This hook called when a player leave any Map
*
* @param map Contains information about the Map
* @param player Contains information about the Player
*/
virtual void OnPlayerLeaveAll(Map* /*map*/, Player* /*player*/) { }
/**
* @brief This hook called before create instance script
*
* @param instanceMap Contains information about the WorldSession
* @param instanceData Contains information about the WorldPacket
* @param load if true loading instance save data
* @param data Contains information about the instance save data
* @param completedEncounterMask Contains information about the completed encouter mask
*/
virtual void OnBeforeCreateInstanceScript(InstanceMap* /*instanceMap*/, InstanceScript** /*instanceData*/, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) { }
/**
* @brief This hook called before destroy instance
*
* @param mapInstanced Contains information about the MapInstanced
* @param map Contains information about the Map
*/
virtual void OnDestroyInstance(MapInstanced* /*mapInstanced*/, Map* /*map*/) { }
/**
* @brief This hook called before creating map
*
* @param map Contains information about the Map
*/
virtual void OnCreateMap(Map* /*map*/) { }
/**
* @brief This hook called before destroing map
*
* @param map Contains information about the Map
*/
virtual void OnDestroyMap(Map* /*map*/) { }
/**
* @brief This hook called before updating map
*
* @param map Contains information about the Map
* @param diff Contains information about the diff time
*/
virtual void OnMapUpdate(Map* /*map*/, uint32 /*diff*/) { }
};
#endif