home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / EVENTS / LONEW11.ZIP / INITLW.C next >
Text File  |  1989-10-09  |  22KB  |  884 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "color.h"
  4. #include <dir.h>
  5.  
  6.  
  7.  
  8.  
  9. struct PLAYER
  10.     {
  11.             char name[81];
  12.     int number,
  13.             combat_skill,
  14.             endurance,
  15.             origendur,
  16.             skill[6],
  17.             weoponskill,
  18.             weopons[3],
  19.             money,
  20.             food,
  21.             moves,
  22.             day,
  23.             location,
  24.             special[101];
  25.             long score;
  26.     }player,player1;
  27.  
  28.     struct COUNTER
  29.     {
  30.      int count;
  31.     }counter;
  32.  
  33.     struct ROOMCH
  34.     {
  35.      int roomnum;
  36.      int roomtype;
  37.      int choice[5];
  38.      int dis[5];
  39.      int randhi[5];
  40.      int randlow[5];
  41.      int combat[5];
  42.      int endurance[5];
  43.      int comadder;          /*added to you combat*/
  44.      int endadder;         /*added to your endurance for this fight*/
  45.      int weaponin;
  46.      int specialin;
  47.      int specialuse;
  48.      int specialuse_adder;
  49.      int moneyin;
  50.      int moneyuse;
  51.      int foodin;
  52.      int fooduse;
  53.     }roomch[361];
  54.  
  55. struct SCORE
  56. {
  57.     char name[81];
  58.     long score;
  59. }scores[10];
  60.  
  61.  
  62.  
  63.  
  64.  
  65. main()
  66. {
  67.     char ch;
  68.  
  69.     printf(CLEAR);
  70.     printf("This will initialize the player file and wipe out all games in progress\n");
  71.     printf("Should I go on???");
  72.     ch=getche();
  73.     if(ch=='y' || ch=='Y') init();
  74. }
  75.  
  76. init()
  77. {
  78.     FILE *fptr;
  79.     int x,y;
  80.     char *one,ch,current[81],path[81],current1[81],path1[81];
  81.  
  82.  
  83.  
  84.   getcwd(current,80);
  85.     strcpy(path,current);
  86.     strcat(path,"\\lonewolf");
  87.     if((fptr=fopen("path.lw","w"))==NULL)
  88.         {
  89.             printf("There is a problem");
  90.             exit(0);
  91.         }
  92.     fputs(path,fptr);
  93.     fclose(fptr);
  94.     mkdir(path);
  95.  
  96.  
  97.     printf("\nThe Current directory is %s\n",current);
  98.     strcpy(current1,current);
  99.     strcat(current1,"\\instruct.sw");
  100.     strcpy(path1,path);
  101.     strcat(path1,"\\instruct.sw");
  102.     rename(current1,path1);
  103.  
  104.   strcpy(current1,current);
  105.     strcat(current1,"\\text1.sw");
  106.   strcpy(path1,path);
  107.     strcat(path1,"\\text1.sw");
  108.     rename(current1,path1);
  109.  
  110.     strcpy(current1,current);
  111.     strcat(current1,"\\text2.sw");
  112.   strcpy(path1,path);
  113.     strcat(path1,"\\text2.sw");
  114.     rename(current1,path1);
  115.  
  116.     strcpy(current1,current);
  117.     strcat(current1,"\\text3.sw");
  118.   strcpy(path1,path);
  119.     strcat(path1,"\\text3.sw");
  120.     rename(current1,path1);
  121.  
  122.     strcpy(current1,current);
  123.     strcat(current1,"\\text4.sw");
  124.   strcpy(path1,path);
  125.     strcat(path1,"\\text4.sw");
  126.     rename(current1,path1);
  127.  
  128.   strcpy(current1,current);
  129.     strcat(current1,"\\text5.sw");
  130.   strcpy(path1,path);
  131.     strcat(path1,"\\text5.sw");
  132.     rename(current1,path1);
  133.  
  134.   strcpy(current1,current);
  135.     strcat(current1,"\\text6.sw");
  136.   strcpy(path1,path);
  137.     strcat(path1,"\\text6.sw");
  138.     rename(current1,path1);
  139.  
  140.   strcpy(current1,current);
  141.     strcat(current1,"\\text7.sw");
  142.   strcpy(path1,path);
  143.     strcat(path1,"\\text7.sw");
  144.     rename(current1,path1);
  145.  
  146.     chdir(path);
  147.  
  148.     one="Not Used";
  149.     strcpy(player.name,one);
  150.     player.number=0;
  151.     counter.count=1;
  152.     player.combat_skill=0;
  153.     player.endurance=0;
  154.     player.origendur=0;
  155.         for(y=0;y<=5;y++)
  156.             {
  157.                 player.skill[y]=0;
  158.             }
  159.         player.weoponskill=11;
  160.         player.weopons[0]=0;
  161.         player.weopons[1]=0;
  162.         player.weopons[2]=11;
  163.         player.score=0;
  164.         player.money=0;
  165.         player.food=0;
  166.         for(y=0;y<=100;y++)
  167.         {
  168.             player.special[y]=0;
  169.         }
  170.  
  171.     if((fptr=fopen("players.sw","wb")) == NULL)
  172.     {
  173.         printf("Something is wrong!!!");
  174.         exit();
  175.     }
  176.     else
  177.     {
  178.         fwrite(&player,sizeof(player),1,fptr);
  179.     }
  180.     fclose(fptr);
  181.     if((fptr=fopen("counters.sw","wb")) == NULL)
  182.     {
  183.         printf("Something is wrong!!!");
  184.         exit();
  185.     }
  186.     else
  187.     {
  188.         fwrite(&counter,sizeof(counter),1,fptr);
  189.     }
  190.     fclose(fptr);
  191.  
  192.     /* this will initialize the rooms for now */
  193.     for(x=1;x<=361;x++)
  194.     {
  195.         roomch[x].roomnum=x;
  196.         roomch[x].roomtype=0;
  197.         roomch[x].choice[1]=0;
  198.         roomch[x].choice[2]=0;
  199.         roomch[x].choice[3]=0;
  200.         roomch[x].choice[4]=0;
  201.         roomch[x].choice[5]=0;
  202.         roomch[x].combat[1]=0;
  203.         roomch[x].endurance[1]=0;
  204.         roomch[x].specialin=0;
  205.         roomch[x].specialuse=0;
  206.         roomch[x].specialuse_adder=0;
  207.         roomch[x].weaponin=12;
  208.     }
  209.     add_room(1,1,85,275,141,0);
  210.     roomch[1].dis[3]=3;
  211.     add_room(85,1,229,99,0,0);
  212.     add_room(275,2,345,74,0,0);
  213.     roomch[275].randlow[1]=0;
  214.     roomch[275].randlow[2]=5;
  215.     roomch[275].randhi[1]=4;
  216.     roomch[275].randhi[2]=9;
  217.     add_room(99,1,222,0,0,0);
  218.     add_room(222,1,140,252,67,0);
  219.     roomch[222].dis[3]=4;
  220.     add_room(229,3,267,125,0,0);
  221.     roomch[229].combat[1]=16;
  222.     roomch[229].endurance[1]=25;
  223.     roomch[229].comadder=-1;
  224.     add_room(141,1,56,333);
  225.     add_room(56,1,222,0,0,0);
  226.     add_room(333,1,131,0,0,0);
  227.     add_room(140,1,14,252,215,36);
  228.     add_room(14,1,43,106,0,0);
  229.     add_room(345,1,272,19,0,0);
  230.     add_room(131,1,241,55,302,101);
  231.     add_room(67,1,140,0,0,0);
  232.     add_room(106,1,263,334,0,0);
  233.     add_room(252,1,155,70,0,0);
  234.     add_room(215,1,346,14,0,0);
  235.     add_room(43,3,195,106,0,0);
  236.     roomch[43].combat[1]=16;
  237.     roomch[43].endurance[1]=10;
  238.     add_room(155,1,70,0,0,0);
  239.     add_room(70,1,28,157,8,0);
  240.     roomch[70].dis[3]=3;
  241.     add_room(74,1,138,281,0,0);
  242.     add_room(19,1,272,119,69,0);
  243.     roomch[19].dis[3]=4;
  244.     add_room(272,1,134,305,0,0);
  245.     roomch[272].dis[1]=4;
  246.     add_room(195,1,59,106,0,0);
  247.     add_room(346,4,14,0,0,0);
  248.     roomch[346].weaponin=1;
  249.     add_room(59,1,124,106,211,0);
  250.     add_room(28,1,130,147,0,0);
  251.     add_room(334,1,162,73,48,0);
  252.     roomch[334].dis[2]=2;
  253.     roomch[334].dis[3]=3;
  254.     add_room(211,1,173,244,106,0);
  255.     roomch[211].dis[2]=3;
  256.     add_room(8,1,70,0,0,0);
  257.     add_room(30,1,194,261,0,0);
  258.     add_room(157,1,30,167);
  259.     add_room(167,1,88,264,178,0);
  260.     roomch[167].dis[3]=3;
  261.     add_room(194,1,208,148,0,0);
  262.     add_room(261,1,208,264,0,0);
  263.     add_room(264,1,97,6,0,0);
  264.     add_room(178,1,88,264,0,0);
  265.     add_room(216,1,264,0,0,0);
  266.     add_room(88,1,216,31);
  267.     roomch[88].dis[1]=5;
  268.     add_room(33,33,248,0,0,0);
  269.     roomch[33].moneyin=3;
  270.     add_room(2,2,343,276,0,0);
  271.     roomch[2].randlow[1]=0;
  272.     roomch[2].randlow[2]=5;
  273.     roomch[2].randhi[1]=4;
  274.     roomch[2].randhi[2]=9;
  275.     add_room(3,1,196,144,0,0);
  276.     add_room(4,1,75,175,218,0);
  277.     roomch[4].dis[3]=3;
  278.     add_room(5,1,111,0,0,0);
  279.     add_room(6,1,183,200,0,0);
  280.     add_room(7,2,108,25,0,0);
  281.     roomch[7].randlow[1]=0;
  282.     roomch[7].randlow[2]=3;
  283.     roomch[7].randhi[1]=2;
  284.     roomch[7].randhi[2]=9;
  285.     add_room(9,9,236,292,0,0);
  286.     roomch[9].specialuse=3;
  287.     add_room(10,1,115,83,0,0);
  288.     add_room(11,1,139,0,0,0);
  289.     add_room(12,12,262,247);
  290.     roomch[12].moneyuse=10;
  291.     add_room(13,1,307,213,0,0);
  292.     add_room(15,4,207,201,35,0);
  293.     roomch[15].weaponin=5;
  294.     add_room(16,1,192,0,0,0);
  295.     add_room(17,3,53,274,331,0);
  296.     roomch[17].randlow[1]=0;
  297.     roomch[17].randlow[2]=1;
  298.     roomch[17].randhi[1]=0;
  299.     roomch[17].randhi[2]=2;
  300.     roomch[17].randlow[3]=3;
  301.     roomch[17].randhi[3]=9;
  302.     roomch[17].combat[1]=16;
  303.     roomch[17].endurance[1]=24;
  304.     add_room(18,1,239,114,29,0);
  305.     roomch[18].dis[2]=114;
  306.     add_room(20,20,272,0,0,0);
  307.     roomch[20].weaponin=0;
  308.     roomch[20].foodin=2;
  309.     add_room(21,2,189,312,0,0);
  310.     roomch[21].randlow[1]=0;
  311.     roomch[21].randlow[2]=7;
  312.     roomch[21].randhi[1]=6;
  313.     roomch[21].randhi[2]=9;
  314.     add_room(22,2,181,145,0,0);
  315.     roomch[22].randlow[1]=0;
  316.     roomch[22].randlow[2]=5;
  317.     roomch[22].randhi[1]=4;
  318.     roomch[22].randhi[2]=9;
  319.     add_room(23,9,326,337,151,0);
  320.     roomch[23].dis[3]=10;
  321.     roomch[23].specialuse=5;
  322.     add_room(24,1,234,184);
  323.     add_room(25,1,139,0,0,0);
  324.     add_room(26,1,249,100,0,0);
  325.     add_room(27,1,250,52);
  326.     add_room(29,29,270,0,0,0);
  327.     roomch[29].combat[1]=17;
  328.     roomch[29].endurance[1]=25;
  329.     roomch[29].comadder=-2;
  330.     add_room(31,1,264,0,0,0);
  331.     add_room(32,1,176,340,0,0);
  332.     add_room(34,29,328,0,0,0);
  333.     roomch[34].combat[1]=17;
  334.     roomch[34].endurance[1]=25;
  335.     roomch[34].comadder=-2;
  336.     add_room(35,1,207,0,0,0);
  337.     add_room(36,2,140,323,0,0);
  338.     roomch[36].randlow[1]=0;
  339.     roomch[36].randlow[2]=5;
  340.     roomch[36].randhi[1]=4;
  341.     roomch[36].randhi[2]=9;
  342.     add_room(37,5,289,282,0,0);
  343.     roomch[37].dis[2]=1;
  344.     add_room(38,1,128,347,0,0);
  345.     add_room(39,1,228,0,0,0);
  346.     add_room(40,1,105,0,0,0);
  347.     add_room(41,1,174,116,0,0);
  348.     add_room(42,1,86,238,157,147);
  349.     add_room(44,2,277,338,0,0);
  350.     roomch[44].randlow[1]=0;
  351.     roomch[44].randlow[2]=5;
  352.     roomch[44].randhi[1]=4;
  353.     roomch[44].randhi[2]=9;
  354.     add_room(45,1,180,0,0,0);
  355.     add_room(46,12,246,90,296,0);
  356.     roomch[46].moneyuse=2;
  357.     roomch[46].dis[3]=3;
  358.     add_room(47,1,136,322,0,0);
  359.     add_room(48,1,243,0,0,0);
  360.     add_room(49,2,339,60,0,0);
  361.     roomch[49].randlow[1]=0;
  362.     roomch[49].randlow[2]=5;
  363.     roomch[49].randhi[1]=4;
  364.     roomch[49].randhi[2]=9;
  365.     add_room(50,1,97,243,0,0);
  366.     add_room(51,1,288,221,0,0);
  367.     add_room(52,1,225,250,0,0);
  368.     roomch[52].dis[1]=9;
  369.     add_room(53,99,0,0,0,0);
  370.     add_room(54,99,0,0,0,0);
  371.     add_room(55,3,325,0,0,0);
  372.     roomch[55].combat[1]=9;
  373.     roomch[55].endurance[1]=9;
  374.     roomch[55].comadder=4;
  375.     add_room(57,1,164,109,308,0);
  376.     add_room(58,1,286,160,0,0);
  377.     add_room(60,99,0,0,0,0);
  378.     add_room(61,1,268,0,0,0);
  379.     add_room(62,6,288,0,0,0);
  380.     roomch[62].moneyin=28;
  381.     roomch[62].foodin=3;
  382.     add_room(63,3,269,0,0,0);
  383.     roomch[63].combat[1]=11;
  384.     roomch[63].endurance[1]=10;
  385.     add_room(64,1,188,16,0,0);
  386.     add_room(65,1,104,0,0,0);
  387.     add_room(66,1,350,0,0,0);
  388.     add_room(68,1,130,15,0,0);
  389.     add_room(69,1,272,0,0,0);
  390.     add_room(71,1,242,104,65,0);
  391.     roomch[71].dis[3]=3;
  392.     add_room(72,3,265,0,0,0);
  393.     roomch[72].combat[1]=15;
  394.     roomch[72].endurance[1]=24;
  395.     add_room(73,1,243,0,0,0);
  396.     add_room(75,1,260,163,0,0);
  397.     add_room(76,7,118,0,0,0);
  398.     roomch[76].specialin=3;
  399.     add_room(77,1,19,0,0,0);
  400.     add_room(78,1,132,12,220);
  401.     add_room(79,1,204,0,0,0);
  402.     add_room(80,1,7,0,0,0);
  403.     add_room(81,1,183,200,0,0);
  404.     add_room(82,1,235,0,0,0);
  405.     add_room(83,1,205,180,232,45);
  406.     roomch[83].dis[4]=3;
  407.     add_room(84,1,188,0,0,0);
  408.     add_room(86,1,6,35,167,42);
  409.     add_room(87,1,61,0,0,0);
  410.     add_room(89,2,53,274,316,0);
  411.     roomch[89].randlow[1]=0;
  412.     roomch[89].randlow[2]=2;
  413.     roomch[89].randhi[1]=1;
  414.     roomch[89].randhi[2]=4;
  415.     roomch[89].randlow[3]=5;
  416.     roomch[89].randhi[3]=9;
  417.     add_room(90,1,18,0,0,0);
  418.     add_room(91,1,152,7,198,0);
  419.     roomch[91].dis[3]=3;
  420.     add_room(92,1,13,0,0,0);
  421.     add_room(93,1,106,0,0,0);
  422.     add_room(94,33,7,0,0,0);
  423.     roomch[94].moneyin=16;
  424.     add_room(95,1,240,5,0,0);
  425.     add_room(96,1,33,248,0,0);
  426.     add_room(97,1,255,306,0,0);
  427.     add_room(98,1,139,0,0,0);
  428.     add_room(100,1,161,133,257,0);
  429.     add_room(101,1,281,0,0,0);
  430.     add_room(102,1,284,0,0,0);
  431.     add_room(103,1,13,287,0,0);
  432.     add_room(104,1,26,100,0,0);
  433.     add_room(105,1,298,335,0,0);
  434.     roomch[105].dis[1]=9;
  435.     add_room(107,1,23,0,0,0);
  436.     add_room(108,99,0,0,0,0);
  437.     add_room(109,164,308,0,0);
  438.     add_room(110,1,55,0,0,0);
  439.     add_room(111,1,57,308,0,0);
  440.     add_room(112,3,33,248,0,0);
  441.     roomch[112].combat[1]=13;
  442.     roomch[112].endurance[1]=10;
  443.     roomch[112].combat[2]=12;
  444.     roomch[112].endurance[2]=10;
  445.     add_room(113,6,347,295,0,0);
  446.     roomch[113].moneyin=0;
  447.     roomch[113].foodin=3;
  448.     add_room(114,1,239,0,0,0);
  449.     add_room(115,1,150,177,83,0);
  450.     add_room(116,1,321,0,0,0);
  451.     add_room(117,1,330,0,0,0);
  452.     add_room(118,1,224,0,0,0);
  453.     add_room(119,8,226,38,0,0);
  454.     roomch[119].endadder=-2;
  455.     add_room(120,1,84,171,54,0);
  456.     add_room(121,1,342,309,283,0);
  457.     add_room(122,1,206,0,0,0);
  458.     add_room(123,1,304,2,0,0);
  459.     add_room(124,7,211,106,0,0);
  460.     roomch[124].specialin=6;
  461.     roomch[124].moneyin=15;
  462.     add_room(125,1,27,214,301,0);
  463.     roomch[125].dis[3]=4;
  464.     add_room(126,1,46,143,0,0);
  465.     add_room(127,99,0,0,0,0);
  466.     add_room(128,1,297,336,0,0);
  467.     roomch[128].dis[1]=2;
  468.     add_room(129,1,3,144,0,0);
  469.     add_room(130,5,28,201,0,0);
  470.     add_room(132,1,64,0,0,0);
  471.     add_room(133,3,266,0,0,0);
  472.     roomch[133].combat[1]=16;
  473.     roomch[133].endurance[1]=18;
  474.     add_room(134,1,305,40,0,0);
  475.     add_room(135,1,223,4,0,0);
  476.     add_room(136,3,313,0,0,0);
  477.     roomch[136].combat[1]=13;
  478.     roomch[136].endurance[1]=10;
  479.     roomch[136].combat[1]=12;
  480.     roomch[136].endurance[1]=10;
  481.     roomch[136].comadder=1;
  482.     add_room(137,7,23,0,0,0);
  483.     roomch[137].specialin=7;
  484.     add_room(138,3,291,0,0,0);
  485.     roomch[138].combat[1]=13;
  486.     roomch[138].endurance[1]=10;
  487.     roomch[138].combat[2]=12;
  488.     roomch[138].endurance[2]=10;
  489.     add_room(139,1,66,0,0,0);
  490.     add_room(142,1,58,135,102,0);
  491.     add_room(143,1,149,0,0,0);
  492.     add_room(144,144,63,217,0,0);
  493.     roomch[144].endadder=-2;
  494.     roomch[144].fooduse=1;
  495.     add_room(145,1,165,0,0,0);
  496.     add_room(146,8,154,0,0,0);
  497.     roomch[146].endadder=-3;
  498.     add_room(147,5,42,28,0,0);
  499.     add_room(148,4,81,320,199,0);
  500.     roomch[148].weaponin=4;
  501.     add_room(149,1,256,0,0,0);
  502.     add_room(150,1,83,0,0,0);
  503.     add_room(151,1,87,0,0,0);
  504.     roomch[151].dis[1]=10;
  505.     add_room(152,1,49,231,0,0);
  506.     add_room(153,1,202,135,329,0);
  507.     add_room(154,99,0,0,0,0);
  508.     add_room(156,1,294,245,0,0);
  509.     add_room(158,8,106,0,0,0);
  510.     roomch[158].endadder=-8;
  511.     add_room(159,1,191,234,0,0);
  512.     add_room(160,2,286,10,0,0);
  513.     roomch[160].randlow[1]=0;
  514.     roomch[160].randlow[2]=5;
  515.     roomch[160].randhi[1]=4;
  516.     roomch[160].randhi[2]=9;
  517.     add_room(161,7,209,0,0,0);
  518.     roomch[161].specialin=5;
  519.     add_room(162,162,258,127,0,0);
  520.     roomch[162].dis[1]=10;
  521.     add_room(163,1,321,0,0,0);
  522.     add_room(164,7,308,0,0,0);
  523.     add_room(165,1,212,0,0,0);
  524.     add_room(166,8,104,0,0,0);
  525.     add_room(168,5,64,0,0,0);
  526.     add_room(169,3,23,137,0,0);
  527.     roomch[169].combat[1]=16;
  528.     roomch[169].endurance[1]=16;
  529.     add_room(170,170,319,0,0,0);
  530.     roomch[170].combat[1]=17;
  531.     roomch[170].endurance[1]=7;
  532.     add_room(171,1,303,0,0,0);
  533.     add_room(172,1,239,114,29);
  534.     roomch[172].dis[2]=1;
  535.     add_room(173,9,158,259,0,0);
  536.     roomch[173].specialuse=6;
  537.     add_room(174,162,190,0,0,0);
  538.     add_room(175,1,41,116,182,0);
  539.     roomch[175].dis[3]=1;
  540.     add_room(176,1,253,126,0,0);
  541.     add_room(177,1,83,0,0,0);
  542.     add_room(179,1,318,51,0,0);
  543.     add_room(180,1,351,22,0,0);
  544.     add_room(351,3,62,0,0,0);   /*additional room to 180, split it up*/
  545.     roomch[351].combat[1]=15;
  546.     roomch[351].endurance[1]=20;
  547.     roomch[351].combat[2]=13;
  548.     roomch[351].endurance[2]=20;
  549.     roomch[351].combat[3]=12;
  550.     roomch[351].endurance[3]=20;
  551.     add_room(181,162,288,0,0,0);
  552.     add_room(182,1,174,0,0,0);
  553.     add_room(183,1,97,200,0,0);
  554.     add_room(184,184,64,0,0,0);
  555.     roomch[184].foodin=3;
  556.     roomch[184].moneyin=40;
  557.     roomch[184].weaponin=5;
  558.     add_room(185,99,0,0,0,0);
  559.     add_room(186,1,106,0,0,0);
  560.     add_room(187,1,186,228,0,0);
  561.     add_room(188,2,352,353,0,0);
  562.     roomch[188].randlow[1]=0;
  563.     roomch[188].randlow[2]=7;
  564.     roomch[188].randhi[1]=6;
  565.     roomch[188].randhi[2]=9;
  566.     add_room(352,162,303,0,0,0);  /* additional rooms for 188*/
  567.     add_room(353,8,303,0,0,0);
  568.     roomch[353].endadder=-3;
  569.     add_room(189,1,118,0,0,0);
  570.     add_room(190,1,20,273,0,0);
  571.     add_room(191,3,24,234,0,0);
  572.     roomch[191].combat[1]=11;
  573.     roomch[191].endurance[1]=21;
  574.     add_room(192,1,171,120,0,0);
  575.     add_room(193,1,253,126,0,0);
  576.     roomch[193].specialin=10;
  577.     add_room(196,1,332,144,0,0);
  578.     add_room(197,4,172,0,0,0);
  579.     roomch[197].weaponin=3;
  580.     add_room(198,1,7,152,0,0);
  581.     add_room(199,6,81,0,0,0);
  582.     add_room(200,1,78,168,0,0);
  583.     roomch[200].dis[2]=1;
  584.     add_room(201,1,238,215,130,0);
  585.     add_room(202,1,58,0,0,0);
  586.     add_room(203,8,344,80,0,0);
  587.     roomch[203].endadder=-10;
  588.     add_room(204,1,111,0,0,0);
  589.     add_room(205,2,181,145,0,0);
  590.     roomch[205].randlow[1]=0;
  591.     roomch[205].randlow[2]=4;
  592.     roomch[205].randhi[1]=5;
  593.     roomch[205].randhi[2]=9;
  594.     add_room(207,1,30,0,0,0);
  595.     add_room(208,3,148,320,0,0);
  596.     roomch[208].combat[1]=15;
  597.     roomch[208].endurance[1]=13;
  598.     add_room(209,1,23,0,0,0);
  599.     add_room(210,1,332,37,0,0);
  600.     add_room(212,8,350,0,0,0);
  601.     roomch[212].endadder=5;
  602.     add_room(213,1,331,0,0,0);
  603.     add_room(214,1,125,0,0,0);
  604.     add_room(217,1,91,7,0,0);
  605.     add_room(218,1,75,0,0,0);
  606.     add_room(219,99,0,0,0,0);
  607.     add_room(220,3,24,234,0,0);
  608.     roomch[220].combat[1]=11;
  609.     roomch[220].endurance[1]=20;
  610.     add_room(221,1,318,0,0,0);
  611.     add_room(223,1,75,175,0,0);
  612.     add_room(225,1,187,39,0,0);
  613.     add_room(226,2,277,338,0,0);
  614.     roomch[226].randlow[1]=0;
  615.     roomch[226].randlow[2]=4;
  616.     roomch[226].randhi[1]=5;
  617.     roomch[226].randhi[2]=9;
  618.     add_room(227,3,354,0,0,0);
  619.     roomch[227].combat[1]=16;
  620.     roomch[227].endurance[1]=6;
  621.     add_room(354,2,271,348,0,0);
  622.     roomch[354].randlow[1]=0;
  623.     roomch[354].randlow[2]=4;
  624.     roomch[354].randhi[1]=5;
  625.     roomch[354].randhi[2]=9;
  626.     add_room(228,1,140,215,0,0);
  627.     add_room(230,1,179,0,0,0);
  628.     add_room(231,3,355,0,0,0);
  629.     roomch[231].combat[1]=13;
  630.     roomch[231].endurance[1]=20;
  631.     add_room(355,2,94,203,7,0);
  632.     roomch[355].randlow[1]=0;
  633.     roomch[355].randlow[2]=2;
  634.     roomch[355].randlow[3]=6;
  635.     roomch[355].randhi[1]=1;
  636.     roomch[355].randhi[2]=5;
  637.     roomch[355].randhi[3]=9;
  638.     add_room(232,1,180,22,0,0);
  639.     add_room(234,99,0,0,0,0);
  640.     add_room(235,5,32,146,254,0);
  641.     roomch[235].dis[3]=4;
  642.     add_room(236,8,104,0,0,0);
  643.     roomch[236].endadder=-8;
  644.     add_room(237,2,265,72,0,0);
  645.     roomch[237].randlow[1]=0;
  646.     roomch[237].randlow[2]=4;
  647.     roomch[237].randhi[1]=5;
  648.     roomch[237].randhi[2]=9;
  649.     add_room(238,1,42,68,0,0);
  650.     add_room(239,1,34,118,0,0);
  651.     add_room(240,1,79,0,0,0);
  652.     add_room(241,1,349,0,0,0);
  653.     add_room(242,1,166,9,0,0);
  654.     roomch[242].dis[1]=7;
  655.     add_room(243,4,97,0,0,0);
  656.     roomch[243].weaponin=2;
  657.     add_room(244,1,93,0,0,0);
  658.     add_room(245,1,190,0,0,0);
  659.     add_room(246,3,197,0,0,0);
  660.     roomch[246].combat[1]=15;
  661.     roomch[246].endurance[1]=23;
  662.     add_room(247,1,159,220,0,0);
  663.     add_room(248,1,44,300,0,0);
  664.     add_room(249,1,169,107,0,0);
  665.     add_room(250,1,186,228,0,0);
  666.     add_room(251,1,10,0,0,0);
  667.     add_room(253,3,278,0,0,0);
  668.     roomch[253].combat[1]=13;
  669.     roomch[253].endurance[1]=24;
  670.     roomch[253].combat[2]=14;
  671.     roomch[253].endurance[2]=23;
  672.     roomch[253].combat[3]=14;
  673.     roomch[253].endurance[3]=22;
  674.     roomch[253].combat[4]=15;
  675.     roomch[253].endurance[4]=21;
  676.     add_room(254,1,32,146,0,0);
  677.     add_room(255,3,82,0,0,0);
  678.     roomch[255].combat[1]=20;
  679.     roomch[255].endurance[1]=30;
  680.     add_room(256,1,224,0,0,0);
  681.     add_room(257,1,133,161,0,0);
  682.     add_room(258,162,50,0,0,0);
  683.     add_room(259,99,0,0,0,0);
  684.     add_room(260,3,156,0,0,0);
  685.     roomch[260].comadder=-4;
  686.     roomch[260].combat[1]=11;
  687.     roomch[260].endurance[1]=18;
  688.     roomch[260].combat[2]=12;
  689.     roomch[260].endurance[2]=17;
  690.     add_room(262,1,191,234,0,0);
  691.     add_room(263,33,70,157,0,0);
  692.     roomch[263].moneyin=3;
  693.     add_room(265,1,142,0,0,0);
  694.     add_room(266,1,209,0,0,0);
  695.     add_room(267,7,125,0,0,0);
  696.     roomch[267].specialin=11;
  697.     add_room(268,1,288,0,0,0);
  698.     add_room(269,33,314,7,0,0);
  699.     roomch[269].moneyin=10;
  700.     add_room(270,1,21,0,0,0);
  701.     add_room(271,99,0,0,0,0);
  702.     add_room(273,1,179,51,0,0);
  703.     add_room(274,274,331,0,0,0);
  704.     add_room(276,8,213,0,0,0);
  705.     add_room(277,274,113,0,0,0);
  706.     add_room(278,1,149,0,0,0);
  707.     add_room(279,2,112,96,0,0);
  708.     roomch[279].randlow[1]=0;
  709.     roomch[279].randlow[2]=7;
  710.     roomch[279].randhi[1]=6;
  711.     roomch[279].randhi[2]=9;
  712.     add_room(280,1,327,170,0,0);
  713.     add_room(281,1,311,77,0,0);
  714.     add_room(282,1,11,0,0,0);
  715.     add_room(283,29,123,0,0,0);
  716.     roomch[283].combat[1]=17;
  717.     roomch[283].endurance[1]=25;
  718.     add_room(284,1,71,0,0,0);
  719.     add_room(285,1,325,0,0,0);
  720.     add_room(286,99,0,0,0);
  721.     add_room(287,1,13,330,0,0);
  722.     add_room(288,1,129,0,0,0);
  723.     add_room(289,1,139,0,0,0);
  724.     add_room(290,4,140,0,0,0);
  725.     roomch[290].weaponin=8;
  726.     add_room(291,4,272,0,0,0);
  727.     roomch[291].weaponin=0;
  728.     add_room(292,99,0,0,0,0);
  729.     add_room(293,1,281,0,0,0);
  730.     add_room(294,294,230,190,321,0);
  731.     roomch[294].randlow[1]=0;
  732.     roomch[294].randlow[2]=3;
  733.     roomch[294].randlow[3]=7;
  734.     roomch[294].randhi[1]=2;
  735.     roomch[294].randhi[2]=6;
  736.     roomch[294].randhi[3]=9;
  737.     add_room(295,1,185,92,0,0);
  738.     add_room(296,1,90,0,0,0);
  739.     add_room(297,1,117,0,0,0);
  740.     add_room(298,1,121,38,0,0);
  741.     add_room(299,1,227,95,0,0);
  742.     add_room(300,5,13,0,0,0);
  743.     add_room(301,1,27,0,0,0);
  744.     add_room(302,2,110,285,0,0);
  745.     roomch[302].randlow[1]=0;
  746.     roomch[302].randlow[2]=3;
  747.     roomch[302].randhi[1]=2;
  748.     roomch[302].randhi[2]=9;
  749.     add_room(303,1,237,72,0,0);
  750.     roomch[303].dis[1]=1;
  751.     add_room(304,304,2,0,0,0);
  752.     roomch[304].endadder=-2;
  753.     roomch[304].specialin=3;
  754.     add_room(305,4,105,0,0,0);
  755.     roomch[305].weaponin=1;
  756.     add_room(306,99,0,0,0,0);
  757.     add_room(307,6,213,0,0,0);
  758.     roomch[307].foodin=1;
  759.     add_room(309,99,0,0,0,0);
  760.     add_room(310,1,37,0,0,0);
  761.     add_room(311,1,279,47,324,0);
  762.     roomch[311].dis[3]=1;
  763.     add_room(312,1,299,0,0,0,0);
  764.     add_room(313,8,248,0,0,0);
  765.     roomch[313].endadder=-1;
  766.     add_room(314,2,341,98,0,0);
  767.     roomch[314].randlow[1]=0;
  768.     roomch[314].randlow[2]=7;
  769.     roomch[314].randhi[1]=6;
  770.     roomch[314].randhi[2]=9;
  771.     add_room(315,10,213,0,0,0);
  772.     roomch[315].moneyin=6;
  773.     roomch[315].specialin=12;
  774.     add_room(316,1,331,0,0,0);
  775.     add_room(317,1,61,0,0,0);
  776.     add_room(318,1,129,0,0,0);
  777.     add_room(319,10,157,0,0,0);
  778.     roomch[319].moneyin=20;
  779.     add_room(320,8,264,0,0,0);
  780.     roomch[320].endadder=-2;
  781.     add_room(321,1,273,0,0,0);
  782.     add_room(322,1,17,89,0,0);
  783.     add_room(323,1,290,140,0,0);
  784.     add_room(324,1,33,248,0,0);
  785.     add_room(325,1,349,0,0,0);
  786.     add_room(326,1,61,0,0,0);
  787.     add_room(327,99,0,0,0,0);
  788.     add_room(328,1,76,118,0,0);
  789.     add_room(329,1,284,0,0,0);
  790.     add_room(330,1,315,213,0,0);
  791.     add_room(331,1,170,280,0,0);
  792.     add_room(332,1,350,0,0,0);
  793.     add_room(335,1,121,0,0,0);
  794.     add_room(336,3,117,0,0,0);
  795.     roomch[336].combat[1]=14;
  796.     roomch[336].endurance[1]=11;
  797.     roomch[336].combat[2]=13;
  798.     roomch[336].endurance[2]=11;
  799.     add_room(337,2,219,317,0,0);
  800.     roomch[337].randlow[1]=0;
  801.     roomch[337].randlow[2]=7;
  802.     roomch[337].randhi[1]=6;
  803.     roomch[337].randhi[2]=9;
  804.     add_room(338,1,113,0,0,0);
  805.     add_room(339,3,356,0,0,0);
  806.     roomch[339].combat[1]=13;
  807.     roomch[339].endurance[1]=20;
  808.     add_room(356,2,94,203,7,0);
  809.     roomch[356].randlow[1]=0;
  810.     roomch[356].randlow[2]=2;
  811.     roomch[356].randhi[1]=1;
  812.     roomch[356].randhi[2]=5;
  813.     roomch[356].randlow[3]=6;
  814.     roomch[356].randlow[3]=9;
  815.     add_room(340,3,193,0,0,0);
  816.     roomch[340].combat[1]=14;
  817.     roomch[340].endurance[1]=24;
  818.     add_room(341,1,210,37,310,0);
  819.     roomch[341].dis[3]=4;
  820.     add_room(342,29,123,0,0,0);
  821.     roomch[342].comadder=-2;
  822.     roomch[342].combat[1]=18;
  823.     roomch[342].endurance[1]=26;
  824.     add_room(343,8,213,0,0,0);
  825.     roomch[343].endadder=-2;
  826.     add_room(344,1,60,0,0,0);
  827.     add_room(347,7,103,0,0,0);
  828.     roomch[347].specialin=9;
  829.     add_room(348,1,95,0,0,0);
  830.     add_room(349,7,293,0,0,0);
  831.     roomch[349].specialin=13;
  832.     add_room(350,350,0,0,0,0);
  833.  
  834.  
  835.     if((fptr=fopen("rooms.sw","wb")) == NULL)
  836.     {
  837.         printf("Something is wrong!!!");
  838.         exit();
  839.     }
  840.     else
  841.     {
  842.         for(x=0;x<=360;x++)
  843.         {
  844.         fwrite(&roomch[x],sizeof(roomch[x]),1,fptr);
  845.         }
  846.     }
  847.     fclose(fptr);
  848.     if((fptr=fopen("scores.sw","wb")) == NULL)
  849.     {
  850.         printf("Something is wrong!!!");
  851.         exit();
  852.     }
  853.     for(x=0;x<=9;x++)
  854.     {
  855.         strcpy(scores[x].name,"Noone");
  856.         scores[x].score=0;
  857.         fwrite(&scores[x],sizeof(scores[x]),1,fptr);
  858.     }
  859.     fclose(fptr);
  860.  
  861.  
  862.     chdir(current);
  863.  
  864.  
  865. }
  866.  
  867.  
  868.  
  869. add_room(num,type,c1,c2,c3,c4)
  870. int num,type,c1,c2,c3,c4;
  871. {
  872.     roomch[num].roomtype=type;
  873.     roomch[num].choice[1]=c1;
  874.     roomch[num].choice[2]=c2;
  875.     roomch[num].choice[3]=c3;
  876.     roomch[num].choice[4]=c4;
  877. }
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.