RHPTest utility v1.68 Beta Program Codes:
    - v1.5: Released officially 09-20-2005. -
    - v1.68 Betas:  January 2011 Betas (RHPTest and LordType)

-- Docs updated on December 31, 2010. --

-- Synchronized with LORD Cavern docs on 06/11/2008.
-- Synchronized with The Gateway docs on 10/28/2009.
============================================================

Notice for RHP Script authors:
    RHPTEST v1.68 Beta is for usage with these programs:
    The Forest Outhouse (OUTHOUSE.EXE), The Gateway (GATEWAY.EXE),
    The LORD Cavern (LORDCAVE.EXE), and The Outlands Tavern
    (OUTLANDS.EXE).

    As of early January 2011, The Outlands Skeleton IGM is not
    coded to support use of RHP Scripts, so it is NOT covered by
    these RHP Library documentation files.  Donald 11/25/2009.

The Gateway IGM was put back into full-time official development
on Oct. 31th, 2009.  It is in BBS testing by Christopher Gosse
and others currently.  -- Donald. 11/23/2009.  Edited 12/28/09.
========================================================

This file lists the program codes for the built-in Random Happening
Program (RHP) system, used currently by The Forest Outhouse,
The Gateway, The LORD Cavern, and The Outlands Tavern IGMs;
and the RHPTest utility.  It covers all usable RHP Codes as of
the latest work on RHPTest, LORD Cavern, Outlands Tavern, and
Forest Outhouse in January 2011.

The Gateway IGM was put back into full-time official development
on Oct. 31th, 2009.  It will be a little while before I make
it available for BBS testing, so I can do needed testing.

With the exception of Outlands Skeleton, which does not yet
have the ability to run RHP Scripts, all of the RHP-based IGMs
are in full-time development at the current time.  10/31/2009 DGT
===================================================================

RHPTest v1.3+:  RHPTest now supports all RHP Scripts developed
     for The Forest Outhouse LORD IGM - versions 2.10 forward.
------------------------------------------------------

Download link for RHP Toolkit v1.4:
   http://camelot.legendarydragons.com/LordApps/rhptst14.zip

Download link for RHP Toolkit v1.5:
   http://camelot.legendarydragons.com/LordApps/rhptst15.zip
=======================================================

June 11, 2005: Did official release of The Forest Outhouse
   v2.50, The Gateway v1.3, The LORD Cavern v1.7, The
   Outlands Tavern v1.5, and RHP Toolkit v1.4.

Sept. 20, 2005: Did official release of RHP Toolkit v1.5.
===========================================================


Notices Section:  (revised 10/28/2009)
--------------------------------------
Required in the @VERSION@ statement of *ALL* RHP Scripts:

LORD Cavern requires:        @VERSION@ 1.80
Forest Outhouse requires:    @VERSION@ 2.70
Outlands Tavern requires:    @VERSION@ 1.80

The Gateway (will) require:  @VERSION@ 1.80

As of early Dec. 2009, all four RHP-based IGMs are in
development.

Note: Do NOT attempt to use the rewritten math formulas in
The Gateway v1.3.  It will NOT be able to understand or
process them correctly.  Use only The Gateway v1.31+ Betas.
-----------------------------------------------------------


01/30/2010 Notes:  @SHOW@ and @NOSHOW@ RHP codes.
--------------------------------------------------
If you wish the IGMs to display the result of a RHP Code, it
is necessary for the script to include a @SHOW@ command,
which should be located below the lines for @;@@NAME@ and
@;@@SCRIPTVERSION@ in the script.  Or relatively close to
them.  It has to be placed BEFORE any RHP codes are used
that access RHP Codes based on the LORD player stats.

If you want an igm to NOT display the result of a RHP Code
operation, place @NOSHOW@ immediately before the command.

If @NOSHOW@ is used once at the start of a script, then NONE
of the results from RHP code operations will ever be shown
to the user.  So use this code with caution.  Players may NOT
appreciate a RHP Script that NEVER tells them about penalties
or reward that the RHP Script Event executed.
------------------------------------------------------------

@RANDOMU1@ - Added by Dennis Collins.  I've never used it, so
I don't know its purpose for sure.  Other than it randomizes
script variables possibly that are used by a Script.

End of Jan. 30, 2010 section.
------------------------------------------------------------


03/25/2008 Syntax Changes:
--------------------------
This *MUST* be followed in writing new scripts, or in modifying
old ones which utilize any kind of math operation for the purpose
of modifying a LORD/IGM stat up/down by xx%.

Usage of SIMPLE math operations:
--------------------------------
@GEMS@ +10         This ADDS 10 to player's LORD Gems stat.

@HITMAX@ -10       This SUBTRACTS 10 points from Max HitPoints.

@CHARM@ *10        Multiplies amount of Charm Points by 10,
                   and resets Charm equal to the result.

    Ex. Player has 500 Charm Points. IGM will compute 500 * 10,
    which is 5,000 and it resets Charm Points to 5,000 points.

@DEFENSE@ /10      Divides amount of DEFENSE Points by 10,
                   and resets Defense Points equal to the result.
                   Works with either / or \ division symbols.

@HITPOINTS@ =1     Resets HitPoints equal to 1.
-----------------------------------------------------------------


Usage of Percentages in RHP Code statements.  06/08/2008
--------------------------------------------------------
In order for them to work properly, *EVERYONE* who writes
RHP scripts who wishes to use percentages, is required to
do so in this fashion.  No other way will work correctly.

Example:  You wish to reward the player with a 5% increase in
Gems.  The only way this will work is to write these 2 lines:

@VARIABLE1 =GEMS%5   <-- Computes 5% of GEMS stat.
@GEMS@ +VARIABLE1    <-- Adds amount stored in VARIABLE1 to GEMS.

Example: To write a loss of 5% Experience, you would do this:

@VARIABLE1 =EXPERIENCE%5   <-- Computes 5% of EXPERIENCE stat.
@EXPERIENCE@ -VARIABLE1
       <-- Deducts amount stored in VARIABLE1 from EXPERIENCE.

Example: To write a gain of 5% Charm, you would do this:

@VARIABLE1 =CHARM%5   <-- Computes 5% of CHARM stat.
@CHARM@ +VARIABLE1
       <-- Adds amount stored in VARIABLE1 to CHARM.

