home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / NY_005A.ZIP / STRUCT.DOC < prev    next >
Text File  |  1995-11-02  |  11KB  |  261 lines

  1. NY2008 (update 3)
  2.  
  3. These are the 'C' structures used in user files, .sts file and mail, and newz:
  4.  
  5. Also here is a description how they work and stuff like that ... READ ALL!!
  6.  
  7. NOTE: all numbers of records are 0 based ... 0=1st record, user number 0 is
  8. the first in the file, enemy number 0 is the first in the file .... this is
  9. done for easy seeking of records .... to get the pointer to the beginning of
  10. record 34 in the user file do:
  11.  
  12.   fseek(fpUserFile,34 * sizeof(user_rec),SEEK_SET);
  13.  
  14.  
  15.  
  16. These are the enumerated types:
  17. (!!!!!!be sure to store them as *UNSIGNED CHARACTERS* not int!!!!!)
  18. (or you can use character values directly to write to theuser file,
  19.  here's how that would work: first choice=0, second=1 ... e.g. POT=0, HASH=1)
  20.  
  21. typedef enum {HANDS,PEPPER,KNIFE,CHAIN,GUN,RIFLE,LASER_GUN,SHOTGUN,MACHINEGUN,GRANADE_LAUNCHER,BLASTER,A_BOMB} weapon;
  22. typedef enum {POT,HASH,LSD,COKE,PCP,HEROIN} drug_type;
  23. typedef enum {MALE,FEMALE} sex_type;
  24. typedef enum {HEADBANGER,HIPPIE,BIG_FAT_DUDE,CRACK_ADDICT,PUNK} guy_type;
  25. typedef enum {NONE,CRAPS,HERPES,SYPHILIS,AIDS} desease;
  26. typedef enum {ALIVE,UNCONCIOUS,DEAD} guy_status;
  27. typedef enum {NOWHERE,MOTEL,REG_HOTEL,EXP_HOTEL} hotel_type;
  28.  
  29.  
  30. And here is the structure of the user file (and the .sts file):
  31. (you should not use the user file in the IGM, but this structure is written
  32.  to the temporary file .sts which you should read and modify upon exit)
  33.  
  34. NOTE: With BETA 9 the name of the .sts file changed to
  35. n<zero padded node number>.sts (the old style .sts files exist but changing
  36. them will not make any difference. They are there only for crash recovery
  37. purposes)
  38.  
  39. NOTE: All the strings are null terminated, if you are using pascal, use a
  40. conversion routine! if you are just creating IGM it is probably better
  41. to use the text character information file, the .stt file, read the
  42. 3rdparty.doc for more info.
  43.  
  44. NOTE: Editting hitpoints and strenghts is only temporary so not recomended,
  45. these are reset to defaults each time the user rise a level ... this will
  46. be redone sometime in the future, but not yet ... (i strongly recomend
  47. against doing that, and under no circumstances do not make hitpoints
  48. larger that maxhitpoints, or make max hitpoints smaller!)
  49.  
  50. NOTE: Read the SCORE FILE INFO further on, on modifying this file!!!
  51.  
  52. //Player User File structure (beta9+ format)
  53. typedef struct {
  54.     //character records
  55.     char            bbsname[36],     //the BBS name of the user
  56.             name[25],        //the name of the character
  57.             say_win[41],     //what the user says when he wins
  58.             say_loose[41];   // "    "    "   "    "   "  looses
  59.     //integer records
  60.     int             rank,            //user rank (read score file info
  61.                      //in this document!!!)
  62.             days_not_on,     //days the user has been inactive
  63.             strength,        //attacking strenght of the user
  64.             defense,         //defensive strenght
  65.             condoms,         //condoms user has
  66.             since_got_laid,  //days since the user last got laid
  67.             drug_hits,       //the hits of drug that the user has
  68.             drug_days_since; //if addicted how long the user
  69.                      //has not used the drug
  70.  
  71.     //long type records
  72.     long            hitpoints,       //users hitpoints
  73.             maxhitpoints;    //maximum of the users hitpoints
  74.  
  75.     //unsigned long type records
  76.     unsigned long   points,          //users points
  77.             money,           //money in hand
  78.             bank;            //money in bank
  79.  
  80.     //unsigned char type records used as values
  81.     unsigned char   level,           //user level
  82.             turns,           //fights the user has left today
  83.             hunger,          // % of hunger
  84.             sex_today,       //sex turns left today
  85.             std_percent,     // % of current std
  86.             drug_addiction,  // % of drug addiction
  87.             drug_high,       // % of how "high" the player is
  88.             hotel_paid_fer,  //for how many more days the hotel
  89.                      //is paid for
  90.             days_in_hospital;//how many days has the use been
  91.                      //in hospital
  92.  
  93.     /*enumerated types stored as unsigned chars!!! (not int)*/
  94.     guy_status      alive;           //user: alive, unconsious, or dead
  95.     sex_type        sex;             //user sex: Male, Female
  96.     guy_type        nation;          //what is he:
  97.                      //punk, headbanger ...
  98.     weapon          arm;             //players weapon
  99.     desease         std;             //current player std
  100.     drug_type       drug;            //current player drug type
  101.     hotel_type      rest_where;      //where the user is staying lately
  102.  
  103.     /*added values BETA 9*/
  104.     char            wtc;             //# of wtc bombings allowed per day
  105.                      //default=1
  106.     char            poison;          //number of poisoning of water allowed
  107.                      //per day, default=1
  108.  
  109. /*reserved for future use 8 bytes reset to 0*/
  110.     int             res1,
  111.             res2,
  112.             res3,
  113.             res4;
  114.     } user_rec;
  115.  
  116. Here is the mail header file NY2008.MSX structure:
  117.  
  118. typedef struct {
  119.     char    sender[25];    //sender character name
  120.     char    senderI[36];   //sender bbsname
  121.     sex_type sender_sex;   //sender sex
  122.     char    n1;            //unused!
  123.     char    recver[25];    //receiver character name
  124.     char    recverI[36];   //receiver bbs name, used for searching mail
  125.     long    location;      //position of the message text in the
  126.                    //NY2008.MSG file
  127.     int     afterquote;    //how many lines are a quote
  128.     int     length;        //how long is the post
  129.     int     flirt;         //flirt flag used for other flags too:
  130.                    //0=no flag normal mail
  131.                    //1=sender wants sex
  132.                    //999=positive reply to flirt 1 (no mail body)
  133.                    //1000=receiver was raped (no mail body)
  134.                    //1001=receiver was defeated (no mail body)
  135.                    //1002=receiver got some money (the amount
  136.                    //stored as text in a one line msg body)
  137.     desease ill;           //sender's illness (std)
  138.     char    n2;            //unused!
  139.     int     inf;           //sender's infection percent (std_percent)
  140.     int     deleted;       //is this mail deleted (TRUE,FALSE)
  141.     } mail_idx_type;
  142.  
  143. Here is how the NY2008.MSG works:
  144.  
  145. location record points to the line where message starts in NY2008.MSG
  146.  
  147. A line (any length is stored as an 80 byte character field) so the position
  148. of a message body is location*80. And just read an 80 character string, (79
  149. characters and a NULL terminating character) each record is 80 char long and
  150. the terminating NULL character is anywhere in this field. If the NULL character
  151. is the first character, it's a blank line!
  152.  
  153. All the other records are in lines as the units, (not bytes) too so if length
  154. is 3 the message is 3 lines long.
  155.  
  156. And online messages. To send an online message, add to or if it does not
  157. exist create a file called "U00<user number>.OMG", and store two, null
  158. terminated strings in it, one of them is 51 characters long (including the
  159. NULL character) and that is the message, the one that follows is the name
  160. of the sender which is 25 characters long. Do not delete this file, and if
  161. it exists add to it, so no messages are lost, in C use the "a+b" mode.
  162. The game will erase it when the user recieves the messages. Do not
  163. send online messages in the SingleNode mode, they would not work.
  164.  
  165. NOTE the .OMG file has to be in the flag directory to be read.
  166.  
  167.  
  168. Here is the newz structure:
  169. files are : NYNEWS.YES for yesterday's news
  170.         NYNEWS.TOD for today's news
  171.  
  172. struct {
  173.   char  tagline[80],
  174.     name[25],
  175.     name2[36];
  176.   int   flag;
  177. } newzfile;
  178. // flag settings//
  179. // 0 - system news (tagline)
  180. // 1 - user announcment (name) anounces (tagline)
  181. // 2 - user BUSTED (name) for (tagline)
  182. // 3 - user newz (name) (tagline)
  183. // 4 - user kicked ass (name) kicked (name2)'s ass
  184. // 5 - user had his ass kicked (name) was beat by (name2)
  185.  
  186.  
  187. And here are the enemy file structures .... (street fights)
  188.  
  189. typedef struct {
  190.     char            name[36];   //name of the enemy
  191.     long            hitpoints,  //it's hitpoints
  192.             strength,   //enemy offensive strength
  193.             defense;    //users defensive strength
  194.     weapon          arm;        //users weapon
  195.     char            n1;         //not used
  196.     } enemy;
  197.  
  198. This is an enemy record in the enemy file "NYENM.DAT", here is how the
  199. level indexing works ("NYENM.IDX"):
  200.  
  201. the file "NYENM.IDX" consists of two arrays:
  202.  
  203. int first[21];
  204. int last[21];
  205.  
  206. (In this order!)
  207.  
  208. The first array contains the number of the first monster (the number of the
  209. record in the enemy file 0=1st) to choose randomly from. last is the last
  210. enemy that can be used for that particular level.
  211.  
  212. Example:
  213.  
  214. user is in level 5 and first[5]=50 and last[5]=60, which means:
  215. create a random number between 50 and 60 and that is the enemy the user
  216. will fight.
  217.  
  218.  
  219. SCORE FILE INFO!!!!! READ BEFORE DOING ANYTHING!!!!!
  220.  
  221. This is the score file .... it is created every night during the
  222. maintanance. ("NY2008.SCR") (It is used for lot of stuff so don't mess
  223. it up !!!)
  224.  
  225. DO NOT TOUCH this file in your IGMs, I included the structure so that
  226. if you are going to change points of players or add players or NPCs
  227. outside of NY2008 (not in an IGM), so you can add them to the scr file
  228. and SORT it.
  229.  
  230. Also if you sort the score file, you have to change the rank variables
  231. in the user file. And vice versa, if you change the order of the user
  232. file, you have to change the user_num variables in the scr structure ...
  233.  
  234. Remember there is no temporary file for this structure and it is writen
  235. to all the time so the scores are up to date ... it is also used for user
  236. searching. Changing users properties here will have little effect.
  237. I strongly recomend not messing with the usr and scr files if any users are
  238. online. If you do, to change a rank of a user that is online send him a
  239. rank flag file (binary) ("U00?????.RNK"). dump the integer value of his new
  240. rank to this file. the proccess looks for these files and will process them
  241. as soon as it can ... (user num and alive numbers might change during the
  242. maintanance ... packing) .. this file should be treated as read only and if
  243. you read from it while people are online then close it as soon as you can,
  244. so other nodes can read it ... (or write - the game does)
  245.  
  246. typedef struct {
  247.     char            name[25]; //character's name
  248.     guy_type        nation;   //what is the character
  249.     char            n1;       //not used
  250.     int             level;    //his level
  251.     unsigned long   points;   //points
  252.     guy_status      alive;    //alive, unconsious or dead
  253.     char            n2;       //not used
  254.     sex_type        sex;      //users sex
  255.     char            n3;       //not used
  256.     int             user_num, // user's number in the usr file
  257.             online;   //TRUE or FALSE ... is the user online.
  258.     } scr_rec;
  259.  
  260.  
  261.