mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core: ported headers cleanup from master branch
This commit is contained in:
@@ -17,27 +17,32 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptReloadMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Config.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GossipDef.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Item.h"
|
||||
#include "LFGScripts.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptReloadMgr.h"
|
||||
#include "ScriptSystem.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "SmartAI.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "GossipDef.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "Player.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Weather.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Chat.h"
|
||||
#include "MapManager.h"
|
||||
#include "LFGScripts.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
// Trait which indicates whether this script type
|
||||
// must be assigned in the database.
|
||||
@@ -984,7 +989,7 @@ struct TSpellSummary
|
||||
uint8 Effects; // set of enum SelectEffect
|
||||
} *SpellSummary;
|
||||
|
||||
ScriptObject::ScriptObject(const char* name) : _name(name)
|
||||
ScriptObject::ScriptObject(char const* name) : _name(name)
|
||||
{
|
||||
sScriptMgr->IncreaseScriptCount();
|
||||
}
|
||||
@@ -1508,7 +1513,7 @@ InstanceScript* ScriptMgr::CreateInstanceData(InstanceMap* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
GET_SCRIPT_RET(InstanceMapScript, map->GetScriptId(), tmpscript, NULL);
|
||||
GET_SCRIPT_RET(InstanceMapScript, map->GetScriptId(), tmpscript, nullptr);
|
||||
return tmpscript->GetInstanceScript(map);
|
||||
}
|
||||
|
||||
@@ -1579,7 +1584,7 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature)
|
||||
{
|
||||
ASSERT(creature);
|
||||
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, NULL);
|
||||
GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, nullptr);
|
||||
return tmpscript->GetAI(creature);
|
||||
}
|
||||
|
||||
@@ -1587,7 +1592,7 @@ GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject)
|
||||
{
|
||||
ASSERT(gameobject);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, NULL);
|
||||
GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, nullptr);
|
||||
return tmpscript->GetAI(gameobject);
|
||||
}
|
||||
|
||||
@@ -1604,12 +1609,12 @@ Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
|
||||
{
|
||||
/// @todo Implement script-side battlegrounds.
|
||||
ABORT();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId)
|
||||
{
|
||||
GET_SCRIPT_RET(OutdoorPvPScript, scriptId, tmpscript, NULL);
|
||||
GET_SCRIPT_RET(OutdoorPvPScript, scriptId, tmpscript, nullptr);
|
||||
return tmpscript->GetOutdoorPvP();
|
||||
}
|
||||
|
||||
@@ -1624,7 +1629,7 @@ std::vector<ChatCommand> ScriptMgr::GetChatCommands()
|
||||
}
|
||||
|
||||
// Sort commands in alphabetical order
|
||||
std::sort(table.begin(), table.end(), [](const ChatCommand& a, const ChatCommand&b)
|
||||
std::sort(table.begin(), table.end(), [](ChatCommand const& a, ChatCommand const& b)
|
||||
{
|
||||
return strcmp(a.Name, b.Name) < 0;
|
||||
});
|
||||
@@ -2070,7 +2075,7 @@ void ScriptMgr::OnGroupInviteMember(Group* group, ObjectGuid guid)
|
||||
FOREACH_SCRIPT(GroupScript)->OnInviteMember(group, guid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, const char* reason)
|
||||
void ScriptMgr::OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason)
|
||||
{
|
||||
ASSERT(group);
|
||||
FOREACH_SCRIPT(GroupScript)->OnRemoveMember(group, guid, method, kicker, reason);
|
||||
@@ -2119,167 +2124,176 @@ void ScriptMgr::ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& dama
|
||||
FOREACH_SCRIPT(PlayerScript)->ModifySpellDamageTaken(target, attacker, damage);
|
||||
}
|
||||
|
||||
SpellScriptLoader::SpellScriptLoader(const char* name)
|
||||
SpellScriptLoader::SpellScriptLoader(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<SpellScriptLoader>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
ServerScript::ServerScript(const char* name)
|
||||
ServerScript::ServerScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<ServerScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
WorldScript::WorldScript(const char* name)
|
||||
WorldScript::WorldScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<WorldScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
FormulaScript::FormulaScript(const char* name)
|
||||
FormulaScript::FormulaScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<FormulaScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
UnitScript::UnitScript(const char* name, bool addToScripts)
|
||||
UnitScript::UnitScript(char const* name, bool addToScripts)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
if (addToScripts)
|
||||
ScriptRegistry<UnitScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<Map>(mapId)
|
||||
WorldMapScript::WorldMapScript(char const* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<Map>(sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
if (!GetEntry())
|
||||
TC_LOG_ERROR("scripts", "Invalid WorldMapScript for %u; no such map ID.", mapId);
|
||||
|
||||
if (GetEntry() && !GetEntry()->IsWorldMap())
|
||||
TC_LOG_ERROR("scripts", "WorldMapScript for map %u is invalid.", mapId);
|
||||
|
||||
ScriptRegistry<WorldMapScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<InstanceMap>(mapId)
|
||||
InstanceMapScript::InstanceMapScript(char const* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<InstanceMap>(sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
if (!GetEntry())
|
||||
TC_LOG_ERROR("scripts", "Invalid InstanceMapScript for %u; no such map ID.", mapId);
|
||||
|
||||
if (GetEntry() && !GetEntry()->IsDungeon())
|
||||
TC_LOG_ERROR("scripts", "InstanceMapScript for map %u is invalid.", mapId);
|
||||
|
||||
ScriptRegistry<InstanceMapScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<BattlegroundMap>(mapId)
|
||||
BattlegroundMapScript::BattlegroundMapScript(char const* name, uint32 mapId)
|
||||
: ScriptObject(name), MapScript<BattlegroundMap>(sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
if (!GetEntry())
|
||||
TC_LOG_ERROR("scripts", "Invalid BattlegroundMapScript for %u; no such map ID.", mapId);
|
||||
|
||||
if (GetEntry() && !GetEntry()->IsBattleground())
|
||||
TC_LOG_ERROR("scripts", "BattlegroundMapScript for map %u is invalid.", mapId);
|
||||
|
||||
ScriptRegistry<BattlegroundMapScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
ItemScript::ItemScript(const char* name)
|
||||
ItemScript::ItemScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<ItemScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
CreatureScript::CreatureScript(const char* name)
|
||||
CreatureScript::CreatureScript(char const* name)
|
||||
: UnitScript(name, false)
|
||||
{
|
||||
ScriptRegistry<CreatureScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
GameObjectScript::GameObjectScript(const char* name)
|
||||
GameObjectScript::GameObjectScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<GameObjectScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
AreaTriggerScript::AreaTriggerScript(const char* name)
|
||||
AreaTriggerScript::AreaTriggerScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<AreaTriggerScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
BattlegroundScript::BattlegroundScript(const char* name)
|
||||
BattlegroundScript::BattlegroundScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<BattlegroundScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
OutdoorPvPScript::OutdoorPvPScript(const char* name)
|
||||
OutdoorPvPScript::OutdoorPvPScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<OutdoorPvPScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
CommandScript::CommandScript(const char* name)
|
||||
CommandScript::CommandScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<CommandScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
WeatherScript::WeatherScript(const char* name)
|
||||
WeatherScript::WeatherScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<WeatherScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
AuctionHouseScript::AuctionHouseScript(const char* name)
|
||||
AuctionHouseScript::AuctionHouseScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<AuctionHouseScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
ConditionScript::ConditionScript(const char* name)
|
||||
ConditionScript::ConditionScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<ConditionScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
VehicleScript::VehicleScript(const char* name)
|
||||
VehicleScript::VehicleScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<VehicleScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
DynamicObjectScript::DynamicObjectScript(const char* name)
|
||||
DynamicObjectScript::DynamicObjectScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<DynamicObjectScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
TransportScript::TransportScript(const char* name)
|
||||
TransportScript::TransportScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<TransportScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
AchievementCriteriaScript::AchievementCriteriaScript(const char* name)
|
||||
AchievementCriteriaScript::AchievementCriteriaScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<AchievementCriteriaScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
PlayerScript::PlayerScript(const char* name)
|
||||
PlayerScript::PlayerScript(char const* name)
|
||||
: UnitScript(name, false)
|
||||
{
|
||||
ScriptRegistry<PlayerScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
AccountScript::AccountScript(const char* name)
|
||||
AccountScript::AccountScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<AccountScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
GuildScript::GuildScript(const char* name)
|
||||
GuildScript::GuildScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<GuildScript>::Instance()->AddScript(this);
|
||||
}
|
||||
|
||||
GroupScript::GroupScript(const char* name)
|
||||
GroupScript::GroupScript(char const* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<GroupScript>::Instance()->AddScript(this);
|
||||
|
||||
Reference in New Issue
Block a user