OSDN Git Service

使われなくなった関数do_cmd_pray()を削除.
[hengband/hengband.git] / src / birth.c
index f74908f..8dde0a1 100644 (file)
@@ -1,11 +1,11 @@
 /* Purpose: create a player character */
 
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
 #include "angband.h"
@@ -728,7 +728,7 @@ static hist_type bg[] =
 
 
 #ifdef JP
-       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
+       {"¤¢¤Ê¤¿¤Ï½÷²¦¥¯¥é¥å³¥ó¤Î²¿¿Í¤«¤Î»Ò¶¡¤Î¤¦¤Á¤Î°ì¿Í¤Ç¤¹¡£"
        , 100, 84, 85, 50 },
 
        {"¤¢¤Ê¤¿¤ÏÀÖ¤¤È©¤È", 40, 85, 86, 50 },
@@ -1353,7 +1353,7 @@ static hist_type bg[] =
        {"¤¢¤Ê¤¿¤Ï°­¤òÌǤܤ¹¤¿¤á¤Ë¤³¤ÎÃϤËÁ÷¤é¤ì¤Æ¤­¤Þ¤·¤¿¡£", 100, 143, 144, 80},
        {"¤³¤ÎÌÜŪ¤òÀ®¤·¿ë¤²¤ë¤Þ¤Ç¤ÏµÙ¤à¤³¤È¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£", 100, 144, 0, 80},
 #else
-       {"You are of the blessed host of heaven.", 100, 142, 143, 80},
+       {"You are of the blessed host of heaven.  ", 100, 142, 143, 80},
        {"You have been sent to earth to eradicate the wicked, ", 100, 143, 144, 80},
        {"and shall not rest until you have succeeded.", 100, 144, 0, 80},
 #endif
@@ -1619,7 +1619,7 @@ static cptr race_jouhou[MAX_RACES] =
   
 "¥¨¥ë¥Õ¤Ï¿Í´Ö¤è¤êÎɤ¤ËâË¡»È¤¤¤Ë¤Ê¤ì¤Þ¤¹¤¬¡¢ÀïÆ®¤Ï¶ì¼ê¤Ç¤¹¡£Èà¤é¤Ï¿Í´Ö¤ä¥Ï¡¼¥Õ¥¨¥ë¥Õ¤è¤ê¤âƬ¤¬Îɤ¯¡¢¹â¤¤¸­¤µ¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¥¨¥ë¥Õ¤Ïõº÷, ²ò½ü, ÃγÐ, ±£Ì©¹ÔÆ°, ¼Í·â, ¤½¤·¤ÆËâË¡Æ»¶ñ»ÈÍѤÇÍ¥¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢Éð´ï¤Î°·¤¤¤ÏÆÀ°Õ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£Èà¤é¤ÏÀ¸¤Þ¤ì¤Ä¤­¸÷¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
-"¥Û¥Ó¥Ã¥È¡¢¤Þ¤¿¤Ï¥Ï¡¼¥Õ¥ê¥ó¥°¤ÏµÝ¤äÅêÚ³¤ËŤ±¡¢ËâË¡Ëɸæ¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Ãµº÷, ²ò½ü, ÃγÐ, ¤½¤·¤Æ±£Ì©¹ÔÆ°¤Ç¤â¤È¤Æ¤âÎɤ¤Ç½ÎϤò¼¨¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Èà¤é¤ÏÍ¥¤ì¤¿Åð±¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ê¤·¤«¤·¡¢¡ÖǦ¤Ó¤Î¼Ô¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤ò¹¥¤ß¤Þ¤¹¡Ë¡£¥Û¥Ó¥Ã¥È¤Ï¿Í´Ö¤è¤êÍÚ¤«¤ËÉϼå¤Ç¡¢Àï»Î¤È¤·¤Æ¤Ï¤Æ¤ó¤Ç¥À¥á¤Ç¤¹¡£Èà¤é¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Û¥Ó¥Ã¥È¤Ï´ïÍѤµ¤ò²¼¤²¤é¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤»¤ó¡£",
+"¥Û¥Ó¥Ã¥È¡¢¤Þ¤¿¤Ï¥Ï¡¼¥Õ¥ê¥ó¥°¤ÏµÝ¤äÅêÚ³¤ËŤ±¡¢ËâË¡Ëɸæ¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Ãµº÷, ²ò½ü, ÃγÐ, ¤½¤·¤Æ±£Ì©¹ÔÆ°¤Ç¤â¤È¤Æ¤âÎɤ¤Ç½ÎϤò¼¨¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Èà¤é¤ÏÍ¥¤ì¤¿Åð±¤È¤Ê¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ê¤·¤«¤·¡¢¡ÖǦ¤Ó¤Î¼Ô¡×¤È¸Æ¤Ð¤ì¤ë¤³¤È¤ò¹¥¤ß¤Þ¤¹¡Ë¡£¥Û¥Ó¥Ã¥È¤Ï¿Í´Ö¤è¤êÍÚ¤«¤ËÉϼå¤Ç¡¢Àï»Î¤È¤·¤Æ¤Ï¤Æ¤ó¤Ç¥À¥á¤Ç¤¹¡£Èà¤é¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Èà¤é¤ÏÀ¸Ì¿ÎϤòÊÝ»ý¤¹¤ëÎϤ¬¶¯¤¯¡¢À¸Ì¿Îϵۼý¹¶·â¤ËÂФ·¤ÆÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
 "¥Î¡¼¥à¤Ï¥É¥ï¡¼¥Õ¤è¤ê¾®¤µ¤¤¤Ç¤¹¤¬¡¢¥Û¥Ó¥Ã¥È¤è¤ê¤ÏÂ礭¤¤¼ï²¤Ç¤¹¡£Èà¤é¤Ï¥Û¥Ó¥Ã¥ÈƱÍÍÃÏɽ¤Îƶ·ê¤Î¤è¤¦¤Ê²È¤Ë½»¤ó¤Ç¤¤¤Þ¤¹¡£¥Î¡¼¥à¤Ï¤È¤Æ¤âÎɤ¤ËâË¡Ëɸæ¤ò»ý¤Á¡¢Ãµº÷, ²ò½ü, ÃγÐ, ±£Ì©¹ÔÆ°¤Ç¤âÍ¥¤ì¤Æ¤¤¤Þ¤¹¡£Èà¤é¤Ï¿Í´Ö¤è¤êÄ㤤ÏÓÎϤò»ý¤Á¡¢Éð´ï¤ò»ý¤Ã¤Æ¤ÎÀïÆ®¤Ï¶ì¼ê¤Ç¤¹¡£¥Î¡¼¥à¤Ï¤«¤Ê¤êÎɤ¤ÀÖ³°Àþ»ëÎϤò»ý¤Ã¤Æ¤ª¤ê¡¢²¹·ìưʪ¤òÎ¥¤ì¤¿¾ì½ê¤«¤é¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Î¡¼¥à¤ÏÀ¸¤Þ¤ì¤Ä¤­Ëãáã¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£",
   
@@ -1695,7 +1695,7 @@ static cptr race_jouhou[MAX_RACES] =
 
 "Elves are better magicians then humans, but not as good at fighting.  They tend to be smarter and faster than either humans or half-elves and also have better wisdom.  Elves are better at searching, disarming, perception, stealth, bows, and magic, but they are not as good at hand weapons.  They resist light effects intrinsically.",
 
-"Hobbits, or Halflings, are very good at bows, throwing, and have good saving throws.  They also are very good at searching, disarming, perception, and stealth; so they make excellent rogues, but prefer to be called burglars.  They are much weaker than humans, and no good at melee fighting.  Halflings have fair infravision, so they can detect warm creatures at a distance.  They have their dexterity sustained.",
+"Hobbits, or Halflings, are very good at bows, throwing, and have good saving throws.  They also are very good at searching, disarming, perception, and stealth; so they make excellent rogues, but prefer to be called burglars.  They are much weaker than humans, and no good at melee fighting.  Halflings have fair infravision, so they can detect warm creatures at a distance.  They have a strong hold on their life force, and are thus intrinsically resistant to life draining.",
 
 "Gnomes are smaller than dwarves but larger than Halflings.  They, like the hobbits, live in the earth in burrow-like homes.  Gnomes make excellent mages, and have very good saving throws.  They are good at searching, disarming, perception, and stealth.  They have lower strength than humans so they are not very good at fighting with hand weapons.  Gnomes have fair infra-vision, so they can detect warm-blooded creatures at a distance.  Gnomes are intrinsically protected against paralysis.",
 
