7 [YEP] [Buffs & States Core] Damage Conversion ignoring Element check?

Discussion in 'Javascript/Plugin Support' started by PauloHPBender, Aug 23, 2017.

  1. PauloHPBender

    PauloHPBender Villager Member

    Messages:
    18
    Likes Received:
    1
    Location:
    Olinda, Pernambuco, Brazil
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    Hello there, makers!
    I've been working in a special skill for my game.
    The character uses a skill called "Elemental Aura", which leads to a choice section.
    Each choice leads to the apply of a different State, called "[Selected Element] Aura"

    All these states to the same thing: while active, any damage provided by the element of choice is converted into TP gain.

    The code for the conversion is shown below:
    Code:
    <Custom React Effect>
    var element = this.item().damage.elementId;
    if (this.isHpEffect() && value > 0)
      {
      if (element = 4)  \\ This is the Fire Aura state, which checks if the damage taken is Fire (Element 4) type.
        {
        var tp = value;
        value = 0;
        target.gainTp(tp);
        target.clearResult();
        target.startAnimation(135);
        }
      else
        {
        target.removeState(11); \\This is the ID of the Fire Aura State.
        }
      }
    </Custom React Effect>
    My problem is: The element checking is being completely ignored! As it is right now, any Aura state is being able to convert any element damage!
     
    #1
  2. boomy

    boomy Veteran Veteran

    Messages:
    107
    Likes Received:
    76
    Location:
    Melbourne, Australia
    First Language:
    English
    if (element == 4)

    Need double equal marks!
     
    #2

Share This Page