Be extremely careful using percentages, since they can result
in HUGE rewards or penalties.  For example, a 5% increase in
Max HitPoints could optimally be 1,600 points.  Which is way
too much for any IGM, much less a RHP script, to award any
player in a LORD game, under any circumstance.

For these scripts to work properly, it is imperative that
you use the June 08+, 2008 beta of LORD Cavern, or of Outlands
Tavern.  For RHPTEST.EXE, it also has to be June 08+, 2008.
-----------------------------------------------------------------


Modifying a LORD Stat based on Game Level:
------------------------------------------
Mandatory:  LEVEL has to be used first in the math formula.

@GEMS@ +LEVEL*5    Multiplies Game Level by 5. Adds the result
                   to Gems stat's value. Reset Gems to the
                   amount of the final result.

See SHINY.RHP script for an example of this math operation.
    Note: The script is for the Outlands Tavern IGM.

@KIDS@ -LEVEL*5    Multiplies Game Level by 5. Subtracts the result
                   from the Kids stat's value.  Resets Kids equal
                   to amount of the final result.

                       End of 06/11/2008 Notices block.
============================================================


                  Programs coverage:   (rewritten 10/28/09)
                  -----------------------------------------
This RHP Library Codes documentation file covers 2009 Betas
of The Forest Outhouse (v2.51+), The Gateway (v1.31+), The
LORD Cavern v1.7+), RHPTEST (v1.51+), and The Outlands Tavern
(v1.6+).   Information about revised usage of Math formulas
is NOT intended for usage in RHP Scripts that will use older
versions of each program.

The ANGEL Toolkit-based version of The Outlands Tavern that I
have been working on in 2009 can NOT currently use RHP Scripts.
There is NOT any plans at the current time to make ANGEL versions
of the LORD Cavern or Forest Outhouse until sometime in 2010,
after I get their current DDIGM-based versions officially released.
--------------------------------------------------------------

Link for Castle Camelot IGM Betas web-page:
   -- http://camelot.legendarydragons.com/igm-beta.htm

Note that it is best to contact me directly via email for
beta archives, since I don't update the web-site very often
each month.
=======================================================

The Forest Outhouse IGM's OH2SETUP.EXE utility, The Gateway
IGM's GWSETUP.EXE utility, LORD Cavern's LCSETUP.EXE utility,
and Outlands Tavern's OTSETUP.EXE utility are all written the
same way.  All four igms require that RHP Scripts use the
extension .RHP.  All script files must use the classic 8.3
filename format with no spaces used.  Example: MAGICIAN.RHP

Note: The RHPTEST.EXE program does NOT run LordStat scripts.

An example RHP Script that Dennis Collins and I are using to
test the RHP Library Unit's programming changes, can be found
in the OUT-WORK.ZIP Outlands Tavern beta archive.
======================================================

The RHP language uses codes that have a @ on both sides. All
RHP codes listed in RHPTCODE.TXT are fully usable with the
current beta versions of RHPTEST, The Forest Outhouse, The LORD
Cavern, and The Outlands Tavern.  A new beta of GATEWAY.EXE
for The Gateway IGM will be made available in early November.

New codes are indicated with a *.  Or by parenthetical notes,
such as (1:1.5) for something usable only with LORD Cavern v1.5+,
for instance.  If some codes do not work with some IGM versions,
a key code follows:

(X,X.XX) indicates what program and versions it does not work with.
No version means it does not work at all.

 0: RHP v1 definition, not in any current programs.
 1: The LORD Cavern v1.3+
 2: The Outlands Tavern v1.3+
 3: Most of these also work with The Gateway v1.0+
 4: The Forest Outhouse v2.10+
    (v2.00 of The Forest Outhouse was unable to use RHP Scripts.)
--------------------------------------------------------------

Color codes!  For LORD programs, use the first column, for others
the second column is used.  Example:  In a LORD IGM, LADY Script
(for LORD v4.05pb+), or a RHP Script, to assign (dark) Blue color
to a text passage, you would use `1.  (The ` is the caret symbol,
located to the left of the 1 key on your keyboard.  It is NOT the
apostrophe.)  For a non-LORD program, one would use `01 for Blue.
{ Revised 06/25/2003. }

`1 ; `01: Dark Blue     `2 ; `02: Dark Green     `3 ; `03: Dark Cyan
`4 ; `04: Magenta       `5 ; `05: Dark Violet    `6 ; `06: Brown
`7 ; `07: Lt. Grey      `8 ; `08: Dark Grey      `9 ; `09: Light Blue
`0 ; `10: Lt. Green     `! ; `11: Lt. Cyan       `@ ; `12: Lt. Magenta
`# ; `13: Lt. Violet    `$ ; `14: Yellow         `% ; `15: White

Advisory note: Keep in mind that LORD IGMs display data against
black background.  Use dark colors with caution, since user
will possibly be unable to read them on-screen.
----------------------------------------------------------------------

This first set of codes are just normal commands with no parameters.

They are RHP properties, which tell the IGM (or RHPTest) various
things about the script.  Remember that these have a @;@ at the
start!

@;@@PROGRAM@ xxxxxxxxxxx  What program it's for, LORDCAVE, OUTLANDS,
                          (1:1.3a-1.3F).  Gateway v1.0+. Outhouse v2.10+.

@;@@VERSION@ xxxx         Version of the IGM program the script is
                          compatible with.  

@;@@NAME@ xxxxxxxxx       Optional name for RHP (for SETUP utility),
                          maximum length is 50 characters (v1.4+)

@;@@SCRIPTVERSION@ xxxxx  Optional field for Script Version.
                          {RHPTest v1.3+ . Backward-compatible with igms.}
--------------------------

Example Notes:  @VERSION@ 1.5 would be used for a LORD Cavern
script using the new @SKILLUSE@ RHP code.

@VERSION@ 2.10 (or 2.15) would be used by an Forest Outhouse script.

06/2003 Note: Script version numbers should not be used in @NAME@ field.
----------------------------------------------------------------------

This example is for one of the Forest Outhouse RHP Scripts.
It is only applicable to the Setup program of that IGM.
-----------------------------------------------------------

@;@ RHP_name: The Magic GemStone

In this example, you would see something like this in OH2SETUP:

(A) GEMSTONE.RHP (The Magic GemStone)

