[XP] Center Battler battle box problem

Hello everyone, I found Center Battlers script in this link https://forums.rpgmakerweb.com/index.php?threads/rmxp-centering-battlers-in-battle.37261/

I used this script to make my characters stay in the center but, the problem is the battle command window is still at the left side while my characters are in the center

Spoiler: Script
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Base

#--------------------------------------------------------------------------
#* Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
party_offset = 320 - 80 *
$game_party.actors.size
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4 + party_offset
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else draw_actor_state(actor, actor_x, 96)
end
end
end
end

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
def screen_x
# Return after calculating x-coordinate by order of members in party
if self.index != nil
return self.index * 160 + 400 - 80 *
$game_party.actors.size
else
return 0
end
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
alias cbs_phase3_setup_command_window cbs_phase3_setup_command_window
def cbs_phase3_setup_command_window cbs_phase3_setup_command_window
@actor_command_window.x = @actor_index * 160 + 320 - 80 *
$game_party.actors.size
end
end



I don't know why the box isn't move like the characters.
I will appreciate the help so much, thank you in advance
1609295961663.png
Use CODE blocks instead of QUOTE blocks. Here's the script in a readable format:
Spoiler
Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    party_offset = 320 - 80 * $game_party.actors.size
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4 + party_offset
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index * 160 + 400 - 80 * $game_party.actors.size
    else
      return 0
    end
  end
end
class Scene_Battle
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
  alias cbs_phase3_setup_command_window phase3_setup_command_window
  def phase3_setup_command_window
    cbs_phase3_setup_command_window
    @actor_command_window.x = @actor_index * 160 + 320 - 80 * $game_party.actors.size
  end
end
I plugged this into a blank project and the window was in the correct position over each actor. You're not using other scripts by chance, are you?
Use CODE blocks instead of QUOTE blocks. Here's the script in a readable format:
Spoiler
Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    party_offset = 320 - 80 * $game_party.actors.size
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4 + party_offset
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index * 160 + 400 - 80 * $game_party.actors.size
    else
      return 0
    end
  end
end
class Scene_Battle
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
  alias cbs_phase3_setup_command_window phase3_setup_command_window
  def phase3_setup_command_window
    cbs_phase3_setup_command_window
    @actor_command_window.x = @actor_index * 160 + 320 - 80 * $game_party.actors.size
  end
end
I plugged this into a blank project and the window was in the correct position over each actor. You're not using other scripts by chance, are you?

Actually, I changed the script from https://forums.rpgmakerweb.com/index.php?threads/rmxp-centering-battlers-in-battle.37261/ a little bit because when I tested the script it said "Scene Battle 3 error wrong number of argument (0 to 1)". After that, the script run like I showed you and I don't know how to fix it. I appreciate your help Mr.KK20 but, I have something to ask again (Sorry to disturb you more)

I tried to test the script along with other scripts that I will use and I found a new problem
1609302733647.png


Now the character info is on the left and my characters are in the center
I tried to find what's cause the problem and I found that it because of ATB - Window level up
1609302829585.png


I tried removing this script and your modify script worked normally

1609302906651.png


Can you help me solve this issue? Thank you in advance
This is ATB - Window level up that I use
Spoiler: Script
#==============================================================================
# * Window_LevelUp - ATB Add On or Stand Alone Script
#
# Original Author: Unknown
# Version: Unkownn
# Release Date: Unkwown
#
# Revised by Heretic
#
#------------------------------------------------------------------------------
#
# Place this script BELOW the ATB - Window_CP if it is installed.
#
# If this script is ABOVE the ATB - Window_CP, then the CP Bar from that
# script will not change to display Experience instead of CP at the end
# of a Battle.
#
# If ATB - Window_CP is not installed, this script will still function
# normally, but wont change the CP Bar to an Experience Bar since there
# is no CP Bar to change to an Experience Bar.
#
# Options:
#
# RECOVER_ON_LEVEL_UP - Should be self explanitory
#
# REDEFINE_STATUS_REFRESH - This takes some explaining. When Leveled Up,
# each Actor will get a Detailed Level Up Window. The Actors Status also
# changes to "Level Up" while that window is displayed. Redefining Refresh
# will allow an Actors Status to be retained as "Level Up" after their
# detailed Level Up Window has been closed. It is a very simple alteration
# but may cause some issues with other scripts because it redefines the
# Refresh Method. Hopefully, code from other scripts can be modified easily
# to allow the same effect.
#
# Set REDEFINE_STATUS_REFRESH to true if just using Default Battle System
#
# LEVEL_UP_ME and LEVEL_UP_SE - Sound to use on Level Up. Use one or the
# other, but not both. The sound file needs to be specified in the
# Materials/Sounds Database.
#
# Version 1.03 - Added Bonus Experience Option
# - To use Bonus Exp, just use add_bonus_exp(Number) in a Script
# - Can be Negative to punish Player for an unwanted Battle outcome, for
# example, killing a Hostage (Hostage is an Enemy)
#
#==============================================================================

#--------------------------------------------------------------------------
# * Options
#--------------------------------------------------------------------------

RECOVER_ON_LEVEL_UP = true # Sets HP and SP to Full on Level Up
REDEFINE_STATUS_REFRESH = false # Redefines BattleStatus Refresh

# Sound Effect for Level Up (use one or the other, not both)
LEVEL_UP_SE = nil # SE Plays WITH Background Music
LEVEL_UP_ME = '105-Heal01' # ME Stops Background Music to Play

PLAY_LVL_UP_SOUND = true # Plays Level Up Music / SE

