Larian Studios
Posted By: Emraell Skill that deals percentage damage - 17/12/17 02:03 PM
Is it possible to create a skill that deals a percent of the target's current vitality?

I'm having some difficulty understanding the behaviour of Damage: TargetCurrentVitality.

My skill currently is set up as:

Damage: TargetCurrentVitality
Damage Multiplier: 100
Damage Range: 0
Damage Type: None

In game, it deals 0-1 pure damage.

[b]EDIT 1[/b]
Setting Damage to TargetCurrentPhysicalArmor appears to crash the game.

Damage: TargetCurrentPhysicalArmor
Damage Multiplier: 99
Damage Range: -1
Damage Type: None

[b]EDIT 2[/b]
Might have been Damage Range: -1.

Trying with no Damage Range doesn't crash.
Posted By: Dark_Ansem Re: Skill that deals percentage damage - 20/12/17 11:45 AM
So like the "Gravity/Demi" Final Fantasy Spells?
Posted By: Emraell Re: Skill that deals percentage damage - 20/12/17 05:07 PM
Pretty much. I just don't know how to make the current vitality thing work. There are no examples in the base game to use.
Posted By: Emraell Re: Skill that deals percentage damage - 03/02/18 05:14 AM
I didn't notice this in the logs before.

[CalculateBaseDamage] Trying to calculate damnage based on Target Current Vitality, but tgtCharStats is nullptr!
Posted By: Module 003 Re: Skill that deals percentage damage - 03/02/18 08:43 AM
There are 2 ways I found to do this:
1) Scripting. Story script will do.
+: flexible, can setup it the way you want.
-: damage numbers wont be shown overhead

2) Deal damage with Status_HEAL with negative number. There is a tab for vitality%based heals.
+: easy to setup, just apply that status with your skill ExtraProperty
+: damage numbers overhead
-: damage numbers may look strange



A basic example with story script.
Will deal 10% hp damage each time a status YOUR_STATUS is applied.

IF
CharacterStatusApplid(_Character,"YOUR_STATUS",_)
AND
CharacterGetHitpointsPercentage(_Character,_CurrentHP)
AND
IntegerSubtract(_CurrentHP,10,_NewHP)
THEN
CharacterSetHitpointsPercentage(_Character,_NewHP);

Description:
line#1: triggers when a status YOUR_STATUS is applied to any character
#2: checks current HP of a target and saves it to _CurrentHP variable
#3: subtract 10 from _CurrentHP and saves to _NewHP variable
#4: sets target HP to new value

Of course there should be more conditions, like checks if target has HP left > 0, and kill it if it has <0 left after apply,
or some target checks (is it dead, is it enemy, etc.), but thats the idea.

If you find a better way to do it - lemme know plz =)

Hope that helped
Posted By: Erikem Re: Skill that deals percentage damage - 03/02/18 08:55 AM
In case of HEAL damage numbers will look like this:
[Linked Image]
© Larian Studios forums