Falcoa Pearl ABS - changing between passive/active depending on level

I'm using Falcoa's Pearl ABS script, which is awesome, but I have an issue.

https://falcaorgss.wordpress.com/2012/12/02/falcao-pearl-abs-liquid-v1/

I want to set my enemies so that they aggro the player if they are below a certain level.

I've set the enemies to Passive by default (Enemy Passive = true in notetags) so when they are attacked, they attack you back. This is fine for the enemies that are a lower level than you, but because I have multiple classes of different levels, I want to be able to switch this on and off for each individual event. I created a page in the map event - condition variable char_lvl < X, then "$game_map.events[13].epassive = false", where that event page is a parallel process so it checks the player level constantly.

This doesn't work though - the mob stays passive regardless of the level.

Any ideas?
Please edit your post to include a link to the web page where you got the script so that people don't have to hunt for it .

Moved to: RGSSx Script Support
Try adding this bullet:
Code:
class Game_Event < Game_Character
 

  alias_method :register_enemy_old , :register_enemy
  def register_enemy(event)
    register_enemy_old(event)
    change_passivness if @enemy != nil
  end
 
  def change_passivness
    @epassive = false if @enemy.enemy_id == 1 && $game_party.leader.level < 5
    end
 
end
Is not too user friendly snippet, but the idea is that you set your disabling conditions one by one in same patern
in change_passivness method.
The only entry I gave set the value to false if enemy id is 1(the one from the database), and the party leader level is less than 5.
A valid second entry or row 2( row 2 of the method ) would be:
Code:
@epassive = false if @enemy.enemy_id == 2 && $game_party.leader.level < 8
And so. It requares basic understanding how to use condition checks, and how to get varius needed data.
Maybe someone can come with more user friendly idea.
As the system works, once enemy is installed on map, his passiveness cannot be changed. Means those conditions will apply
only when player leaves and reenters map.
Edit: renamed my new method, because confused the english word i used for it's name -_-.
Edit 2: Forgot to say, the bullet must be placed bellow the other ABS scripts.
It works perfectly. Thanks very much 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/falcoa-pearl-abs-changing-between-passive-active-depending-on-level.95919/