@@ -1815,7 +1815,7 @@ static cptr class_jouhou[MAX_CLASS] =
   
 "µ³Ê¼¤ÏÇϤ˾è¤êÀï¾ì¤ò¶î¤±È´¤±¤ë¥¨¥ê¡¼¥ÈÀï»Î¤Ç¤¹¡£ËâË¡¤Ï»È¤¨¤Þ¤»¤ó¤¬¡¢ÇϾ夫¤é¤Î°µÅÝŪ¤Ê¹¶·âÎϤò¸Ø¤ë¾å¤Ë¡¢¹â¤¤µ¡Æ°ÎϤòÀ¸¤«¤·¤¿¼Í·â¤ò¤âÆÀ°Õ¤È¤·¤Æ¤¤¤Þ¤¹¡£¥ì¥Ù¥ë¤¬¾å¤¬¤ì¤Ð¡¢ÌîÀ¸¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤Þ¤¿¤¬¤ê̵ÍýÌðÍý¼ê¤Ê¤º¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Èà¤é¤Ï¸Ê¤ÎÆùÂΤÈÀº¿À¤Ë¸Ø¤ê¤ò»ý¤Á¡¢ËâË¡Æ»¶ñ¤Ë¤Ï¤¢¤Þ¤êÍê¤í¤¦¤È¤Ï¤·¤Þ¤»¤ó¡£",
   
-"¶¸Àï»Î¤ÏÅܤ궸¤Ã¤ÆÉð´ï¤ò¿¶¤ë¤¦¶²¤ë¤Ù¤­Àï»Î¤Ç¤¹¡£Á´¿¦¶ÈÃæºÇ¹â¤ÎÆùÂÎǽÎϤò¸Ø¤ê¡¢¶²ÉݤÈËãáã¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Á¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ì¤Ð¤½¤Î¶¯¿Ù¤ÊÆùÂΤÇÌð¤Î¼öʸ¤òÄ·¤ÍÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËÉð´ï¤Ê¤·¤ÇÀ臘¤³¤È¤ä¡¢¼ö¤¤¤Î¤«¤±¤é¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤¹¤³¤È¤¬¤Ç¤­¡¢¤¤¤¯¤Ä¤«¤Îµ»¤ò(È¿ËâË¡¾õÂ֤Ǥâ)»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¡¢´¬Êª¤äËâË¡Æ»¶ñ¤ÏÁ´¤¯»È¤¦¤³¤È¤¬¤Ç¤­¤º¡¢æ«¤Î²ò½ü¤ä±£Ì©¹ÔÆ°¡¢Ãµº÷¡¢ËâË¡Ëɸ桢Èô¤ÓÆ»¶ñ¤Îµ»Ç½¤Ë´Ø¤·¤Æ¤ÏÀä˾Ū¤Ç¤¹¡£¤Ò¤¿¤¹¤é²¥¤Ã¤ÆÆ»¤ò³«¤¯¤·¤«¤¢¤ê¤Þ¤»¤ó¡£¥¢¥ó¥Ð¥é¥¤¥È¤ÈÍ©Îî¤ÏÈó¾ï¤Ë¾¡Íø¤·¤ä¤¹¤¤¤Ç¤¹¤¬¥¹¥³¥¢¤¬¤«¤Ê¤êÄ㤯½¤Àµ¤µ¤ì¤Þ¤¹¡£",
+"¶¸Àï»Î¤ÏÅܤ궸¤Ã¤ÆÉð´ï¤ò¿¶¤ë¤¦¶²¤ë¤Ù¤­Àï»Î¤Ç¤¹¡£Á´¿¦¶ÈÃæºÇ¹â¤ÎÆùÂÎǽÎϤò¸Ø¤ê¡¢¶²ÉݤÈËãáã¤ËÂФ¹¤ëÂÑÀ­¤ò»ý¤Á¡¢¥ì¥Ù¥ë¤¬¾å¤¬¤ì¤Ð¤½¤Î¶¯¿Ù¤ÊÆùÂΤÇÌð¤Î¼öʸ¤òÄ·¤ÍÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤µ¤é¤ËÉð´ï¤Ê¤·¤ÇÀ臘¤³¤È¤ä¡¢¼ö¤¤¤Î¤«¤±¤é¤ì¤¿ÁõÈ÷¤òÎϤŤ¯¤ÇÇí¤¬¤¹¤³¤È¤¬¤Ç¤­¡¢¤¤¤¯¤Ä¤«¤Îµ»¤ò(È¿ËâË¡¾õÂ֤Ǥâ)»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¡¢´¬Êª¤äËâË¡Æ»¶ñ¤ÏÁ´¤¯»È¤¦¤³¤È¤¬¤Ç¤­¤º¡¢æ«¤Î²ò½ü¤ä±£Ì©¹ÔÆ°¡¢Ãµº÷¡¢ËâË¡Ëɸ桢Èô¤ÓÆ»¶ñ¤Îµ»Ç½¤Ë´Ø¤·¤Æ¤ÏÀä˾Ū¤Ç¤¹¡£¤Ò¤¿¤¹¤é²¥¤Ã¤ÆÆ»¤ò³«¤¯¤·¤«¤¢¤ê¤Þ¤»¤ó¡£Í©Îî¤ÏÈó¾ï¤Ë¾¡Íø¤·¤ä¤¹¤¤¤Ç¤¹¤¬¥¹¥³¥¢¤¬¤«¤Ê¤êÄ㤯½¤Àµ¤µ¤ì¤Þ¤¹¡£",
 
 "ÃÃÌê»Õ¤ÏÉð´ï¤äËɶñ¤ò¼«Ê¬¤Ç¶¯²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Æüì¸ú²Ì¤ò»ý¤ÄÉð´ï¤äËɶñ¤«¤éÆüì¸ú²Ì¤Î¸µ¤È¤Ê¤ë¥¨¥Ã¥»¥ó¥¹¤ò¼è¤ê½Ð¤·¡¢Ê̤ÎÉð´ï¤äËɶñ¤Ë¥¨¥Ã¥»¥ó¥¹¤òÉղ乤뤳¤È¤Ë¤è¤Ã¤Æ¤½¤ÎÆüì¸ú²Ì¤òÉղäǤ­¤Þ¤¹¡£¤¢¤ëÄøÅÙ¤ÎÀïƮǽÎϤâ»ý¤Á¤Þ¤¹¤¬¡¢ËâË¡¤Ï°ìÀÚ»ÈÍѤǤ­¤º¡¢±£Ì©¤äËâË¡Ëɸæ¤Îµ»Ç½¤âÄ㤯¤Ê¤ê¤Þ¤¹¡£",
 
@@ -1843,7 +1843,7 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "The Monk character class is very different from all other classes.  Their training in martial arts makes them much more powerful with no armor or weapons.  To gain the resistances necessary for survival a monk may need to wear some kind of armor, but if the armor he wears is too heavy, it will severely disturb his martial arts maneuvers.  As the monk advances levels, new, powerful forms of attack become available.  Their defensive capabilities increase likewise, but if armour is being worn, this effect decreases.  Wisdom determines a Monk's spell casting ability.",
 
-"The Mindcrafter is a unique class that uses the powers of the mind instead of magic.  These powers are unique to Mindcrafters, and vary from simple extrasensory powers to mental domination of others.  Since these powers are developed by the practice of certain disciplines, a Mindcrafter requires no spellbooks to use them.  The available powers are simply determined by the character's level.  Wisdom determines a Mindcrafter's ability to use mind powers,",
+"The Mindcrafter is a unique class that uses the powers of the mind instead of magic.  These powers are unique to Mindcrafters, and vary from simple extrasensory powers to mental domination of others.  Since these powers are developed by the practice of certain disciplines, a Mindcrafter requires no spellbooks to use them.  The available powers are simply determined by the character's level.  Wisdom determines a Mindcrafter's ability to use mind powers.",
 
 "High-mages are mages who specialize in one particular field of magic and learn it very well - much better than the ordinary mage.  For the price of giving up a second realm of magic, they gain substantial benefits in the mana costs, minimum levels, and failure rates in the spells of the realm of their specialty.  A high mage's prime statistic is intelligence as this determines his spell casting ability. ",
 
@@ -1871,7 +1871,7 @@ static cptr class_jouhou[MAX_CLASS] =
 
 "Cavalry ride on horses into battle.  Although they cannot cast spells, they are proud of their overwhelming offensive strength on horseback.  They are good at shooting.  At high levels, they learn to forcibly saddle and tame wild monsters.  Since they take pride in the body and the soul, they don't use magical devices well.",
 
-"A Berserker is a fearful fighter indeed, immune to fear and paralysis.  At high levels, Berserkers can reflect bolt spells with their tough flesh.  Furthermore, they can fight without weapons, can remove cursed equipment by force, and can even use their special combat techniques when surrounded by an anti-magic barrier.  Berserkers, however, cannot use any magical devices or read any scrolls, and are hopeless at all non-combat skills.  Since Berserker Amberite or Spectres are quite easy to *win* with, their scores are lowered.",
+"A Berserker is a fearful fighter indeed, immune to fear and paralysis.  At high levels, Berserkers can reflect bolt spells with their tough flesh.  Furthermore, they can fight without weapons, can remove cursed equipment by force, and can even use their special combat techniques when surrounded by an anti-magic barrier.  Berserkers, however, cannot use any magical devices or read any scrolls, and are hopeless at all non-combat skills.  Since Berserker Spectres are quite easy to *win* with, their scores are lowered.",
 
 "A Weaponsmith can improve weapons and armors for him or herself.  They can extract the essences of special effects from weapons or armors which have various special abilities, and can add these essences to another weapon or armor.  They are good at fighting, but cannot cast spells, and are poor at skills such as stealth or magic defense.",
 
