Jump to content

Minimum Current Stat


Recommended Posts

Would it be possible to create a buff that, when it is active, sets the minimum limit of a stat to X?

 

For example, I have a weapon that consumes a lot of stamina, so as long as the buff is active, the stamina doesn't drop beyond 100.
But even if I don't use just one action of the weapon, I can still use other actions.

 

I don't want the stat to be infinite, I want it not to drop beyond the limit, so if I set the minimum life to be 100, then the life doesn't drop below 100.

Link to comment
Share on other sites

Though I haven't modded in a very long time, the way past Telric would do it would be to have an onupdate buff that resets the stat every .1 second. That's the only method I know, though. Could be another way that's more efficient.

Link to comment
Share on other sites

Posted (edited)

I've redefined my answer!
So maybe this is unfeasible?
For example, suppose I set the minimum life limit to 1, then my current life is 20!
But right now I've taken 1 hit that deals 50 damage, so I'll die instantly!
Then maybe it won't work, because before the buff updates, I'll already be dead!

 

I tried using `GeneralDamageResist`:

                <passive_effect name="GeneralDamageResist" operation="base_add" value="1">
                    <requirement name="StatCompareCurrent" stat="Health" operation="LTE" value="50"/>
                </passive_effect>

 

So it works, as long as I set it lower than the `Health ModMax` with all injuries active.
But if I set the minimum health to 1, it doesn't prevent me from dying if I don't have 1 health yet.
 

If there was a way to define "if I suffer damage to my current life, then instead of suffering damage, my life is defined as X".

For example, I have 30 life, the damage calculation results in 50 damage, so the damage is canceled and my life is set to 1.
But I haven't found anything that allows me to do this, in fact I'm just starting out in the world of mods for 7D2D so I'm still lost in some aspects of xml!

Edited by Luduaver (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...