Basic Attack Command

● ARCHIVED · READ-ONLY
Started by Jazzy_Robot 3 posts View original ↗
  1. I want to make it so that Different classes use different skills when selecting the attack command, but no matter what I try, they always just use Skill number 1.
  2. Your solution is plugins. Either the weapon attack replace one that came with the program or something like Yanflys Weapon Unleash.
  3. or, just find out what's the instruction that yanfly used to condition the skill use, and just use *that* instead of the whole plugin that includes fool-proof conditions to make it work with random users and their random potential requirements, which you don't need when you know exactly what you want for your game.

    the actual pointer to skill ID 1 is located in Game_BattlerBase.attackSkillId, so it's all a matter of having the code return a different pointer depending on what class the actor is.
    since actors are battlers, and actors are the ones that sport classes, then you overwrite the BattlerBase ID with an Actor ID.

    Code:
    Game_BattlerBase.prototype.attackSkillId = function() {
        return 1;
    };
    
    Game_Actor.prototype.attackSkillId = function() {
        return 1;
    };

    and instead of 1, you make it return whatever you want.
    "whatever you want" being, *something else based on the class the actor sports*

    Code:
    (function() {
    Game_Actor.prototype.attackSkillId = function() {
      switch (this._classId) {
          case A:
              return X;
              break;
          case B:
              return Y;
              break;
          case C:
             return Z;
             break;
          };
    };})();

    where A,B,C are the class ID you want watched, and X,Y,Z are the skill ID from the skill database you want returned.
    you can escalate the check by adding more cases.