Logs::NPCScaling to LogNPCScaling

This commit is contained in:
Akkadius 2019-09-02 03:35:19 -05:00
parent c3a94766ea
commit 70ba7c9c85
2 changed files with 18 additions and 29 deletions

View File

@ -2153,7 +2153,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
std::string variable_key = StringFormat("modify_stat_%s", id.c_str()); std::string variable_key = StringFormat("modify_stat_%s", id.c_str());
SetEntityVariable(variable_key.c_str(), new_value); SetEntityVariable(variable_key.c_str(), new_value);
Log(Logs::Detail, Logs::NPCScaling, "NPC::ModifyNPCStat key: %s val: %s ", variable_key.c_str(), new_value); LogNPCScaling("NPC::ModifyNPCStat key: [{}] val: [{}] ", variable_key.c_str(), new_value);
if (id == "ac") { if (id == "ac") {
AC = atoi(val.c_str()); AC = atoi(val.c_str());

View File

@ -24,10 +24,11 @@
/** /**
* @param npc * @param npc
*/ */
void NpcScaleManager::ScaleNPC(NPC * npc) void NpcScaleManager::ScaleNPC(NPC *npc)
{ {
if (npc->IsSkipAutoScale()) if (npc->IsSkipAutoScale()) {
return; return;
}
int8 npc_type = GetNPCScalingType(npc); int8 npc_type = GetNPCScalingType(npc);
int npc_level = npc->GetLevel(); int npc_level = npc->GetLevel();
@ -36,7 +37,8 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level); global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level);
if (!scale_data.level) { if (!scale_data.level) {
Log(Logs::General, Logs::NPCScaling, "NPC: %s - scaling data not found for type: %i level: %i", LogNPCScaling(
"NPC: [{}] - scaling data not found for type: [{}] level: [{}]",
npc->GetCleanName(), npc->GetCleanName(),
npc_type, npc_type,
npc_level npc_level
@ -109,11 +111,7 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
int32 class_level_damage_mod = GetClassLevelDamageMod(npc->GetLevel(), npc->GetClass()); int32 class_level_damage_mod = GetClassLevelDamageMod(npc->GetLevel(), npc->GetClass());
min_dmg = (min_dmg * class_level_damage_mod) / 220; min_dmg = (min_dmg * class_level_damage_mod) / 220;
Log(Logs::Moderate, LogNPCScaling("ClassLevelDamageMod::min_dmg base: [{}] calc: [{}]", scale_data.min_dmg, min_dmg);
Logs::NPCScaling,
"ClassLevelDamageMod::min_dmg base: %i calc: %i",
scale_data.min_dmg,
min_dmg);
} }
npc->ModifyNPCStat("min_hit", std::to_string(min_dmg).c_str()); npc->ModifyNPCStat("min_hit", std::to_string(min_dmg).c_str());
@ -124,12 +122,7 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
int32 class_level_damage_mod = GetClassLevelDamageMod(npc->GetLevel(), npc->GetClass()); int32 class_level_damage_mod = GetClassLevelDamageMod(npc->GetLevel(), npc->GetClass());
max_dmg = (scale_data.max_dmg * class_level_damage_mod) / 220; max_dmg = (scale_data.max_dmg * class_level_damage_mod) / 220;
Log(Logs::Moderate, LogNPCScaling("ClassLevelDamageMod::max_dmg base: [{}] calc: [{}]", scale_data.max_dmg, max_dmg);
Logs::NPCScaling,
"ClassLevelDamageMod::max_dmg base: %i calc: %i",
scale_data.max_dmg,
max_dmg
);
} }
npc->ModifyNPCStat("max_hit", std::to_string(max_dmg).c_str()); npc->ModifyNPCStat("max_hit", std::to_string(max_dmg).c_str());
@ -160,14 +153,14 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
} }
} }
Log(Logs::General, LogNPCScaling(
Logs::NPCScaling, "([{}]) level: [{}] type: [{}] Auto: [{}] Setting: [{}]",
"(%s) level: %i type: %i Auto: %s Setting: %s",
npc->GetCleanName(), npc->GetCleanName(),
npc_level, npc_level,
npc_type, npc_type,
(is_auto_scaled ? "true" : "false"), (is_auto_scaled ? "true" : "false"),
scale_log.c_str()); scale_log.c_str()
);
} }
} }
@ -249,7 +242,7 @@ bool NpcScaleManager::LoadScaleData()
); );
} }
Log(Logs::General, Logs::NPCScaling, "Global Base Scaling Data Loaded..."); LogNPCScaling("Global Base Scaling Data Loaded");
return true; return true;
} }
@ -489,10 +482,8 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically(NPC *&npc)
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level); global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level);
if (!scale_data.level) { if (!scale_data.level) {
Log( LogNPCScaling(
Logs::General, "NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically NPC: [{}] - scaling data not found for type: [{}] level: [{}]",
Logs::NPCScaling,
"NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically NPC: %s - scaling data not found for type: %i level: %i",
npc->GetCleanName(), npc->GetCleanName(),
npc_type, npc_type,
npc_level npc_level
@ -577,10 +568,8 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically(NPC *&npc)
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level); global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level);
if (!scale_data.level) { if (!scale_data.level) {
Log( LogNPCScaling(
Logs::General, "NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically NPC: [{}] - scaling data not found for type: [{}] level: [{}]",
Logs::NPCScaling,
"NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically NPC: %s - scaling data not found for type: %i level: %i",
npc->GetCleanName(), npc->GetCleanName(),
npc_type, npc_type,
npc_level npc_level