Without an @;@ RHP_Name line, OH2SETUP.EXE will just show this:

(A) GEMSTONE.RHP ( )
==============================================================


This set of codes are just random commands.

@;@@VARIABLE1@ xxxxxxxxx
     Gives a name to the given user variable number.  If you
     define a name, it will show up in the stats.  Covers
     @VARIABLE1@ through @VARIABLE5@ codes.  Max Length is 13
     characters or 13 digits if using a number.

     Usable fully with RHPTEST v1.51+ beta, LORDCAVE.EXE v1.71+
     beta, and OUTLANDS.EXE v1.61+ beta.   As of 06/11/2008.

     Usable fully with OUTHOUSE.EXE v2.51+ betas, as of Summer 2009.

@;@        Comment, everything on a line with this at the front
           will be ignored (works in recording)

@CLEAR@    Clear the screen (works in recording)
@MORE@     Pause for keypress with "<MoRE>"
@DELAY@    Small delay (250 milliseconds)
@END@      Stop program and pause

@KILL@     Stop program, pause, and kill player
           (player is notified via their LORD Mail file.)

@KILLSAVE@    Same as KILL code, but allows 50% chance that a
              Fairy will be allowed to rescue player from death.

              * No fairy: Player dies and is notified of death.

              * Has Fairy: Event #1: Fairy brings player back
              to life, healing all wounds. It then leaves. Event
              #2: Fairy is "on strike", like a union member at
              a factory.  It refuses to save the dead player and
              leaves.  Player stays dead. (Rewrote 08/21/07)

              ( RHPTest 1.2+, LORD Cavern v1.5+, Outlands Tavern v1.4+,
                Gateway v1.1+, and Forest Outhouse v2.01+. )

@EXIT@     Stop program, pause, and exit to LORD (1,1.3a+)

@STATS@    Shows the player's LORD and IGM Stats (1,1.4+)

@RUNRHP@ xxxxxxxx.xxx  Quit current RHP and run xxxxxxxx.xxx (1,1.4+)
------------------------------------------------------------

-- For Outlands Tavern and RHPTest script usage/testing ONLY:

@GETROOM@  Stop program, pause, puts player to sleep in Tavern
           Room, and exit to BBS.

@PRISON@   Stop program, pause, imprisons player in Dungeon Cell,
           and exit to BBS.

If used in RHPTEST, either code causes a script to immediately
stop processing, and the RHPTEST session returns to DOS prompt.
=================================================================

This set is for writing to a player's MAIL?.DAT and LORD's LOGNOW.TXT.

@MAIL@      Start writing to mail
@MAILEND@   Stop writing to mail
@NEWS@      Start writing to LOGNOW.TXT
@NEWSLINE@  Stop writing to LOGNOW.TXT and add a line "-=-=-=-"
              centered (on-screen, when file is displayed.)
@NEWSEND@   Stop writing to LOGNOW.TXT

Note any blank lines in a script between @MAIL@ and @MAILEND@
are shown on-screen in the IGM, or in RHPTEST, as blank lines.
The same is true for blank lines in a script between the @NEWS@
and @NEWSEND@ lines. {06/11/08 info}
----------------------------------------------------------------------

The following two sets can be used in Mail and News recordings.

  The next set is for designating sections (of a script) to go to.

  @#xxxxxxxx         Section designation, no maximun length
  @GOTO@ @#xxxxxxxx  Go to section xxxxxxxx after this command
---------------------------------------------------------------------------

  The one in this section is for writing lengths of spaces.

  @SPACE@ x  Write x spaces to screen/file
---------------------------------------------------------------------------

This set is for testing existing information and can be used in
Mail or News recording.  All RHP code commands which can be done
with @IF@ statements can also be used with @NOTIF@ statements.

Example: @IF@ FEMALE @GOTO@ @#Help
    (if player is Female, goto section @#Help)

Example: @IF@ EXPERIENCE>0 @GOTO@ @#Help
    (if experience is greater than 0, goto section @#Help)

Example @IF@ FIGHTER `9Good job!
    (if player is a Death Knight, write `9Good job! to file/screen)

Example @IFNOT@ MAGIC `9Good job!
    (if player is not a Magician, write `9Good job! to file/screen)

@IF@ condition command
    Test condition, if True, do command.  Command can be any RHP
    @ command or one line text.  Condition can have only ONE math
    formula in it (see variables section). (v1.3a+)

@IFNOT@ condition command
    Test condition, if False, do command.  Command can be any RHP
    @ command or one line text. Condition can have only ONE math
    formula in it (see Variables section). (v1.4+)
-----------------------------------------------------------------

Usable conditions for @IF@ and @IFNOT@ statements:
    ** Sorted into alphabetical order 05/29/2008.
--------------------------------------------------

 FEMALE     : returns if player is Female
 MALE       : returns if player is Male
 FIGHTER    : returns if player is currently a Death Knight
 MAGIC      : returns if player is currently a Magic User
 THIEF      : returns if player is currently a Thief
 HORSE      : returns if player has a Horse
 FAIRY      : returns if player has a Fairy
 MARRIED    : returns if player is married, works with Violet and
              Seth Able marriages as well as player to player.
 SPIRITS    : returns if player is in High Spirits
 WEIRDEVENT : returns if player will have a Weird Event in the Forest
              (Note: Weird is intentional spelling of the word.)
 HEALED     : returns if player is healed
 x<y        : returns if number x is less than a number y
 x>y        : returns if number x is greater than a number y
 x<>y       : returns if x is not equal to y
 x=y        : returns if x is equal to y

Any number can be used as X or Y, or you can use player stats.
----------------------------------------

 BARDSONG   : Returns if player has heard Bard Sing in Inn.
              (LordCave v1.5+, RHPTest 1.2+)

 CLEANMODE  : Executes script statements based upon LORD's Clean
              Mode status.  See bottom of file for detailed
              information and examples of usage.

 FLIRTED    : Returns if player has Flirted With another Player yet.
              (LordCave v1.5+, RHPTest 1.2+)

 SEENDRAGON : Returns if player has Seen the Red Dragon yet.
              (LordCave v1.5+, RHPTest 1.2+)

 SEENMASTER : Returns if player has Seen Master yet.
              If True, player LOST a master fight challenge.
              And is not allowed to do another challenge that day.
              (LordCave v1.5+, RHPTest 1.2+)

 SETHVIOLET : Returns if player has Flirted with Violet or Seth.
              (LordCave v1.5+, RHPTest 1.2+)
