sunder2.1/clan/
sunder2.1/class/
sunder2.1/class/bak/
sunder2.1/doc/ideas/
sunder2.1/gods/
sunder2.1/log/
sunder2.1/msgbase/
sunder2.1/src/o/
sunder2.1/time/
#!/bin/sh
DIALOG=${DIALOG=dialog}
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile;rm -rf ../bin/sunder.rc;cp ../bin/sunder.rc.autoback ../bin/sunder.rc;rm -rf ../src/options.h;cp ../src/options.h.autoback ../src/options.h" 1 2 5 15
trap "rm -f $tempfile" 0

cp ../bin/sunder.rc ../bin/sunder.rc.autoback;
rm -rf ../bin/sunder.rc;
cp ../src/options.h ../src/options.h.autoback;
rm -rf ../src/options.h;

echo "/* SunderMud 2.0. Please view the license before compiling. */
/* This file is auto-generated by ../bin/autosetup          */" >> ../src/options.h

 $DIALOG --title "Port Number" --clear --no-shadow \
         --inputbox "What port number would you like the mud to run on?\
		 This should be a number over 1024. Common values for many muds are 4000, 6666,\
		 9000 or 9999. Some port numbers may be used by other system services, so if you\
		 aren't sure, you should choose one of these.\
		 \n\nEnter a Port Number (4000 or 9000 recommended):" 0 0 2> $tempfile

case $? in
   0)
      echo "PORT_NUM `cat $tempfile`" >> ../bin/sunder.rc;;
esac

$DIALOG --title "E-Mail Verification" --clear \
        --no-shadow --yesno "SunderMud uses an account system where all characters are associated\
		with an email address that identifies the player. Every player is required, therefore\
		to set up a \"Master Account\" which has a password. Normally, this email is verified\
		by the user typing \"verify\" and returning a validation code to the mud. If you don't\
		want this feature, or your system doesn't have a functioning mail system, you can turn\
		it off here, and all accounts will be automatically upgraded to Verified upon creation.\
		\n\nDo you want E-Mail Verification?" 0 0
case $? in
 0)
 echo "VERIFY_EMAIL 1" >> ../bin/sunder.rc;;
 1)
 echo "NOVERIFY 1" >> ../bin/sunder.rc;;
esac

 
$DIALOG --title "Demi-God Access" --clear --no-shadow \
 --inputbox "Since SunderMud has the ability to associate different characters by the player\
 account, it was decided that more experienced players should be offered more powerful\
 characters, namely Demi-Gods. Demi-Gods cost much more xp to level, but gain some abilities\
 that mortals do not, and all clans require a Demi-God sponsor (who may or may not be in\
 the clan) to be recognized. Also, very importantly, if you enable Aging (later in this config),\
 Demi-Gods have the advantage over mortals that they do not die of old age.\n\n\
 The ability to have a Demi-God character is determined by 2 things: whether a player has validated\
 his or her account, and the number of Mortals the player has reached HERO level with.\n\n\
 I recommend a value of 2 here. If you enter '0', then the player must still create a mortal\
 as his or her first character, however will be immediately able to create a Demi-God afterward\
 without having to Hero.\n\n\
 How many Mortal Heros should a player have to create a Demi-God (2 recommended):" 0 0 2> $tempfile
 

case $? in
 0)
 echo "NEED_FORDEMI `cat $tempfile`" >> ../bin/sunder.rc;;
esac
 
$DIALOG --title "Characters Per Account" --clear --no-shadow \
 --inputbox "Each account can be limited on the number of characters, counting both\
mortal characters and Demi-God characters, that can be created under that account.\
Be aware that if you set this number too low, it will encourage those who are so inclined\
to simply create more accounts at different email addresses.\n\n\
 (This option requires a recompile to activate)\n\
Please enter Max Number of Characters Per Account (10 to 20 recommended):" 0 0 2>$tempfile
 
case $? in
 0)
 echo "/* Maximum characters per account. */" >> ../src/options.h;
 echo "#define MAX_CHARS `cat $tempfile`" >> ../src/options.h;;
esac
 
$DIALOG --title "Group Members" --clear --no-shadow \
--inputbox "Grouping is more popular on some muds than others, and some encourage it more,\
some less. SunderMud 2.0 includes a new grouping system which allows limits to be placed\
on maximum group size.\n\n\
 (This option requires a recompile to activate)\n\
Please enter a Maximum Number of Characters Per Group (recommended 5 to 10):" 0 0 2>$tempfile
 
case $? in
 0)
 echo "/* Maximum members per group. */" >> ../src/options.h;
 echo "#define MAX_GMEMBERS `cat $tempfile`" >> ../src/options.h;;
esac
 
$DIALOG --title "Maximum # of Aliases" --clear --no-shadow \
--inputbox "Aliases are a very handy feature for many users who don't have a mud client,\
have to mud from many locations, or simply don't know how to configure their mud client.\
Aliases in SunderMud allow multiple commands to be stacked, so they can take up quite an\
amount of memory. You may, therefore, limit the number of aliases any user is allowed to\
have on his character.\n\n\
 (This option requires a recompile to activate)\n\
Please enter a Maximum Number of Aliases Per Character (recommended 20):" 0 0 2>$tempfile

