Passive checks enemy state

Discussion in 'Javascript/Plugin Support' started by Dcraft, Dec 4, 2019.

  1. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    I know you can make an skill that increases its damage if the enemy target has certain state, poison for example. I need to use this on a passive state (yanfly), for example "Increase damage against poisoned enemies", when you hit a poisoned monster you will deal extra damage either normal attack or an skill. Thanks for your help
     
    #1
  2. Soulrender

    Soulrender Veteran Veteran

    Messages:
    298
    Likes Received:
    168
    First Language:
    Poland
    Primarily Uses:
    RMMV
    Create empty state and add to note field
    Code:
    <Custom Establish Effect>
    if (target.isStateAffected(idOfPoisonState)){
    value = value + extra damage amount;
    }
    </Custom Establish Effect>
    
    Then give this state to your actor(s)
     
    #2
    Dcraft likes this.
  3. Kes

    Kes Global Moderators Global Mod

    Messages:
    21,116
    Likes Received:
    10,722
    First Language:
    English
    Primarily Uses:
    RMVXA

    I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #3
  4. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    Im not understanding what "value" supposed to mean, value 1 is total damage? atk? and value 2?. Also, can the "extra damage amount" it be a multiplicative amount. Could you give me an example? that would be very useful
     
    #4
  5. Soulrender

    Soulrender Veteran Veteran

    Messages:
    298
    Likes Received:
    168
    First Language:
    Poland
    Primarily Uses:
    RMMV
    value is constant/variable declared in PassiveStates plugin and it is equal to damage you deal to enemy or enemy deal to your actor.

    As I said, create empty state
    https://prnt.sc/q5sv30

    and give it to actor:
    https://prnt.sc/q5svha

    In my case Tallanar will deal extra 100 damage when enemy is poisoned and my poison state has ID 4
     
    #5
  6. TSR

    TSR The Northern Frog Veteran

    Messages:
    44
    Likes Received:
    19
    Location:
    Canada
    First Language:
    French
    Primarily Uses:
    RMMV
    Hi, value is damage in the exemple given above.
    If you want to multiply value by extra damage, write that way:
    Value = value * extra damage
    Or
    Value *= extra damage

    replace extra damage by a fix number or a variable
    Ex: Value *= 100
    (Damage will be multiply by 100
     
    #6
    Dcraft likes this.
  7. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    Well I did exactly as you said but it didn't work
     
    #7
  8. Soulrender

    Soulrender Veteran Veteran

    Messages:
    298
    Likes Received:
    168
    First Language:
    Poland
    Primarily Uses:
    RMMV
    Got YEP_AutoPassiveStates plugin installed?
     
    #8
  9. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    #9
  10. TSR

    TSR The Northern Frog Veteran

    Messages:
    44
    Likes Received:
    19
    Location:
    Canada
    First Language:
    French
    Primarily Uses:
    RMMV
    This is because the <custom establish Effect> is a notetag from the Yanfly Buff&state core...
    It's another plugin.
     
    #10
  11. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    Well I was using it before and I have the same result, in any case I just reinstalled it to the latest version, it remains the same

    https://prnt.sc/q6efnc
     
    #11
  12. TSR

    TSR The Northern Frog Veteran

    Messages:
    44
    Likes Received:
    19
    Location:
    Canada
    First Language:
    French
    Primarily Uses:
    RMMV
    Then copy this inside the note box of your state 4 instead
    Code:
    <Custom React Effect>
       if (this.subject().isStateAffected(14)) {
         value *= x
       }
    </Custom React Effect>
    replace x with extra damage factor.
     
    #12
    Dcraft likes this.
  13. Dcraft

    Dcraft Veteran Veteran

    Messages:
    36
    Likes Received:
    0
    First Language:
    Spanish
    There we go that was it, thanks for the help both of you, this is very useful for me
     
    #13

Share This Page