@@ -1981,15 +1981,15 @@ static cptr realm_jouhou[VALID_REALM] =
 
 "Arcane magic is a general purpose realm of magic.  It attempts to encompass all 'useful' spells from all realms.  This is the downside of Arcane magic: while Arcane does have all the necessary 'tool' spells for a dungeon delver, it has no ultra-powerful high level spells.  As a consequence, all Arcane spellbooks can be bought in town.  It should also be noted that the 'specialized' realms usually offer the same spell at a lower level and cost. ",
 
-"Craft magic can strengthen the caster or equipments.  These spells greatly improve the caster's fighting ability, but spells that hurts opponents directly is not exist.",
+"Craft magic can strengthen the caster or the equipments.  These spells can greatly improve the caster's fighting ability.  Using them against opponents directly is not possible.",
 
 "Demon is a very evil realm, same as Death.  It provides various attack spells and devilish detection spells.  at higher levels, Demon magic provides ability to dominate demons, and to polymorph yourself into a demon.",
 
-"Crusade is a realm of 'Justice'; It does have many attack spells which are mostly used for harming and banishing foul minions of evil, and these spells are not so effective for good monsters.",
+"Crusade is a magic of 'Justice'.  It includes damage spells, which are greatly effective against foul and evil monsters, but have poor effects against good monsters.",
 
 "Music magic shows various effects as sing song.  There is two type of song; the one which shows effects instantly and the other one shows effect continuously until SP runs out.  But the latter type has a limit; only one song can be sing at the same time.",
 
-"The books of Kendo describes various combat technique.  it need to read the books when one studys the techniques, but it doesn't need to take around the books to use the techniques after one momorizes it.  It need a weapon wielded to use the techniques."
+"The books of Kendo describe about various combat techniques.  When learning new techniques, you are required to carry the books, but once you memorizes them, you don't have to carry them.  When using a technique, wielding a weapon is required."
 #endif
 };
 
@@ -2030,7 +2030,12 @@ static char realm_subinfo[VALID_REALM][41] =
  */
 static s16b stat_limit[6];
 
-static s16b chara_limit[6];
+static struct {
+       s16b agemin, agemax;
+       s16b htmin, htmax;
+       s16b wtmin, wtmax;
+       s16b scmin, scmax;
+} chara_limit;
 
 /*
  * Autoroll matches
@@ -2119,7 +2124,7 @@ static byte choose_realm(s32b choices, int *count)
        if (choices & CH_ENCHANT)
        {
                (*count)++;
-               auto_select = REALM_ENCHANT;
+               auto_select = REALM_CRAFT;
        }
        if (choices & CH_DAEMON)
        {
@@ -2297,7 +2302,7 @@ static byte choose_realm(s32b choices, int *count)
                else k = -1;
                if (c == '?')
                {
-#ifdef JP                 
+#ifdef JP
                        show_help("jmagic.txt#MagicRealms");
 #else
                        show_help("magic.txt#MagicRealms");
@@ -2307,9 +2312,9 @@ static byte choose_realm(s32b choices, int *count)
                {
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -2341,7 +2346,7 @@ static bool get_player_realms(void)
        p_ptr->realm2 = 255;
        while (1)
        {
-               char temp[80*8];
+               char temp[80*10];
                cptr t;
                count = 0;
                p_ptr->realm1 = choose_realm(realm_choices1[p_ptr->pclass], &count);
@@ -2355,9 +2360,9 @@ static bool get_player_realms(void)
                put_str("                                   ", 4, 40);
                put_str("                                   ", 5, 40);
 
-               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 74, temp);
+               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 74, temp, sizeof(temp));
                t = temp;
-               for (i = 0; i< 6; i++)
+               for (i = 0; i < 10; i++)
                {
                        if(t[0] == 0)
                                break; 
@@ -2381,9 +2386,9 @@ static bool get_player_realms(void)
                }
 else
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
        }
 
@@ -2418,7 +2423,7 @@ else
                        put_str("                                   ", 4, 40);
                        put_str("                                   ", 5, 40);
 
-                       roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm2)-1], 74, temp);
+                       roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm2)-1], 74, temp, sizeof(temp));
                        t = temp;
                        for (i = 0; i< 6; i++)
                        {
@@ -2443,9 +2448,9 @@ else
                                break;
                        }
 #ifdef JP
-                       else if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+                       else if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-                       else if (get_check("Are you sure? ")) break;
+                       else if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                }
                if (p_ptr->realm2)
@@ -2576,11 +2581,8 @@ static void load_prev_data(bool swap)
 
 /*
  * Returns adjusted stat -JK-  Algorithm by -JWT-
- *
- * auto_roll is boolean and states maximum changes should be used rather
- * than random ones to allow specification of higher values to wait for
  */
