Add ScaleNPC() to Perl and Lua. (#1238)

This commit is contained in:
Alex
2021-02-09 00:08:07 -05:00
committed by GitHub
parent f2b67ae969
commit 8f89f38f5c
7 changed files with 45 additions and 1 deletions
+10
View File
@@ -164,6 +164,16 @@ void NpcScaleManager::ScaleNPC(NPC *npc)
}
}
void NpcScaleManager::ResetNPCScaling(NPC *npc) {
for (const auto &scaling_stat : scaling_stats) {
std::string stat_name = fmt::format("modify_stat_{}", scaling_stat);
std::string reset_value = "0";
if (npc->EntityVariableExists(stat_name.c_str())) {
npc->ModifyNPCStat(scaling_stat.c_str(), reset_value.c_str());
}
}
}
bool NpcScaleManager::LoadScaleData()
{
auto results = content_db.QueryDatabase(