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

This commit is contained in:
Alex authored and GitHub committed 2021-02-08 23:08:07 -06:00
1 parent f2b67ae969
commit 8f89f38f5c
7 files changed
+45 -1

No files matched your search

+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(