Ability that activates when target is below % health?

I'm trying to put together an "Execute" ability that increases attack vs. targets with less than, say, 30% health.  As far as I can tell, there's no "percent health" available by default in the UnitStats.  Also, it looks like expressions don't work in the CoreAbilities.xml, is that right?

4,409 views 5 replies
Reply #1 Top

Not to my knowledge (percentages). But you do know there's 'death blow' which activates at a set value for health, right?

No expressions in coreabilites, to my knowledge. But abilities can trigger spells via MeleeAppliesSpell, so that could be your workaround.

Reply #2 Top

Thanks - actually DeathBlow activates based on max health, as far as I can tell, which isn't quite what I need (or what it sounds like in game).

I suppose I could create a "percent health" UnitStat and attempt to update it using an invisible MeleeAppliesSpell, but I don't think that would work quite right...

Reply #3 Top

Quoting Rynas, reply 2

Thanks - actually DeathBlow activates based on max health.

Not positive, but I think it is current HP. Test it if you can. I'll report what I see if I get a chance to test out.

Also check out the "Rage" ability, it has a tag that checks for percentage hit points (not sure if this will work as a comparative).

Reply #4 Top

I'm basing my suspicion on this snippet:

<GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_Attack_Boost</StrVal>
<StrVal2>UnitStat_HitPoints</StrVal2>
<Value>40</Value>
<BonusValue>20</BonusValue>
<Provides>+40 Attack vs enemies with less than 20 Hit Points</Provides>
<vsLower>1</vsLower>
</GameModifier>

This appears to be max health, not current health, based on how it's used everywhere.  Current health can be queried in CoreSpells using a CDATA statement, but to get current health elsewhere, I think you need to take UnitStats_HitPoints and subtract UnitStat_Damage.

I did a very limited test in a new game, though, vs. enemies with 36 max health.  Here are the numbers on the attacks when they had less than 20 health - level 10 Assassin in all cases, with a base 11 Attack:

Without Death Blow (took Break instead): 6, 9

With Death Blow: 8, 6:

With Death Blow, opponent with 17/17 health: 43

It's pretty clear to me that Death Blow applies to max health only.

Reply #5 Top

Quoting Rynas, reply 4


Without Death Blow (took Break instead): 6, 9

With Death Blow: 8, 6:

With Death Blow, opponent with 17/17 health: 43

It's pretty clear to me that Death Blow applies to max health only.

Thanks for sharing your test. Sure sounds like you're right.