-static int adjust_stat(int value, int amount, int auto_roll)
+static int adjust_stat(int value, int amount)
 {
        int i;
 
@@ -2729,7 +2731,7 @@ void get_max_stats(void)
  */
 static void get_extra(bool roll_hitdie)
 {
-       int             i, j, min_value, max_value;
+       int i, j;
 
        /* Experience factor */
        if (p_ptr->prace == RACE_ANDROID) p_ptr->expfact = rp_ptr->r_exp;
@@ -2746,17 +2748,17 @@ static void get_extra(bool roll_hitdie)
 
        for (i = 0; i < 64; i++)
        {
-               if (p_ptr->pclass == CLASS_SORCERER) p_ptr->spell_exp[i] = 1600;
-               else if (p_ptr->pclass == CLASS_RED_MAGE) p_ptr->spell_exp[i] = 1200;
-               else p_ptr->spell_exp[i] = 0;
+               if (p_ptr->pclass == CLASS_SORCERER) p_ptr->spell_exp[i] = SPELL_EXP_MASTER;
+               else if (p_ptr->pclass == CLASS_RED_MAGE) p_ptr->spell_exp[i] = SPELL_EXP_SKILLED;
+               else p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
        }
 
        for (i = 0; i < 5; i++)
                for (j = 0; j < 64; j++)
                        p_ptr->weapon_exp[i][j] = s_info[p_ptr->pclass].w_start[i][j];
-       if(p_ptr->pseikaku == SEIKAKU_SEXY)
+       if ((p_ptr->pseikaku == SEIKAKU_SEXY) && (p_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER))
        {
-               p_ptr->weapon_exp[TV_HAFTED-TV_BOW][SV_WHIP] = 4000;
+               p_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
        }
 
        for (i = 0; i < 10; i++)
@@ -2769,45 +2771,7 @@ static void get_extra(bool roll_hitdie)
                p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
 
        /* Roll for hit point unless quick-start */
-       if (roll_hitdie)
-       {
-               /* Minimum hitpoints at highest level */
-               min_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 3 / 8;
-               min_value += p_ptr->hitdie;
-
-               /* Maximum hitpoints at highest level */
-               max_value = ((PY_MAX_LEVEL+2) * (p_ptr->hitdie + 1)) * 5 / 8;
-               max_value += p_ptr->hitdie;
-
-               /* Roll out the hitpoints */
-               while (TRUE)
-               {
-                       /* Pre-calculate level 1 hitdice */
-                       p_ptr->player_hp[0] = p_ptr->hitdie;
-
-                       for (i = 1; i < 4; i++)
-                       {
-                               j = randint1(p_ptr->hitdie);
-                               p_ptr->player_hp[0] += j;
-                       }
-
-                       /* Roll the hitpoint values */
-                       for (i = 1; i < PY_MAX_LEVEL; i++)
-                       {
-                               j = randint1(p_ptr->hitdie);
-                               p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + j;
-                       }
-
-                       /* XXX Could also require acceptable "mid-level" hitpoints */
-
-                       /* Require "valid" hitpoints at highest level */
-                       if (p_ptr->player_hp[PY_MAX_LEVEL - 1] < min_value) continue;
-                       if (p_ptr->player_hp[PY_MAX_LEVEL - 1] > max_value) continue;
-
-                       /* Acceptable */
-                       break;
-               }
-       }
+       if (roll_hitdie) do_cmd_rerate_aux();
 
        /* Initial hitpoints */
        p_ptr->mhp = p_ptr->player_hp[0];
@@ -3062,7 +3026,7 @@ static void get_history(void)
 
        {
        char temp[64*4];
-       roff_to_buf(s, 60, temp);
+       roff_to_buf(s, 60, temp, sizeof(temp));
        t = temp;
        for(i=0 ; i<4 ; i++){
             if(t[0]==0)break; 
@@ -3073,36 +3037,46 @@ static void get_history(void)
 
 
 /*
- * Computes character's age, height, and weight
- * by henkma
+ * Get character's height and weight
  */
-static void get_ahw(void)
+void get_height_weight(void)
 {
-  int h_percent; /* ¿ÈŤ¬Ê¿¶Ñ¤Ë¤¯¤é¤Ù¤Æ¤É¤Î¤¯¤é¤¤°ã¤¦¤«. */
-
+       int h_percent; /* ¿ÈŤ¬Ê¿¶Ñ¤Ë¤¯¤é¤Ù¤Æ¤É¤Î¤¯¤é¤¤°ã¤¦¤«. */
 
-  /* Calculate the age */
-  p_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
-  
-  /* Calculate the height/weight for males */
-  if (p_ptr->psex == SEX_MALE)
+       /* Calculate the height/weight for males */
+       if (p_ptr->psex == SEX_MALE)
        {
-         p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
-         h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
-         p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
-                                                 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
+               p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
+               h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
+               p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
+                                   , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
        }
   
-  /* Calculate the height/weight for females */
-  else if (p_ptr->psex == SEX_FEMALE)
+       /* Calculate the height/weight for females */
+       else if (p_ptr->psex == SEX_FEMALE)
        {
-         p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
-         h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
-         p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
-                                                 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
+               p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
+               h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
+               p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
+                                   , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
        }
 }
 
+
+/*
+ * Computes character's age, height, and weight
+ * by henkma
+ */
+static void get_ahw(void)
+{
+       /* Get character's age */
+       p_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
+
+       /* Get character's height and weight */
+       get_height_weight();
+}
+
+
 /*
  * Get the player's starting money
  */
@@ -3163,7 +3137,7 @@ static void birth_put_stats(void)
                        j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
 
                        /* Obtain the current stat */
-                       m = adjust_stat(p_ptr->stat_max[i], j, TRUE);
+                       m = adjust_stat(p_ptr->stat_max[i], j);
 
                        /* Put the stat */
                        cnv_stat(m, buf);
@@ -3202,6 +3176,24 @@ static void birth_put_stats(void)
 }
 
 
+static void k_info_reset(void)
+{
+       int i;
+
+       /* Reset the "objects" */
+       for (i = 1; i < max_k_idx; i++)
+       {
+               object_kind *k_ptr = &k_info[i];
+
+               /* Reset "tried" */
+               k_ptr->tried = FALSE;
+
+               /* Reset "aware" */
+               k_ptr->aware = FALSE;
+       }
+}
+
+
 /*
  * Clear all the global "character" data
  */
@@ -3209,6 +3201,8 @@ static void player_wipe(void)
 {
        int i;
 
+       /* Hack -- free the "last message" string */
+       if (p_ptr->last_message) string_free(p_ptr->last_message);
 
        /* Hack -- zero the struct */
        (void)WIPE(p_ptr, player_type);
@@ -3269,10 +3263,15 @@ static void player_wipe(void)
 
                /* Hack -- Reset the max counter */
                if (r_ptr->flags1 & RF1_UNIQUE) r_ptr->max_num = 1;
-               if (r_ptr->flags7 & RF7_UNIQUE_7) r_ptr->max_num = 5;
 
-               /* Clear player kills */
+               /* Hack -- Non-unique Nazguls are semi-unique */
+               else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num = MAX_NAZGUL_NUM;
+
+               /* Clear visible kills in this life */
                r_ptr->r_pkills = 0;
+
+               /* Clear all kills in this life */
+               r_ptr->r_akills = 0;
        }
 
 
@@ -3352,7 +3351,6 @@ static void player_wipe(void)
        p_ptr->arena_number = 0;
        p_ptr->inside_arena = FALSE;
        p_ptr->inside_quest = 0;
-       p_ptr->leftbldg = FALSE;
        for (i = 0; i < MAX_MANE; i++)
        {
                p_ptr->mane_spell[i] = -1;
@@ -3361,12 +3359,6 @@ static void player_wipe(void)
        p_ptr->mane_num = 0;
        p_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
 
-       /* Reset rewards */
-       for (i = 0; i < MAX_BACT; i++)
-       {
-               p_ptr->rewards[i] = 0;
-       }
-
        /* Bounty */
        p_ptr->today_mon = 0;
 
@@ -3394,73 +3386,102 @@ static void player_wipe(void)
        }
 }
 
+
 /*
- *  Initialize random quests and final quests
+ *  Hook function for quest monsters
  */
-static void init_dungeon_quests(int number_of_quests)
+static bool mon_hook_quest(int r_idx)
 {
-       int i;
-       monster_race    *r_ptr;
+       monster_race *r_ptr = &r_info[r_idx];
 
-       /* Init the random quests */
-       init_flags = INIT_ASSIGN;
-       p_ptr->inside_quest = MIN_RANDOM_QUEST;
+       /* Random quests are in the dungeon */
+       if (r_ptr->flags8 & RF8_WILD_ONLY) return FALSE;
 
-       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+       /* No random quests for aquatic monsters */
+       if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
+
+       /* No random quests for multiplying monsters */
+       if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
+
+       /* No quests to kill friendly monsters */
+       if (r_ptr->flags7 & RF7_FRIENDLY) return FALSE;
+
+       return TRUE;
+}
 
-       p_ptr->inside_quest = 0;
+
+/*
+ * Determine the random quest uniques
+ */
+void determine_random_questor(quest_type *q_ptr)
+{
+       int          r_idx;
+       monster_race *r_ptr;
 
        /* Prepare allocation table */
-       get_mon_num_prep(monster_quest, NULL);
+       get_mon_num_prep(mon_hook_quest, NULL);
 
-       /* Remove QUESTOR flag */
-       for (i = 1; i < max_r_idx; i++)
+       while (1)
        {
-               r_ptr = &r_info[i];
-               if (r_ptr->flags1 & RF1_QUESTOR) r_ptr->flags1 &= ~RF1_QUESTOR;
-       }
+               /*
+                * Random monster 5 - 10 levels out of depth
+                * (depending on level)
+                */
+               r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
+               r_ptr = &r_info[r_idx];
 
-       /* Generate quests */
-       for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--)
-       {
-               quest_type      *q_ptr = &quest[i];
-               monster_race    *quest_r_ptr;
-               int             r_idx;
+               if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
 
-               q_ptr->status = QUEST_STATUS_TAKEN;
+               if (r_ptr->flags1 & RF1_QUESTOR) continue;
 
-               while (1)
-               {
-                       /*
-                        * Random monster 5 - 10 levels out of depth
-                        * (depending on level)
-                        */
-                       r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
-                       r_ptr = &r_info[r_idx];
+               if (r_ptr->rarity > 100) continue;
 
-                       if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
+               if (r_ptr->flags7 & RF7_FRIENDLY) continue;
 
-                       if(r_ptr->flags1 & RF1_QUESTOR) continue;
+               if (r_ptr->flags7 & RF7_AQUATIC) continue;
 
-                       if(r_ptr->flags6 & RF6_SPECIAL) continue;
+               if (r_ptr->flags8 & RF8_WILD_ONLY) continue;
 
-                       if(r_ptr->flags7 & RF7_FRIENDLY) continue;
+               if (no_questor_or_bounty_uniques(r_idx)) continue;
 
-                       if(r_ptr->flags7 & RF7_AQUATIC) continue;
+               /*
+                * Accept monsters that are 2 - 6 levels
+                * out of depth depending on the quest level
+                */
+               if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
+       }
 
-                       if(r_ptr->flags8 & RF8_WILD_ONLY) continue;
+       q_ptr->r_idx = r_idx;
+}
 
-                       /*
-                        * Accept monsters that are 2 - 6 levels
-                        * out of depth depending on the quest level
-                        */
-                       if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
-               }
 
-               q_ptr->r_idx = r_idx;
-               quest_r_ptr = &r_info[q_ptr->r_idx];
+/*
+ *  Initialize random quests and final quests
+ */
+static void init_dungeon_quests(void)
+{
+       int number_of_quests = MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1;
+       int i;
+
+       /* Init the random quests */
+       init_flags = INIT_ASSIGN;
+       p_ptr->inside_quest = MIN_RANDOM_QUEST;
+
+       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+
+       p_ptr->inside_quest = 0;
+
+       /* Generate quests */
+       for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--)
+       {
+               quest_type      *q_ptr = &quest[i];
+               monster_race    *quest_r_ptr;
+
+               q_ptr->status = QUEST_STATUS_TAKEN;
+               determine_random_questor(q_ptr);
 
                /* Mark uniques */
+               quest_r_ptr = &r_info[q_ptr->r_idx];
                quest_r_ptr->flags1 |= RF1_QUESTOR;
 
                q_ptr->max_num = 1;
@@ -3629,7 +3650,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Harper */
+               /* Bard */
                { TV_MUSIC_BOOK, 0 },
                { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR},
                { TV_SWORD, SV_SHORT_SWORD },
@@ -3664,7 +3685,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kihei */
+               /* Cavalry */
                { TV_BOW, SV_SHORT_BOW },
                { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL},
                { TV_POLEARM, SV_BROAD_SPEAR}
@@ -3678,7 +3699,7 @@ static byte player_init[MAX_CLASS][3][2] =
        },
 
        {
-               /* Kaji */
+               /* Weaponsmith */
                { TV_RING, SV_RING_RES_FEAR }, /* Warriors need it! */
                { TV_HARD_ARMOR, SV_CHAIN_MAIL },
                { TV_POLEARM, SV_BROAD_AXE }
@@ -3707,13 +3728,29 @@ static bool monster_hook_human(int r_idx)
 
        if (r_ptr->flags1 & (RF1_UNIQUE)) return FALSE;
 
-       if (strchr("pht", r_ptr->d_char)) return TRUE;
+       if (my_strchr("pht", r_ptr->d_char)) return TRUE;
 
        return FALSE;
 }
 
 
 /*
+ * Add an outfit object
+ */
+static void add_outfit(object_type *o_ptr)
+{
+       s16b slot;
+
+       object_aware(o_ptr);
+       object_known(o_ptr);
+       slot = inven_carry(o_ptr);
+
+       /* Auto-inscription */
+       autopick_alter_item(slot, FALSE);
+}
+
+
+/*
  * Init players with some belongings
  *
  * Having an item makes the player "aware" of its purpose.
@@ -3748,7 +3785,7 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(TV_CORPSE, SV_CORPSE));
                        q_ptr->pval = get_mon_num(2);
                        q_ptr->number = 1;
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
                break;
 
@@ -3757,9 +3794,7 @@ void player_outfit(void)
                /* Some Skeletons */
                object_prep(q_ptr, lookup_kind(TV_SKELETON, SV_ANY));
                q_ptr->number = (byte)rand_range(7, 12);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
                break;
 #endif
        case RACE_SKELETON:
@@ -3769,19 +3804,15 @@ void player_outfit(void)
                /* Staff (of Nothing) */
                object_prep(q_ptr, lookup_kind(TV_STAFF, SV_STAFF_NOTHING));
                q_ptr->number = 1;
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
                break;
 
        case RACE_ENT:
                /* Potions of Water */
                object_prep(q_ptr, lookup_kind(TV_POTION, SV_POTION_WATER));
                q_ptr->number = (byte)rand_range(15, 23);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                break;
 
@@ -3790,12 +3821,10 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
 
                /* Fuel with oil (move pval to xtra4) */
-               apply_magic(q_ptr, 1, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (byte)rand_range(7, 12);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                break;
 
@@ -3803,10 +3832,8 @@ void player_outfit(void)
                /* Food rations */
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
                q_ptr->number = (byte)rand_range(3, 7);
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        /* Get local object */
@@ -3819,10 +3846,7 @@ void player_outfit(void)
 
                q_ptr->number = (byte)rand_range(2, 5);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass != CLASS_NINJA)
        {
@@ -3830,10 +3854,8 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH));
                q_ptr->number = (byte)rand_range(3, 7);
                q_ptr->xtra4 = rand_range(3, 7) * 500;
