diff options
Diffstat (limited to 'src/server/game/Maps/MapScripts.cpp')
-rw-r--r-- | src/server/game/Maps/MapScripts.cpp | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/src/server/game/Maps/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp index 0462967e1e6..8c88d07b81c 100644 --- a/src/server/game/Maps/MapScripts.cpp +++ b/src/server/game/Maps/MapScripts.cpp @@ -102,7 +102,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe { Player* player = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo()); else { // Check target first, then source. @@ -112,7 +112,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe player = source->ToPlayer(); if (!player) - TC_LOG_ERROR("scripts", "%s neither source nor target object is player (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target object is player (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -124,7 +124,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t { Creature* creature = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo()); else { if (bReverse) @@ -145,7 +145,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t } if (!creature) - TC_LOG_ERROR("scripts", "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target are creatures (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -157,7 +157,7 @@ inline GameObject* Map::_GetScriptGameObjectSourceOrTarget(Object* source, Objec { GameObject* gameobject = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo()); else { if (bReverse) @@ -178,7 +178,7 @@ inline GameObject* Map::_GetScriptGameObjectSourceOrTarget(Object* source, Objec } if (!gameobject) - TC_LOG_ERROR("scripts", "%s neither source nor target are gameobjects (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target are gameobjects (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -190,16 +190,16 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* s { Unit* unit = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else if (!obj->isType(TYPEMASK_UNIT)) - TC_LOG_ERROR("scripts", "%s %s object is not unit %s, skipping.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not unit {}, skipping.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); else { unit = obj->ToUnit(); if (!unit) - TC_LOG_ERROR("scripts", "%s %s object could not be cast to unit.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object could not be cast to unit.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); } return unit; } @@ -208,13 +208,13 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, ScriptInfo cons { Player* player = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { player = obj->ToPlayer(); if (!player) - TC_LOG_ERROR("scripts", "%s %s object is not a player %s.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not a player {}.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); } return player; } @@ -223,13 +223,13 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, ScriptInfo { Creature* creature = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { creature = obj->ToCreature(); if (!creature) - TC_LOG_ERROR("scripts", "%s %s object is not a creature %s.", scriptInfo->GetDebugInfo().c_str(), - isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not a creature {}.", scriptInfo->GetDebugInfo(), + isSource ? "source" : "target", obj->GetGUID().ToString()); } return creature; } @@ -238,14 +238,14 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, Scrip { WorldObject* pWorldObject = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { pWorldObject = dynamic_cast<WorldObject*>(obj); if (!pWorldObject) - TC_LOG_ERROR("scripts", "%s %s object is not a world object %s.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not a world object {}.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); } return pWorldObject; } @@ -260,30 +260,30 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, ScriptInfo c case SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break; case SCRIPT_COMMAND_CLOSE_DOOR: break; default: - TC_LOG_ERROR("scripts", "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo()); return; } if (!guid) - TC_LOG_ERROR("scripts", "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} door guid is not specified.", scriptInfo->GetDebugInfo()); else if (!source) - TC_LOG_ERROR("scripts", "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source object is NULL.", scriptInfo->GetDebugInfo()); else if (!source->isType(TYPEMASK_UNIT)) - TC_LOG_ERROR("scripts", "%s source object is not unit %s, skipping.", scriptInfo->GetDebugInfo().c_str(), - source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source object is not unit {}, skipping.", scriptInfo->GetDebugInfo(), + source->GetGUID().ToString()); else { WorldObject* wSource = dynamic_cast <WorldObject*> (source); if (!wSource) - TC_LOG_ERROR("scripts", "%s source object could not be cast to world object %s, skipping.", - scriptInfo->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source object could not be cast to world object {}, skipping.", + scriptInfo->GetDebugInfo(), source->GetGUID().ToString()); else { GameObject* pDoor = _FindGameObject(wSource, guid); if (!pDoor) - TC_LOG_ERROR("scripts", "%s gameobject was not found (guid: " UI64FMTD ").", scriptInfo->GetDebugInfo().c_str(), guid); + TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", scriptInfo->GetDebugInfo(), guid); else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR) - TC_LOG_ERROR("scripts", "%s gameobject is not a door (GoType: %u, %s).", - scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} gameobject is not a door (GoType: {}, {}).", + scriptInfo->GetDebugInfo(), pDoor->GetGoType(), pDoor->GetGUID().ToString()); else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY)) { pDoor->UseDoorOrButton(nTimeToToggle); @@ -348,8 +348,8 @@ void Map::ScriptsProcess() source = GetCorpse(step.sourceGUID); break; default: - TC_LOG_ERROR("scripts", "%s source with unsupported high guid %s.", - step.script->GetDebugInfo().c_str(), step.sourceGUID.ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source with unsupported high guid {}.", + step.script->GetDebugInfo(), step.sourceGUID.ToString()); break; } } @@ -377,8 +377,8 @@ void Map::ScriptsProcess() target = GetCorpse(step.targetGUID); break; default: - TC_LOG_ERROR("scripts", "%s target with unsupported high guid %s.", - step.script->GetDebugInfo().c_str(), step.targetGUID.ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target with unsupported high guid {}.", + step.script->GetDebugInfo(), step.targetGUID.ToString()); break; } } @@ -389,7 +389,7 @@ void Map::ScriptsProcess() { if (step.script->Talk.ChatType > CHAT_TYPE_BOSS_WHISPER) { - TC_LOG_ERROR("scripts", "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType); + TC_LOG_ERROR("scripts", "{} invalid chat type ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->Talk.ChatType); break; } @@ -403,7 +403,7 @@ void Map::ScriptsProcess() Unit* sourceUnit = source->ToUnit(); if (!sourceUnit) { - TC_LOG_ERROR("scripts", "%s source object (%s) is not an unit, skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source object ({}) is not an unit, skipping.", step.script->GetDebugInfo(), source->GetGUID().ToString()); break; } @@ -424,7 +424,7 @@ void Map::ScriptsProcess() { Player* receiver = target ? target->ToPlayer() : nullptr; if (!receiver) - TC_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo()); else sourceUnit->Whisper(step.script->Talk.TextID, receiver, step.script->Talk.ChatType == CHAT_TYPE_BOSS_WHISPER); break; @@ -481,12 +481,12 @@ void Map::ScriptsProcess() { if (!source) { - TC_LOG_ERROR("scripts", "%s source object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source object is NULL.", step.script->GetDebugInfo()); break; } if (!target) { - TC_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo()); break; } @@ -497,8 +497,8 @@ void Map::ScriptsProcess() { if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER) { - TC_LOG_ERROR("scripts", "%s source is not unit, gameobject or player %s, skipping.", - step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source is not unit, gameobject or player {}, skipping.", + step.script->GetDebugInfo(), source->GetGUID().ToString()); break; } worldObject = dynamic_cast<WorldObject*>(source); @@ -510,15 +510,15 @@ void Map::ScriptsProcess() { if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER) { - TC_LOG_ERROR("scripts", "%s target is not unit, gameobject or player %s, skipping.", - step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target is not unit, gameobject or player {}, skipping.", + step.script->GetDebugInfo(), target->GetGUID().ToString()); break; } worldObject = dynamic_cast<WorldObject*>(target); } else { - TC_LOG_ERROR("scripts", "%s neither source nor target is player (source: %s; target: %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target is player (source: {}; target: {}), skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str(), target->GetGUID().ToString().c_str()); break; @@ -551,7 +551,7 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT: if (!step.script->RespawnGameobject.GOGuid) { - TC_LOG_ERROR("scripts", "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} gameobject guid (datalong) is not specified.", step.script->GetDebugInfo()); break; } @@ -561,7 +561,7 @@ void Map::ScriptsProcess() GameObject* pGO = _FindGameObject(pSummoner, step.script->RespawnGameobject.GOGuid); if (!pGO) { - TC_LOG_ERROR("scripts", "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid); + TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", step.script->GetDebugInfo(), step.script->RespawnGameobject.GOGuid); break; } @@ -570,8 +570,8 @@ void Map::ScriptsProcess() pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP) { - TC_LOG_ERROR("scripts", "%s can not be used with gameobject of type %u (guid: %u).", - step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid); + TC_LOG_ERROR("scripts", "{} can not be used with gameobject of type {} (guid: {}).", + step.script->GetDebugInfo(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid); break; } @@ -593,7 +593,7 @@ void Map::ScriptsProcess() if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script)) { if (!step.script->TempSummonCreature.CreatureEntry) - TC_LOG_ERROR("scripts", "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} creature entry (datalong) is not specified.", step.script->GetDebugInfo()); else { float x = step.script->TempSummonCreature.PosX; @@ -602,7 +602,7 @@ void Map::ScriptsProcess() float o = step.script->TempSummonCreature.Orientation; if (!pSummoner->SummonCreature(step.script->TempSummonCreature.CreatureEntry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, Milliseconds(step.script->TempSummonCreature.DespawnDelay))) - TC_LOG_ERROR("scripts", "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry); + TC_LOG_ERROR("scripts", "{} creature was not spawned (entry: {}).", step.script->GetDebugInfo(), step.script->TempSummonCreature.CreatureEntry); } } break; @@ -620,14 +620,14 @@ void Map::ScriptsProcess() // Target must be GameObject. if (!target) { - TC_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo()); break; } if (target->GetTypeId() != TYPEID_GAMEOBJECT) { - TC_LOG_ERROR("scripts", "%s target object is not gameobject %s, skipping.", - step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target object is not gameobject {}, skipping.", + step.script->GetDebugInfo(), target->GetGUID().ToString()); break; } @@ -649,7 +649,7 @@ void Map::ScriptsProcess() { if (!source && !target) { - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", step.script->GetDebugInfo()); break; } @@ -682,13 +682,13 @@ void Map::ScriptsProcess() if (!uSource) { - TC_LOG_ERROR("scripts", "%s no source worldobject found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID); + TC_LOG_ERROR("scripts", "{} no source worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID); break; } if (!uTarget) { - TC_LOG_ERROR("scripts", "%s no target worldobject found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID); + TC_LOG_ERROR("scripts", "{} no target worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID); break; } @@ -750,7 +750,7 @@ void Map::ScriptsProcess() if (Unit* unit = _GetScriptUnit(source, true, step.script)) { if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID)) - TC_LOG_ERROR("scripts", "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID); + TC_LOG_ERROR("scripts", "{} source object has an invalid path ({}), skipping.", step.script->GetDebugInfo(), step.script->LoadPath.PathID); else unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable != 0); } @@ -760,12 +760,12 @@ void Map::ScriptsProcess() { if (!step.script->CallScript.CreatureEntry) { - TC_LOG_ERROR("scripts", "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} creature entry is not specified, skipping.", step.script->GetDebugInfo()); break; } if (!step.script->CallScript.ScriptID) { - TC_LOG_ERROR("scripts", "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} script id is not specified, skipping.", step.script->GetDebugInfo()); break; } @@ -784,7 +784,7 @@ void Map::ScriptsProcess() if (!cTarget) { - TC_LOG_ERROR("scripts", "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry); + TC_LOG_ERROR("scripts", "{} target was not found (entry: {})", step.script->GetDebugInfo(), step.script->CallScript.CreatureEntry); break; } @@ -793,7 +793,7 @@ void Map::ScriptsProcess() //if no scriptmap present... if (!datamap) { - TC_LOG_ERROR("scripts", "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType); + TC_LOG_ERROR("scripts", "{} unknown scriptmap ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->CallScript.ScriptType); break; } @@ -807,8 +807,8 @@ void Map::ScriptsProcess() if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) { if (cSource->isDead()) - TC_LOG_ERROR("scripts", "%s creature is already dead %s", - step.script->GetDebugInfo().c_str(), cSource->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} creature is already dead {}", + step.script->GetDebugInfo(), cSource->GetGUID().ToString()); else { cSource->setDeathState(JUST_DIED); @@ -888,7 +888,7 @@ void Map::ScriptsProcess() break; default: - TC_LOG_ERROR("scripts", "Unknown script command %s.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "Unknown script command {}.", step.script->GetDebugInfo()); break; } |