Yanfly SkillCore-Non-Guaranteed Blue Magic

● ARCHIVED · READ-ONLY
Started by SawyerFriend 2 posts View original ↗
  1. Hello, everyone! So, Yanfly has a very nifty trick with the SkillCore plugin that allows you to mimic Blue Magic as it's seen in Final Fantasy V. That said, I have a slight specific modification I'd like to make to it that I'm unsure how to use.

    So, if you've played Final Fantasy VI, you're likely familiar with Celes's Runic ability, which draws any magic towards her and restores MP based on the spell she absorbed. I'd like to create a skill with this same mechanic, but instead of recovering MP, I want the spell itself to be absorbed and memorized. In other words, I want this to be the method of learning Blue Magic. Furthermore, I don't want the chance of the spell being learned to be guaranteed, but rather RNG based on the LUK stat. Do you think this can be done through normal plugin script, or will I need to modify the JS code itself?

    This is the original script that Yanfly gave to mimic Blue Magic as it is in FFV, where being targeted with the spell will make the target automatically learn it as long as they're a Blue Mage.

    Code:
    <Post-Damage Eval>
    
    if (target.isActor() && target._classId === 3) {
    
    if (!target.isLearnedSkill(item.id)) {
    
    target.learnSkill(item.id);
    
    var text = target.name() + ' has learned '
    
    text = text + item.name + '!';
    
    $gameMessage.add(text);

    I think I understand some of this script, but not enough to figure out how to trigger it with a skill.
  2. A basic random check:
    Code:
    if (Math.randomInt(100) < 25)
    This says "if a random integer from 0~99 (inclusive) is less than 25"; in other words, it'll be true 25% of the time. I think you should be able to use target.luk for the skill target's luk stat; here's an example where the success chance is one-fifth of the target's current luk:
    Example
    Code:
    <Post-Damage Eval>
    if (target.isActor() && target._classId === 3) {
      if (!target.isLearnedSkill(item.id)) {
        if (Math.randomInt(100) < target.luk / 5) {
          target.learnSkill(item.id);
          var text = target.name() + ' has learned '
          text = text + item.name + '!';
          $gameMessage.add(text);
        }
      }
    }
    </Post-Damage Eval>