-               object_aware(q_ptr);
-               object_known(q_ptr);
 
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        /* Get local object */
@@ -3845,20 +3867,14 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        if (p_ptr->pclass == CLASS_RANGER)
        {
                /* Hack -- Give the player some arrows */
                object_prep(q_ptr, lookup_kind(TV_BOW, SV_SHORT_BOW));
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_ARCHER)
        {
@@ -3866,10 +3882,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_ARROW, SV_AMMO_NORMAL));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_HIGH_MAGE)
        {
@@ -3878,10 +3891,7 @@ void player_outfit(void)
                q_ptr->number = 1;
                q_ptr->pval = (byte)rand_range(25, 30);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_SORCERER)
        {
@@ -3891,10 +3901,7 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(i, 0));
                        q_ptr->number = 1;
 
-                       object_aware(q_ptr);
-                       object_known(q_ptr);
-
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
        }
        else if (p_ptr->pclass == CLASS_TOURIST)
@@ -3905,51 +3912,33 @@ void player_outfit(void)
                        object_prep(q_ptr, lookup_kind(TV_SHOT, SV_AMMO_LIGHT));
                        q_ptr->number = (byte)rand_range(15, 20);
 
-                       object_aware(q_ptr);
-                       object_known(q_ptr);
-
-                       (void)inven_carry(q_ptr);
+                       add_outfit(q_ptr);
                }
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_BISCUIT));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_WAYBREAD));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_JERKY));
                q_ptr->number = (byte)rand_range(1, 3);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_ALE));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
 
                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_PINT_OF_WINE));
                q_ptr->number = (byte)rand_range(2, 4);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
        else if (p_ptr->pclass == CLASS_NINJA)
        {
@@ -3957,10 +3946,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_SPIKE, 0));
                q_ptr->number = (byte)rand_range(15, 20);
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
 
        if(p_ptr->pseikaku == SEIKAKU_SEXY)
@@ -4006,11 +3992,11 @@ void player_outfit(void)
                        q_ptr->name2 = EGO_BRAND_POIS;
                }
 
-               object_aware(q_ptr);
-               object_known(q_ptr);
-
-               (void)inven_carry(q_ptr);
+               add_outfit(q_ptr);
        }
+
+       /* Hack -- make aware of the water */
+       k_info[lookup_kind(TV_POTION, SV_POTION_WATER)].aware = TRUE;
 }
 
 