class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor 😛lay_lvl_up_sound # Plays Level Up Music / SE
#--------------------------------------------------------------------------
# * Game System New Property
#--------------------------------------------------------------------------
alias level_up_window_initialize initialize
def initialize
# Call Original or other Aliases
level_up_window_initialize
# New Property
@play_lvl_up_sound = PLAY_LVL_UP_SOUND
end
end
#==============================================================================
# * Window_LevelUp
#==============================================================================
class Window_LevelUp < Window_Base
#--------------------------------------------------------------------------
# * Initialize Level Up Window
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#--------------------------------------------------------------------------
# * Refresh Level Up Window Contents
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.name = "Arial"
self.contents.font.size = 16
self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!")
self.contents.font.size = 14
self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
self.contents.draw_text(92, 0, 128, 24, ">")
self.contents.draw_text(76, 28, 128, 24, ">")
self.contents.draw_text(76, 50, 128, 24, ">")
self.contents.draw_text(76, 72, 128, 24, ">")
self.contents.draw_text(76, 94, 128, 24, ">")
self.contents.draw_text(76, 116, 128, 24, ">")
self.contents.draw_text(76, 138, 128, 24, ">")
self.contents.font.color = normal_color
self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end

#==============================================================================
# ** Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :level_up_flags # Flags Public and passed to Child Windows
#--------------------------------------------------------------------------
# If ATB - Window_CP has not already defined this method
#--------------------------------------------------------------------------
if not self.method_defined?('xrxs_battlestatus_window_cp_version')
#--------------------------------------------------------------------------
# * Display Exp
#
# If Window_CP isnt used, this creates an empty definition that
# does nothing. Doing so allows this script to act as
# a Standalone Script independent of the XRXS Battle System.
#
# Initialize and Refresh allow the Actors Status to retain the Level Up
# state after the detailed Level Up Window has disappeared.
#
#--------------------------------------------------------------------------
def display_exp_in_cp_bar=(value)
# Do Nothing because CP Window is not used, defined to prevent crash
end
end
#--------------------------------------------------------------------------
# If ATB - BattleBars has not already defined this method
#--------------------------------------------------------------------------
if not self.method_defined?('xrxs_battlestatus_battlebars_version')
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias level_up_in_battlestatus_window_initialize initialize
def initialize
# New Variable to retain which Actors were Leveled Up
@leveled_up = []
# Call Original, which calls Refresh
level_up_in_battlestatus_window_initialize
end
#--------------------------------------------------------------------------
# * Refresh - Redefinition of Default Enterbrain
#
# Note: This is ONLY used if Window_BattleBars is NOT installed.
#
# If you have a Non Default method of Refresh, you may wish to
# replace the contents of this method with the one defined by
# the script that you use.
#
# @leveled_up.include?(i) is used to retain "Level Up" after
# the Detailed Window has closed for that Actor that Leveled.
# You may have to alter the script you copy and paste here
# to change your script from:
#
# if @level_up_flags
#
# to:
#
# if @level_up_flags or @leveled_up.include?(i)"
# # Remember that this Actor has Leveled Up to retain "Level Up"
# @leveled_up.push(i)
#
# This is only if you wish to retain the Status of "Level Up"
#
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags or @leveled_up.include?(i)
# Remember that this Actor has Leveled Up to retain "Level Up" status
@leveled_up.push(i)
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
end
end

