State that when wears off play a skill

Discussion in 'JS Plugin Requests' started by Grumphlu, Jan 12, 2019.

?

Do you know a code that can do my request ?

  1. Yes i have

    1 vote(s)
    100.0%
  2. No i don't

    0 vote(s)
    0.0%
  1. Grumphlu

    Grumphlu Villager Member

    Messages:
    13
    Likes Received:
    4
    First Language:
    Français
    Hi ! i am using almost all plugins of Yanfly (Battle Core, Buff and States etc....)
    And i want to do a state that when it wears off will do a skill.

    For exemple this state can be put on a foe and will stay for 3 turns then damage him when the state wears off.

    Is someone know a code that can do this ? It will help me a lot.

    Thanks in advance.
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,096
    Likes Received:
    7,230
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

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

     
    #2
  3. artoni

    artoni Writer, Editor Veteran

    Messages:
    115
    Likes Received:
    152
    First Language:
    English
    Primarily Uses:
    RMMV
    Yep, easily done with Buff/States. Make sure you have the state set to last 3 turns, or however many you plan.

    <Custom Leave Effect>
    // Get the damage skill.
    var skill = {{INSERT SKILL NUMBER HERE}};
    // Get the 'self' index.
    var target = 0;
    // Queue the forced action.
    BattleManager.queueForceAction(user, skill, target);
    </Custom Leave Effect

    If that doesn't work let me know, I'll play around with it for you.
     
    #3
  4. Grumphlu

    Grumphlu Villager Member

    Messages:
    13
    Likes Received:
    4
    First Language:
    Français
    Hi artoni, thanks for help ! Sorry for the place of the post, it's my first one here.

    It work good but the problem now is the damages. I did a Trap, it wears off after 3 Turns but then when the skill plays there is no damage.
    My formula is a.mat * 4 - b.mdf * 2. I don't know if its a problem of formula here or that the code you give me just loose who is "a" and who is "b"
    I am terrible with coding, i am learning by myself ^^

    In this spell i use a formule of Yanfly to make the spell having a critical damage if the ennemy is on Fire.
    So basicaly my trap will deal damage after 3 turns and can be critical if the foe is on Fire.

    Thanks for your help
     
    #4
  5. artoni

    artoni Writer, Editor Veteran

    Messages:
    115
    Likes Received:
    152
    First Language:
    English
    Primarily Uses:
    RMMV
    Well, for one, I forgot to add the last > on </Custom Leave Effect> - whups.

    You might want to consider creating a new skill with ActSeqPack as well; below is a skill I have that does damage to the person who uses it (for a battle cutscene).

    <Setup Action>
    display action
    perform start
    motion chant: user
    wait: 20
    motion spell: user
    wait: 20
    </Setup Action>

    <Target Action>
    animation 58: user
    WAIT: 20
    action effect: user
    motion damage: user
    WAIT: 20
    </Target action>

    <Finish Action>
    clear battle log
    perform finish
    </Finish Action>

    Alternatively, see if the scope "The User" works?
     
    #5
  6. Grumphlu

    Grumphlu Villager Member

    Messages:
    13
    Likes Received:
    4
    First Language:
    Français
    Mhh, didn't change anything but i figure it out by myself

    I put this code :

    <Custom Leave Effect>
    target.startAnimation(67)
    user.gainHp(-1 * origin.mat * 4 + target.mdf *2)
    target.startDamagePopup()
    target.addState(16)
    </Custom Leave Effect>

    Now eveything is fine the foe takes damages, then he get on fire. The only thing now that change is that the spell is not aymore a Fire element
    and it will not deal critical if the foe is already on Fire. But i don't know if it's important. So let's say that my problem is solved ^^

    Thank you a lot for your attention, it helped me to understand more about the codes and how it works ;)
     
    #6

Share This Page