How do I restore my hero's stats during a plotscript?

From OHRRPGCE-Wiki
Jump to: navigation, search

Well that's rather easy! Let's say you have 4 heroes, and want to restore the HP and MP for all of them. Put in your plotscript the following lines:

  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)
  
  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)   

  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)  

  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)   

Please note that the stat names may vary on your RPG file. Check in your hsi file for stat names. If you don't have the hsi file for your game, open in custom and go to Script Management, then select 'export names for scripts'.

Also, you can restore absolutely all your stats this way by changing the stat names. However, stats ( HP and MP excepted) can only be change outside of battle with plotscripts, so otherwise they are always set to maximum.

You can also include an if (check tag()) command if you only want to restore your stats only in certain situations.

Using this script is a good alternative to using an inn that costs $0 dollars for things like sleeping in a bed, or talking to a friend who can heal you for free.

Feel also free to use these code to create very special inns! (You pay with items for example)

See also[edit]