Pet Battles: Add effect properties mapping dump for diagnostics

The BattlePetEffectPropertiesID values in the DB2 don't map 0-18
sequentially — they're arbitrary IDs (222, 26, 24, etc.). Add startup
logging that dumps all unique PropertiesIDs with their ParamLabel
strings and usage counts, so we can build the correct mapping.

Also improve the UNHANDLED effect warning to include all 6 Param values
and the ParamLabel strings from the DB2, making the logs self-documenting.
This commit is contained in:
luis
2026-03-12 08:33:41 -03:00
parent 8d332b0643
commit 7bf6bcb46c
2 changed files with 36 additions and 2 deletions
+11 -2
View File
@@ -1430,8 +1430,16 @@ namespace PetBattles
break;
}
default:
TC_LOG_WARN("server.loading", "PetBattle ProcessEffect: UNHANDLED effectCategory={} basePower={} defenderAlive={}",
effectCategory, basePower, defender.IsAlive());
{
std::string labels;
if (effectProps)
for (uint8 i = 0; i < 6; ++i)
if (effectProps->ParamLabel[i] && effectProps->ParamLabel[i][0] != '\0')
labels += Trinity::StringFormat("[{}]={} ", i, effectProps->ParamLabel[i]);
TC_LOG_WARN("server.loading", "PetBattle ProcessEffect: UNHANDLED effectCategory={} basePower={} defenderAlive={} params=[{},{},{},{},{},{}] labels={}",
effectCategory, basePower, defender.IsAlive(),
effect->Param[0], effect->Param[1], effect->Param[2], effect->Param[3], effect->Param[4], effect->Param[5],
labels);
// Unhandled effect category - treat as damage if basePower > 0
if (basePower > 0 && defender.IsAlive())
{
@@ -1458,6 +1466,7 @@ namespace PetBattles
}
break;
}
}
}
// ============================================================================
@@ -114,6 +114,31 @@ namespace PetBattles
TC_LOG_INFO("server.loading", ">> Loaded {} breed quality entries, {} breed stat entries",
uint32(_breedQualityMultipliers.size()), uint32(_breedBaseStats.size()));
// Dump all BattlePetEffectProperties IDs used by ability effects for mapping
{
std::map<uint16, uint32> propsIdUsageCount;
for (BattlePetAbilityEffectEntry const* entry : sBattlePetAbilityEffectStore)
propsIdUsageCount[entry->BattlePetEffectPropertiesID]++;
TC_LOG_INFO("server.loading", ">> BattlePetEffectProperties mapping ({} unique IDs used by {} effects):",
uint32(propsIdUsageCount.size()), turnEffectCount);
for (auto const& [propsID, count] : propsIdUsageCount)
{
BattlePetEffectPropertiesEntry const* props = sBattlePetEffectPropertiesStore.LookupEntry(propsID);
if (props)
{
std::string labels;
for (uint8 i = 0; i < 6; ++i)
if (props->ParamLabel[i] && props->ParamLabel[i][0] != '\0')
labels += Trinity::StringFormat("[{}]={} ", i, props->ParamLabel[i]);
TC_LOG_INFO("server.loading", " PropsID={:3d} count={:3d} visual={} labels: {}",
propsID, count, props->BattlePetVisualID, labels);
}
else
TC_LOG_INFO("server.loading", " PropsID={:3d} count={:3d} (NO DB2 ENTRY)", propsID, count);
}
}
LoadNPCTeams();
TC_LOG_INFO("server.loading", ">> Pet Battle system initialized");