home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / PRE412.ZIP / ELRIC37.MOD < prev    next >
Text File  |  1990-06-13  |  9KB  |  324 lines

  1.                                   Elric 37
  2.                            Variable Gold per Chain
  3.  
  4.  
  5.   Hello, and welcome once again to another mod in the Elrics series. Todays
  6. mod allows you to set up variable gold per chain, so you can let users play
  7. global war for free, and charge them 9 to play Tetris.
  8.  
  9. Instead of spending all day on a big useless description of everything
  10. it does, and why, I'll just start off with the mod.
  11.  
  12. =============================================================================
  13.  
  14. /** this step is indeed a form step, much like a form letter **/
  15. 1. From DOS, in your dir where you keep your source....
  16.  
  17. PKZIP SOURCE *.c *.h
  18.  
  19. If you already have a source zip file, then
  20.  
  21. PKZIP -f source *.c *.h
  22.  
  23. This way you have a copy of everything before you screw it up with a bad mod.
  24. If you decide to take the mod out, it's as easy as
  25. PKUNZIP -x source
  26.  
  27. and hit Y to overwrite any files you changed.
  28.  
  29. /** we now resume our regularly scheduled mod with step 2.... **/
  30.  
  31. =============================================================================
  32.  
  33. 2. Load up Vardec.H. Dont you just love making changes there? Means recompile
  34. the whole BBS, including RETURN.EXE (just to be safe).
  35.  
  36. Start off by looking for the chainfilerec, and make these changes.
  37.  
  38. /* DATA FOR OTHER PROGRAMS AVAILABLE */
  39. typedef struct {
  40.     char        filename[81],        /* filename for .chn file */
  41.             description[81];    /* description of it */
  42.     unsigned char    sl,            /* seclev restriction */
  43.             ansir,            /* if ANSI required */
  44.                         gold;                   /* gold cost per game */
  45.     unsigned short    ar;            /* AR restriction */
  46. } chainfilerec;
  47.  
  48.  
  49. Just add the line that says gold, making sure to change the semi-colon; after
  50. ansir to a comma.
  51.  
  52. =============================================================================
  53. 3. Still in vardec.h, search down for the exemptions, and add exempt_gold
  54.  
  55.  
  56. /* userrec.exempt */
  57. #define exempt_ratio 0x01
  58. #define exempt_time 0x02
  59. #define exempt_all 0x04
  60. #define exempt_post 0x08
  61. #define exempt_gold 0x10      /** add me **/
  62.  
  63. =============================================================================
  64. 4. Now, save that, and load up BBSUTL1.C. Search down for show_chains,
  65. and replace it with this one...
  66.  
  67. void show_chains(int *mapp, int *map)
  68. {
  69.   int abort,i,i1;
  70.   char s[81];
  71.  
  72.   abort=0;
  73.   nl();
  74.   pl("#  (Gold) Name");
  75.   for (i=0; (i<*mapp) && (!abort) && (!hangup); i++) {
  76.     sprintf(s,"%2u. (%2u)    %s",i+1,
  77.               chains[map[i]].gold,chains[map[i]].description);
  78.     pla(s,&abort);
  79.   }
  80.   nl();
  81. }
  82.  
  83. =============================================================================
  84.  
  85. 5. Right under that, you should find run_chains. Make the indicated
  86. additions at the beginning of that procedure.
  87.  
  88. void run_chain(int cn)
  89. {
  90.   char s[81],s1[81],s2[81];
  91.   int oc;
  92.  
  93. /** start adding here **/
  94.  
  95.   if ((chains[cn].gold>0) && !(thisuser.exempt & exempt_gold)){
  96.     if (thisuser.gold<=chains[cn].gold) {
  97.       sprintf(s,"You only have %d gold pieces.\n\rYou need %d to play %s",
  98.                (int) thisuser.gold, chains[cn].gold,chains[cn].description);
  99.       pl(s);
  100.       return;
  101.     }
  102.     sprintf(s,"%s takes away %u pieces of gold for that playing that game",
  103.                syscfg.sysopname,chains[cn].gold);
  104.     pl(s);
  105.     thisuser.gold-=(float) chains[cn].gold;
  106.     sprintf(s,"That leaves you with %d gold pieces.",(int) thisuser.gold);
  107.     pl(s);
  108.     }
  109.  
  110. /** end of addition **/
  111.  
  112.   strcpy(s1,chains[cn].filename);
  113.   strcpy(s2,create_chain_file("CHAIN.TXT"));
  114.   stuff_in(s,s1,s2,"","","","");
  115.   sprintf(s2,"!Ran '%s'",chains[cn].description);
  116.   sysoplog(s2);
  117.   oc=chatcall;
  118.  
  119. =============================================================================
  120.  
  121. 6. Now save BBSUTL1.C, and load up SYSOPF.C. Scan down to modify_chains, and
  122. make the indicated additons and/or changes... Alternately, just block-read
  123. in this segment.
  124.  
  125.  
  126. void modify_chain(int n)
  127. {
  128.   chainfilerec c;
  129.   char s[81],s1[81],ch,ch2;
  130.   int i,i1,done;
  131.  
  132.   c=chains[n];
  133.   done=0;
  134.   do {
  135.     outchr(12);
  136.     print("A. Description  : ",c.description,"");
  137.     print("B. Filename     : ",c.filename,"");
  138.     itoa(c.sl,s,10);
  139.     print("C. SL           : ",s,"");
  140.     strcpy(s,"None.");
  141.     if (c.ar!=0) {
  142.       for (i=0; i<16; i++)
  143.         if ((1 << i) & c.ar)
  144.           s[0]='A'+i;
  145.       s[1]=0;
  146.     }
  147.     print("D. AR           : ",s,"");
  148.     sprintf(s,"E. ANSI         : %s",
  149.       ((c.ansir & ansir_ansi) ? "Required" : "Optional"));
  150.     pl(s);
  151.  
  152.     sprintf(s,"F. DOS Interrupt: %s",
  153.       ((c.ansir & ansir_no_DOS) ? "Not used" : "Used"));
  154.     pl(s);
  155.  
  156.     sprintf(s,"G. Gold         : %u",c.gold);  /** add **/
  157.     pl(s);                                     /** add **/
  158.  
  159.  
  160. /** This one was letter G, make it H **/
  161.     sprintf(s,"H. 300 Baud     : %s",
  162.       ((c.ansir & ansir_no_300) ?  "Not allowed" : "Allowed"));
  163.     pl(s);
  164.  
  165. /** same here, change from H to I **/
  166.     sprintf(s,"I. Shrink Out   : %s",
  167.       ((c.ansir & ansir_shrink) ?  "Yes" : "No"));
  168.     pl(s);
  169.     nl();
  170.     prt(2,"Which (A-I,Q) ? ");   /** change prompt **/
  171.     ch=onek("QABCDEFGHI");       /** add I on the end **/
  172.     switch(ch) {
  173.       case 'Q':done=1; break;
  174.       case 'A':
  175.         nl();
  176.         prt(2,"New Description? ");
  177.         inputl(s,40);
  178.         if (s[0])
  179.           strcpy(c.description,s);
  180.         break;
  181.       case 'B':
  182.         nl();
  183.         prt(2,"New Filename? ");
  184.         input(s,40);
  185.         if (s[0]!=0)
  186.           strcpy(c.filename,s);
  187.         break;
  188.       case 'C':
  189.         nl();
  190.         prt(2,"New SL? ");
  191.         input(s,3);
  192.         i=atoi(s);
  193.         if ((i>=0) && (i<256) && (s[0]))
  194.           c.sl=i;
  195.         break;
  196.       case 'D':
  197.         nl();
  198.         prt(2,"New AR (<SPC>=None) ? ");
  199.         ch2=onek("ABCDEFGHIJKLMNOP ");
  200.         if (ch2==32)
  201.           c.ar=0;
  202.         else
  203.           c.ar=1 << (ch2-'A');
  204.         break;
  205.       case 'E':
  206.         nl();
  207.         prt(5,"Require ANSI? ");
  208.         if (yn())
  209.       c.ansir |= ansir_ansi;
  210.     else
  211.       c.ansir &= ~ansir_ansi;
  212.         break;
  213.       case 'F':
  214.         nl();
  215.         prt(5,"Have BBS intercept DOS calls? ");
  216.         if (ny())
  217.       c.ansir &= ~ansir_no_DOS;
  218.     else
  219.       c.ansir |= ansir_no_DOS;
  220.         break;
  221. /** add this case in **/
  222.       case 'G':
  223.         nl();
  224.         prt(2,"New Gold Cost? ");
  225.         input(s,3);
  226.         i=atoi(s);
  227.         if ((i>=0) && (i<10) && (s[0]))
  228.           c.gold=i;
  229.         break;
  230. /** end of addition **/
  231.  
  232. /** change to case H **/
  233.       case 'H':
  234.         nl();
  235.         prt(5,"Allow 300 baud users to run? ");
  236.         if (ny())
  237.       c.ansir &= ~ansir_no_300;
  238.     else
  239.       c.ansir |= ansir_no_300;
  240.         break;
  241.  
  242. /** change to case I **/
  243.       case 'I':
  244.         nl();
  245.         prt(5,"Shrink the BBS to run? ");
  246.         if (yn())
  247.           c.ansir |= ansir_shrink;
  248.         else
  249.           c.ansir &= ~ansir_shrink;
  250.         break;
  251.     }
  252.   } while ((!done) && (!hangup));
  253.   chains[n]=c;
  254. }
  255.  
  256. =============================================================================
  257.  
  258. 7. Now look down for insert_chain, and add one line.
  259.  
  260.  
  261. void insert_chain(int n)
  262. {
  263.   chainfilerec c;
  264.   int i,i1,nu;
  265.  
  266.   for (i=numchain-1; i>=n; i--)
  267.     chains[i+1]=chains[i];
  268.   strcpy(c.description,"** NEW CHAIN **");
  269.   strcpy(c.filename,"REM");
  270.   c.sl=10;
  271.   c.ar=0;
  272.   c.ansir=0;
  273.   c.gold=0;          /** add me **/
  274.   chains[n]=c;
  275.   ++numchain;
  276.   modify_chain(n);
  277. }
  278.  
  279. =============================================================================
  280.  
  281. 8. Save the file, and compile the BBS. Load in CHAINCON.C, and compile
  282. in the Large memory model.
  283.  
  284. =============================================================================
  285.  
  286. 9. Run CHAINCON. When you are finished you can delete it, since you will
  287.    never need it again.
  288.  
  289. =============================================================================
  290.  
  291. 10. Run the BBS. Should be complete.
  292.  
  293. =============================================================================
  294. Anyone you choose to exempt from gold should be have 0x10, or 16 in decimal 
  295. if you prefer, added to their exemptions. Since the only other one that does
  296. anything is 0x01, or exempt from D/L ratios, you can give them 17 to be exempt
  297. from both, 16 just for gold, 1 just for D/L, and 0 to enforce everything.
  298.  
  299.  
  300.  
  301. /** hey, it's the form info file **/
  302. As usual, I take no responsibility for hard drive crashes, death in the
  303. family, or end of the world as we know it resulting from this mod.
  304.  
  305. It's your fault if you didn't back up the files before you made the mod.
  306.  
  307. It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
  308. a month.
  309.  
  310. It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
  311.  
  312. If you use this, the only payment I ask is that you send me a note through
  313. WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
  314.  
  315. The Kingdom of Melnibone(LINK/NET)
  316. 812-877-3488  24 Hrs a day
  317. 3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
  318. Auto-validation of WWIV sysops on first call
  319. Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
  320.  
  321. WWIV Link  1@18251
  322.  
  323. WWIV Net   1@8251
  324.