As many years passed, some RMXP scripts got lost in the sands of time for many reasons. This is why I thought that offering you another option for improving the Party's Victory processing stage was something very convenient for everybody.
What this scriptlet does is simple:
It rewrites the Scene_Battle#start_phase5 by subdividing it into several other methods that handle very specific stuff.
Then I added a Game Variable and a Game Switch to alter its normal behavior.
The Game Variable handles how much EXP your heroes will get.
0 stands for EXP divided by Total Heroes
1 stands for EXP divided by Total Heroes * 2
2 stands for Full EXP
The Game Switch defines if the Party will get the whole list of Treasures.
The Party will only get up to 5 Treasures if the Game Switch is OFF.
Ruby:
# * BattleEnd XP * #
# Scripter : Kyonides Arkanthes
# 2023-06-16
# - Values for VAR_FULL_EXP Game Variable:
# 0 - EXP divided by Total Heroes
# 1 - EXP divided by Total Heroes * 2 (Punishment)
# 2 - Full EXP (Reward)
# - SWITCH_ALL_TREASURES Game Switch allows you to let the party get all of
# the treasures they have earned instead of just 5 of them.
module BattleEnd
VAR_FULL_EXP = 1
SWITCH_ALL_TREASURES = 1
end
class Scene_Battle
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
process_exp_gold_treasures
limit_treasures
distribute_treasures
distribute_exp_gold
end
def process_exp_gold_treasures
@exp = 0
@gold = 0
@treasures = []
for enemy in $game_troop.enemies
next if enemy.hidden
@exp += enemy.exp
@gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
@treasures << $data_items[enemy.item_id]
elsif enemy.weapon_id > 0
@treasures << $data_weapons[enemy.weapon_id]
elsif enemy.armor_id > 0
@treasures << $data_armors[enemy.armor_id]
end
end
end
end
def limit_treasures
return if $game_variables[BattleEnd::SWITCH_ALL_TREASURES]