Equipment Learning

Discussion in 'Javascript/Plugin Support' started by Tatsumaro, Feb 15, 2018.

  1. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    Equipment Learning by Moogle_X, he was a "Lunatic Code" in this plugin. But according to a post its code JavaScript:
    Sorry, my eval is not really "friendly" compares to Yanfly.
    You need to write the code just like you would code the JavaScript directly.

    <EQL AP Gain Eval>
    this.hp -= this.mhp * 0.1;
    </EQL AP Gain Eval>

    Some tips:
    • this // The actor who gain the AP.
    • $dataSkills[x] // Skill with id x.
    • $dataSkills[x].eqlShowSwitch // Skill x's binded switch id.
    • this.forgetSkill(x) // Forget (and also reset AP to 0) skill with id x.
    • this._eqlAp[skillId] = 0; // Only reset AP to 0.
    • this._eqlAp[x] // Skill x current AP.
    • this.eqlIsMastered(skillId) // Is this actor "mastered" or learned the skill?


    I don't know any javaScript, but i need a code like this:

    <EQL AP Gain Eval>
    if (this.eqlIsMastered(610)){
    value = true;}
    else{
    value = false;
    }
    </EQL AP Gain Eval>


    What i mente is a code that prevent Skill (611) to gain any AP until Skill (610) as ben "mastered"
     
    #1
  2. Zarsla

    Zarsla Veteran Veteran

    Messages:
    686
    Likes Received:
    201
    First Language:
    English
    Try this:
    <EQL AP Gain Eval>
    var skillid = 611;
    if (this.eqlIsMastered(610)){
    this._eqlAp[skillid] += x;
    }else{
    this._eqlAp[skillid] = 0;
    }
    </EQL AP Gain Eval>
    And place this code on skill 611.
    Where x is the amount you want to gain.
     
    #2

Share This Page