#==============================================================================
# ** Scene_Battle (Level Up Enhancement)
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :bonus_exp # Adds Bonus Exp - Requires Level Up Addon
attr_accessor :bonus_gold # Adds Bonus Gold - Requires this Addon
attr_accessor :bonus_items # Adds Bonus Items - Requires this Addon
#--------------------------------------------------------------------------
# * Start After Battle Phase - Redefinition
#--------------------------------------------------------------------------
alias level_up_window_xrxs_atb_start_phase_1 start_phase1
def start_phase1
# Call Original or Other Aliases
level_up_window_xrxs_atb_start_phase_1
# Bonus Experience for Battle - set with add_bonus_exp(number)
@bonus_exp = 0
# Bonus Gold for Battle - set with add_bonus_gold(number)
@bonus_gold = 0
# Bonus Items for Battle - set with add_bonus_items([id, id])
@bonus_items = []
end
#--------------------------------------------------------------------------
# * Start After Battle Phase - Redefinition
#--------------------------------------------------------------------------
def start_phase5
# Shift to phase 5
@phase = 5
# Turn On Exp Ban
for i in 0...$game_party.actors.size
$game_party.actors.exp_gain_ban = true
end
# Prevent CP from increasing at End of Battle, even though EXP Bar will show
@cp_thread.stop
# Resets CP at the End of Battle
for i in 0...$game_party.actors.size
$game_party.actors.cp = 0
end
# Shows Battle Exp Bar instead of CP Bar
@status_window.display_exp_in_cp_bar = 1
# 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
exp += enemy.exp
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
# Set Value to display and Time end of battle differently
@need_treasure_window = true if treasures.size > 0
end
end
end
# if Bonus Treasures (Items) for this Battle, Bonus priority over Win Items
if @bonus_items.size > 0
# For each Bonus Treasure (Item)
for item in @bonus_items
# Add to List of Treasures to front of array, display at End of Battle
treasures.unshift(item)
end
end
# Treasure is limited to a maximum of 6 items
treasures = treasures[0..5]
# Increase Exp for each Actor based on Enemy Exp Values
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
# If there is Bonus Gold
if @bonus_gold != 0
gold += @bonus_gold
end
# Obtaining Gold
$game_party.gain_gold(gold)
# Obtaining Treasure by Item Type
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
# If sum of Exp and Bonus Exp is a Positive Number
if exp + @bonus_exp > 0
# Add Bonus Exp to Battle Result Window for Display
exp += @bonus_exp
end
# Modify Treasures allows other Scripts to change Treasures before return
treasures = modify_battle_win_treasures(treasures)
# Make battle result window
@result_window = Window_BattleResult.new(exp, gold, treasures)
# Set wait count
@phase5_wait_count = 100
# Turn Off Exp Ban
for i in 0...$game_party.actors.size
$game_party.actors.exp_gain_ban = false
end
# Total the Exp for all defeated Enemies
@exp_gained = 0
# If sum of Exp and Bonus Exp is a Positive Number
if exp + @bonus_exp > 0
# Add Bonus Experience to Actor Experience Gained if available
@exp_gained += @bonus_exp
end
for enemy in $game_troop.enemies
# Give Exp for each Enemy Defeated and Didn't Run Away or didnt appear
if not enemy.hidden
# Total Up the Enemy Exp
@exp_gained += enemy.exp
# Set Var that we need to display the Treasure Window
@need_treasure_window = true
end
end
# Shift to Step 0
@phase5_step = 0
@exp_gain_actor = -1
# Check for Level Up
phase5_next_levelup
end
#--------------------------------------------------------------------------
# * Update Phase 5 - Next Level Up! - New Definition
#--------------------------------------------------------------------------
def phase5_next_levelup
begin
# Next Actor
@exp_gain_actor += 1
# If Next Actor doesnt Exist
if @exp_gain_actor >= $game_party.actors.size
# Phase 5 Step to =
@phase5_step = 0
# Quit Processing
return
end
# Assign Actor from the Party
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# Remember Levels, HP, and SP
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# Add Exp Gained to Actor Exp
actor.exp += @exp_gained
@showed_level_up_window = true
# Check if the Actor Leveled Up
if actor.level > last_level
# Change the Status Window with a Level Up Flag
@status_window.level_up(@exp_gain_actor)
# If Level Up Sound is Enabled
if $game_system.play_lvl_up_sound
# If the Level Up Sound Effct is not Nil
if LEVEL_UP_SE != nil
# Stop any currently playing Sound Effects
Audio.se_stop
# Restart the Level Up Sound Effect - Happens Per Actor that Leveled
Audio.se_play('Audio/SE/' + Scene_Battle::LEVEL_UP_ME)
end
# If the Level Up Musical Effect is not Nil
if LEVEL_UP_ME != nil
# Stop any currently playing Musical Effects
Audio.me_stop
# Restart the Level Up Musical Effect
Audio.me_play('Audio/SE/' + Scene_Battle::LEVEL_UP_ME)
end
end
# Display the Level Up Window with these Variables
@levelup_window = Window_LevelUp.new(actor, last_level,
actor.maxhp-last_maxhp, actor.maxsp-last_maxsp, actor.str-last_str,
actor.dex-last_dex, actor.agi-last_agi, actor.int-last_int)
# If Full HP and SP on Level Up Option is set
if RECOVER_ON_LEVEL_UP
# Max HP and SP on Level Up
actor.hp = actor.maxhp
actor.sp = actor.maxsp
end
# Position the Level Up Window behind the Actor that Leveled Up
@levelup_window.x = 160 * @exp_gain_actor
# Make the Window Visible
@levelup_window.visible = true
# Set a Wait so the Scene doesnt exit
@phase5_wait_count = 40
# Phase 5 Step is Level Up
@phase5_step = 1
# Cause the Exp Bar (Stored) to display EXP instead of CP
@status_window.display_exp_in_cp_bar = 1
# Refresh the Status Window to display New Stats
@status_window.refresh
return
end
end
# End the Begin Loop
end until false
end
#--------------------------------------------------------------------------
# * Update Phase 5 - Redefinition
#--------------------------------------------------------------------------
def update_phase5
case @phase5_step
when 1
update_phase5_step1
else
# If we need to display the Treasure / Exp Window
if @showed_level_up_window and @need_treasure_window and
@phase5_wait_count == 20
# If we need to display the Treasure Window and it isnt visible
if not @result_window.visible
# Show Item Result Window
@result_window.y -= 64
@result_window.visible = true
# Change Status Window to show Increased Experience
@status_window.display_exp_in_cp_bar = 2
@status_window.refresh
elsif Input.trigger?(Input::C)
@phase5_wait_count += 50
@result_window.visible = false
@need_treasure_window = false
else
return
end
end
# If wait count is larger than 0
if @phase5_wait_count > 0
# Decrease wait count
@phase5_wait_count -= 1
# If wait count reaches 0
if @phase5_wait_count == 0
# Show result window
if not @showed_level_up_window and @need_treasure_window
@result_window.visible = true
end
# Clear main phase flag
$game_temp.battle_main_phase = false
# Refresh status window
@status_window.refresh
elsif @phase5_wait_count == 40 and not @showed_level_up_window
# Change Status Window to show Increased Experience
@status_window.display_exp_in_cp_bar = 2
@status_window.refresh
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Battle ends
battle_end(0)
end
# If Conditions are met
if @levelup_window != nil and @phase5_wait_count <= 0 and
@result_window.visible != true
# Exit the Battle Scene
battle_end(0)
end
end
end
#--------------------------------------------------------------------------
# * Update Phase 5 - Step 1
#--------------------------------------------------------------------------
def update_phase5_step1
# Handles Level Up at the End of Battles
if Input.trigger?(Input::C)
# Hide the Level Up Window if it has Contents
@levelup_window.visible = false if @levelup_window != nil
# Clear Level Up Flag for Actor
@status_window.level_up_flags[@exp_gain_actor] = false
# Go to Next Level Up Phase
phase5_next_levelup
end
end
#--------------------------------------------------------------------------
# * Modify Battle Win Treasures - New Definition in 1.03
# treasures : array of items
#--------------------------------------------------------------------------
def modify_battle_win_treasures(treasures)
# Alias this Method to alter Treasures for End of Battle
return treasures
end
end

#--------------------------------------------------------------------------
# * If XRXS ATB is not installed - Allow as Standalone Script
#--------------------------------------------------------------------------
if not Scene_Battle.method_defined?('xrxs_atb_version')
#============================================================================
# ** Scene_Battle_CP - Fake Thread - Does Nothing
#----------------------------------------------------------------------------
class Scene_Battle_CP
# These do Nothing but must be defined
def initialize
end
def start
end
def stop
end
end
#============================================================================
# ** Game_Battler
#============================================================================
class Game_Battler
attr_accessor :exp_gain_ban # Prevents Actor from Getting Exp
#--------------------------------------------------------------------------
# * Ban Actors from getting Exp, so they dont get more than they've earned
#--------------------------------------------------------------------------
alias exp_gain_ban_initialize initialize
def initialize
# Run Original
exp_gain_ban_initialize
# Create New Variables
@exp_gain_ban = false
end
#--------------------------------------------------------------------------
# * Check if the Actor cant get Exp
#--------------------------------------------------------------------------
alias exp_gain_ban_cant_get_exp? cant_get_exp?
def cant_get_exp?
# If Actor is Banned from getting Exp
if @exp_gain_ban == true
# Return true, that they are being prevented from getting Exp
return true
else
# Run Original
return exp_gain_ban_cant_get_exp?
end
end
#--------------------------------------------------------------------------
# Null Setter Methods if XRXS ATB Script not installed
#--------------------------------------------------------------------------
def cp=(value)
end
end
#============================================================================
# ** Scene_Battle
#============================================================================
class Scene_Battle
alias fake_cp_main main
def main
# Create New Fake CP Thread
@cp_thread = Scene_Battle_CP.new
# Normal Processing
fake_cp_main
# Dispose of Fake CP Thread
@cp_thread = nil
end
end
end

