Temporarily disable EXP from enemies

I want to make a function called "Safe mode". You can turn it on wherever you want in emergency situations. I want to make this mode to:
- make the party immortal (already did, with status)
- disable (until the switch is on) gained exp and gold from enemies.

Can you help me to do the second part?
the exp is easy - just look at the death state, that also reduces exp gain to zero.

gold drop to zero needs either a script, or you'll have to get tricky with drops by setting the gold on all enemies to zero and add the gold later indirectly.
Can you not just make a copy of that monster and put EXP and GOLD to 0 ? or am i reading your question incorrectly?
Something like this?
Ruby:
module BattleManager
  def self.process_victory
    play_battle_end_me
    replay_bgm_and_bgs
    $game_message.add(sprintf(Vocab::Victory, $game_party.name))
    if $game_switches[1] == true
      display_exp
      gain_gold
      gain_drop_items
      gain_exp
    end
    wait_for_message
    SceneManager.return
    battle_end(0)
    return true
  end
end
Not sure if the check against game_switches will work inside BattleManager
Something like this?
Ruby:
module BattleManager
  def self.process_victory
    play_battle_end_me
    replay_bgm_and_bgs
    $game_message.add(sprintf(Vocab::Victory, $game_party.name))
    if $game_switches[1] == true
      display_exp
      gain_gold
      gain_drop_items
      gain_exp
    end
    SceneManager.return
    battle_end(0)
    return true
  end
end
Not sure if the check against game_switches will work inside BattleManager


I tried this code and nothing changed.
What you exactly did? If game switch is on gain gold, exp, items and else?
I think the solution is if game switch is if switch is on do not gain gold.
Do you have switch 1 on? or did you change the number?
Do you have switch 1 on? or did you change the number?

I changed it to 72.
So it is written in a way that if switch 72 is on it will process normally. if switch 72 is off it will not process what is inside the if statement.
I also just added a wait as it did not do that otherwise.
So it is written in a way that if switch 72 is on it will process normally. if switch 72 is off it will not process what is inside the if statement.
I also just added a wait as it did not do that otherwise.

Oh ok i'll retry

Original thread: https://forums.rpgmakerweb.com/threads/temporarily-disable-exp-from-enemies.130336/