-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X return; X `7D X if (rnd(43) == 5) X `7B X if (c`5BWEAR`5D) X lprcat("You feel your armor vibrate for a moment"); X enchantarmor(); X return; X `7D X if (rnd(43) == 8) X `7B X if (c`5BWIELD`5D) X lprcat("You feel your weapon vibrate for a moment"); X enchweapon(); X return; X `7D X X lprcat("Thank You."); X return ; X `7D X X /* Player donates more gold than they have. Loop back around so X player can't escape the altar for free. X */ X lprcat("You don't have that much!"); X `7D X `7D X X/* X Performs the actions associated with 'just praying' at the altar. Calle Vd X when the user responds 'just pray' when in prompt mode, or enters 0 to X the money prompt when praying. X X Assumes cursors(), and that any leading \n have been printed (to get X around VMS echo mode problem. X*/ Xact_just_pray() X `7B X if (rnd(100)<75)`20 X lprcat("nothing happens"); X else if (rnd(43) == 10) X `7B X if (c`5BWEAR`5D)`20 X lprcat("You feel your armor vibrate for a moment"); X enchantarmor();`20 X return; X `7D X else if (rnd(43) == 10) X `7B X if (c`5BWIELD`5D)`20 X lprcat("You feel your weapon vibrate for a moment"); X enchweapon();`20 X return; X `7D X else`20 X createmonster(makemonst(level+1)); X return; X `7D X X/* X function to cast a +3 protection on the player X */ Xstatic act_prayer_heard() X `7B X lprcat("You have been heard!"); X if (c`5BALTPRO`5D==0)`20 X c`5BMOREDEFENSES`5D+=3; X c`5BALTPRO`5D += 500; /* protection field */ X bottomline(); X `7D X X/* X Performs the act of ignoring an altar. X X Assumptions: cursors() has been called. X*/ Xact_ignore_altar() X `7B X if (rnd(100)<30) `20 X `7B X createmonster(makemonst(level+1));`20 X c`5BAGGRAVATE`5D += rnd(450);`20 X `7D X else `20 X lprcat("\nNothing happens"); X return; X `7D X X/* X Performs the act of opening a chest. `20 X X Parameters: x,y location of the chest to open. X Assumptions: cursors() has been called previously X*/ Xact_open_chest(x,y) Xint x,y ; X `7B X int i,k; X X k=rnd(101); X if (k<40) X `7B X lprcat("\nThe chest explodes as you open it"); beep(); X i = rnd(10); lastnum=281; /* in case he dies */ X lprintf("\nYou suffer %d hit points damage!",(long)i); X checkloss(i); X switch(rnd(10)) /* see if he gets a curse */ X `7B X case 1: c`5BITCHING`5D+= rnd(1000)+100; X lprcat("\nYou feel an irritation spread over your skin!" V); X beep(); X break; X X case 2: c`5BCLUMSINESS`5D+= rnd(1600)+200; X lprcat("\nYou begin to lose hand to eye coordination!"); X beep(); X break; X X case 3: c`5BHALFDAM`5D+= rnd(1600)+200; X beep(); X lprcat("\nA sickness engulfs you!"); break; X `7D; X item`5Bx`5D`5By`5D=know`5Bx`5D`5By`5D=0; /* destroy the chest */ X if (rnd(100)<69) creategem(); /* gems from the chest */ X dropgold(rnd(110*iarg`5Bplayerx`5D`5Bplayery`5D+200)); X for (i=0; i3) c`5BSTRENGTH`5D--; X bottomline(); break; X X default: break; X `7D X return( 0 ); X `7D X else X `7B X know`5Bx`5D`5By`5D=0; X item`5Bx`5D`5By`5D=OOPENDOOR; X return( 1 ); X `7D X `7D $ CALL UNPACK ACTION.C;1 1361450494 $ create 'f' X/* bill.c */ X#include "header.h" X#include "larndefs.h" X X# ifdef MAIL X# include "player.h" X# ifdef VMS X# define MAILTMP "sys$scratch:" X# else X# define MAILTMP "/tmp/#" X# endif Xstatic int pid; Xstatic char mail600`5Bsizeof(MAILTMP)+sizeof("mail600")+20`5D; X# endif X/* X * function to create the tax bill for the user X */ X# ifdef MAIL Xstatic letter1() X# else Xstatic letter1(gold) Xlong gold; X# endif X `7B X# ifdef MAIL X sprintf(mail600,"%s%dmail600",MAILTMP,pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 600 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif /*RFCMAIL*/ X# endif X#ifdef RFCMAIL X lprcat("From: LRS (Larn Revenue Service)\n"); X lprcat("Subject: Undeclared Income\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" the LRS (Larn Revenue Service)\n"); X standout("\nSubject:"); lprcat(" undeclared income\n"); X#endif /*RFCMAIL*/ X lprcat("\n We heard you survived the caverns of Larn. Let me be the"); X lprcat("\nfirst to congratulate you on your success. It is quite a feat." V); X lprcat("\nIt must also have been very profitable for you."); X lprcat("\n\n The Dungeon Master has informed us that you brought"); X# ifdef MAIL X lprintf("\n%d gold pieces back with you from your journey. As the",(long) Vc`5BGOLD`5D); X# else X lprintf("\n%d gold pieces back with you from your journey. As the", gold) V; X# endif X lprcat("\ncounty of Larn is in dire need of funds, we have spared no time" V); X lprintf("\nin preparing your tax bill. You owe %d gold pieces as", X# ifdef MAIL X (long)c`5BGOLD`5D*TAXRATE); X# else X gold * TAXRATE); X# endif X lprcat("\nof this notice, and is due within 5 days. Failure to pay will") V; X lprcat("\nmean penalties. Once again, congratulations, We look forward"); X lprcat("\nto your future successful expeditions.\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X Xstatic letter2() X `7B X# ifdef MAIL X sprintf(mail600,"%s%dmail600",MAILTMP,pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 601 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif /*RFCMAIL*/ X# endif X#ifdef RFCMAIL X lprcat("From: King (His Majesty King Wilfred of Larndom)\n"); X lprcat("Subject: A Noble Deed\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" His Majesty King Wilfred of Larndom\n"); X standout("\nSubject:"); lprcat(" a noble deed\n"); X#endif /*RFCMAIL*/ X lprcat("\n I have heard of your magnificent feat, and I, King Wilfred,") V; X lprcat("\nforthwith declare today to be a national holiday. Furthermore," V); X lprcat("\nhence three days, Ye be invited to the castle to receive the"); X lprcat("\nhonour of Knight of the realm. Upon thy name shall it be writte Vn. . ."); X lprcat("\nBravery and courage be yours."); X lprcat("\nMay you live in happiness forevermore . . .\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X Xstatic letter3() X `7B X# ifdef MAIL X sprintf(mail600,"%s%dmail600",MAILTMP,pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 602 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif /*RFCMAIL*/ X# endif X#ifdef RFCMAIL X lprcat("From: Endelford (Count Endelford)\n"); X lprcat("Subject: You Bastard!\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" Count Endelford\n"); X standout("\nSubject:"); lprcat(" You Bastard!\n"); X#endif /*RFCMAIL*/ X lprcat("\n I heard (from sources) of your journey. Congratulations!"); X lprcat("\nYou Bastard! With several attempts I have yet to endure the"); X lprcat(" caves,\nand you, a nobody, makes the journey! From this time"); X lprcat(" onward, bewarned\nupon our meeting you shall pay the price!\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X Xstatic letter4() X `7B X# ifdef MAIL X sprintf(mail600,"%s%dmail600", MAILTMP,pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 603 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif /*RFCMAIL*/ X# endif X#ifdef RFCMAIL X lprcat("From: Mainair (Mainair, Duke of Larnty)\n"); X lprcat("Subject: High Praise\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" Mainair, Duke of Larnty\n"); X standout("\nSubject:"); lprcat(" High Praise\n"); X#endif /*RFCMAIL*/ X lprcat("\n With a certainty a hero I declare to be amongst us! A nod of V"); X lprcat("\nfavour I send to thee. Me thinks Count Endelford this day of"); X lprcat("\nright breath'eth fire as of dragon of whom ye are slayer. I"); X lprcat("\nyearn to behold his anger and jealously. Should ye choose to"); X lprcat("\nunleash some of thy wealth upon those who be unfortunate, I,"); X lprcat("\nDuke Mainair, Shall equal thy gift also.\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X Xstatic letter5() X `7B X# ifdef MAIL X sprintf(mail600,"%s%dmail600", MAILTMP,pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 604 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif /*RFCMAIL*/ X# endif X#ifdef RFCMAIL X lprcat("From: StMary (St. Mary's Children's Home)\n"); X lprcat("Subject: These Poor Children\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" St. Mary's Children's Home\n"); X standout("\nSubject:"); lprcat(" these poor children\n"); X#endif /*RFCMAIL*/ X lprcat("\n News of your great conquests has spread to all of Larndom."); X lprcat("\nMight I have a moment of a great man's time. We here at St."); X lprcat("\nMary's Children's Home are very poor, and many children are"); X lprcat("\nstarving. Disease is widespread and very often fatal without"); X lprcat("\ngood food. Could you possibly find it in your heart to help us" V); X lprcat("\nin our plight? Whatever you could give will help much."); X lprcat("\n(your gift is tax deductible)\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X Xstatic letter6() X `7B X# ifdef MAIL X sprintf(mail600, "%s%dmail600", MAILTMP, pid); /* prepare path */ X if (lcreat(mail600) < 0) `7B write(1,"can't write 605 letter\n",23); retur Vn(0);`7D X#ifndef RFCMAIL X lprcat("\n\n\n\n\n\n\n\n\n\n\n\n"); X#endif X# endif X#ifdef RFCMAIL X lprcat("From: CancerSociety (The National Cancer Society of Larn)\n"); X lprcat("Subject: Hope\n\n"); X#else /*RFCMAIL*/ X standout("From:"); lprcat(" The National Cancer Society of Larn\n"); X standout("\nSubject:"); lprcat(" hope\n"); X#endif /*RFCMAIL*/ X lprcat("\nCongratulations on your successful expedition. We are sure much V"); X lprcat("\ncourage and determination were needed on your quest. There are" V); X lprcat("\nmany though, that could never hope to undertake such a journey") V; X lprcat("\ndue to an enfeebling disease -- cancer. We at the National"); X lprcat("\nCancer Society of Larn wish to appeal to your philanthropy in"); X lprcat("\norder to save many good people -- possibly even yourself a few") V; X lprcat("\nyears from now. Much work needs to be done in researching this" V); X lprcat("\ndreaded disease, and you can help today. Could you please see i Vt"); X lprcat("\nin your heart to give generously? Your continued good health"); X lprcat("\ncan be your everlasting reward.\n"); X# ifdef MAIL X lwclose(); X# endif X return(1); X `7D X X Xstatic int (*pfn`5B`5D)()= `7B letter1, letter2, letter3, letter4, letter5, V letter6 `7D; X X# ifdef MAIL X/* X * function to mail the letters to the player if a winner X */ Xmailbill() X `7B X#ifdef VMS X register int i; X char buf`5B128`5D; X pid = getpid(); X for (i=0; i