From 70a5a83419fc0cf84ca8f350c701851e83e42724 Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Tue, 23 Jul 2013 16:48:54 +0200 Subject: [PATCH] Change the formula used to calculate initial NPC health --- apps/openmw/mwclass/npc.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index b6af9f0e57..9757374ec1 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -113,7 +113,19 @@ namespace // initial health int strength = creatureStats.getAttribute(ESM::Attribute::Strength).getBase(); int endurance = creatureStats.getAttribute(ESM::Attribute::Endurance).getBase(); - creatureStats.setHealth(static_cast (0.5 * (strength + endurance)) + 4 * (creatureStats.getLevel() - 1)); + + int multiplier = 3; + + if (class_->mData.mSpecialization == ESM::Class::Combat) + multiplier += 2; + else if (class_->mData.mSpecialization == ESM::Class::Stealth) + multiplier += 1; + + if (class_->mData.mAttribute[0] == ESM::Attribute::Endurance + || class_->mData.mAttribute[1] == ESM::Attribute::Endurance) + multiplier += 1; + + creatureStats.setHealth(static_cast (0.5 * (strength + endurance)) + multiplier * (creatureStats.getLevel() - 1)); } }