case $? in
 0)
 echo "/* A number of aliases (recommended 20) per user */" >> ../src/options.h;
 echo "#define MAX_ALIAS `cat $tempfile`" >> ../src/options.h;;
esac

$DIALOG --title "Aging Effects and Death" --clear --no-shadow \
--menu "SunderMud 2.0 tracks the characters \"age\" in based on time since created, rather\
than amount of time played. All characters will age as the game clock advances, and eventually\
they will reach old age. What happens at this point, is up to you right now. If Aging Effects\
are enabled, once a character reaches \"middle age\", depending on race, he or she has a chance to die of illness\
or old age, with the odds of this very small to begin with and increasing as the chracter gets\
older. Demi-God characters, however are immune to this. Mortals should have plenty of time to\
reach Hero and participate in many politics before reaching old age, and experienced players should\
create Demi-Gods if they wish to avoid this happening. As a benefit for their limited lives, Mortals\
are able to level much more quickly than Demi-Gods. However, I realize that this style of play, which\
is similar to muds which enforce \"PermaDeath\", is not popular with everyone, so you may disable the\
Aging Effects either partially or completely.\n\n\
Please make a selection: " 0 0 4 \
       "1"  "Full PermaDeath - Any character who dies for any reason is deleted." \
       "2"  "Full Aging      - Older Mortals may die of old age and are deleted." \
	   "3"  "Partial Aging   - Older Mortals may die, but it is not permanent." \
	   "4"  "No Aging        - Characters never die permanently - ever." 2> $tempfile

menuitem=`cat $tempfile`

case $? in
 0)
 echo "DEATHLEVEL $menuitem" >> ../bin/sunder.rc;;
esac

$DIALOG --title "Color Login" --clear --no-shadow \
--menu "This toggles the color prompt at the start of login. If you turn this prompt off,\
players will not be able to use colour login at all, and won't have colour unless they turn\
it on manually once in the game. However, you can also configure the game to assume everyone\
has colour, which is a pretty safe option these days. Most clients that don't support colour\
do at least strip the codes.\n\n\
Choose an option for Colour Login: " 0 0 3 \
      "1"   "No Colour     - No prompt and no colour login" \
	  "2"   "Assume Colour - Always use color without prompting." \
	  "3"   "Prompt        - Ask about colour when connecting." 2> $tempfile

menuitem=`cat $tempfile`

case $? in
 0)
   echo "COLORLEVEL $menuitem" >> ../bin/sunder.rc;;
esac

$DIALOG --title "Difficulty Level" --clear --no-shadow \
--menu "There is forever a debate on how hard a mud should be. I happen to fall on the side \
that believes levelling should be slow, however I know that not everyone feels the same way. \
Also if you are using the full PermaDeath option, you may wish to make levelling go much faster.\n\n\
Therefore, you can set the Difficulty level of the mud here. Currently, this only affects the \
amount of XP gained, but it affects it to a very large degree. \n\n\
  Please choose a difficulty: " 0 0 6 \
     "1"   "Easiest     - Players will advance very quickly. Best used with permadeath."\
	 "2"   "Easy        - Players will level pretty quick, but it will still take some time."\
	 "3"   "Normal      - Players will need to put in time to get levels."\
	 "4"   "Hard        - Levelling begins to slow down here, best without permadeath or age code."\
	 "5"   "Very Hard   - Players who reach Hero will have been quite dedicated at this level."\
	 "6"   "Nightmare   - Need you ask?" 2> $tempfile
	 
menuitem=`cat $tempfile`

case $? in
  0)
     echo "DIFFICULTY $menuitem" >> ../bin/sunder.rc;;
esac

$DIALOG --title "Clan Settings Part 1" --clear --no-shadow \
--inputbox "There are 3 basic requirements for someone on SunderMud to make a clan. \
Besides the obvious, they must not already be IN a clan, they must meet a minimum \
level requirement and pay a cost in both gold and questpoints. \
These 3 costs are up to you now. Do remember the minimum level to join a clan at all \
is level 10.\n\n\
  Please choose a Level to make a clan: " 0 0 2> $tempfile
  
case $? in
  0)
    echo "MAKELEVEL `cat $tempfile`" >> ../bin/sunder.rc;;
esac

$DIALOG --title "Clan Settings Part 2" --clear --no-shadow \
--inputbox "Now, you should choose a cost in GOLD to create a clan. \n\n\
  Please enter a Cost in Gold to make a clan: " 0 0 2> $tempfile
  
case $? in
  0)
    echo "MAKECOST `cat $tempfile`" >> ../bin/sunder.rc;;
esac

$DIALOG --title "Clan Settings Part 3" --clear --no-shadow \
--inputbox "Finally, enter a cost in QP to create a clan.\n\n\
  Please enter a Cost in Questpoints to make a clan: " 0 0 2> $tempfile

case $? in
  0)
    echo "MAKEQP `cat $tempfile`" >> ../bin/sunder.rc;;
esac	 

echo "End" >> ../bin/sunder.rc

$DIALOG --title "Finished!" --clear --no-shadow \
--msgbox "You have now finished configuring your sunder.rc file, as well as options.h \
The original file, if there was one, has been renamed to sunder.rc.autobackup should you need to\
return to your prior configuration. options.h has been backed up in this same manner." 0 0

case $? in
 0)
   echo "Complete."
esac