How do I prevent a dead hero from reviving at the Inn?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

As it is not very rationnal that a stay at a Inn revives a dead hero you might want to prevent this from happening in your game.

If you are using a Inn that comes with Custom.exe[edit]

If you are using the Inn that comes with Custom.exe then, all you have to do is going under custom.Exe, editing the preference bitsets and activate the bitset "Inns Don't Revive Dead Heroes"

If you are using your own Inn[edit]

It might be more difficult to do so if you have made your own Inn but not impossible. All you have to do is to use a variable that checks that the Hp of the heroes is not 0, and if so, not to restore them. Let's take a basic Inn script:

plotscript, inn script, begin

suspend player

variable (hero0 hp, hero1 hp, hero2 hp, hero3 hp)
hero0 hp:= get hero stat (0,hp,current stat)
hero1 hp:= get hero stat (1,hp,current stat)
hero2 hp:= get hero stat (2,hp,current stat)
hero3 hp:= get hero stat (3,hp,current stat)


  if(pay money(600)), then, begin

If (hero0 hp >= 1) then, begin # # if main hero (hero 0) has least 1hp then begin..
    set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat)
    set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
end

If (hero1 hp >= 1) then, begin # if hero 1 has least 1hp then begin..
    set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat)
    set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
end

If (hero2 hp >= 1) then, begin # if hero 2 has least 1hp then begin..
    set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat)
    set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
end

If (hero3 hp >= 1) then, begin 
    set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat)
    set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat)
end

    show text box (57)
  else
    show text box (58)# sorry not enough cask
  end
  wait for text box
end

Then you may wander but how shall I make my hero revive? Well that easy as pie. You have to create a "revive point" In many old rpgs the church usually plays this role. Go under custom and pick a free tag.Let's say it's tag 15 and that you name it "go to revive" or any name that may help you remember what is the tag for. Then pick up a free text box (let's say text box 45) and put in it "Priest: "Hello my son. May I help you?" (or any equivalent that will not seem strange to the player.) Then edit choice. Make choice avaliable. Yes is choice number 1 (set the tag ON) and No choice number 2 (set the tag off). Then edit the conditionals. If the player's choice is no, then tag is turned off and you turn the line "jump to text box 45 instead" but if the player chooses "yes" you get down and turn the line "if tag 15 = (go to revive)" then "run priest revived dead hero next"

In the same time, include the script in question in your hss file

script, priest revived dead hero ,begin

suspend player
suspend npcs

if (check tag (tag: go to revive)==On)then, begin

variable (hero0 hp, hero1 hp, hero2 hp, hero3 hp)
hero0 hp:= get hero stat (0,hp,current stat)
hero1 hp:= get hero stat (1,hp,current stat)
hero2 hp:= get hero stat (2,hp,current stat)
hero3 hp:= get hero stat (3,hp,current stat)


If (hero0 hp == 0) then, begin # if hero 0 has no Hp then begin
    set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat)
    set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
    show text box (45) #priest: good luck may the lord be with you
    wait for text box
end, else, begin

If (hero1 hp == 0) then, begin # if hero 1 has least 1hp then begin..
    set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat)
    set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
    show text box (45) #priest: good luck may the lord be with you
    wait for text box
end, else, begin

If (hero2 hp == 1) then, begin 
    set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat)
    set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
    show text box (45)
    wait for text box
end, else, begin

If (hero3 hp == 1) then, begin 
    set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat)
    set hero stat(3,stat:mp, get hero stat(3,stat:mp,maximum stat), current stat)
    show text box (45) 
    wait for text box
end, else, begin

show text box (13)# sorry buy it seems that you don't need my service
wait for text box
resume player
resume npcs
end# end for last else, begin

end # ends for the ifs
end
end
end
end

end #end of the plotscript

Save you rpg file, export the new tag in your hsi file and compile you hss file (after saving it indeed). You can now import your .hss file in your rpg save the whole thing and you are ready to test!


See Also[edit]