-----------------------------------------------------------

Player stats that can be used as X or Y:
    ** Sorted into alphabetical order 05/29/2008.

 ALLGOLD    : Total amount of gold     (See info below)
 ARMOUR     : Armour number       {Covers #0-15}
 BANK       : Gold in bank
 CHARM      : Charm
 DEFENCE    : Defense Points.
 DEFENSE    : Defense Points

 DEFENSE:  (LordCave: v1.5+, Outlands: v1.4+, Gateway: v1.2+,)
           (Outhouse: v2.10+, and RHPTest: 1.2+)

 EXPERIENCE : Experience Points
 FIGHTS     : Player fights
 FOREST     : Forest Fights
 GEMS       : Gems
 GOLD       : Gold in hand
 HITMAX     : Max HitPoints
 HITPOINTS  : Current HitPoints
 KIDS       : Kids
 KILLS      : Number of player kills
 LAYS       : Lays
 LEVEL      : Player's level
 SKILL      : Current skill type points amount
 SKILLUSE   : Skill Usage Points amount, for current Skill.
              (LordCave v1.5+, Rhptest v1.2+)
 STRENGTH   : Strength Points
 WEAPON     : Weapon number       {Covers #0-15}
 WINS       : Number of times player has won
 --------------------------------------

 These four commands are only usable in ONE specific IGM,
 and in RHPTEST, as noted in the parenthesis notes:

 SEARCH       : Cave searches        (LORD Cavern, Rhptest)
 FORESTSEARCH : Forest Searches      (Forest Outhouse 2.15+, Rhptest 1.3+)
 VISITS       : Visits Left          (The Gateway, Rhptest)
 DRUNKLEVEL   : Level of Drunk-ness  (Outlands Tavern, Rhptest)
 -------------------------------------------------

Regarding the @USER1@ to @USER5@ variables, any IF or IFNOT
conditions and in-line includes that use them, can only be
used in scripts for The Gateway IGM.  The only other program
that will process them is RHPTEST.
------------------------------------------------------------

Regarding the @VISITS@ variable, it is handled differently
depending on the IGM in use.  In The Gateway, it applies to
the number of Script Events that can occur before the script
stops executing them.  In the other three IGMs, it refers
to the IGM Visits Today counter that the programs all use.
------------------------------------------------------------

 STRENGTH   : Strength Points
 EXPERIENCE : Experience Points
 LAYS       : Lays
 SKILL      : Current skill type points amount
 HITPOINTS  : Current HitPoints
 HITMAX     : Max HitPoints
 GEMS       : Gems
 GOLD       : Gold in hand
 BANK       : Gold in bank
 CHARM      : Charm
 WEAPON     : Weapon number       {Covers #0-15}
 ARMOUR     : Armour number       {Covers #0-15}
 LEVEL      : Player's level (1:1.3c)
 KILLS      : Number of player kills (1:1.3c)
 ALLGOLD    : Total amount of gold (1:v1.4+)
 WINS       : Number of times player has won
              (killed the Red Dragon)    (1:v1.4+)
----------------------------------------
 SKILLUSE   : Skill Usage Points amount, for current Skill.
              (1:v1.5+, 2:v1.4+, 3:v1.2+, 4:v2.10+, RHPTest 1.2+)
============================================================


## File edited to this point ##


ALLGOLD can only be displayed in a script, using @*@ALLGOLD@*@
in a text statement.  The stats LEVEL, CLASS, and WINS are
display-only variables, which a script can NOT modify.

The following set is for prompting for Input (from player).  The
single character section is used to act on the Input data.  The
program runner acts on the first matching section found, so don't
use the same selections nested.

Example: @PROMPT@ CD (prompts for C and D selections.  You MUST
                      have @##C and @##D sections later in script.)

@YESNO@        Prompt for Y/n, Y and N sections

@PROMPT@ xx..  Prompt for selections xx.., selections must be
               capitalized.  The first selection will be the default one.

@RANDOM@ x     Random number between 1 and x, each number a section

@##x           Single character section, can be called with @GOTO@
-----------------------------------------------------------------

The following set has some special properties.  If you put a =
before the number x, it makes that attribute equal to x.  If
you put % (before the number), it adds/subtracts x% of the
existing attribute to the attribute.  Ones marked with a $ can
be used in Mail without the = option and may just increment the
attribute by 1.  Player is notified with a 'You LOSE/GAIN x
<type>!' message in both Mail and on screen, except not in Mail
for those that just increment.

You can also do ONE math operation (/,*,+,-) in a line. (1.4+)

** See Explanatory Notes section for special info.
--------------------------------------------------------------

Important: When using the equal sign, there can be no blank
spaces between it and the formula that is to be processed.
-----------------------------------------------------------

@DEFENSE@ =DEFENSE/5
          (Requires O.T. v1.64+ Beta; RHPTest v1.51+ beta)

     Step 1: IGM divides DEFENSE stat value by 5.
     Step 2: IGM resets DEFENSE to that computed amount.

Example: Player has 10,000 Defense Points.  When processed,
the Step 1 result will be 2,000.  So Step 2 would reset the
player's DEFENSE stat to 2,000 points.  End result would be
the message:  You LOSE 8,000 Defense Points.
============================================================

Using LEVEL*X, where X is a number, multiplies the player's Game
     Level by the X value.  You can only use Whole Numbers.

     You must always indicate the TYPE of math operation by
     using the appropriate math symbol (+,-,*, or /).  The IGM
     will also accept (\) for Division.

     Example:  @GOLD@ +LEVEL*500
     This adds 6,000 to Gold in Hand, for a Level 12 player.

     By default, it is assumed that the amount is added to
     the listed LORD stat.  Important: In all MATH formulas
     involving a LORD or IGM stat, you have to specify the
     RHP code for that stat first, followed by the math formula
     or value that is being used to modify the stat's value.
----------------------------------------

Example: @GOLD@ =0             (Sets gold in hand to 0)

Example: @EXPERIENCE@ +LEVEL*4
      (Adds amount (Game Level * 4) to)
      (the player's Experience)

Example: @GOLD@ +GEMS*6        (Adds amount (Gems * 6) to the
                                player's Gold in Hand)
-------------------------
Example: @SKILLUSE@ +1   (Adds 1 to current Skill's Uses)

Example: @SKILL@ -1      (Deletes 1 skill point, of current class)

@SEARCH@ x      Cavern Searches Left
                { Usable only in LORD Cavern and RHPTEST. }

@FOREST@ x      Forest Fights ($)
@FIGHTS@ x      Player fights ($)
@KIDS@ x        Kids  ($ increments number by 1, ignores x)
@DEFENCE@ x     Defence ($)
@DEFENSE@ x     Defense ($)          (Added in July 2002)
@STRENGTH@ x    Strength ($)
@EXPERIENCE@ x  Experience ($)
@LAYS@ x        Lays ($ increments number by 1, ignores x)

@SKILL@ x       Adds x amount to player's current Skill Class's
                Skill Points.  0-100 range only.

@SKILL@ $       Increments player's current Skill Class's Skill
                Points by 1, when $ is used.

@HITPOINTS@ x   Current HitPoints
@HITMAX@ x      Max HitPoints ($)
@GEMS@ x        Gems
@GOLD@ x        Gold in Hand ($)
@BANK@ x        Gold in Bank ($)
@CHARM@ x       Charm ($)(increments number by 1, ignores x, = option can
                be used)
@KILLS@ x       Number of player kills (1:1.3c)
--------------------

@VARIABLE1@ x   RHP variable 1 for math, is forgotten after RHP is done
@VARIABLE2@ x   RHP variable 2 for math, is forgotten after RHP is done
@VARIABLE3@ x   RHP variable 3 for math, is forgotten after RHP is done
@VARIABLE4@ x   RHP variable 4 for math, is forgotten after RHP is done
@VARIABLE5@ x   RHP variable 5 for math, is forgotten after RHP is done
--------------------

@SKILLUSE@ x    Adds x amount to player's current Skill Class's
                Skill Use Points.

@SKILLUSE@ $    Increments player's current Skill Class's Skill
                Use Points by 1, when $ is used.

If SKILL or SKILLUSE is used, the applicable LORD stat can not
be set above 100.  If x is negative number, that value is
deducted from player's Skill Points or Skill Use Points stat.
--------------------------------------------------------------

Other examples:
  @WEAPON@ - Weapon Number.

  In LORD Cavern scripts, it changes the player's Weapon Name to
  one used by the Skeleton event.  Weapon # is NOT change-able
  using RHP Scripts under any circumstance.
  ------------------------------------------

  @ARMOUR@ - Armour Number.

  In LORD Cavern scripts, it changes the player's Armour Name to
  one used by the Skeleton event.  Armour # is NOT change-able
  using RHP Scripts under any circumstance.
  ------------------------------------------

Note: The WEAPON and ARMOUR codes will also work in scripts that
      are designed for usage in The Forest Outhouse, The Gateway,
      and Outlands Tavern IGMs.  They also will work in RHPTEST.
================================================================

  @ARMORNUM@  - v1.4+ only. Armour Number - normal spelling.
  @ARMOURNUM@ - v1.4+ only. Armour Number - Old English spelling..
  @WEAPONNUM@ - v1.4+ only. Weapon Number.

  Covers item numbers 1-20. Default name coverage for any
  unknown Weapon/Armour using item # above 20.
              (Requires: Outlands v1.4+, RHPTest 1.2+,)
              (LORD Cavern v1.5+, The Gateway v1.1+,)
              {Or Forest Outhouse v2.20+.}
=================================================================

These codes are special player value changers that don't act like the
earlier ones.  They cannot be used in Mail.  Player is NOT notified.

@FAIRY@       Changes if user has a Fairy.  Takes no parameters.  If user
              has a Fairy, it's taken, else one is given.

@HORSE@       Changes if user has a Horse.  Takes no parameters.  If user
              has a Horse, it's taken, else one is given.

@SEX@         Changes user's sex.  Takes no parameters.

@ARMOUR@      Changed!  Changes Armour Name to built in name.

@WEAPON@      Changed!  Changes Weapon Name to built in name.

@WEIRDEVENT@  Changes if user will have a weird event in the forest, that
              is if they will find gems when entering.

@SPIRITS@     Changes the player's spirits, from high to low or from low
              to high.

@HEAL@        Heal the player.

     06/11/08 Note: The IGMs and RHPTEST as of 06/09/2008 will now
     automatically inform the player that all of their injuries were
     healed.  The RHP scripts don't have to tell them that now.
---------------------------------------------------------------------------

                   For LordCave v1.5+, RHPTest v1.2+ usage:

@BARDSONG@       Indicates whether player has have heard Bard Sing.

@FLIRTED@        Indicates whether player has Flirted with Player yet.

@SETHVIOLET@     Indicates whether player has Flirted with either
                 Violet or Seth Able.  The field's value is based
                 on the player's Sex.  If they are Male, it applies
                 to Flirted with Violet.  Otherwise, it applies to
                 Flirted with Seth Able.
------------
@SEENMASTER@     Indicates whether player has Seen their Master yet.

@SEENDRAGON@     Indicates whether player has Seen the Red Dragon yet.

-- Neither indicates WHAT happened during an event, just that
   there was an encounter with either a Training Master or with
   the Red Dragon.  LORD may change the stat's value only if the
   player actually fights the Master, or fights the Dragon.
-----------------------------------------------------------------

Variables like these work like the older LORD style codes, you put them
in a string to Output, and they get replaced by the corresponding value.
Place the word you want in between @*@ like so:

  Example: `4Hello, @*@NAME@*@!

These codes all require LORD Cavern v1.4+, Outlands Tavern v1.3+,
The Gateway v1.2+, Forest Outhouse v2.10+, or RHPTest v1.2+, in
order for them to be usable:

ALLGOLD    : Player's total gold (In Hand + In Bank)
ARMOUR     : Player's Armour Name (same as `a)
BANK       : Player's Bank Gold
CHARM      : Player's charm
CLASS      : Player's class (eg. "Death Knight")
DEFENCE    : Player's defense
DEFENSE    : Player's Defense points        (v1.4+)
EXPERIENCE : Player's experience
FIGHTS     : Player's Human Fights left
FOREST     : Player's Forest Fights left
GOLD       : Player's gold on hand
HITPOINTS  : Player's current hitpoints
HITMAX     : Player's maximum hitpoints
KILLS      : Player's number of player kills
KIDS       : Player's number of kids
LAYS       : Player's number of lays
LEVEL      : Player's level
NAME       : Player's name (same as `n lord code)
MARRIED    : Player's Spouse's name (same as `m)
STRENGTH   : Player's strength
SKILL      : Player's skill level for current class
SKILLUSE   : Skill Use Points for current Skill. {v1.4+}
VARIABLE1  : RHP variable 1
VARIABLE2  : RHP variable 2
VARIABLE3  : RHP variable 3
VARIABLE4  : RHP variable 4
VARIABLE5  : RHP variable 5
WEAPON     : Player's Weapon Name (same as `w)
WINS       : Number of times player has won
------------------------------------------------------------------

These 3 codes require LORD Cavern v1.5+, Outlands Tavern v1.4+,
The Gateway v1.3+, Forest Outhouse v2.50+, or RHPTest v1.3+, in
order for them to be usable:

ARMORNUM   : Armour Number.                        {Added 06/18/2003}
             {LordCave v1.5+, RHPTest 1.3+}

ARMOURNUM  : Armour Number.  Alternative spelling. {Added 06/21/2003}
             {LordCave v1.5+, RHPTest 1.3+}

WEAPONNUM  : Weapon Number.                        {Added 06/21/2003}
             {LordCave v1.5+, RHPTest 1.3+}

* The IGM must have been released after June 18th, 2003 in order
  for it to support usage of ARMORNUM, WEAPNUM, or WEAPONNUM.
=================================================================

The following codes can be put anywhere in a line, even in Mail
and News recording.  They are case sensitive, and will output
the correct case if they're at the beginning of a sentence.

`n  Put player's name
`a  Put player's Armour Name
`w  Put player's Weapon Name
`m  Put player's Spouse's name if married
`l  Do NOT perform line feed (put at the end of a line)
`s  Put player's sex (he/she)
`o  Put player's opposite sex (he/she)
`[  Put player's sex possessive (his/her)
`]  Put player's opposite sex possessive (his/her)

`<  Put player's sex (him/her)
`>  Put player's opposite sex (him/her)
-------------------------

Note: Old RHP Scripts for IGMs released before June 2003
      will have to be rechecked if these two codes (`< and `>)
      are used.  Glitch was found while Outlands Tavern v1.4B
      Beta was in development.  It was inserting "his/her"
      incorrectly, where "him/her" *SHOULD* have been in use.
      In O.T. v1.4b beta - "him/her" usage was restored.

This problem was fixed permanently when these IGM versions were
released.  LORD Cavern v1.6;  The Gateway v1.2;  Forest Outhouse
v2.20;  RHP Toolkit v1.3;  and Outlands Tavern v1.5.
------------------------------------------------------------

The LORD text color codes that are listed earlier in this file
may also be used in text messages written either to the screen,
to a MAIL file, or to the LORD lognow.txt News file.

Thanks to Gary Hartzell who wrote up the LORD Color Codes info
for me back in 2003.  Email: gary.hartzell@verizon.net
========================================================================


Usage of CLEANMODE RHP Code:
-------------------------------------------
Note: CLEANMODE did not work correctly in some IGMs until after
Sept. 20th, 2005.  Any IGM released after 2005 will run it
without problems.
----------------------------------------

CLEANMODE - Used in script to do one set of commands if LORD is
    in Clean Mode.  Second set done if LORD is in normal mode.
    Here are two examples of how to use it:

@IF@ CLEANMODE `1You're naughty!
-- If LORD is in clean mode, it displays the "You're naughty" phrase
on screen.  Can also be used with the @GOTO@ command, etc.

@IFNOT@ CLEANMODE <your statement>
-- If Clean mode NOT in use, then <your statement> content is
displayed on-screen.  Usable with @GOTO@ command, etc.

@IFNOT@ note:  All variables that can be used with @IF@ may also
be used with @IFNOT@.
-------------------------------------------------------------


Usage of the @VARIABLEx@ Codes:  07/16/2002
-------------------------------------------
The @VARIABLE1@ through @VARIABLE5@ codes may be used in The
LORD Cavern, Outlands Tavern, and The Gateway to store math
computation data that are multi-step.  IOW, the standard RHP scripts
easily handle x*y type mathematics.  But something like A*B/C would
require two separate math computation statement lines in a script.

You store data in the five VARIABLE codes while getting to your
final result for complex math.

To code GOLD = LEVEL*2*GEMS would be done like this:

It is not necessary to preset the VARIABLE codes to Zero,
unless they have been previously used in the RHP Script.

  Statement #1: @VARIABLE1@ =0    (Optional)
         (Presets variable #1 for data handling)

  Statement #2: @VARIABLE2@ =0    (Optional)
         {Presets variable #2 for data handling}

  Statement #3: @VARIABLE1@ =LEVEL*2
         {Assigns result of Level * 2 to Variable1.}

  Statement #4: @VARIABLE2@ =VARIABLE1*GEMS
         {Assigns result of Variable1 * Gems to Variable2.}

  Statement #5: @GOLD@ =VARIABLE2
         {Assigns amount stored in Variable2 to Gold in Hand.

         This WIPES out the player's old Gold balance, which
         can NOT be recovered afterwards.

  Alternate coding:
         @GOLD@ +VARIABLE2   Adds amount to Gold in Hand.
         @GOLD@ -VARIABLE2   Deducts amount from Gold stat.

Notes:  Do not include blanks between values in the math statements.
You need one blank space before the = sign.  With statement #5,
you MUST use the = sign to get such commands to work.

In all cases, the IGM will not raise the Gold in Hand, Gold
in Bank, and Experience LORD stats above Two Billion.  It
will not raise any INTEGER LORD stat above 32,000.

When dealing with the Skill Points and Skill Use Points stats,
it may be necessary to include an IF statement that will make
sure they are not set to values above 100.  Example:

@IF@ SKILL>100 @SKILL@ =100

If player's Skill Class is Death Knight, this command will
reset the SkillW LORD stat to 100, if its value is above 100.

@IF@ SKILLUSE>100 @SKILLUSE@ =100

This would reset Death Knight Skill Use Points to 100, if
the stat was over 100, and Skill Class is 1 for the player.
----------------------------------------

06/11/08 note: Current betas of LORD Cavern, Outlands Tavern,
and RHPTEST will not allow an RHP Script command to raise the
value of a LORD Skill Points stat above 100.  However, there
is a glitch that allows them to be reset to negative numbers.
That will be fixed soon.
=========================================================


############################################################
July 2002 - June 2003 RHP Language Changes Summary:
----------------------------------------

1) Corrected error in handling of the sex gender codes <,>.  If
   player is female, script processes the `< code and inserts "her"
   on-screen.  If male, "him" is written. For female player, use of
   the `> code inserts "him" on-screen. The male player sees "her"
   on-screen.  06/18/03 Note.

2) Fixed omission in earlier IGM version releases of GEMS@*@ usage.
   When used, replaces value of @GEMS@ with the LORD stat's value.

3) 07/15/02: Applies to RHPTest v1.2+, and the November 2002 LORD
   IGM releases.  04/14/03: Applies to The Forest Outhouse v2.10+ IGM:

   Old copies of the IGM's CODES.TXT files referred to @FIGHT@
   code for Forest Fights.  It is actually @FIGHTS@, so be to
   sure to use the ending 's'.

4) Created/tested new RHP Codes: ARMORNUM, ARMOURNUM, WEAPONNUM,
   and SCRIPTVERSION.

5) Fixes done to RHP Language handling of VARIABLEx codes.
   They now support lower boundary of -2 billion.

6) Enabled use of various Boolean-type VARs with IF commands.
   Ex. @VARIABLE1@ SKILL*2
       If SKILL is 25 points, then 50 is assigned to the
       VARIABLE1 code.

7) The KIDS code now allows adoption, via script, of Kids up
   to a maximum of 32,000.  This bypasses any limits on Daily
   Adoptions that may be in use by an IGM.

8) These RHP Codes are usable with "@VARIABLE1@ FEMALE*2" type commands
   now.  In this context, they are for use with @IF@ commands or in
   assigning their respective value to the VARIABLE code being used.

   Example: If player is female, it multiplies FEMALE's value (5) by 2,
            and assigns result (10) to VARIABLE1.

   FEMALE - value is 5.  FIGHTER - value is 1.  MAGIC - Value is 2.
   THIEF - value is 3.  ARMORNUM, ARMOURNUM, and WEAPONNUM number codes -
   Substitutes the player's item number.
------------------------------------------------------------


############################################################
July 2003 RHP Language Changes Summary:
----------------------------------------

8) Usable with VARIABLE codes in math statements, as of
   07/02/2003:  MALE, FEMALE, HORSE. FLIRTED, BARDSONG, SEENMASTER,
   SEENDRAGON, SPIRITS, FAIRY, WEIRDEVENT, and SETHVIOLET codes.

   If player is Male, value is 1. If female, value is 2.

   Used 0/1 value for Horse, Flirted, BardSong, SeenMaster, SeenDragon,
   Spirits, Fairy, WeirdEvent, and SethViolet.  If code/stat is
   True/activated, its value will be 1.

========================================
   ** Requires use of betas or official versions, dated July 2003
   or later, of each IGM or of RHPTest.

   Specifically, these RHP codes work with The Gateway v1.2 and
   v1.3;  The LORD Cavern v1.6 and v1.7;  The Outlands Tavern
   v1.5, v1.5a, and v1.6;  The Forest Outhouse v2.20 and v2.50;
   or RHPTest v1.3, v1.4, and v1.5.  { Revised paragraph 09/20/2005. }
------------------------------------------------------------


############################################################
December 2003 Changes -- Outlands Tavern v1.5+ IGMs:

Also applicable to Forest Outhouse v2.00+, LORD Cavern v1.6+,
The Gateway v1.2+, and RHPTest v1.3+ programs.
----------------------------------------

When you use RHP Code in a script to reduce the player's
Hitpoints, one result was unforseen previously.  When a RHP
script being tested, using @HITPOINTS@ %-90 statement, was
executed repeatedly by player, they ended up eventually with
Zero Hitpoints.

The IGM continued to allow them to stay inside the Tavern.
The Tavern IGM was adjusted to declare the player is Dead,
when that happens, and it ejects them back to LORD.
Which in turn does its customary "You got killed" stuff.
                              
Also, when executing a proposed reward in RHP scripts, the IGM
now deals with situations where the affected LORD stat is over
the allowed LORD limit.  E.g.: Seth Robinson said that IGM
writers were to not raise Experience above 2 Billion points.  But
some IGMs did not follow that rule.  Free World is one example.

So when the RHP script reward event encounters an above-range
LORD stat, the proposed reward now becomes an actual penalty,
with result that the LORD stat is lowered to its upper limit.

This is handled internally by the IGM and does not require any
modification of how you write your RHP scripts.
-------------------------------------------------------

06/11/08 Note: None of the IGMs or RHPTEST will process
commands such as @HITPOINTS@ %-90 any more.  It was simply
too difficult to get the programs to work correctly using
% commands of any type.  So usage of %+, %-, %* or %/ is
no longer allowed in RHP scripts.
------------------------------------------------------------


#########################################################
July 2004 Notices:
------------------
07/22/04 Note: LEVEL, CLASS, and WINS are display-only
variables, which can't be set to a different value by the
script writer.  You can do arithmetic operations WITH them,
but you can NOT change their actual codes in any way.

This decision was made in 2004 after discussing the issues
of what LORD codes should be modifiable in a RHP script
with Michael Preslar, who is the developer of the LORD games.
------------------------------------------------------------

07/22/04 Note: Due to an omission years ago of code covering the
GEMS Lord stat, if you wish to display the value of Gems, you
will have to use a @VERSION@ code line value that matches The
Gateway v1.1B+, LORD Cavern v1.5B+, The Outlands Tavern v1.4B+,
The Forest Outhouse v2.15+, or RHPTest v1.3+.
------------------------------------------------------------


############################################################
September 2005 RHP Language Changes Summary:
----------------------------------------

1) LORD Cavern - Development for version 1.7 release was
   started in June 2004.  v1.7 was released on June 11th, 2005.

2) Outlands Tavern - Version 1.5 was released on Jan. 01th, 2004.
   v1.5a was released released on Jan. 05, 2004.
   v1.6 was released on June 11th, 2005.

