Tutorial: Advanced Inns with changing Prices
Difficulty: Advanced
RPG Maker: 2000/2003
Author: kid27

Hiya folks! It's me again!

Thejackyl wrote a tutorial on how to make inns that charge a certain amount of money per living character in the player's current party. He also mentioned about inns that charge the player more money depending on how hurt his/her characters are. I will tell you how to make an inn that charges you more depending on how much HP and/or MP they are restoring for you, AND how to make a seperate NPC who charges you to revive people!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Step 1 - Variables
First of all, you will need 7 variables - name them "Party HP", "Party MP", "Party Max HP" and "Party Max MP". The last 2 will be called "HP to Heal" and "MP to Heal". And finally, one will be called "Price". You will also need 4 extra variables per playable character in your game. Name them "[Name] HP", "[Name] MP", "[Name] Max HP" and "[Name] Max MP".

Step 2 - The Inkeepern
With your variables ready, create a map that is to be the inn. Create an event named "Innkeeper" and give him/her whatever graphic fits. Create these events in his/her event page:

1) Have a message pop up saying something like "Innkeper: We charge 1 GP per health point restored and 2 GP per mana point restored. [These values can be changed to your liking.] Would you like to stay a night?"

2) Give the player a choice of "Yes" or "No". Under "No", have a message saying something like "Inkeeper: You'll regret that! Come again soon!". Under Yes...

3) ...Check if [Character 1] is in the player's current party. If so, assign the corresponding variables to that character's HP and Max HP. Then repeat this process for every other playable character in your game.

4) After checking characters and assigning variables, add all the [Name] HP variables up. (I.e. the first action would be "[Character 1] HP" + "[Character 2] HP", the next "[Character 1] HP" + "[Character 3] HP", etc.) Then assign the Party HP variable to the [Character 1] HP variable.

5) Now repeat event 4, using Max HP variables instead of current HP variables.

6) Now repeat events 4 and 5, using max and current MP variables instead of max and current HP variables.

7) Now take the value of Party Max HP away from the value of Party HP. (I.e. Party Max HP - Party HP). Do the same with Party MP and Party Max MP. Then assign "HP to Heal" to "Party HP" and "MP to Heal" to "Party MP".

8) Multiply HP to Heal and MP to Heal by whatever amount of money the inn charges per health point and mana point correspondingly. (E.g. if the inn charges 1 Gold per health point and 2 Gold per mana point, multiply MP to Heal by 2 [HP to Heal x 1 just comes to the same value, so there's no point].)

9) Add "HP to Heal" and "MP to Heal". Then assign Price to "HP to Heal".

10) Have a message appear saying something along the lines of "Innkeeper: That will cost you \v[###] Gold altogether." ### is equal to the ID of the Price variable.

11) Using a Fork Condition, check if the player is currently holding enough Gold to pay. (I.e. their Gold is "more" [NOT bigger!] than Price.) Include an ELSE case. If this is the case, decrease the necessary amount (i.e. the variable Price) from the player's current Gold and have a message saying something like "Innkeeper: Thanks! Have a good sleep, now!" appear and then a sleeping process take place (see event number 12). Under the ELSE case, make a message appear saying something like "Innkeeper: Sorry, you don't have enough money!" come up.

12) To create the sleeping process:
I: Have the screen fade out to black.
II: Check if [Character 1] is in the party.
III: If so, restore that character's HP and MP (NOT "Full Restore") via HP and MP increasing events.
IV: Repeat events II and III for every other playable character.
V: Fade the screen back to normal.
VI (optional): Make a message appear saying something like "Innkeeper: Did you have a nice sleep? Come again anytime!"

Step 3 - The Reviving NPC
Create an NPC with whatever graphic fits best. In his/her event page, have the following events occur:

1) Make a message saying something like "Cleric: I charge 300 Gold to revive all those dead. Would you like me to revive everyone dead?" come up.

2) Give the player a "Yes" or "No" choice. If the choice is "No", make a message appear saying something along the lines of "Cleric: Okay, but you'll regret it when you all die!". If the choice is Yes...

3) ...Check if [Character 1] is in the party. If so, check if that character is dead. (I.e. in the state "Death" [by default it's often called "Normal"].) If THAT is so, revive the character by removing the death condition from them and restoring some HP and MP.

4) Repeat event number 3 for every other playable character in the game.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thank you VERY MUCH for bearing with me throughout this very long tutorial. I hope it helps you out!

E-mail me at bohew00t@yahoo.co.uk if you have any questions, comments (praises and constructive criticsms are welcome!) or just anything you want to ask me or say to me. Adios!



Click to Return to the Tutorials Page