#==============================================================================
# ** Interpreter
#==============================================================================

class Interpreter
#--------------------------------------------------------------------------
# * Add Bonus Exp - New in Version 1.03
# value : Integer (can be Negative)
#
# - Call with add_bonus_exp(50)
# ** Note: Most useful with Window Help Msg to tell a Player why
# they are given a Bonus. help_msg can display ANY text.
#--------------------------------------------------------------------------
def add_bonus_exp(value)
# Error Checking
if not value.is_a?(Integer)
# If in Editor
if $DEBUG
# Explain Problem
print "Warning: add_bonus_exp(Number) needs ", value, " to be a Number!"
end
# Prevent Crash
return
end
# If not a Battle
if not $game_temp.in_battle
# If in Editor
if $DEBUG
# Explain Problem
print "Warning: add_bonus_exp(Number) can only be called in Battle!"
end
# Prevent Crash
return
end
# Add Value to current Bonus (allows for Negative Numbers too!)
$scene.bonus_exp += value
end
#--------------------------------------------------------------------------
# * Add Bonus Gold - New in Version 1.03
# value : Integer (can be Negative)
#
# - Call with add_bonus_exp(50)
# ** Note: Most useful with Window Help Msg to tell a Player why
# they are given a Bonus. help_msg can display ANY text.
#--------------------------------------------------------------------------
def add_bonus_gold(value)
# Error Checking
if not value.is_a?(Integer)
# If in Editor
if $DEBUG
# Explain Problem
print "Warning: add_bonus_gold(Number) needs ", value, " to be a Number!"
end
# Prevent Crash
return
end
# If not a Battle
if not $game_temp.in_battle
# If in Editor
if $DEBUG
# Explain Problem
print "Warning: add_bonus_gold(Number) can only be called in Battle!"
end
# Prevent Crash
return
end
# Add Value to current Bonus (allows for Negative Numbers too!)
$scene.bonus_gold += value
end
#--------------------------------------------------------------------------
# * Add Bonus Item - New in Version 1.03
# item_id : Id of Item in Database
# item_type : 0 - Item, 1 - Weapon, 2 - Armor
#
# - Call with add_bonus_item(1, 2)
# ** Note: Can be used with or without Window Help Msg as the player
# will see one way or the other.
#--------------------------------------------------------------------------
def add_bonus_item(item_id, item_type)
# Check for Problems
unless item_id.is_a?(Numeric) and item_type.is_a?(Numeric) and
$scene.is_a?(Scene_Battle)
# Display Error if in Debug (Editor
if $DEBUG
if not $scene.is_a?(Scene_Battle)
print "Warning: add_bonus_item(item_id, item_type)\n",
"can only be called during Battle!"
elsif not item_id.is_a?(Numeric)
print "Warning: add_bonus_item(item_id, item_type)\n",
"need item_id to be a Number. The Number is\n",
"the Item's Numeric ID in the Database\n\n",
"Bonus Item not added"
elsif not item_type.is_a?(Numeric) or not [0,1,2].include?(item_type)
print "Warning: add_bonus_item(item_id, item_type)\n",
"needs item_type to be a Number.\n\n",
"use 0 to add an Item - add_bonus_item(1, 0) for a Potion\n",
"use 1 to add a Weapon - add_bonus_item(1, 1) for a Sword\n",
"use 2 to add an Armor - add_bonus_item(1, 2) for a Shield"
elsif item_id < 0
print "Warning: add_bonus_item(item_id, item_type)\n",
"The Item ID: ", item_id, " should be 1 or greater\n",
item_id, " is invalid because the actual item it points\n",
"to doesn't exist in the Database!"
end
end
# Prevent Crash
return
end
# Branch by Item Type
case item_type
when 0 # Item
item = $data_items[item_id].clone if $data_items[item_id]
when 1 # Weapon
item = $data_weapons[item_id].clone if $data_weapons[item_id]
when 2 # Armor
item = $data_armors[item_id].clone if $data_armors[item_id]
end
if item
# Add the Item to Bonus Items Array
$scene.bonus_items.unshift(item)
# If in Editor
elsif $DEBUG
# Branch by Item Type
case item_type
when 0 # Item
print "Warning: The Item ID: ", item_id, " doesn't\n",
"exist in the Items Database!\n\n",
"Bonus Item not added"
when 1 # Weapon
print "Warning: The Weapon ID: ", item_id, " doesn't\n",
"exist in the Weapons Database!\n\n",
"Bonus Weapon Item not added"
when 2 # Armor
print "Warning: The Armor ID: ", item_id, " doesn't\n",
"exist in the Armors Database!\n\n",
"Bonus Armor Item not added"
end
end
end
end
Can you please use the CODE tags...
Can you please use the CODE tags...