3) RHPTest/LordType - v1.4 development was started in mid-June
   2004.  V1.4 was released on June 11th, 2005.  V1.5 was
   released on September 20th, 2005.

4) Forest Outhouse - Resumed development in late September 2004.
   Version 2.50 was released on June 11th, 2005.

5) The Gateway - Resumed development in mid-October 2004.
   Version 1.3 was released on June 11th, 2005.

5) Updates of the Outlands Tavern RHP Set (OTRHP1.ZIP), and of
   the Forest Outhouse RHP Set (FORHP1.ZIP), -- text files
   primarily - are available periodically from my web-site.

---------------------------------------------------------------
6) The Gateway v1.2, The Forest Outhouse v2.20, and RHP Toolkit v1.3
   LORD programs were officially released on November 09, 2003.

7) The Gateway v1.3, The Forest Outhouse v2.50, The L.O.R.D.
   Cavern v1.7, The Outlands Tavern v1.6, and RHP Toolkit v1.4
   LORD programs were officially released on June 11th, 2005.

-----------------------------------------------------------
8) RHP Toolkit v1.5 was officially released on Sept. 20, 2005.

They may be downloaded from these web-pages:
     http://camelot.legendarydragons.com/LordApps.htm
     -- Castle Camelot LORD Apps Page

     http://camelot.legendarydragons.com/camelot6.htm
     -- Castle Camelot LORD IGMs Page
     -- Includes download links for current version of RHPTest
        and LordType utilities tool-kit package.
   -----------------------------------------------

