LTP Conditions

Last Updated: 2012.01.02
Download Link
Github Link

This is a script for Lunatic Targets Package Scopes with conditional themed scopes. These scopes include targeting a group of units whose stats are above or below a certain amount, current HP, MP, or TP is above or below a certain percentage, whether or not they’re affected by a specific state, or whether or not they’re affected by all of the specified states.

Install this script under YEA – Lunatic Targets. Then, proceed to use the proper effects notetags to apply the proper LTP Conditions item desired. Look within the script for more instructions on how to use each effect.

Condition Scope No.1: Current Stat Above

This will select all targets in the specified team whose current HP, MP, or TP is x% or above x%. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes stat above x%>
<custom target: allies stat above x%>
<custom target: every stat above x%>

Replace “stat” with HP, MP, or TP.
Replace x with the number percentage requirement.

Condition Scope No.2: Current Stat Below

This will select all targets in the specified team whose current HP, MP, or TP is x% or below x%. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes stat below x%>
<custom target: allies stat below x%>
<custom target: every stat below x%>

Replace “stat” with HP, MP, or TP.
Replace x with the number percentage requirement.

Condition Scope No.3: Stat Above

This will select all targets in the specified team whose specified stat is x or above x. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes stat above x>
<custom target: allies stat above x>
<custom target: every stat above x>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
Replace x with the number requirement.

Condition Scope No.4: Stat Below

This will select all targets in the specified team whose specified stat is x or below x. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes stat below x>
<custom target: allies stat below x>
<custom target: every stat below x>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK.
Replace x with the number requirement.

Condition Scope No.5: Any State

This will select all targets in the specified team who is afflicted by any of the listed states. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes any state x>
<custom target: foes any state x, x>
<custom target: allies any state x>
<custom target: allies any state x, x>
<custom target: every any state x>
<custom target: every any state x, x>

Replace x with the state’s ID.

Condition Scope No.6: All States

This will select all targets in the specified team who is afflicted by all of the listed states. Targets will not be re-added if the targets already exist within the current targeting scope.

<custom target: foes all state x, x>
<custom target: allies all state x, x>
<custom target: every all state x, x>

Replace x with the state’s ID.

And that’s all, folks!

7 comments on “LTP Conditions

  1. Greetings.
    I’ve been to do the following:
    One of the characters of my game is based around making combos. How is this handled? Certain skills apply a certain state to an enemy, and placing the tag “” in the skills that may be chained, in his next turn the character may be able to select and use them on the target affected by said state.
    However, I can’t seem to get this to work. It simply seems to ignore the tag.
    Perhaps I missunderstood something?
    The installation of the script seems correct. It’s under all of the other scripts (all of them being yours, Yanfly), and precisely under Lunatic Targets.

  2. I’m currently trying to make a skill called Shatter. It takes targets, which have the state Frozen on them, removes Frozen and deals massive damage. Thing is, I need the skill to only be used when someone is Frozen and hit them and only them. I’ve been looking through every site I know for two days now and your script is the only thing that comes close, but it’s still not exactly what I need.

    Would it be too difficult to adapt? I’d be really, really grateful for any help you could give.

  3. Good!

    But there a little bug i think!

    Commands Current Stat Above and Current Stat Below are inverted.
    To repare this little problem i have exchange line 99 and 139
    line : next unless current >= $3.to_i * 0.01 * maximum

    But script is very good, always YANFLY.
    Thanks

  4. Can’t remember if I asked this already, but: Would it be possible to make the script support single-target skills? It would make a nice band-aid fix for the stupid enemy AI that likes to use resurrection skills on LIVING TARGETS, even if one of their allies actually is dead.

    I ask since, going by your description, it only works with multi-targeting.

  5. Articose, I have a similar skill in my game. What I did was make a skill that deals ‘Shatter’ damage, and has a chance to add the State Frozen. While Frozen, you gain a weakness to Shatter damage.

    Afterwards, I duplicated all instances of Ice Weaknesses, Immunities, etc. to also include Shatter. Essentially making it identical to Ice damage without needing to overhaul anything, but this script would certainly still be helpful if you are trying to make a mass skill that would only target Frozen foes with Shatter damage.

    • Note that this would allow you to the skill next time to not target a Frozen enemy. Using this script is more of a “Locked-On” approach.

      So which ever you choose id based on what you need.

    • I know this is an old post, but I wanted to put this here for anyone who finds this via Google and needs a similar solution to make an ability deal damage to targets based on if a state is present and remove it. It’s much easier to just do something like this through the ability formula. It doesn’t need fancy scripting or an extra weakness.

      The downside is you may have a “Null” pop-up if you have Yanfly’s Popup system and have that enabled and don’t want to have the ability damage things that don’t have the state on them. You can either remove that if it’s not something you need in your game (easy to do in the script itself in the parts designed for plug and play editing), or common event the entire skill through conditional branches that check all enemies for the Frozen state, and then force your Actor attack to them with the ability if they have the state present.

      Formula solution:
      Make a skill, called “Shatter”. Have it target all enemies. In the formula box, put this:

      if b.state?(20);a.mat * 5;else;a.mat * 2.5;end

      Replace “20” with whatever your state for Frozen is. This reads “if Frozen is on the target, deal a.mat * 5. If not, deal a.mat * 2.5.

      If you’d like to make it deal no damage if Shatter isn’t present, just do this:

      if b.state?(20);a.mat * 5;else;end

      This reads “If shatter is on the target, deal a.mat * 5. Otherwise, deal no damage.

      Obviously, you can adjust the damage however you need and add a defense/magic defense check by doing something like if b.state?(20);a.mat * 5 – b.mdf * 2;else;a.mat * 2.5 – b.mdf * 2;end .

      In the effects box, have the ability remove Frozen from it’s targets. Because it targets everything and deals the extra damage only to things that have Frozen, you can just have it remove Frozen from all enemies. You could put this in the formula as well ( (b.remove_state(x) ), but that sometimes leads to issues where an ability won’t act correctly; it’s simpler/foolproof if you’re new to formula stuff to just put it into effects, as those apply after the formula.

      If you’re going for an ability that just targets one enemy and deals more damage based on a state, just use if b.state?(20);a.mat * 5;else;a.mat * 2.5;end and have it remove the state in the effects box. Very simple, very easy, and no scripts or odd Null issues.

Leave a comment