How do I cap level on different classes for different actors?

Something like this:

So there's actor X, actor Y, and actor Z.
There's class x, class y, and class z.

Actor X level cap:
class x: 30
class y: 21
class z: 28

Actor Y level cap:
class x: 23
class y: 24
class z: 42

Actor Z level cap:
class x: 25
class y: 52
class z: 2

The numbers were random but you get the idea.
Code:
class Game_Actor
  def max_level
    case actor.id
    when 1 # actor ID 1
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    when 2 # actor ID 2
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    when 3 # actor ID 3
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    end
  end
end
The number doesn't match with your example but you get the idea.
@TheoAllen Seeing some code without ";" actually hurts my eyes...
@MushroomCake28 I'd say ";" is unnecessary noises 😛
(enough out of topic talk)
@TheoAllen Even if it's unnecessary I've become so used to it that not seeing it makes me uncomfortable lol. ";" is like an addiction for me.
Code:
class Game_Actor
  def max_level
    case actor.id
    when 1 # actor ID 1
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    when 2 # actor ID 2
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    when 3 # actor ID 3
      case @class_id
      when 1 # class ID 1
        return 23
      when 2 # class ID 2
        return 24
      when 3 # class ID 3
        return 25
      end
    end
  end
end
The number doesn't match with your example but you get the idea.


I'm kind of a noob. Where do I put this?
I'm kind of a noob. Where do I put this?
Insert it as a new script. If you don't know how to insert script, maybe you can try to search how to insert script in VX Ace.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-cap-level-on-different-classes-for-different-actors.103178/