Alternate download sites:
     http://www.filegate.net/camelot/lordfile/
     -- Camelot LordNews FDN

     http://archives.thebbs.org/ra98a.htm - covers IGMs.
     http://archives.thebbs.org/ra99a.htm - covers Utils.
        BBS Archives site is owned by Mike Ehlert.

     ftp://legendarydragons.com
------------------------------------------------------------


############################################################
August 2007 Notes:   {section created on 08/21/2007]
------------------

ALLGOLD Notes:    {08/21/2007}
--------------------
Pascal programs can't handle any integer numbers that exceed
2,147,483,647, so if the Gold in Hand + Gold in Bank result goes
over that value, the ALLGOLD value shown on-screen or used in an
RHP script calculation will be a negative amount.  01-01-2004.

Changed Outlands Tavern v1.64+ betas to use 2,147,483,647 as
value of ALLGOLD whenever its computed value is a negative
number.  Change is applicable to RHPTEST v1.51+ betas and to
LORD CAVERN v1.71+ Betas.
------------------------------------------------------------

Math Formula usage Notes:   {08/21/2007}
--------------------
Only ONE math symbol (/,*,+,-,%) can be used in a single
script command.  @LAYS@ %-50, for example, doesn't work.

Commands such as @GOLD@ =HITMAX*2*LEVEL also do not work.

