mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-07 02:03:51 +00:00
Logs::NPCScaling to LogNPCScaling
This commit is contained in:
parent
c3a94766ea
commit
70ba7c9c85
@ -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());
|
||||
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") {
|
||||
AC = atoi(val.c_str());
|
||||
|
||||
@ -24,10 +24,11 @@
|
||||
/**
|
||||
* @param npc
|
||||
*/
|
||||
void NpcScaleManager::ScaleNPC(NPC * npc)
|
||||
void NpcScaleManager::ScaleNPC(NPC *npc)
|
||||
{
|
||||
if (npc->IsSkipAutoScale())
|
||||
if (npc->IsSkipAutoScale()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int8 npc_type = GetNPCScalingType(npc);
|
||||
int npc_level = npc->GetLevel();
|
||||
@ -36,7 +37,8 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
|
||||
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_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_type,
|
||||
npc_level
|
||||
@ -109,11 +111,7 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
|
||||
int32 class_level_damage_mod = GetClassLevelDamageMod(npc->GetLevel(), npc->GetClass());
|
||||
min_dmg = (min_dmg * class_level_damage_mod) / 220;
|
||||
|
||||
Log(Logs::Moderate,
|
||||
Logs::NPCScaling,
|
||||
"ClassLevelDamageMod::min_dmg base: %i calc: %i",
|
||||
scale_data.min_dmg,
|
||||
min_dmg);
|
||||
LogNPCScaling("ClassLevelDamageMod::min_dmg base: [{}] calc: [{}]", scale_data.min_dmg, min_dmg);
|
||||
}
|
||||
|
||||
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());
|
||||
max_dmg = (scale_data.max_dmg * class_level_damage_mod) / 220;
|
||||
|
||||
Log(Logs::Moderate,
|
||||
Logs::NPCScaling,
|
||||
"ClassLevelDamageMod::max_dmg base: %i calc: %i",
|
||||
scale_data.max_dmg,
|
||||
max_dmg
|
||||
);
|
||||
LogNPCScaling("ClassLevelDamageMod::max_dmg base: [{}] calc: [{}]", scale_data.max_dmg, max_dmg);
|
||||
}
|
||||
|
||||
npc->ModifyNPCStat("max_hit", std::to_string(max_dmg).c_str());
|
||||
@ -160,14 +153,14 @@ void NpcScaleManager::ScaleNPC(NPC * npc)
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::General,
|
||||
Logs::NPCScaling,
|
||||
"(%s) level: %i type: %i Auto: %s Setting: %s",
|
||||
LogNPCScaling(
|
||||
"([{}]) level: [{}] type: [{}] Auto: [{}] Setting: [{}]",
|
||||
npc->GetCleanName(),
|
||||
npc_level,
|
||||
npc_type,
|
||||
(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;
|
||||
}
|
||||
@ -426,7 +419,7 @@ int8 NpcScaleManager::GetNPCScalingType(NPC *&npc)
|
||||
if (npc->IsRareSpawn() || npc_name.find('#') != std::string::npos || isupper(npc_name[0])) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -489,10 +482,8 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically(NPC *&npc)
|
||||
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level);
|
||||
|
||||
if (!scale_data.level) {
|
||||
Log(
|
||||
Logs::General,
|
||||
Logs::NPCScaling,
|
||||
"NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically NPC: %s - scaling data not found for type: %i level: %i",
|
||||
LogNPCScaling(
|
||||
"NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically NPC: [{}] - scaling data not found for type: [{}] level: [{}]",
|
||||
npc->GetCleanName(),
|
||||
npc_type,
|
||||
npc_level
|
||||
@ -577,10 +568,8 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically(NPC *&npc)
|
||||
global_npc_scale scale_data = GetGlobalScaleDataForTypeLevel(npc_type, npc_level);
|
||||
|
||||
if (!scale_data.level) {
|
||||
Log(
|
||||
Logs::General,
|
||||
Logs::NPCScaling,
|
||||
"NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically NPC: %s - scaling data not found for type: %i level: %i",
|
||||
LogNPCScaling(
|
||||
"NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically NPC: [{}] - scaling data not found for type: [{}] level: [{}]",
|
||||
npc->GetCleanName(),
|
||||
npc_type,
|
||||
npc_level
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user