From 660416065eefbfc24ac99230f758014164a0351c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 11 Jun 2019 15:19:27 -0500 Subject: [PATCH] Fix scaling and display for cor / phr --- zone/mob_info.cpp | 4 ++-- zone/npc.cpp | 8 ++++++++ zone/npc_scale_manager.cpp | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/zone/mob_info.cpp b/zone/mob_info.cpp index 1382e5c97..174a00330 100644 --- a/zone/mob_info.cpp +++ b/zone/mob_info.cpp @@ -189,11 +189,11 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut } if (attribute == "cor") { - return std::to_string(mob->GetCorrup()); + return commify(std::to_string(mob->GetCorrup())) + scaling_modified; } if (attribute == "phy") { - return std::to_string(mob->GetPhR()); + return commify(std::to_string(mob->GetPhR())) + scaling_modified; } if (attribute == "name") { diff --git a/zone/npc.cpp b/zone/npc.cpp index 355196d2e..b0367f469 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -2215,6 +2215,14 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value) CR = atoi(val.c_str()); return; } + else if (id == "cor") { + Corrup = atoi(val.c_str()); + return; + } + else if (id == "phr") { + PhR = atoi(val.c_str()); + return; + } else if (id == "pr") { PR = atoi(val.c_str()); return; diff --git a/zone/npc_scale_manager.cpp b/zone/npc_scale_manager.cpp index c17619482..4047b0e6f 100644 --- a/zone/npc_scale_manager.cpp +++ b/zone/npc_scale_manager.cpp @@ -98,10 +98,10 @@ void NpcScaleManager::ScaleNPC(NPC * npc) npc->ModifyNPCStat("dr", std::to_string(scale_data.disease_resist).c_str()); } if (npc->GetCorrup() == 0) { - npc->ModifyNPCStat("cr", std::to_string(scale_data.corruption_resist).c_str()); + npc->ModifyNPCStat("cor", std::to_string(scale_data.corruption_resist).c_str()); } if (npc->GetPhR() == 0) { - npc->ModifyNPCStat("pr", std::to_string(scale_data.physical_resist).c_str()); + npc->ModifyNPCStat("phr", std::to_string(scale_data.physical_resist).c_str()); } if (npc->GetMinDMG() == 0 && npc->GetMaxDMG() == 0) { int min_dmg = scale_data.min_dmg;