<pre>
# Character Database Reference
# Last Modified: 2004-02-29 21:55
#  2004 Michael Wigley


CHARACTER ATTRIBUTES:

Variables that can be assigned to character in the game to handle special cases
and/or other times when flagging an item would be useful.

    CREATE TABLE $prefix_char_attrib (
      CharAttribId     bigint            unsigned NOT NULL auto_increment,
      CharAttribTarget int               unsigned NOT NULL default '0',
      CharAttribDeath  int               unsigned NOT NULL default '0',
      CharAttribKey    varchar(32)       NOT NULL default '',
      CharAttribValue  text,
      PRIMARY KEY     (CharAttribId),
      KEY              CharAttribCharId (CharAttribCharId),
      KEY              CharAttribKey    (CharAttribKey)
    ) TYPE=MyISAM;

CharAttribId:
Primary Key

CharAttribTarget:
Numeric reference to $prefix_items.ItemId for which item this attribute modifies.

CharAttribDeath:
Numeric time stamp representing the UNIX time that the attribute should expire.

CharAttribKey:
Text reference for this attribute

CharAttribValue:
Text field for storing the attribute value data


###############################################################################

CHARACTER EQUIPMENT SLOTS:

Links to $prefix_items.ItemId and are the real time, in game equipped items of a
given character.

    CREATE TABLE $prefix_char_equip (
      CharEquipId      int          unsigned NOT NULL default '0',
      CharEquipHead    int          unsigned NOT NULL default '0',
      CharEquipNeck    int          unsigned NOT NULL default '0',
      CharEquipChest   int          unsigned NOT NULL default '0',
      CharEquipArms    int          unsigned NOT NULL default '0',
      CharEquipBelt    int          unsigned NOT NULL default '0',
      CharEquipFeet    int          unsigned NOT NULL default '0',
      CharEquipRFinger int          unsigned NOT NULL default '0',
      CharEquipLFinger int          unsigned NOT NULL default '0',
      CharEquipRHand   int          unsigned NOT NULL default '0',
      CharEquipLHand   int          unsigned NOT NULL default '0',
      PRIMARY KEY     (CharEquipId)
    ) TYPE=MyISAM;

CharEquipId:
Primary Key

CharEquipHead:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of one.

CharEquipNeck:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of two.

CharEquipChest:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of three.

CharEquipArms:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of four.

CharEquipBelt:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of five.

CharEquipFeet:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of six.

CharEquipRFinger:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of seven.

CharEquipLFinger:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of eight.

CharEquipRHand:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of nine.

CharEquipLHand:
Links to $prefix_items.ItemId with $prefix_item_info.ItemInfoEquipLoc of ten.


###############################################################################

CHARACTER IMAGES:

Primary Database for storing character images.

    CREATE TABLE $prefix_char_appearance (
      CharImageId       int          unsigned NOT NULL default '0',
      CharImageBody     varchar(128) NOT NULL default '',
      CharImageHair     varchar(128) NOT NULL default '',
      CharImageSkinHF   varchar(64),
      CharImageSkinPF   varchar(64),
      CharImageHairHF   varchar(64),
      CharImageHairPF   varchar(64),
      CharImageGDImage  varchar(128) NOT NULL default '',
      CharImagePortrait varchar(128) NOT NULL default '',
      PRIMARY KEY  (CharImageId)
    ) TYPE=MyISAM;

CharImageId:
Primary Key

CharImageBody:
Physical path to the body image or image template if CharImageSkinPF and/ or
CharImageSkinHF is set; file paths are relative to ???

CharImageHair:
Physical path to the hair image or image template if CharImageHairPF and/ or
CharImageHairHF is set; file paths are relative to ???

CharImageSkinHF:
serialized array of the RGB values for the Highlight Fill color (index (255,255,255))
if using GD enhanced body images.  The array should be of the format array("RED"=>
$rVal,"BLUE"=>$bVal,"GREEN"=>$gVal);

CharImageSkinPF:
serialized array of the RGB values for the Primary Fill color (index (255,255,255))
if using GD enhanced body images.  The array should be of the format array("RED"=>
$rVal,"BLUE"=>$bVal,"GREEN"=>$gVal);

CharImageHairHF:
serialized array of the RGB values for the Highlight Fill color (index (255,255,255))
if using GD enhanced hair images.  The array should be of the format array("RED"=>
$rVal,"BLUE"=>$bVal,"GREEN"=>$gVal);

CharImageHairPF:
serialized array of the RGB values for the Primary Fill color (index (255,255,255))
if using GD enhanced hair images.  The array should be of the format array("RED"=>
$rVal,"BLUE"=>$bVal,"GREEN"=>$gVal);

CharImageGDImage:
Path to GD processed image of all equipped items, hair, body and any other merged
images into one cached image that is updated on equip/unequip.