A LORD stat can not be set below/above its allowed data range.
Two examples: Stats such as GEMS or CHARM can only be set to
values between 0 and 32,000.  Stats such as GOLD and EXPERIENCE
can only be set to values between 0 and 2 Billion.

Any of the RHP-based programs released prior to 2007 are not
able to properly process multiplication or division formulas.
They also may not process percentage formulas accurately.  So
avoid their use in older RHP scripts.

The division commands did NOT work in late 2007 IGM tests
using the '/' symbol.  However, any beta of RHPTEST, LORD Cavern
or Outlands Tavern dated after March 2008 will properly process
division math operations that use either '/' or '\'. (06/11/08)
------------------------------------------------------------


############################################################
Issues related to the SKILL and SKILLUSE RHP Codes:
Section created 01/01/2004.
---------------------------------------------------

Since pre-v4.02 LORD versions only handled up to 40 Skill/Skill
Use points, usage of @SKILL@ and @SKILLUSE@ in mail*.dat files
*WOULD* result in either one being reset by LORD, when it
re-assumed control of the player, to 0-40 range values.  And
if you are using post-v4.02 LORD versions, they handle Skill
Points and Skill USE Points info in Mail files the same way.

So it is best to AVOID using SKILL or SKILLUSE in your RHP
Scripts.  Also those points are too valuable in LORD itself
to be simply granted to the user in an RHP Event -- especially
when the player could encounter the script multiple times
during the same IGM session.

