this script was made by me blablabla, credits to me and such.
for as far as i tested it , it works perfectly, if it doesn't for you, please let me know.
what does the script do:
the script will cancel the effect of dying after a normal battle however it will still allow death from the "gameover" line
it will also drain exp and gold from the heroes upon losing judging by the amount of gold the enemy should drop and by the exp the heroes got atm.
after that it will send you to a map of your choice and a spot of your choice in it (set it in the script, i wrote inside it in green where to change what)
from there it's up to you to send the hero elsewhere.
in the demo i made i sent the hero to a map called "angel of death" he removed the death status (don't forget to do it ) and reducded the sp to 0 and then sent you to the inn you "saved" in (you can check out the saving in the demo by opening it in editing mode)
ok now for the script:
replace the script "Scene_Battle 1" with this one:
#==============================================================================
# ? Scene_Battle (???? 1)
#------------------------------------------------------------------------------
# edited by bluexx , when you die in a normal battle you will now lose exp and gold
# and you will be sent to a map of your choice (such as the angel of death, and from there to an inn)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def main
# ???????????????
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# ??????????????????
$game_system.battle_interpreter.setup(nil, 0)
# ???????
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# ????????????????
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# ????????????
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# ???????????
@spriteset = Spriteset_Battle.new
# ????????????
@wait_count = 0
# ?????????
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# ???????????
start_phase1
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ??????????
$game_map.refresh
# ?????????
Graphics.freeze
# ????????
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# ???????????
@spriteset.dispose
# ???????????????
if $scene.is_a?(Scene_Title)
# ??????????
Graphics.transition
Graphics.freeze
end
# ???????????????????????????
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def judge
if $game_party.all_dead? or $game_party.actors.size == 0
if $game_temp.battle_can_lose
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# ?????
battle_end(2)
# true ???
return true
end
@phase = 6
$game_system.me_play($data_system.gameover_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
last_level = actor.level
#set the amount of exp you want the hero to lose here:
actor.exp -= actor.exp/30
if actor.level > last_level
@status_window.level_up(i)
end
end
for enemy in $game_troop.enemies
unless enemy.hidden
#set the amount of gold you want the hero to lose here: (amount per enemy)
gold -= enemy.gold*3
end
end
$game_party.gain_gold(gold)
@result_window = Window_BattleLose.new
@phase6_wait_count = 40
end
def update_phase6
if @phase6_wait_count > 0
@phase6_wait_count -= 1
if @phase6_wait_count == 0
@result_window.visible = true
$game_temp.battle_main_phase = false
@status_window.refresh
end
return
end
#set the map id of "the angel of death" here:
$game_map.setup(2)
#set the postion (x,y) in that map here:
$game_player.moveto(10, 10)
$game_player.straighten
$game_map.update
if Input.trigger?(Input::C)
battle_end(0)
end
return true
end
for enemy in $game_troop.enemies
if enemy.exist?
return false
end
end
# ????????????? (??)
start_phase5
# true ???
return true
end
#--------------------------------------------------------------------------
# ? ?????
# result : ?? (0:?? 1:?? 2:??)
#--------------------------------------------------------------------------
def battle_end(result)
# ??????????
$game_temp.in_battle = false
# ????????????????
$game_party.clear_actions
# ???????????
for actor in $game_party.actors
actor.remove_states_battle
end
# ????????
$game_troop.enemies.clear
# ??? ?????????
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call(result)
$game_temp.battle_proc = nil
end
# ??????????
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ? ??????????????
#--------------------------------------------------------------------------
def setup_battle_event
# ?????????????
if $game_system.battle_interpreter.running?
return
end
# ???????????????
for index in 0...$data_troops[@troop_id].pages.size
# ??????????
page = $data_troops[@troop_id].pages[index]
# ??????? c ??????
c = page.condition
# ??????????????????????
unless c.turn_valid or c.enemy_valid or
c.actor_valid or c.switch_valid
next
end
# ??????????????
if $game_temp.battle_event_flags[index]
next
end
# ??? ????
if c.turn_valid
n = $game_temp.battle_turn
a = c.turn_a
b = c.turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
end
# ???? ????
if c.enemy_valid
enemy = $game_troop.enemies[c.enemy_index]
if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
next
end
end
# ???? ????
if c.actor_valid
actor = $game_actors[c.actor_id]
if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
next
end
end
# ???? ????
if c.switch_valid
if $game_switches[c.switch_id] == false
next
end
end
# ???????????
$game_system.battle_interpreter.setup(page.list, 0)
# ?????????? [???] ? [???] ???
if page.span <= 1
# ???????????
$game_temp.battle_event_flags[index] = true
end
return
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ?????????????
if $game_system.battle_interpreter.running?
# ?????????
$game_system.battle_interpreter.update
# ?????????????????????????
if $game_temp.forcing_battler == nil
# ?????????????????
unless $game_system.battle_interpreter.running?
# ??????????????????????????
unless judge
setup_battle_event
end
end
# ????????????????
if @phase != 5
# ?????????????????
@status_window.refresh
end
end
end
# ???? (????)??????
$game_system.update
$game_screen.update
# ????? 0 ??????
if $game_system.timer_working and $game_system.timer == 0
# ?????
$game_temp.battle_abort = true
end
# ????????
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# ???????????
@spriteset.update
# ?????????????
if $game_temp.transition_processing
# ?????????????????
$game_temp.transition_processing = false
# ?????????
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# ????????????????
if $game_temp.message_window_showing
return
end
# ???????????
if @spriteset.effect?
return
end
# ??????????
if $game_temp.gameover
# ??????????????
$scene = Scene_Gameover.new
return
end
# ???????????
if $game_temp.to_title
# ???????????
$scene = Scene_Title.new
return
end
# ????????
if $game_temp.battle_abort
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# ?????
battle_end(1)
return
end
# ????????
if @wait_count > 0
# ????????????
@wait_count -= 1
return
end
# ???????????????????????
# ????????????????
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# ??????????
case @phase
when 1 # ?????????
update_phase1
when 2 # ????????????
update_phase2
when 3 # ????????????
update_phase3
when 4 # ???????
update_phase4
when 5 # ???????????
update_phase5
when 6
update_phase6
end
end
end
after that, under the script "Window_BattleResult"
it's important you'll put it right there and not just above main(actually you can put it anywhere for as long as it's above the other scene_battle1 script, but you get the point, i hope)
make a new script and call it "WindowBattleLose"
and put this in it:
#==============================================================================
# ? Window_BattleResult
#------------------------------------------------------------------------------
# made by bluexx
#==============================================================================
class Window_BattleLose < Window_Base
#--------------------------------------------------------------------------
# this is a part of the "losing exp + gold upon losing a battle" script
#
# made by bluexx
#
#--------------------------------------------------------------------------
def initialize
super(80, 304, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Battle Result" window font
self.contents.font.size = $defaultfontsize
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
cx = contents.text_size("You lost the fight").width
self.contents.draw_text(x, 0, 130, 70, "You lost the fight")
self.contents.font.color = system_color
cx = contents.text_size("now you shall meet the angel of death").width
self.contents.draw_text(x, 20, 250, 70, "now you shall meet the angel of death")
cx = contents.text_size("your heroes lost some exp and gold").width
self.contents.draw_text(x, 40, 250, 70, "your heroes lost some exp and gold")
end
end
feel free to change what the window says, it won't do any damage.
i hope you understood, if not i made a demo that shows what i did and how it works:
-dead link-
if you wanna use it please leave the lines "made/edited by bluexx" inside the script, thank you.
p.s the cow sprite was made by me using charas and then edited in paint
(oh and dwarra i expect to see you bow
-edit: he did
)
still edit:
file reuploaded. demo can be found at:
http://www.megaupload.com/?d=KP6W9HKY