Code:
#==============================================================================
# * Window_LevelUp - ATB Add On or Stand Alone Script
#
#   Original Author: Unknown
#   Version:         Unkownn
#   Release Date:    Unkwown
#
#   Revised by Heretic
#
#------------------------------------------------------------------------------
#
#  Place this script BELOW the ATB - Window_CP if it is installed.
#
#  If this script is ABOVE the ATB - Window_CP, then the CP Bar from that
#  script will not change to display Experience instead of CP at the end
#  of a Battle.
#
#  If ATB - Window_CP is not installed, this script will still function
#  normally, but wont change the CP Bar to an Experience Bar since there
#  is no CP Bar to change to an Experience Bar.
#
#  Options:
#
#  RECOVER_ON_LEVEL_UP - Should be self explanitory
#
#  REDEFINE_STATUS_REFRESH - This takes some explaining.  When Leveled Up,
#  each Actor will get a Detailed Level Up Window.  The Actors Status also
#  changes to "Level Up" while that window is displayed.  Redefining Refresh
#  will allow an Actors Status to be retained as "Level Up" after their
#  detailed Level Up Window has been closed.  It is a very simple alteration
#  but may cause some issues with other scripts because it redefines the
#  Refresh Method.  Hopefully, code from other scripts can be modified easily
#  to allow the same effect.
#
#  Set REDEFINE_STATUS_REFRESH to true if just using Default Battle System
#
#  LEVEL_UP_ME and LEVEL_UP_SE - Sound to use on Level Up.  Use one or the
#  other, but not both.  The sound file needs to be specified in the
#  Materials/Sounds Database.
#
#  Version 1.03 - Added Bonus Experience Option
#  - To use Bonus Exp, just use add_bonus_exp(Number) in a Script
#  - Can be Negative to punish Player for an unwanted Battle outcome, for
#    example, killing a Hostage (Hostage is an Enemy)
#
#==============================================================================

#--------------------------------------------------------------------------
# * Options
#--------------------------------------------------------------------------

RECOVER_ON_LEVEL_UP = true       # Sets HP and SP to Full on Level Up
REDEFINE_STATUS_REFRESH = false  # Redefines BattleStatus Refresh

# Sound Effect for Level Up (use one or the other, not both)
LEVEL_UP_SE = nil            # SE Plays WITH Background Music
LEVEL_UP_ME = '105-Heal01'     # ME Stops Background Music to Play

PLAY_LVL_UP_SOUND = true       # Plays Level Up Music / SE

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :play_lvl_up_sound      # Plays Level Up Music / SE
  #--------------------------------------------------------------------------
  # * Game System New Property
  #--------------------------------------------------------------------------
  alias level_up_window_initialize initialize
  def initialize
    # Call Original or other Aliases
    level_up_window_initialize
    # New Property
    @play_lvl_up_sound = PLAY_LVL_UP_SOUND
  end
