mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT * correct CheckCompactArrayMaskOverflow * 1 * Update src/server/game/Spells/Spell.cpp * rework logging * add fmt replace logs * logging * FMT_LOG_ * settings * fix startup * 1 * 2 * 3 * 4 * 5 * fmt::print * to fmt
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
{ \
|
||||
if (value > 1) \
|
||||
{ \
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses param %s of type Boolean with value %u, valid values are 0 or 1, skipped.", \
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses param {} of type Boolean with value {}, valid values are 0 or 1, skipped.", \
|
||||
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), STRINGIZE(value), value); \
|
||||
return false; \
|
||||
} \
|
||||
@@ -93,7 +93,7 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
}
|
||||
|
||||
if (last_id != id)
|
||||
LOG_ERROR("sql.sql", "SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
|
||||
LOG_ERROR("sql.sql", "SmartWaypointMgr::LoadFromDB: Path entry {}, unexpected point id {}, expected {}.", entry, id, last_id);
|
||||
|
||||
last_id++;
|
||||
(*waypoint_map[entry])[id] = new WayPoint(id, x, y, z, o, delay);
|
||||
@@ -102,7 +102,7 @@ void SmartWaypointMgr::LoadFromDB()
|
||||
total++;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} SmartAI waypoint paths (total {} waypoints) in {} ms", count, total, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8();
|
||||
if (source_type >= SMART_SCRIPT_TYPE_MAX)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: invalid source_type ({}), skipped loading.", uint32(source_type));
|
||||
continue;
|
||||
}
|
||||
if (temp.entryOrGuid >= 0)
|
||||
@@ -169,7 +169,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
{
|
||||
if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -178,7 +178,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
{
|
||||
if (!sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: GameObject entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -187,7 +187,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
{
|
||||
if (!sObjectMgr->GetAreaTrigger((uint32)temp.entryOrGuid))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -195,7 +195,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
case SMART_SCRIPT_TYPE_TIMED_ACTIONLIST:
|
||||
break;//nothing to check, really
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type {}", (uint32)source_type);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
{
|
||||
if (!sObjectMgr->GetCreatureData(uint32(std::abs(temp.entryOrGuid))))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(std::abs(temp.entryOrGuid)));
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature guid ({}) does not exist, skipped loading.", uint32(std::abs(temp.entryOrGuid)));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
|
||||
mEventMap[source_type][temp.entryOrGuid].push_back(temp);
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} SmartAI scripts in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
{
|
||||
if (e.target.unitDistance.creature && !sObjectMgr->GetCreatureTemplate(e.target.unitDistance.creature))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Creature entry {} as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -369,7 +369,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
{
|
||||
if (e.target.goDistance.entry && !sObjectMgr->GetGameObjectTemplate(e.target.goDistance.entry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent GameObject entry {} as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -391,7 +391,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
{
|
||||
if (e.target.playerDistance.dist == 0)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -401,7 +401,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
case SMART_TARGET_INVOKER_PARTY:
|
||||
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && e.GetEventType() != SMART_EVENT_LINK && !EventHasInvoker(e.event.type))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invoker target, but action does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invoker target, but action does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -442,7 +442,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
||||
case SMART_TARGET_THREAT_LIST:
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled target_type({}), Entry {} SourceType {} Event {} Action {}, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -452,20 +452,20 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if ((e.event.type >= SMART_EVENT_TC_END && e.event.type <= SMART_EVENT_AC_START) || e.event.type >= SMART_EVENT_AC_END)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid event type ({}), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
|
||||
return false;
|
||||
}
|
||||
// in SMART_SCRIPT_TYPE_TIMED_ACTIONLIST all event types are overriden by core
|
||||
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && !(SmartAIEventMask[e.event.type][1] & SmartAITypeMask[e.GetScriptType()][1]))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {}, event type {} can not be used for Script type {}", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
|
||||
return false;
|
||||
}
|
||||
if (e.action.type <= 0
|
||||
|| (e.action.type >= SMART_ACTION_TC_END && e.action.type <= SMART_ACTION_AC_START)
|
||||
|| e.action.type >= SMART_ACTION_AC_END)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has an invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an invalid action type ({}), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
switch (e.action.type)
|
||||
@@ -474,7 +474,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_PLAY_ANIMKIT:
|
||||
case SMART_ACTION_SCENE_PLAY:
|
||||
case SMART_ACTION_SCENE_CANCEL:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has an action type that is not supported on 3.3.5a (%u), skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an action type that is not supported on 3.3.5a ({}), skipped.",
|
||||
e.entryOrGuid, e.event_id, e.GetActionType());
|
||||
return false;
|
||||
case SMART_ACTION_SET_CORPSE_DELAY:
|
||||
@@ -486,7 +486,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_SPAWN_SPAWNGROUP:
|
||||
case SMART_ACTION_DESPAWN_SPAWNGROUP:
|
||||
case SMART_ACTION_RESPAWN_BY_SPAWNID:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has an action type that is not yet supported on AzerothCore (%u), skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an action type that is not yet supported on AzerothCore ({}), skipped.",
|
||||
e.entryOrGuid, e.event_id, e.GetActionType());
|
||||
return false;
|
||||
default:
|
||||
@@ -494,24 +494,24 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
}
|
||||
if (e.target.type < 0 || (e.target.type >= SMART_TARGET_TC_END && e.target.type < SMART_TARGET_AC_START) || e.target.type >= SMART_TARGET_AC_END)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has an invalid target type (%u), skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an invalid target type ({}), skipped.",
|
||||
e.entryOrGuid, e.event_id, e.GetTargetType());
|
||||
return false;
|
||||
}
|
||||
if (e.target.type == SMART_TARGET_LOOT_RECIPIENTS)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has a target type that is not yet supported on AzerothCore (%u), skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has a target type that is not yet supported on AzerothCore ({}), skipped.",
|
||||
e.entryOrGuid, e.event_id, e.GetTargetType());
|
||||
return false;
|
||||
}
|
||||
if (e.event.event_phase_mask > SMART_EVENT_PHASE_ALL)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid phase mask ({}), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
|
||||
return false;
|
||||
}
|
||||
if (e.event.event_flags > SMART_EVENT_FLAGS_ALL)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid event flags ({}), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
|
||||
return false;
|
||||
}
|
||||
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
|
||||
@@ -552,12 +552,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.event.spellHit.spell);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Spell entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
return false;
|
||||
}
|
||||
if (e.event.spellHit.school && (e.event.spellHit.school & spellInfo->SchoolMask) != spellInfo->SchoolMask)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses Spell entry %u with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses Spell entry {} with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.event.los.hostilityMode >= AsUnderlyingType(SmartEvent::LOSHostilityMode::End))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses hostilityMode with invalid value %u (max allowed value %u), skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses hostilityMode with invalid value {} (max allowed value {}), skipped.",
|
||||
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.los.hostilityMode, AsUnderlyingType(SmartEvent::LOSHostilityMode::End) - 1);
|
||||
return false;
|
||||
}
|
||||
@@ -583,12 +583,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_EVENT_RESPAWN:
|
||||
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Map entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
|
||||
return false;
|
||||
}
|
||||
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && !sAreaTableStore.LookupEntry(e.event.respawn.area))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Area entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Area entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -627,7 +627,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_EVENT_VICTIM_CASTING:
|
||||
if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId))
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Spell entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.event.movementInform.type > NULL_MOTION_TYPE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid Motion type {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -706,7 +706,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.link && e.link == e.event_id)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {}, Event {}, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -727,7 +727,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.event.doAction.eventId > EVENT_CHARGE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid event id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -738,7 +738,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.event.friendlyHealthPct.maxHpPct > 100 || e.event.friendlyHealthPct.minHpPct > 100)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -753,7 +753,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_TARGET_PLAYER_DISTANCE:
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid target_type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid target_type {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -772,13 +772,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.event.distance.guid != 0 && !sObjectMgr->GetCreatureData(e.event.distance.guid))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature guid %u, skipped.", e.event.distance.guid);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature guid {}, skipped.", e.event.distance.guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.event.distance.entry != 0 && !sObjectMgr->GetCreatureTemplate(e.event.distance.entry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature entry %u, skipped.", e.event.distance.entry);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature entry {}, skipped.", e.event.distance.entry);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -797,13 +797,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.event.distance.guid != 0 && !sObjectMgr->GetGOData(e.event.distance.guid))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject guid %u, skipped.", e.event.distance.guid);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject guid {}, skipped.", e.event.distance.guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.event.distance.entry != 0 && !sObjectMgr->GetGameObjectTemplate(e.event.distance.entry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject entry %u, skipped.", e.event.distance.entry);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject entry {}, skipped.", e.event.distance.entry);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -813,13 +813,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.event.counter.id == 0)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid counter id %u, skipped.", e.event.counter.id);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid counter id {}, skipped.", e.event.counter.id);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.event.counter.value == 0)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid value %u, skipped.", e.event.counter.value);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid value {}, skipped.", e.event.counter.value);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -860,7 +860,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_EVENT_ON_SPELLCLICK:
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled event_type({}), Entry {} SourceType {} Event {} Action {}, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -870,7 +870,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_SET_FACTION:
|
||||
if (e.action.faction.factionID && !sFactionTemplateStore.LookupEntry(e.action.faction.factionID))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Faction %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Faction {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -880,7 +880,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.morphOrMount.creature > 0 && !sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Creature entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -888,12 +888,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.morphOrMount.creature)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
else if (!sCreatureDisplayInfoStore.LookupEntry(e.action.morphOrMount.model))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Model id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Model id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -953,7 +953,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (!sTaxiPathStore.LookupEntry(e.action.taxi.id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid Taxi path ID {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -997,32 +997,32 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} SpecialFlags for Quest entry {} does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Quest entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SMART_ACTION_SET_EVENT_PHASE:
|
||||
if (e.action.setEventPhase.phase >= SMART_EVENT_PHASE_MAX)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set phase %u. Phase mask cannot be used past phase %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX - 1);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set phase {}. Phase mask cannot be used past phase {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX - 1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SMART_ACTION_INC_EVENT_PHASE:
|
||||
if (!e.action.incEventPhase.inc && !e.action.incEventPhase.dec)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
else if (e.action.incEventPhase.inc > SMART_EVENT_PHASE_MAX || e.action.incEventPhase.dec > SMART_EVENT_PHASE_MAX)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1039,7 +1039,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
e.action.randomPhase.phase5 >= SMART_EVENT_PHASE_MAX ||
|
||||
e.action.randomPhase.phase6 >= SMART_EVENT_PHASE_MAX)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
if (e.action.randomPhase.phase1 == 0 &&
|
||||
@@ -1049,7 +1049,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
e.action.randomPhase.phase5 == 0 &&
|
||||
e.action.randomPhase.phase6 == 0)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1059,7 +1059,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
if (e.action.randomPhaseRange.phaseMin >= SMART_EVENT_PHASE_MAX ||
|
||||
e.action.randomPhaseRange.phaseMax >= SMART_EVENT_PHASE_MAX)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax))
|
||||
@@ -1071,7 +1071,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
return false;
|
||||
if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses incorrect TempSummonType {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1089,7 +1089,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_SET_SHEATH:
|
||||
if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect Sheath state %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses incorrect Sheath state {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1097,7 +1097,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.react.state > REACT_AGGRESSIVE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses invalid React State {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1117,14 +1117,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_TELEPORT:
|
||||
if (!sMapStore.LookupEntry(e.action.teleport.mapID))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Map entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SMART_ACTION_INSTALL_AI_TEMPLATE:
|
||||
if (e.action.installTtemplate.id >= SMARTAI_TEMPLATE_END)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature %d Event %u Action %u uses non-existent AI template id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses non-existent AI template id {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1137,7 +1137,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses non-existent WaypointPath id {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
|
||||
return false;
|
||||
}
|
||||
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest))
|
||||
@@ -1149,7 +1149,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
|
||||
if (e.action.wpStart.reactState > (REACT_AGGRESSIVE + TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses invalid React State {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1177,7 +1177,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_REMOVE_POWER:
|
||||
if (e.action.power.powerType > MAX_POWERS)
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Power %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.power.powerType);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Power {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.power.powerType);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1188,14 +1188,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
if (eventId < 1 || eventId >= events.size())
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEventData const& eventData = events[eventId];
|
||||
if (!eventData.isValid())
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1207,14 +1207,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
if (eventId < 1 || eventId >= events.size())
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEventData const& eventData = events[eventId];
|
||||
if (!eventData.isValid())
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1230,7 +1230,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.entryOrGuid, equipId);
|
||||
if (!einfo)
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u, skipped.", equipId, e.entryOrGuid);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}, skipped.", equipId, e.entryOrGuid);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1241,7 +1241,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (!Acore::IsValidMapCoord(e.target.x, e.target.y))
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: %u, skipped.", e.entryOrGuid);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: {}, skipped.", e.entryOrGuid);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1250,7 +1250,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.GetScriptType() == SMART_SCRIPT_TYPE_GAMEOBJECT)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartScript: action_type %u is not allowed with source_type %u. Entry %u, skipped.", e.GetActionType(), e.GetScriptType(), e.entryOrGuid);
|
||||
LOG_ERROR("sql.sql", "SmartScript: action_type {} is not allowed with source_type {}. Entry {}, skipped.", e.GetActionType(), e.GetScriptType(), e.entryOrGuid);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1261,13 +1261,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.setInstanceData.data >= EncounterState::TO_BE_DECIDED)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA with type 1 (bossState) uses invalid encounter state %u. Source entry %u, type %u", e.action.setInstanceData.data, e.entryOrGuid, e.GetScriptType());
|
||||
LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA with type 1 (bossState) uses invalid encounter state {}. Source entry {}, type {}", e.action.setInstanceData.data, e.entryOrGuid, e.GetScriptType());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (e.action.setInstanceData.type > 1)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA uses unsupported data type %u. Source entry %u, type %u", e.action.setInstanceData.type, e.entryOrGuid, e.GetScriptType());
|
||||
LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA uses unsupported data type {}. Source entry {}, type {}", e.action.setInstanceData.type, e.entryOrGuid, e.GetScriptType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1276,7 +1276,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.setHealthPct.percent > 100 || !e.action.setHealthPct.percent)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u is trying to set invalid HP percent %u, skipped.",
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} is trying to set invalid HP percent {}, skipped.",
|
||||
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setHealthPct.percent);
|
||||
return false;
|
||||
}
|
||||
@@ -1286,13 +1286,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
{
|
||||
if (e.action.movementSpeed.movementType >= MAX_MOVE_TYPE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses invalid movementType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.movementSpeed.movementType);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid movementType {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.movementSpeed.movementType);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!e.action.movementSpeed.speedInteger && !e.action.movementSpeed.speedFraction)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses speed 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses speed 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -1450,7 +1450,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_ATTACK_STOP:
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type({}), event_type({}), Entry {} SourceType {} Event {}, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1468,7 +1468,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(entry);
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} using non-existent Creature guid {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1478,7 +1478,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
error = true;
|
||||
if (error)
|
||||
{
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
|
||||
LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} using non-existent Text id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user