@@ -4170,7 +4156,7 @@ static bool get_player_race(void)
                else k = -1;
                if (c == '?')
                {
-#ifdef JP                 
+#ifdef JP
                        show_help("jraceclas.txt#TheRaces");
 #else
                        show_help("raceclas.txt#TheRaces");
@@ -4180,9 +4166,9 @@ static bool get_player_race(void)
                {
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
                        screen_load();
                }
@@ -4193,10 +4179,9 @@ static bool get_player_race(void)
        p_ptr->prace = k;
 
        rp_ptr = &race_info[p_ptr->prace];
-       str = rp_ptr->title;
 
        /* Display */
-       c_put_str(TERM_L_BLUE, str, 4, 15);
+       c_put_str(TERM_L_BLUE, rp_ptr->title, 4, 15);
 
        /* Success */
        return TRUE;
@@ -4385,7 +4370,7 @@ static bool get_player_class(void)
                else k = -1;
                if (c == '?')
                {
-#ifdef JP                 
+#ifdef JP
                        show_help("jraceclas.txt#TheClasses");
 #else
                        show_help("raceclas.txt#TheClasses");
@@ -4395,9 +4380,9 @@ static bool get_player_class(void)
                {
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -4409,15 +4394,10 @@ static bool get_player_class(void)
        p_ptr->pclass = k;
        cp_ptr = &class_info[p_ptr->pclass];
        mp_ptr = &m_info[p_ptr->pclass];
-       str = cp_ptr->title;
 
 
        /* Display */
-#ifdef JP
-       c_put_str(TERM_L_BLUE, str, 5, 15);
-#else
        c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 15);
-#endif
 
        return TRUE;
 }
@@ -4627,7 +4607,7 @@ static bool get_player_seikaku(void)
                else k = -1;
                if (c == '?')
                {
-#ifdef JP                 
+#ifdef JP
                        show_help("jraceclas.txt#ThePersonalities");
 #else
                        show_help("raceclas.txt#ThePersonalities");
@@ -4637,9 +4617,9 @@ static bool get_player_seikaku(void)
                {
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -4705,7 +4685,7 @@ static bool get_stat_limits(void)
                j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
 
                /* Obtain the "maximal" stat */
-               m = adjust_stat(17, j, TRUE);
+               m = adjust_stat(17, j);
 
                /* Save the maximum */
                mval[i] = m;
@@ -4731,7 +4711,7 @@ static bool get_stat_limits(void)
                }
 
                /* Obtain the current stat */
-               m = adjust_stat(cval[i], j, TRUE);
+               m = adjust_stat(cval[i], j);
 
                /* Above 18 */
                if (m > 18)
@@ -4795,7 +4775,7 @@ static bool get_stat_limits(void)
                                j = rp_ptr->r_adj[cs] + cp_ptr->c_adj[cs] + ap_ptr->a_adj[cs];
 
                                /* Obtain the current stat */
-                               m = adjust_stat(cval[cs], j, TRUE);
+                               m = adjust_stat(cval[cs], j);
                                
                                /* Above 18 */
                                if (m > 18)
@@ -4831,10 +4811,8 @@ static bool get_stat_limits(void)
                switch ( c ){
                case 'Q':
                        birth_quit();
-                       break;
                case 'S':
-                       return (FALSE); 
-                       break;
+                       return FALSE;
                case ESCAPE:
                        break;
                case ' ':
@@ -4901,20 +4879,18 @@ static bool get_stat_limits(void)
                        }
                        break;
                case '?':
-               {
-#ifdef JP                 
+#ifdef JP
                        show_help("jbirth.txt#AutoRoller");
 #else
                        show_help("birth.txt#AutoRoller");
 #endif
-               }
                        break;
                case '=':
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -4939,17 +4915,21 @@ static bool get_stat_limits(void)
 #ifdef ALLOW_AUTOROLLER
 static bool get_chara_limits(void)
 {
+#define MAXITEMS 8
+
        int i, j, m, cs, os;
-       int mval[6], cval[6];
+       int mval[MAXITEMS], cval[MAXITEMS];
        int max_percent, min_percent;
        char c;
        char buf[80], cur[80];
-       char param[3][80] = {
+       cptr itemname[] = {
 #ifdef JP
+               "ǯÎð",
                "¿ÈĹ(¥¤¥ó¥Á)",
                "ÂνÅ(¥Ý¥ó¥É)",
                "¼Ò²ñŪÃÏ°Ì"
 #else
+               "age",
                "height",
                "weight",
                "social class"
@@ -4988,31 +4968,38 @@ static bool get_chara_limits(void)
 #endif
 
        /* Output the maximum stats */
-       for (i = 0; i < 6; i++)
+       for (i = 0; i < MAXITEMS; i++)
        {
                /* Obtain the "maximal" stat */
                switch (i)
                {
-               case 0: /* Minimum height */
+               case 0: /* Minimum age */
+                       m = rp_ptr->b_age + 1;
+                       break;
+               case 1: /* Maximum age */
+                       m = rp_ptr->b_age + rp_ptr->m_age;
+                       break;
+
+               case 2: /* Minimum height */
                        if (p_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht-rp_ptr->m_m_ht*4+1;
                        else m = rp_ptr->f_b_ht-rp_ptr->f_m_ht*4+1;
                        break;
-               case 1: /* Maximum height */
+               case 3: /* Maximum height */
                        if (p_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht+rp_ptr->m_m_ht*4-1;
                        else m = rp_ptr->f_b_ht+rp_ptr->f_m_ht*4-1;
                        break;
-               case 2: /* Minimum weight */
+               case 4: /* Minimum weight */
                        if (p_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * min_percent / 100) - (rp_ptr->m_m_wt * min_percent / 75) +1;
                        else m = (rp_ptr->f_b_wt * min_percent / 100) - (rp_ptr->f_m_wt * min_percent / 75) +1;
                        break;
-               case 3: /* Maximum weight */
+               case 5: /* Maximum weight */
                        if (p_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * max_percent / 100) + (rp_ptr->m_m_wt * max_percent / 75) -1;
                        else m = (rp_ptr->f_b_wt * max_percent / 100) + (rp_ptr->f_m_wt * max_percent / 75) -1;
                        break;
-               case 4: /* Minimum social class */
+               case 6: /* Minimum social class */
                        m = 1;
                        break;
-               case 5: /* Maximum social class */
+               case 7: /* Maximum social class */
                        m = 100;
                        break;
                default:
@@ -5025,10 +5012,10 @@ static bool get_chara_limits(void)
                cval[i] = m;
        }
 
-       for (i = 0; i < 3; i++)
+       for (i = 0; i < 4; i++)
        {
                /* Prepare a prompt */
-               sprintf(buf, "%-12s (%3d - %3d)", param[i], mval[i*2], mval[i*2+1]);
+               sprintf(buf, "%-12s (%3d - %3d)", itemname[i], mval[i*2], mval[i*2+1]);
 
                /* Dump the prompt */
                put_str(buf, 14 + i, 20);
@@ -5042,30 +5029,29 @@ static bool get_chara_limits(void)
        
        /* Get a minimum stat */
        cs = 0;
-       os = 6;
+       os = MAXITEMS;
        while (TRUE)
        {
                /* Move Cursol */
                if (cs != os)
                {
-                       if(os == 6)
-                       {
 #ifdef JP
-                               c_put_str(TERM_WHITE, "·èÄꤹ¤ë", 18, 35);
+                       const char accept[] = "·èÄꤹ¤ë";
 #else
-                               c_put_str(TERM_WHITE, "Accept", 18, 35);
+                       const char accept[] = "Accept";
 #endif
+                       if(os == MAXITEMS)
+                       {
+                               c_put_str(TERM_WHITE, accept, 19, 35);
                        }
-                       else if(os < 6)
+                       else
+                       {
                                c_put_str(TERM_WHITE, cur, 14 + os/2, 45 + 8 * (os%2));
+                       }
                        
-                       if(cs == 6)
+                       if(cs == MAXITEMS)
                        {
-#ifdef JP
-                               c_put_str(TERM_YELLOW, "·èÄꤹ¤ë", 18, 35);
-#else
-                               c_put_str(TERM_YELLOW, "Accept", 18, 35);
-#endif
+                               c_put_str(TERM_YELLOW, accept, 19, 35);
                        }
                        else
                        {
@@ -5081,7 +5067,6 @@ static bool get_chara_limits(void)
                switch (c){
                case 'Q':
                        birth_quit();
-                       break;
                case 'S':
                        return (FALSE);
                case ESCAPE:
@@ -5089,7 +5074,7 @@ static bool get_chara_limits(void)
                case ' ':
                case '\r':
                case '\n':
-                       if(cs == 6) break;
+                       if(cs == MAXITEMS) break;
                        cs++;
                        c = '6';
                        break;
@@ -5099,8 +5084,8 @@ static bool get_chara_limits(void)
                        break;
                case '2':
                case 'j':
-                       if (cs < 6) cs += 2;
-                       if (cs > 6) cs = 6;
+                       if (cs < MAXITEMS) cs += 2;
+                       if (cs > MAXITEMS) cs = MAXITEMS;
                        break;
                case '4':
                case 'h':
@@ -5108,11 +5093,11 @@ static bool get_chara_limits(void)
                        break;
                case '6':
                case 'l':
-                       if (cs < 6) cs++;
+                       if (cs < MAXITEMS) cs++;
                        break;
                case '-':
                case '<':
-                       if (cs != 6)
+                       if (cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5134,7 +5119,7 @@ static bool get_chara_limits(void)
                        break;
                case '+':
                case '>':
-                       if (cs != 6)
+                       if (cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5155,7 +5140,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'm':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5176,7 +5161,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case 'n':
-                       if(cs != 6)
+                       if(cs != MAXITEMS)
                        {
                                if(cs%2)
                                {
@@ -5197,7 +5182,7 @@ static bool get_chara_limits(void)
                        }
                        break;
                case '?':
-#ifdef JP                 
+#ifdef JP
                        show_help("jbirth.txt#AutoRoller");
 #else
                        show_help("birth.txt#AutoRoller");
@@ -5206,9 +5191,9 @@ static bool get_chara_limits(void)
                case '=':
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -5217,18 +5202,128 @@ static bool get_chara_limits(void)
                        bell();
                        break;
                }
-               if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))break;
+               if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS))break;
        }
 
        /* Input the minimum stats */
-       for (i = 0; i < 6; i++)
+       chara_limit.agemin = cval[0];
+       chara_limit.agemax = cval[1];
+       chara_limit.htmin = cval[2];
+       chara_limit.htmax = cval[3];
+       chara_limit.wtmin = cval[4];
+       chara_limit.wtmax = cval[5];
+       chara_limit.scmin = cval[6];
+       chara_limit.scmax = cval[7];
+
+       return TRUE;
+}
+#endif
+
+#define HISTPREF_LIMIT 1024
+static char *histpref_buf = NULL;
+
+/*
+ * Hook function for reading the histpref.prf file.
+ */
+void add_history_from_pref_line(cptr t)
+{
+       /* Do nothing if the buffer is not ready */
+       if (!histpref_buf) return;
+
+       my_strcat(histpref_buf, t, HISTPREF_LIMIT);
+}
+
+
+static bool do_cmd_histpref(void)
+{
+       char buf[80];
+       errr err;
+       int i, j, n;
+       char *s, *t;
+       char temp[64 * 4];
+       char histbuf[HISTPREF_LIMIT];
+
+#ifdef JP
+       if (!get_check("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return FALSE;
+#else
+       if (!get_check("Load background history preference file? ")) return FALSE;
+#endif
+
+       /* Prepare the buffer */
+       histbuf[0] = '\0';
+       histpref_buf = histbuf;
+
+#ifdef JP
+       sprintf(buf, "histedit-%s.prf", player_name);
+#else
+       sprintf(buf, "histpref-%s.prf", player_name);
+#endif
+       err = process_histpref_file(buf);
+
+       /* Process 'hist????.prf' if 'hist????-<name>.prf' doesn't exist */
+       if (0 > err)
        {
-               /* Save the minimum stat */
-               chara_limit[i] = (cval[i] > 0) ? cval[i] : 0;
+#ifdef JP
+               strcpy(buf, "histedit.prf");
+#else
+               strcpy(buf, "histpref.prf");
+#endif
+               err = process_histpref_file(buf);
+       }
+
+       if (err)
+       {
+#ifdef JP
+               msg_print("À¸¤¤Î©¤ÁÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
+#else
+               msg_print("Failed to load background history preference.");
+#endif
+               msg_print(NULL);
+
+               /* Kill the buffer */
+               histpref_buf = NULL;
+
+               return FALSE;
+       }
+
+       /* Clear the previous history strings */
+       for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
+
+       /* Skip leading spaces */
+       for (s = histpref_buf; *s == ' '; s++) /* loop */;
+
+       /* Get apparent length */
+       n = strlen(s);
+
+       /* Kill trailing spaces */
+       while ((n > 0) && (s[n - 1] == ' ')) s[--n] = '\0';
+
+       roff_to_buf(s, 60, temp, sizeof(temp));
+       t = temp;
+       for (i = 0; i < 4; i++)
+       {
+               if (t[0] == 0) break;
+               else
+               {
+                       strcpy(p_ptr->history[i], t);
+                       t += strlen(t) + 1;
+               }
        }
+
+       /* Fill the remaining spaces */
+       for (i = 0; i < 4; i++)
+       {
+               for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
+
+               for (; j < 59; j++) p_ptr->history[i][j] = ' ';
+               p_ptr->history[i][59] = '\0';
+       }
+
+       /* Kill the buffer */
+       histpref_buf = NULL;
+
        return TRUE;
 }
-#endif
 
 /*
  *  Character background edit-mode
@@ -5236,7 +5331,6 @@ static bool get_chara_limits(void)
 static void edit_history(void)
 {
        char old_history[4][60];
-       char c;
        int y = 0, x = 0;
        int i, j;
 
@@ -5256,12 +5350,17 @@ static void edit_history(void)
        display_player(1);
 #ifdef JP
        c_put_str(TERM_L_GREEN, "(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á - ÊÔ½¸¥â¡¼¥É)", 11, 20);
+       put_str("[ ¥«¡¼¥½¥ë¥­¡¼¤Ç°ÜÆ°¡¢Enter¤Ç½ªÎ»¡¢Ctrl-A¤Ç¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß ]", 17, 10);
 #else
        c_put_str(TERM_L_GREEN, "(Character Background - Edit Mode)", 11, 20);
+       put_str("[ Cursor key for Move, Enter for End, Ctrl-A for Read pref ]", 17, 10);
 #endif
 
        while (TRUE)
        {
+               int skey;
+               char c;
+
                for (i = 0; i < 4; i++)
                {
                        put_str(p_ptr->history[i], i + 12, 10);
@@ -5276,9 +5375,14 @@ static void edit_history(void)
                /* Place cursor just after cost of current stat */
                Term_gotoxy(x + 10, y + 12);
 
-               c = inkey();
+               /* Get special key code */
+               skey = inkey_special(TRUE);
 
-               if (c == '8')
+               /* Get a character code */
+               if (!(skey & SKEY_MASK)) c = (char)skey;
+               else c = 0;
+
+               if (skey == SKEY_UP || c == KTRL('p'))
                {
                        y--;
                        if (y < 0) y = 3;
@@ -5286,7 +5390,7 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (c == '2')
+               else if (skey == SKEY_DOWN || c == KTRL('n'))
                {
                        y++;
                        if (y > 3) y = 0;
@@ -5294,7 +5398,7 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (c == '6')
+               else if (skey == SKEY_RIGHT || c == KTRL('f'))
                {
 #ifdef JP
                        if (iskanji2(p_ptr->history[y], x)) x++;
@@ -5306,7 +5410,7 @@ static void edit_history(void)
                                if (y < 3) y++;
                        }
                }
-               else if (c == '4')
+               else if (skey == SKEY_LEFT || c == KTRL('b'))
                {
                        x--;
                        if (x < 0)
@@ -5323,12 +5427,26 @@ static void edit_history(void)
                        if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
 #endif
                }
-               else if (c == '\r')
+               else if (c == '\r' || c == '\n')
                {
+                       Term_erase(0, 11, 255);
+                       Term_erase(0, 17, 255);
+#ifdef JP
+                       put_str("(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á - ÊÔ½¸ºÑ¤ß)", 11, 20);
+#else
+                       put_str("(Character Background - Edited)", 11, 20);
+#endif
                        break;
                }
                else if (c == ESCAPE)
                {
+                       clear_from(11);
+#ifdef JP
+                       put_str("(¥­¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á)", 11, 25);
+#else
+                       put_str("(Character Background)", 11, 25);
+#endif
+
                        for (i = 0; i < 4; i++)
                        {
                                sprintf(p_ptr->history[i], "%s", old_history[i]);
@@ -5336,6 +5454,15 @@ static void edit_history(void)
                        }
                        break;
                }
+               else if (c == KTRL('A'))
+               {
+                       if (do_cmd_histpref())
+                       {
+#ifdef JP
+                               if ((x > 0) && (iskanji2(p_ptr->history[y], x - 1))) x--;
+#endif
+                       }
+               }
                else if (c == '\010')
                {
                        x--;
@@ -5412,7 +5539,6 @@ static void edit_history(void)
 static bool player_birth_aux(void)
 {
        int i, k, n, cs, os;
-       int number_of_quests;
 
        int mode = 0;
 
@@ -5432,7 +5558,6 @@ static bool player_birth_aux(void)
        char b2 = ']';
 
        char buf[80], cur[80];
-       char inp[80];
 
 
        /*** Intro ***/
@@ -5495,14 +5620,12 @@ static bool player_birth_aux(void)
        {
                /* Analyze */
                sp_ptr = &sex_info[n];
-               str = sp_ptr->title;
-
 
                /* Display */
 #ifdef JP
-               sprintf(buf, "%c%c%s", I2A(n), p2, str);
+               sprintf(buf, "%c%c%s", I2A(n), p2, sp_ptr->title);
 #else
-               sprintf(buf, "%c%c %s", I2A(n), p2, str);
+               sprintf(buf, "%c%c %s", I2A(n), p2, sp_ptr->title);
 #endif
                put_str(buf, 12 + (n/5), 2 + 15 * (n%5));
        }
@@ -5587,9 +5710,9 @@ static bool player_birth_aux(void)
                {
                        screen_save();
 #ifdef JP
-                       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                        screen_load();
@@ -5600,11 +5723,9 @@ static bool player_birth_aux(void)
        /* Set sex */
        p_ptr->psex = k;
        sp_ptr = &sex_info[p_ptr->psex];
-       str = sp_ptr->title;
-
 
        /* Display */
-       c_put_str(TERM_L_BLUE, str, 3, 15);
+       c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 15);
 
        /* Clean up */
        clear_from(10);
@@ -5620,7 +5741,7 @@ static bool player_birth_aux(void)
 
                clear_from(10);
 
-               roff_to_buf(race_jouhou[p_ptr->prace], 74, temp);
+               roff_to_buf(race_jouhou[p_ptr->prace], 74, temp, sizeof(temp));
                t = temp;
 
                for (i = 0; i< 10; i++)
@@ -5634,9 +5755,9 @@ static bool player_birth_aux(void)
                        }
                }
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                clear_from(10);
                c_put_str(TERM_WHITE, "              ", 4, 15);
@@ -5655,7 +5776,7 @@ static bool player_birth_aux(void)
                if (!get_player_class()) return FALSE;
 
                clear_from(10);
-               roff_to_buf(class_jouhou[p_ptr->pclass], 74, temp);
+               roff_to_buf(class_jouhou[p_ptr->pclass], 74, temp, sizeof(temp));
                t = temp;
 
                for (i = 0; i< 9; i++)
@@ -5670,9 +5791,9 @@ static bool player_birth_aux(void)
                }
 
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                c_put_str(TERM_WHITE, "              ", 5, 15);
        }
@@ -5690,7 +5811,7 @@ static bool player_birth_aux(void)
                if (!get_player_seikaku()) return FALSE;
 
                clear_from(10);
-               roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 74, temp);
+               roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 74, temp, sizeof(temp));
                t = temp;
 
                for (i = 0; i< 6; i++)
@@ -5704,9 +5825,9 @@ static bool player_birth_aux(void)
                        }
                }
 #ifdef JP
-               if (get_check("¤è¤í¤·¤¤¤Ç¤¹¤«¡©")) break;
+               if (get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_DEFAULT_Y)) break;
 #else
-               if (get_check("Are you sure? ")) break;
+               if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
 #endif
                c_put_str(TERM_L_BLUE, player_name, 1, 34);
                prt("", 1, 34+strlen(player_name));
@@ -5720,9 +5841,9 @@ static bool player_birth_aux(void)
 
        screen_save();
 #ifdef JP
-       do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+       do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-       do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+       do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
        screen_load();
@@ -5750,85 +5871,9 @@ static bool player_birth_aux(void)
 
 #endif /* ALLOW_AUTOROLLER */
 
-       /* Clean up */
-       clear_from(10);
-
-       /*** User enters number of quests ***/
-       /* Heino Vander Sanden and Jimmy De Laet */
-
-       /* Extra info */
-#ifdef JP
-       put_str("ɬ¿Ü¤Î¥¯¥¨¥¹¥È(¥ª¥Ù¥í¥óµÚ¤Óº®Æ٤Υµ¡¼¥Ú¥ó¥È)¤Ë²Ã¤¨¤Æ¡¢ÄɲäΥ¯¥¨¥¹¥È¤Î", 10, 5);
-       put_str("¿ô¤òÀßÄꤹ¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£", 11, 5);
-       put_str("Äɲ寥¨¥¹¥È¤ò¹Ô¤Ê¤¤¤¿¤¯¤Ê¤¤¾ì¹ç¤Ï '0'¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£", 12, 5);
-       put_str("¥é¥ó¥À¥à¤Ë·èÄꤹ¤ë¤Ë¤Ï'*'¤òÆþÎϤ·¤Æ²¼¤µ¤¤¡£", 13, 5);
-#else
-       put_str("You can enter the number of quests you'd like to perform in addition", 10, 5);
-       put_str("to the two obligatory ones ( Oberon and the Serpent of Chaos )", 11, 5);
-       put_str("In case you do not want any additional quests, just enter 0", 12, 5);
-       put_str("If you want a random number of random quests, just enter *", 13, 5);
-#endif
-
-       /* Ask the number of additional quests */
-       while (TRUE)
-       {
-
-#ifdef JP
-               put_str(format("Äɲ寥¨¥¹¥È¤Î¿ô (%u°Ê²¼) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1), 15, 5);
-#else
-               put_str(format("Number of additional quests? (<%u) ", MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 2), 15, 5);
-#endif
-
-
-               /* Get a the number of additional quest */
-               while (TRUE)
-               {
-                       /* Move the cursor */
-                       put_str("", 15, 40);
-
-                       /* Default */
-                       strcpy(inp, "10");
-
-                       /* Get a response (or escape) */
-                       if (!askfor_aux(inp, 2)) strcpy(inp, "10");
-
-                       /* Quit */
-                       if (inp[0] == 'Q') birth_quit();
-
-                       /* Start over */
-                       if (inp[0] == 'S') return (FALSE);
-
-                       /* Check for random number of quests */
-                       if (inp[0] == '*')
-                       {
-                               /* 0 to 10 random quests */
-                               number_of_quests = randint0(11);
-                       }
-                       else if (inp[0] == '?')
-                       {
-#ifdef JP                 
-                               show_help("jbirth.txt#RandomQuests");
-#else
-                               show_help("birth.txt#RandomQuests");
-#endif
-                               continue;
-                       }
-                       else
-                       {
-                               number_of_quests = atoi(inp);
-                       }
-
-                       /* Break on valid input */
-                       if ((number_of_quests <= MAX_RANDOM_QUEST - MIN_RANDOM_QUEST + 1) && (number_of_quests >= 0)) break;
-               }
-               break;
-       }
-
        /* Clear */
        clear_from(10);
 
-       init_dungeon_quests(number_of_quests);
-
        /* Reset turn; before auto-roll and after choosing race */
        init_turn();
 
@@ -5913,7 +5958,7 @@ static bool player_birth_aux(void)
                                j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
 
                                /* Obtain the current stat */
-                               m = adjust_stat(stat_limit[i], j, TRUE);
+                               m = adjust_stat(stat_limit[i], j);
 
                                /* Put the stat */
                                cnv_stat(m, buf);
@@ -5976,9 +6021,10 @@ static bool player_birth_aux(void)
 
                                if (autochara)
                                {
-                                       if ((p_ptr->ht < chara_limit[0]) || (p_ptr->ht > chara_limit[1])) accept = FALSE;
-                                       if ((p_ptr->wt < chara_limit[2]) || (p_ptr->wt > chara_limit[3])) accept = FALSE;
-                                       if ((p_ptr->sc < chara_limit[4]) || (p_ptr->sc > chara_limit[5])) accept = FALSE;
+                                       if ((p_ptr->age < chara_limit.agemin) || (p_ptr->age > chara_limit.agemax)) accept = FALSE;
+                                       if ((p_ptr->ht < chara_limit.htmin) || (p_ptr->ht > chara_limit.htmax)) accept = FALSE;
+                                       if ((p_ptr->wt < chara_limit.wtmin) || (p_ptr->wt > chara_limit.wtmax)) accept = FALSE;
+                                       if ((p_ptr->sc < chara_limit.scmin) || (p_ptr->sc > chara_limit.scmax)) accept = FALSE;
                                }
                                if (accept) break;
                        }
@@ -6125,7 +6171,7 @@ static bool player_birth_aux(void)
                        /* Help */
                        if (c == '?')
                        {
-#ifdef JP                 
+#ifdef JP
                                show_help("jbirth.txt#AutoRoller");
 #else
                                show_help("birth.txt#AutoRoller");
@@ -6136,9 +6182,9 @@ static bool player_birth_aux(void)
                        {
                                screen_save();
 #ifdef JP
-                               do_cmd_options_aux(6, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
+                               do_cmd_options_aux(OPT_PAGE_BIRTH, "½é´ü¥ª¥×¥·¥ç¥ó((*)¤Ï¥¹¥³¥¢¤Ë±Æ¶Á)");
 #else
-                               do_cmd_options_aux(6, "Startup Opts((*)s effect score)");
+                               do_cmd_options_aux(OPT_PAGE_BIRTH, "Birth Option((*)s effect score)");
 #endif
 
                                screen_load();
@@ -6198,9 +6244,12 @@ static bool player_birth_aux(void)
        /* Start over */
        if (c == 'S') return (FALSE);
 
+
+       /* Initialize random quests */
+       init_dungeon_quests();
+
        /* Save character data for quick start */
        save_prev_data(&previous_char);
-       previous_char.quests = number_of_quests;
        previous_char.quick_ok = TRUE;
 
        /* Process the player name */
@@ -6236,9 +6285,9 @@ static bool ask_quick_start(void)
                char c;
 
 #ifdef JP
-               put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¤¤Þ¤¹¤«¡©[y/n]", 14, 10);
+               put_str("¥¯¥¤¥Ã¥¯¡¦¥¹¥¿¡¼¥È¤ò»È¤¤¤Þ¤¹¤«¡©[y/N]", 14, 10);
 #else
-               put_str("Use quick start? [y/n]", 14, 10);
+               put_str("Use quick start? [y/N]", 14, 10);
 #endif
                c = inkey();
 
@@ -6246,7 +6295,7 @@ static bool ask_quick_start(void)
                else if (c == 'S') return (FALSE);
                else if (c == '?')
                {
-#ifdef JP                 
+#ifdef JP
                        show_help("jbirth.txt#QuickStart");
 #else
                        show_help("birth.txt#QuickStart");
@@ -6265,7 +6314,7 @@ static bool ask_quick_start(void)
        }
 
        load_prev_data(FALSE);
-       init_dungeon_quests(previous_char.quests);
+       init_dungeon_quests();
        init_turn();
 
        sp_ptr = &sex_info[p_ptr->psex];
@@ -6415,13 +6464,13 @@ void player_birth(void)
 
 void dump_yourself(FILE *fff)
 {
-       char temp[80*8];
+       char temp[80*10];
        int i;
        cptr t;
 
        if (!fff) return;
 
-       roff_to_buf(race_jouhou[p_ptr->prace], 78, temp);
+       roff_to_buf(race_jouhou[p_ptr->prace], 78, temp, sizeof(temp));
        fprintf(fff, "\n\n");
 #ifdef JP
        fprintf(fff, "¼ï²: %s\n", race_info[p_ptr->prace].title);
@@ -6429,14 +6478,14 @@ void dump_yourself(FILE *fff)
        fprintf(fff, "Race: %s\n", race_info[p_ptr->prace].title);
 #endif
        t = temp;
-       for (i = 0; i < 8; i++)
+       for (i = 0; i < 10; i++)
        {
                if(t[0] == 0)
                        break; 
                fprintf(fff, "%s\n",t);
                t += strlen(t) + 1;
        }
-       roff_to_buf(class_jouhou[p_ptr->pclass], 78, temp);
+       roff_to_buf(class_jouhou[p_ptr->pclass], 78, temp, sizeof(temp));
        fprintf(fff, "\n");
 #ifdef JP
        fprintf(fff, "¿¦¶È: %s\n", class_info[p_ptr->pclass].title);
@@ -6444,14 +6493,14 @@ void dump_yourself(FILE *fff)
        fprintf(fff, "Class: %s\n", class_info[p_ptr->pclass].title);
 #endif
        t = temp;
-       for (i = 0; i < 8; i++)
+       for (i = 0; i < 10; i++)
        {
                if(t[0] == 0)
                        break; 
                fprintf(fff, "%s\n",t);
                t += strlen(t) + 1;
        }
-       roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 78, temp);
+       roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 78, temp, sizeof(temp));
        fprintf(fff, "\n");
 #ifdef JP
        fprintf(fff, "À­³Ê: %s\n", seikaku_info[p_ptr->pseikaku].title);
@@ -6469,7 +6518,7 @@ void dump_yourself(FILE *fff)
        fprintf(fff, "\n");
        if (p_ptr->realm1)
        {
-               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 78, temp);
+               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm1)-1], 78, temp, sizeof(temp));
 #ifdef JP
                fprintf(fff, "ËâË¡: %s\n", realm_names[p_ptr->realm1]);
 #else
@@ -6487,7 +6536,7 @@ void dump_yourself(FILE *fff)
        fprintf(fff, "\n");
        if (p_ptr->realm2)
        {
-               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm2)-1], 78, temp);
+               roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm2)-1], 78, temp, sizeof(temp));
 #ifdef JP
                fprintf(fff, "ËâË¡: %s\n", realm_names[p_ptr->realm2]);
 #else