end
#==============================================================================
# * Window_LevelUp
#==============================================================================
class Window_LevelUp < Window_Base
  #--------------------------------------------------------------------------
  # * Initialize Level Up Window
  #--------------------------------------------------------------------------
  def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
    super(0, 128, 160, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    self.back_opacity = 160
    refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  end
  #--------------------------------------------------------------------------
  # * Refresh Level Up Window Contents
  #--------------------------------------------------------------------------
  def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.name = "Arial"
    self.contents.font.size = 16
    self.contents.draw_text( 0,   0, 160, 24, "LEVEL UP!")
    self.contents.font.size = 14
    self.contents.draw_text( 0,  28, 160, 24, $data_system.words.hp)
    self.contents.draw_text( 0,  50, 160, 24, $data_system.words.sp)
    self.contents.font.size = 14
    self.contents.draw_text( 0,  72,  80, 24, $data_system.words.str)
    self.contents.draw_text( 0,  94,  80, 24, $data_system.words.dex)
    self.contents.draw_text( 0, 116,  80, 24, $data_system.words.agi)
    self.contents.draw_text( 0, 138,  80, 24, $data_system.words.int)
    self.contents.draw_text(92,   0, 128, 24, ">")
    self.contents.draw_text(76,  28, 128, 24, ">")
    self.contents.draw_text(76,  50, 128, 24, ">")
    self.contents.draw_text(76,  72, 128, 24, ">")
    self.contents.draw_text(76,  94, 128, 24, ">")
    self.contents.draw_text(76, 116, 128, 24, ">")
    self.contents.draw_text(76, 138, 128, 24, ">")
    self.contents.font.color = normal_color
    self.contents.draw_text( 0,   0,  88, 24, last_lv.to_s, 2)
    self.contents.draw_text( 0,  28,  72, 24, "+" + up_hp.to_s, 2)
    self.contents.draw_text( 0,  50,  72, 24, "+" + up_sp.to_s, 2)
    self.contents.draw_text( 0,  72,  72, 24, "+" + up_str.to_s, 2)
    self.contents.draw_text( 0,  94,  72, 24, "+" + up_dex.to_s, 2)
    self.contents.draw_text( 0, 116,  72, 24, "+" + up_agi.to_s, 2)
    self.contents.draw_text( 0, 138,  72, 24, "+" + up_int.to_s, 2)
    self.contents.font.size = 20
    self.contents.draw_text( 0,   0, 128, 24, actor.level.to_s, 2)
    self.contents.draw_text( 0,  26, 128, 24, actor.maxhp.to_s, 2)
    self.contents.draw_text( 0,  48, 128, 24, actor.maxsp.to_s, 2)
    self.contents.draw_text( 0,  70, 128, 24, actor.str.to_s, 2)
    self.contents.draw_text( 0,  92, 128, 24, actor.dex.to_s, 2)
    self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
    self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
  end
end

#==============================================================================
# ** Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor   :level_up_flags  # Flags Public and passed to Child Windows
  #--------------------------------------------------------------------------
  # If ATB - Window_CP has not already defined this method
  #--------------------------------------------------------------------------
  if not self.method_defined?('xrxs_battlestatus_window_cp_version')
    #--------------------------------------------------------------------------
    # * Display Exp
    #
    #  If Window_CP isnt used, this creates an empty definition that
    #  does nothing.  Doing so allows this script to act as
    #  a Standalone Script independent of the XRXS Battle System.
    #
    #  Initialize and Refresh allow the Actors Status to retain the Level Up
    #  state after the detailed Level Up Window has disappeared.
    #
    #--------------------------------------------------------------------------
    def display_exp_in_cp_bar=(value)
      # Do Nothing because CP Window is not used, defined to prevent crash
    end
  end
  #--------------------------------------------------------------------------
  # If ATB - BattleBars has not already defined this method
  #--------------------------------------------------------------------------
  if not self.method_defined?('xrxs_battlestatus_battlebars_version')
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    alias level_up_in_battlestatus_window_initialize initialize
    def initialize
      # New Variable to retain which Actors were Leveled Up
      @leveled_up = []    
      # Call Original, which calls Refresh
      level_up_in_battlestatus_window_initialize
    end
    #--------------------------------------------------------------------------
    # * Refresh - Redefinition of Default Enterbrain
    #
    #  Note:  This is ONLY used if Window_BattleBars is NOT installed.
    #
    #         If you have a Non Default method of Refresh, you may wish to
    #         replace the contents of this method with the one defined by
    #         the script that you use.
    #
    #         @leveled_up.include?(i) is used to retain "Level Up" after
    #         the Detailed Window has closed for that Actor that Leveled.
    #         You may have to alter the script you copy and paste here
    #         to change your script from:
    #
    #         if @level_up_flags[i]
    #
    #         to:
    #
    #         if @level_up_flags[i] or @leveled_up.include?(i)"
    #           # Remember that this Actor has Leveled Up to retain "Level Up"
    #           @leveled_up.push(i)
    #
    #         This is only if you wish to retain the Status of "Level Up"
    #
    #--------------------------------------------------------------------------
    def refresh
      self.contents.clear
      @item_max = $game_party.actors.size
      for i in 0...$game_party.actors.size
        actor = $game_party.actors[i]
        actor_x = i * 160 + 4
        draw_actor_name(actor, actor_x, 0)
        draw_actor_hp(actor, actor_x, 32, 120)
        draw_actor_sp(actor, actor_x, 64, 120)
        if @level_up_flags[i] or @leveled_up.include?(i)
          # Remember that this Actor has Leveled Up to retain "Level Up" status
          @leveled_up.push(i)
          self.contents.font.color = normal_color
          self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
        else
          draw_actor_state(actor, actor_x, 96)
        end
      end
    end  
  end
end

#==============================================================================
# ** Scene_Battle (Level Up Enhancement)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :bonus_exp       # Adds Bonus Exp - Requires Level Up Addon
  attr_accessor :bonus_gold      # Adds Bonus Gold - Requires this Addon
  attr_accessor :bonus_items     # Adds Bonus Items - Requires this Addon
  #--------------------------------------------------------------------------
  # * Start After Battle Phase - Redefinition
  #--------------------------------------------------------------------------
  alias level_up_window_xrxs_atb_start_phase_1 start_phase1
  def start_phase1
    # Call Original or Other Aliases
    level_up_window_xrxs_atb_start_phase_1  
    # Bonus Experience for Battle - set with add_bonus_exp(number)
    @bonus_exp = 0
    # Bonus Gold for Battle - set with add_bonus_gold(number)
    @bonus_gold = 0
    # Bonus Items for Battle - set with add_bonus_items([id, id])
    @bonus_items = []
  end
  #--------------------------------------------------------------------------
  # * Start After Battle Phase - Redefinition
  #--------------------------------------------------------------------------
  def start_phase5
    # Shift to phase 5
    @phase = 5
    # Turn On Exp Ban
    for i in 0...$game_party.actors.size
        $game_party.actors[i].exp_gain_ban = true
    end
    # Prevent CP from increasing at End of Battle, even though EXP Bar will show
    @cp_thread.stop
    # Resets CP at the End of Battle  
    for i in 0...$game_party.actors.size
      $game_party.actors[i].cp = 0
    end
    # Shows Battle Exp Bar instead of CP Bar
    @status_window.display_exp_in_cp_bar = 1
    # 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
        exp += enemy.exp
        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
          # Set Value to display and Time end of battle differently
          @need_treasure_window = true if treasures.size > 0
        end
      end
    end
    # if Bonus Treasures (Items) for this Battle, Bonus priority over Win Items
    if @bonus_items.size > 0
      # For each Bonus Treasure (Item)
      for item in @bonus_items
        # Add to List of Treasures to front of array, display at End of Battle
        treasures.unshift(item)
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Increase Exp for each Actor based on Enemy Exp Values
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      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
    # If there is Bonus Gold
    if @bonus_gold != 0
      gold += @bonus_gold
    end  
    # Obtaining Gold
    $game_party.gain_gold(gold)
    # Obtaining Treasure by Item Type
    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
    # If sum of Exp and Bonus Exp is a Positive Number
    if exp + @bonus_exp > 0
      # Add Bonus Exp to Battle Result Window for Display
      exp += @bonus_exp
    end
    # Modify Treasures allows other Scripts to change Treasures before return
    treasures = modify_battle_win_treasures(treasures)  
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100  
    # Turn Off Exp Ban
    for i in 0...$game_party.actors.size
        $game_party.actors[i].exp_gain_ban = false
    end
    # Total the Exp for all defeated Enemies
    @exp_gained = 0
    # If sum of Exp and Bonus Exp is a Positive Number
    if exp + @bonus_exp > 0
      # Add Bonus Experience to Actor Experience Gained if available
      @exp_gained += @bonus_exp
    end
    for enemy in $game_troop.enemies
        # Give Exp for each Enemy Defeated and Didn't Run Away or didnt appear
      if not enemy.hidden
        # Total Up the Enemy Exp
          @exp_gained += enemy.exp
        # Set Var that we need to display the Treasure Window
        @need_treasure_window = true
      end
    end
    # Shift to Step 0
    @phase5_step = 0
    @exp_gain_actor = -1
    # Check for Level Up
    phase5_next_levelup
  end
  #--------------------------------------------------------------------------
  # * Update Phase 5 - Next Level Up! - New Definition
  #--------------------------------------------------------------------------
  def phase5_next_levelup
    begin
      # Next Actor
        @exp_gain_actor += 1
        # If Next Actor doesnt Exist
        if @exp_gain_actor >= $game_party.actors.size
          # Phase 5 Step to =
          @phase5_step = 0
        # Quit Processing
          return
        end
      # Assign Actor from the Party
      actor = $game_party.actors[@exp_gain_actor]
      if actor.cant_get_exp? == false
          # Remember Levels, HP, and SP
          last_level = actor.level
          last_maxhp = actor.maxhp
          last_maxsp = actor.maxsp
          last_str = actor.str
          last_dex = actor.dex
          last_agi = actor.agi
          last_int = actor.int
        # Add Exp Gained to Actor Exp
        actor.exp += @exp_gained
        @showed_level_up_window = true
        # Check if the Actor Leveled Up
        if actor.level > last_level
          # Change the Status Window with a Level Up Flag
          @status_window.level_up(@exp_gain_actor)
          # If Level Up Sound is Enabled
          if $game_system.play_lvl_up_sound
            # If the Level Up Sound Effct is not Nil
            if LEVEL_UP_SE != nil
              # Stop any currently playing Sound Effects
              Audio.se_stop
              # Restart the Level Up Sound Effect - Happens Per Actor that Leveled
              Audio.se_play('Audio/SE/' + Scene_Battle::LEVEL_UP_ME)
            end
            # If the Level Up Musical Effect is not Nil
            if LEVEL_UP_ME != nil
              # Stop any currently playing Musical Effects
                  Audio.me_stop
              # Restart the Level Up Musical Effect
                  Audio.me_play('Audio/SE/' + Scene_Battle::LEVEL_UP_ME)
            end
          end
          # Display the Level Up Window with these Variables    
              @levelup_window = Window_LevelUp.new(actor, last_level,
                actor.maxhp-last_maxhp, actor.maxsp-last_maxsp, actor.str-last_str,
                actor.dex-last_dex, actor.agi-last_agi, actor.int-last_int)
          # If Full HP and SP on Level Up Option is set
          if RECOVER_ON_LEVEL_UP
            # Max HP and SP on Level Up
            actor.hp = actor.maxhp
            actor.sp = actor.maxsp
          end
          # Position the Level Up Window behind the Actor that Leveled Up
              @levelup_window.x = 160 * @exp_gain_actor
          # Make the Window Visible
              @levelup_window.visible = true
          # Set a Wait so the Scene doesnt exit
              @phase5_wait_count = 40
          # Phase 5 Step is Level Up
              @phase5_step       =  1
              # Cause the Exp Bar (Stored) to display EXP instead of CP
          @status_window.display_exp_in_cp_bar = 1
          # Refresh the Status Window to display New Stats
              @status_window.refresh
              return
          end
        end
    # End the Begin Loop
    end until false
  end
  #--------------------------------------------------------------------------
  # * Update Phase 5 - Redefinition
  #--------------------------------------------------------------------------
  def update_phase5
    case @phase5_step
    when 1
        update_phase5_step1
    else
      # If we need to display the Treasure / Exp Window
      if @showed_level_up_window and @need_treasure_window and
         @phase5_wait_count == 20
        # If we need to display the Treasure Window and it isnt visible
        if not @result_window.visible
          # Show Item Result Window
          @result_window.y -= 64
          @result_window.visible = true
          # Change Status Window to show Increased Experience
          @status_window.display_exp_in_cp_bar = 2
            @status_window.refresh
        elsif Input.trigger?(Input::C)
          @phase5_wait_count += 50
          @result_window.visible = false
          @need_treasure_window = false
        else
          return
        end      
      end          
      # If wait count is larger than 0
      if @phase5_wait_count > 0
        # Decrease wait count
        @phase5_wait_count -= 1
        # If wait count reaches 0
        if @phase5_wait_count == 0
          # Show result window
          if not @showed_level_up_window and @need_treasure_window
            @result_window.visible = true
          end
          # Clear main phase flag
          $game_temp.battle_main_phase = false
          # Refresh status window
          @status_window.refresh
        elsif @phase5_wait_count == 40 and not @showed_level_up_window
          # Change Status Window to show Increased Experience
          @status_window.display_exp_in_cp_bar = 2
            @status_window.refresh  
        end
        return
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Battle ends
        battle_end(0)
      end
      # If Conditions are met
      if @levelup_window != nil and @phase5_wait_count <= 0 and
         @result_window.visible != true    
        # Exit the Battle Scene
        battle_end(0)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Phase 5 - Step 1
  #--------------------------------------------------------------------------
  def update_phase5_step1
    # Handles Level Up at the End of Battles
    if Input.trigger?(Input::C)
        # Hide the Level Up Window if it has Contents
        @levelup_window.visible = false if @levelup_window != nil
      # Clear Level Up Flag for Actor
        @status_window.level_up_flags[@exp_gain_actor] = false
      # Go to Next Level Up Phase
        phase5_next_levelup
    end
  end
  #--------------------------------------------------------------------------
  # * Modify Battle Win Treasures - New Definition in 1.03
  #     treasures : array of items
  #--------------------------------------------------------------------------
  def modify_battle_win_treasures(treasures)
    # Alias this Method to alter Treasures for End of Battle
    return treasures
  end
end

#--------------------------------------------------------------------------
# * If XRXS ATB is not installed - Allow as Standalone Script
#--------------------------------------------------------------------------
if not Scene_Battle.method_defined?('xrxs_atb_version')
  #============================================================================
  # ** Scene_Battle_CP - Fake Thread - Does Nothing
  #----------------------------------------------------------------------------
  class Scene_Battle_CP
    # These do Nothing but must be defined
    def initialize
    end
    def start
    end
    def stop
    end
  end
  #============================================================================
  # ** Game_Battler
  #============================================================================
  class Game_Battler
    attr_accessor :exp_gain_ban                    # Prevents Actor from Getting Exp
    #--------------------------------------------------------------------------
    # * Ban Actors from getting Exp, so they dont get more than they've earned
    #--------------------------------------------------------------------------
    alias exp_gain_ban_initialize initialize
    def initialize
      # Run Original
      exp_gain_ban_initialize
      # Create New Variables
      @exp_gain_ban = false
    end
    #--------------------------------------------------------------------------
    # * Check if the Actor cant get Exp
    #--------------------------------------------------------------------------    
    alias exp_gain_ban_cant_get_exp? cant_get_exp?
    def cant_get_exp?
      # If Actor is Banned from getting Exp
      if @exp_gain_ban == true
        # Return true, that they are being prevented from getting Exp
        return true
      else
        # Run Original
        return exp_gain_ban_cant_get_exp?
      end
    end  
    #--------------------------------------------------------------------------
    # Null Setter Methods if XRXS ATB Script not installed  
    #--------------------------------------------------------------------------
    def cp=(value)
    end
  end
  #============================================================================
  # ** Scene_Battle
  #============================================================================
  class Scene_Battle
    alias fake_cp_main main
    def main
      # Create New Fake CP Thread
      @cp_thread = Scene_Battle_CP.new
      # Normal Processing
      fake_cp_main
      # Dispose of Fake CP Thread
      @cp_thread = nil
    end
  end
end

#==============================================================================
# ** Interpreter
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Add Bonus Exp - New in Version 1.03
  #     value : Integer (can be Negative)
  #
  #   - Call with add_bonus_exp(50)
  #   ** Note: Most useful with Window Help Msg to tell a Player why
  #            they are given a Bonus.  help_msg can display ANY text.
  #--------------------------------------------------------------------------
  def add_bonus_exp(value)
    # Error Checking
    if not value.is_a?(Integer)
      # If in Editor
      if $DEBUG
        # Explain Problem
        print "Warning: add_bonus_exp(Number) needs ", value, " to be a Number!"
      end
      # Prevent Crash
      return
    end
    # If not a Battle
    if not $game_temp.in_battle
      # If in Editor
      if $DEBUG
        # Explain Problem
        print "Warning: add_bonus_exp(Number) can only be called in Battle!"
      end
      # Prevent Crash
      return
    end
    # Add Value to current Bonus (allows for Negative Numbers too!)
    $scene.bonus_exp += value
  end
  #--------------------------------------------------------------------------
  # * Add Bonus Gold - New in Version 1.03
  #     value : Integer (can be Negative)
  #
  #   - Call with add_bonus_exp(50)
  #   ** Note: Most useful with Window Help Msg to tell a Player why
  #            they are given a Bonus.  help_msg can display ANY text.
  #--------------------------------------------------------------------------
  def add_bonus_gold(value)
    # Error Checking
    if not value.is_a?(Integer)
      # If in Editor
      if $DEBUG
        # Explain Problem
        print "Warning: add_bonus_gold(Number) needs ", value, " to be a Number!"
      end
      # Prevent Crash
      return
    end
    # If not a Battle
    if not $game_temp.in_battle
      # If in Editor
      if $DEBUG
        # Explain Problem
        print "Warning: add_bonus_gold(Number) can only be called in Battle!"
      end
      # Prevent Crash
      return
    end
    # Add Value to current Bonus (allows for Negative Numbers too!)
    $scene.bonus_gold += value
  end
  #--------------------------------------------------------------------------
  # * Add Bonus Item - New in Version 1.03
  #     item_id   : Id of Item in Database
  #     item_type : 0 - Item, 1 - Weapon, 2 - Armor
  #
  #   - Call with add_bonus_item(1, 2)
  #   ** Note: Can be used with or without Window Help Msg as the player
  #            will see one way or the other.
  #--------------------------------------------------------------------------
  def add_bonus_item(item_id, item_type)
    # Check for Problems
    unless item_id.is_a?(Numeric) and item_type.is_a?(Numeric) and
           $scene.is_a?(Scene_Battle)
      # Display Error if in Debug (Editor
      if $DEBUG
        if not $scene.is_a?(Scene_Battle)
          print "Warning: add_bonus_item(item_id, item_type)\n",
                "can only be called during Battle!"
        elsif not item_id.is_a?(Numeric)
          print "Warning: add_bonus_item(item_id, item_type)\n",
                "need item_id to be a Number.  The Number is\n",
                "the Item's Numeric ID in the Database\n\n",
                "Bonus Item not added"
        elsif not item_type.is_a?(Numeric) or not [0,1,2].include?(item_type)
          print "Warning: add_bonus_item(item_id, item_type)\n",
                "needs item_type to be a Number.\n\n",
                "use 0 to add an Item - add_bonus_item(1, 0) for a Potion\n",
                "use 1 to add a Weapon - add_bonus_item(1, 1) for a Sword\n",
                "use 2 to add an Armor - add_bonus_item(1, 2) for a Shield"
        elsif item_id < 0
          print "Warning: add_bonus_item(item_id, item_type)\n",
                "The Item ID: ", item_id, " should be 1 or greater\n",
                item_id, " is invalid because the actual item it points\n",
                "to doesn't exist in the Database!"
        end      
      end
      # Prevent Crash
      return
    end
    # Branch by Item Type
    case item_type
      when 0 # Item
        item = $data_items[item_id].clone if $data_items[item_id]
      when 1 # Weapon
        item = $data_weapons[item_id].clone if $data_weapons[item_id]
      when 2 # Armor
        item = $data_armors[item_id].clone if $data_armors[item_id]
    end
    if item
      # Add the Item to Bonus Items Array
      $scene.bonus_items.unshift(item)
    # If in Editor
    elsif $DEBUG
      # Branch by Item Type
      case item_type
        when 0 # Item
          print "Warning: The Item ID: ", item_id, " doesn't\n",
                "exist in the Items Database!\n\n",
                "Bonus Item not added"
        when 1 # Weapon
          print "Warning: The Weapon ID: ", item_id, " doesn't\n",
                "exist in the Weapons Database!\n\n",
                "Bonus Weapon Item not added"        
        when 2 # Armor
          print "Warning: The Armor ID: ", item_id, " doesn't\n",
                "exist in the Armors Database!\n\n",
                "Bonus Armor Item not added"
      end
    end
  end
end

Sorry my bad, I'm new around here
What if you move the center battlers script below the Window Level Up script?

EDIT: You'll probably need to update the refresh method a bit first
Code:
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    party_offset = 320 - 80 * $game_party.actors.size
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4 + party_offset
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i] or @leveled_up.include?(i)
        # Remember that this Actor has Leveled Up to retain "Level Up" status
        @leveled_up.push(i)
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end
It worked really fine!
Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/xp-center-battler-battle-box-problem.131581/