If item templates images are used then character will be able to assign different
colors to characters (generate by GD) without having to posses an image for every
color. Image templates replace a standard image color [primary fill RGB index
(255,255,255) and highlight fill RGB (128,128,128)] with a specific RGB
replacements as defined in ItemImagePR and ItemImageHL. If both of these values are
not set the image may or may not be a template and thus no GD processing is
preformed. The GD created images are stored in PHPRPG_DIR.'/tmp/sprites/'

CharImagePortrait:
Path to the static portrait image; file paths are relative to
PHPRPG_DIR.'/share/images/portraits/'


###############################################################################

CHARACTER RACE

Used to define commonalities among different player characters as well as hold any
race specific default data a particular character has.

    CREATE TABLE $prefix_char_race (
      CharRaceId       int         unsigned NOT NULL default '0',
      CharRaceSize     smallint    unsigned NOT NULL default '0',
      PRIMARY KEY     (CharRaceId)
    ) TYPE=MyISAM;

RaceId:
Primary Key

RaceSize:
Numeric value representing the relative sizes of a race in the game world;
microscopic = zero, tiny = one, small = two, normal = three, large = four, huge =
five, gigantic = six, colossal = seven.  Should be used by the equipping functions
to limit character size and item size so that small characters aren't generally
able to use gigantic things and vice versa.

RaceSkills:

RaceSpells:

RaceStats:


###############################################################################

CHARACTER STATS:

    CREATE TABLE $prefix_char_stats (
      CharStatId       int         unsigned NOT NULL default '0',
      CharStatStr      smallint    NOT NULL default '0',
      CharStatVit      smallint    NOT NULL default '0',
      CharStatAgl      smallint    NOT NULL default '0',
      CharStatDex      smallint    NOT NULL default '0',
      CharStatInt      smallint    NOT NULL default '0',
      CharStatWis      smallint    NOT NULL default '0',
      CharStatKrm      smallint    NOT NULL default '0',
      CharStatAge      smallint    unsigned NOT NULL default '0',
      CharStatAC       smallint    NOT NULL default '0',
      CharStatHPCur    smallint    unsigned NOT NULL default '0',
      CharStatHPMax    smallint    unsigned NOT NULL default '0',
      CharStatManaCur  smallint    unsigned NOT NULL default '0',
      CharStatManaMax  smallint    unsigned NOT NULL default '0',
      CharStatStmCur   smallint    unsigned NOT NULL default '0',
      CharStatStmMax   smallint    unsigned NOT NULL default '0',
      CharStatCapCur   smallint    unsigned NOT NULL default '0',
      CharStatCapMax   smallint    unsigned NOT NULL default '0',
      PRIMARY KEY     (CharStatId)
    ) TYPE=MyISAM;

StatId:
Primary Key

CharStatStr:
Numeric value representing the characters strength

CharStatVit:
Numeric value representing the characters vitality

CharStatAgl:
Numeric value representing the characters agility

CharStatDex:
Numeric value representing the characters dexterity

CharStatInt:
Numeric value representing the characters intelligence

CharStatWis:
Numeric value representing the characters wisdom

CharStatKrm:
Numeric value representing the characters karma

CharStatAge:
Numeric value representing the characters age

CharStatHPCur:
Numeric value representing the characters current hit points

CharStatHPMax:
Numeric value representing the characters max hit points

CharStatManaCur:
Numeric value representing the characters current manna

CharStatManaMax:
Numeric value representing the characters max manna

CharStatStmCur:
Numeric value representing the characters current stamina

CharStatStmMax:
Numeric value representing the characters max stamina

CharStatCapCur:
Numeric value representing the characters current carrying capacity

CharStatCapMax:
Numeric value representing the characters max carrying capacity


###############################################################################

CHARACTERS:

Records for all real time, in game characters

    CREATE TABLE $prefix_chars (
      CharId        int          unsigned NOT NULL auto_increment,
      CharUser      int          unsigned NOT NULL default '0',
      CharRace      smallint     unsigned NOT NULL default '0',
      CharMapId     smallint     unsigned NOT NULL default '0',
      CharLocId     bigint       unsigned NOT NULL default '0',
      CharName      varchar(16)  NOT NULL default '',
      PRIMARY KEY  (CharId),
      KEY           CharUser    (CharUser),
      KEY           CharMapId   (CharMapId,CharLocId)
    ) TYPE=MyISAM;

CharId:
Primary Key

CharRace:
Links to $prefix_char_race.CharRaceId

CharUser:
Links to $prefix_users.UserId

CharMapId:
Numeric value representing the map that the character is currently on.

CharLocId:
Numeric value representing the map location where the character is currently on.

CharName:
Text name of the character

###############################################################################

</pre>