Regardless of the LORD version number, LORD does not allow
any IGM, LADY Script, or RHP Script to raise the Skill Points
and Skill Use Points above 100.  The game also will not raise
the player's current Skill Class's Skill Points stat above 40,
when the player wins a fight with their Master.  Instead it
raises their Skill Use Points field by 1 point.

Anyone who uses Sherwood Forest LORD IGM has seen how usage
of that IGM when you had over 40 Skill Points can cause you
to lose a lot of hard-earned points.  The Lord Wheel IGM is
another IGM, also by Ken Weitzel, that also works that way.
The Free World IGM also has this problem.

There are other IGMs that will similarly reset a Skill Point
to 40, when it supposedly rewards the player with a Skill
Point, and they had over 40 points already.  None of the IGMs
released by me have this problem.  Donald.  06/11/2008.
=============================================================


The RHPTCODE.TXT file was created by Jason Brown.  It was
initially named CODES.TXT in the IGMs and in RHPTEST, but
each file had to have different wording, which was confusing.
So each program's RHP Codes docs file was given its own
distinct filename.  Jason's email: jmbrown@pcisys.net

RhptCode.txt is copyright 2002-2011 by Jason Brown and Donald Tidmore.

Donald Tidmore, maintainer and updater of Jason's LORD programs.

My email: gtidmore@hiwaay.net, ktidmore@bellsouth.net,
       OR donald.tidmore@usa.net.
---------------------------------------------------------------

{ RHPTest Utility Docs - Version 1.68 Beta }

========================================================
11/01/07: To use RHP Toolkit v1.5x Betas, contact me via
Email for a copy of the current RHP-WORK.ZIP archive.

This docs file was completely rewritten on June 11th, 2008
and is synchronized with LORD Cavern's CAVECODE.TXT file.

Synchronized RHPTCODE.TXT with GATECODE.TXT on Oct 28, 2009.
--------------------------------------------------------

Revised on:   December 31, 2010 at 05:30 pm.

