Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

EXP Script request

Not sure as where to post this script request...
But anyways I'll atleast include good details.

I'm working on a rebirth system, that when you're level 99 you drop back to level 1 and keep your stats ( I don't need a script for this, eventing does it all).

But from that point you can just pound on the highest level monsters to hit a quick level 99 and reborn again.

^
major mistake.

What i need is a script that'll let me alter the exp given after a rebirth...
Ex : say i've reborn once, then all monsters EXP is divided by 2.
after a second rebirth, divided by 3...or 4... ect.
So that characters gain alot less exp from pounding on high level monsters after a rebirth.

Ask further details if you don't understand what i need here, but it should be a little obvious.

Just a script that'll divide monster HP based on the ammount of reborns ( which i can easily turn into a variable)

P.S. : a script that would also let me increase the EXP needed for a level up wouldn't be bad either ( I've seen the exp reset at level script) <=== just it collides with my stat building script.
 
Here try this:

[rgss] 
class Scene_Battle
  def start_phase5
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP and amount of gold obtained
       
        # $game_variables[1] means that it points to the ID 0001 variable in the game
        # to change it change the number 1 to the ID number of the variable in the game
        # for example if your rebirth variable has the ID 50 then change
        # $game_variables[1] to $game_variables[50]
        var_val = $game_variables[1] != 0 ? $game_variables[1] : 1
       
 
        exp += (enemy.exp / var_val).round
        gold += enemy.gold
        # Determine if treasure appears
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
  end
end
 
[/rgss]

You'll have to change rebirth variable by yourself. I've set it to be the 0001 variable in the game. You can change it easily in the script if you want to. To use this just put it above main and that's all, if you want to give credit then do, if not I don't mind. :)

Of course at the start of the game set that variable to 1 and just increase it by 1 every time a character gets it's rebirth.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top