
/* Double Daggers II  - Coded, Programmed & Designed by
   PRINCE DESTY for C-NET Amiga
    Version 2.8
Years of Developement 1990,1991,1992,1994

based on Double Daggers - written on atari 8-bit for carina II by Prince Desty

developement started in October 1990 then halted.
developement continued in April 1991....and continues
Halted June 1991...continued December 91...
Tested with CNET 2.10
 1992 my Amiga500 Died.

 1994 Bought an Amiga 600 and am now going to finish this beast.

*/

Options Results
bufferflush
Signal on ioerr
signal on syntax
signal on error
tinkering=0
getuser 1
handle = result
getuser 12
nowdate=result
call time ('R')
tlimit=40*60
atemp="Pfiles:DDCONFIG"
call inter
atemp="Pfiles:DDconfig2"
call inter
Transmit "c1Loading in Text..."
fpath="Daggers:DDII_TEXT"
if ~exists(Fpath) then do;Transmit "Daggers:DDII_TEXT Missing!";exit;end
call open(Text,Fpath,"R")
tz=0
do until eof(Text)
tz=tz+1
tx.tz=READLN(text)
end
tz=tz-1
if ~exists("Daggers:Maxmon") then do;transmit "c1Missing file MAXMON!!";quit;end
call open(temp,"Daggers:maxmon","R");maxmonsters=readln(temp);call close temp
atemp="Daggers:inter/Introinstall"
call inter
pathh="Daggers:MagicItems/"||handle
pretitle:
sendfile (Pretitles)
Sendstring "n1c3Option: c1" 
getchar
xtx=upper(left(result,1))
if xtx="#" then signal quit
if xtx="A" then do;transmit "About";sendfile (DAGPATH||"news/ABOUT");signal pretitle;end
if xtx="H" then do;Transmit "History";sendfile (DAGPATH||"news/History");signal pretitle;end
if xtx="O" then do;Transmit "Ordering";sendfile (DAGPATH||"news/Ordering");signal pretitle;end
if xtx="C" then do;Transmit "Credits";sendfile (DAGPATH||"news/Credits");signal pretitle;end
if xtx="R" then do;transmit "Read Paper";sendfile (DAGPATH||"text/ddpaper");signal pretitle;end 
if xtx="E" then do;transmit "ERROR LOG";Sendfile ("Daggers:ERRORLOG");signal pretitle;end
atemp="Daggers:inter/Introinstall2"
call inter
if exists(playerfile) then do;Call Loadcharacter;call doubledaggers;end
Transmit tx.1
Transmit tx.2
whatsex:
sendstring tx.3
getchar
u.1=upper(left(result,1))
if u.1="#" then call quit
if u.1 ="M" then do;Transmit "Male";call whatrace;end
if u.1 ="F" then do;Transmit "Female";call Whatrace;end
call whatsex
whatrace:
atemp="Daggers:inter/whatRace"
call inter
Raceoptions:
Transmit tx.4;transmit tx.5;transmit tx.6;sendstring tx.7
getchar
xtx=upper(left(result,1))
if xtx="#" then signal quit
if xtx="P" then do;Transmit "Pick a Race";signal showraces;end
if xtx="V" then do;transmit "View Races";signal viewraces;end
viewraces:
transmit tx.8
do i=1 to maxraces
transmit "c2["rkey.i"]c1 "racename.i
end
pickrace1:
query tx.9
xtx=upper(left(result,1))
if xtx="#" then signal quit
do i = 1 to maxraces
if xtx=rkey.i then do;signal setup339;end
end
signal viewraces
setup339:
sendfile (Rdes.i)
transmit "n1"tx.10
signal raceoptions
showraces:
transmit tx.11
do i=1 to maxraces
transmit "c2<"rkey.i">c1 "racename.i
end
pickrace:
query tx.9
xtx=upper(left(result,1))
if xtx="#" then signal quit
do i = 1 to maxraces
if xtx=rkey.i then do;signal setup33;end
end
signal showraces
setup33:
atemp="Daggers:inter/setup33"
call inter
call fixplayer3
LoadClasses:
atemp="Daggers:inter/loadclass"
call inter
Classoptions:
transmit tx.12;transmit tx.13;transmit tx.14;sendstring tx.15
getchar
xtx=upper(left(result,1))
if xtx="#" then signal Quit
if xtx="V" then do;Transmit "View Class Info";signal viewclassinfo;end
if xtx="P" then do;Transmit "Pick a Class";signal showclass;end
signal classoptions
ViewClassinfo:
Transmit tx.16
do i = 1 to maxclass
transmit "c2["clkey.i"]c1 "clname.i
end
selectclass1:
query tx.9
xtx=upper(left(result,1))
if xtx="#" then signal quit
do z=1 to maxclass
if xtx=clkey.z then signal cont987
end
signal classoptions
cont987:
atemp="Daggers:inter/cont987"
call inter
signal classoptions
showclass:
Transmit tx.17
do i = 1 to maxclass
transmit "c2<"clkey.i">c1 "clname.i
end
selectclass:
query tx.9
xtx=upper(left(result,1))
if xtx="#" then signal quit
do z=1 to maxclass
if xtx=clkey.z then do;u.27=clname.z;u.45=cl2.z;u.46=cl3.z;u.47=cl10.z;u.49=cl6.z;u.50=cl5.z;u.51=cl8.z;signal cont5;end
end
signal showclass
cont5:
atemp="daggers:inter/cont5";call inter
do until eof(ulist);TEMP=READLN(ULIST);if temp=handle then do;call close ulist;signal cont99;end;end
addulist:
atemp="Daggers:inter/addulist";call inter
cont99:
atemp="daggers:inter/cont99";call inter
call fixplayer3
call savecharacter
call loadcharacter
signal doubledaggers

loadcharacter:
Sendstring tx.18
call open(user,playerfile,"R")
do i = 1 to 60;u.i = readln(user);end
call close user
call fixplayer3
transmit "Loaded!"
pathh=Dagpath||"MagicItems/"||handle
if ~exists(pathh) then do;sendstring tx.19;do i=1 to 14;ma1.i="0";ma2.i="0";ma3.i="0";ma4.i="0";ma5.i="0";ma6.i="0";end;call open(fle,pathh,"W");signal off error;do i = 1 to 14;writeln(fle,ma1.i);writeln(fle,ma2.i);writeln(fle,ma3.i);writeln(fle,ma4.i);wr
iteln(fle,ma5.i);writeln(fle,ma6.i);end;signal on error;call close fle;transmit "Done.";end
inky:
atemp="Daggers:inter/inkey";call inter
if u.34=1 then do;awoke=1;Transmit tx.20;signal dungeon;end
if u.34=2 then do;awoke=1;transmit tx.21;signal forest;end
if u.34=0 then do;Transmit tx.22;signal doubledaggers;end
return

fixplayer3:
atemp="Daggers:inter/Fixplayer3"
call inter
return
fixplayer4:
return

SaveCharacter:
Sendstring tx.23
call fixplayer3
atemp="Daggers:inter/savecharacter"
call inter
return

quit:
shutdown
exit

showmagic:
atemp="Daggers:inter/showmagic";call inter
return

showstats:
atemp="Daggers:inter/stats"
call inter
return

doubledaggers:
atemp="Daggers:inter/daggers1";call inter
signal township
signal doubledaggers
Townmenu:

display:
if flzz="01" then call ARMORY
if flzz="02" then call WEAPON
if flzz="03" then call HEALER
if flzz="04" then do;u.32="000";u.33="001";call CHOOSEDUNGEON;end
if flzz="05" then do;u.32="000";u.33="001";call FOREST;end
if flzz="06" then call THEEND
if flzz="07" then call TRAINING
if flzz="08" then call MAGICSHOP
if flzz="09" then call SUPPLIES
if flzz="10" then call TAVERN
if flzz="11" then call GROCER
if flzz="12" then call BROTHEL
if flzz="13" then call INN
if flzz="14" then call CASINO
if flzz="15" then call showstats
if flzz="17" then call Otherplayers
if flzz="18" then call BANK
if flzz="19" then call postoffice
if flzz="20" then BBSCOMMAND "CHAT"
if flzz="21" then BBSCOMMAND "MS"
if flzz="22" then BBSCOMMAND "MR"
if flzz="23" then BBSCOMMAND "ET"
if flzz="16" then call council
if flzz="24" then call Suicide
if flzz="25" then signal sendmoney
if flzz="26" then signal TavernTalk
signal town2

postoffice:
atemp="Daggers:inter/PostOffice1";call inter
if xtx="#" then signal theend
if xtx="1" then do;transmit "Send Email";bbscommand "Mail Send";end	
if xtx="2" then do;transmit "Read Email";bbscommand "Read Mail";end
if xtx="3" then do;transmit "Feedback!";bbscommand "FEEDBACK";end
if xtx="4" then do;transmit "Edit Terminal";bbscommand "ET";end
if xtx="Q" then do;transmit "Exiting...";signal doubledaggers;end
transmit tx.24
signal postoffice

TavernTalk:
line="c5------------------------------------------------------------------------------c3"
base="Tavern Talk"
path=DAGPATH||"MESS/"
fle="msg."
main77:
atemp="daggers:inter/mess2";call inter
Main0:
atemp="Daggers:inter/mess3";call inter
if xtx="#" then do;transmit "Hang Up Detected";Signal TheEnd;end
if xtx="R" then do;Transmit "Read";signal ReadMessages;end
if xtx="W" then do;transmit "Write";signal PostAMessage;end
if xtx="Q" then do;transmit "Return to Town";Signal DoubleDaggers;end
if xtx="N" then do;Transmit "Read New";nim=u.59+1;signal mess3;end
signal main0
ReadMessages:
if high=0 & low=0 then do;transmit tx.25;signal main0;end
query tx.26
xtx=result
if upper(left(xtx,1))="Q" then signal main0
if datatype(xtx,"N")=0 then signal readmessages
nim=xtx
if nim=0 then signal endmess
mess3:
if nim>high then signal readmessages
if nim<low then signal readmessages
path2=path||"Msg."||nim
if ~exists(path2) then do;transmit tx.27;signal readmessages;end
atemp="Daggers:inter/mess1"
call inter
endmess:
sendstring tx.28
getchar
xtx=upper(left(result,1))
if xtx="#" then Do;Transmit "Hung Up";Signal TheEnd;end
if xtx="Q" then do;transmit "Quit";call checkhigh;signal main0;end
if xtx="N" then do;transmit "Next!";signal nextmess;end
if xtx="P" then do;transmit "Previous!";signal prevmess;end
if xtx="R" then do;transmit "Reply";signal REPLY;end
if xtx="J" then do;transmit "Jump!";signal JUMPMESS;end
signal endmess
checkhigh:
if nim>u.59 then u.59=nim
return
jumpmess:
Transmit tx.29low+1"c4 - c1"high
query tx.30
zz=result
if datatype(zz,"N")=0 then signal endmess
if zz>high then do;transmit tx.27;signal endmess;end
if zz<low+1 then do;transmit tx.27;signal endmess;end
nim=zz
signal mess3
nextmess:
nim=nim+1
if nim>high then do;transmit tx.31;nim=high;signal endmess;end
signal mess3
prevmess:
nim=nim-1
if nim<low+1 then do;transmit tx.32;nim=low+1;signal endmess;end
signal mess3 
Reply:
rep=1
Transmit "c3Replying to "r.1
m.2=r.1;m.1=handle
signal post2
PostAMessage:
rep=0
query tx.33
xtx=result
if left(xtx,1)="#" then Signal TheEnd
if xtx="" then signal main0
transmit "c3Writing to c7r1 "xtx" r0"
m.1=handle
m.2=xtx
post2:
do i=3 to 8;m.i="";end
sendfile ("Daggers:text/Messintro")
do i=3 to 8;query "c1"i-2")c3";m.i=result
if m.i="" then m.i=" ";if left(m.i,1)="#" then Signal TheEnd
if upper(left(m.i,4))="EXIT" then signal EDIT;end
edit:
endline=i-1
query "c4End Msg Cmd:c3 <?>c1 "
xtx=upper(left(result,1))
if xtx="#" then Signal TheEnd
if xtx="?" then do
transmit "n1[S]aven1[A]bort"
end
if xtx="S" then signal savemessage
if xtx="A" & rep=0 then do;transmit tx.34;signal main0;end
if xtx="A" & rep=1 then do;transmit tx.34;signal endmess;end
signal edit
savemessage:
Atemp="Daggers:inter/mess4";call inter
call update
if rep=0 then signal main0
if rep=1 then signal endmess
signal main0
Update:
atemp="Daggers:inter/mess5";call inter
return
signal main0

CheckExist:
call open(ulist,dagpath||"ULIST","R")
do until eof(ulist);TEMP=READLN(ULIST)
if upper(left(temp,22," "))=upper(left(Namen,22," ")) then do
call close ulist
exis=1
return
end
end
exis=0
call close ulist
return

SendMoney:
Transmit tx.35
Query "n1c3Send money to Who?c7 "
namen=result
if upper(left(namen,20)) = upper(left(handle,20)) then do;transmit tx.36;signal doubledaggers;end
if left(namen,1)="#" then signal theend
if left(namen,1)=" " then signal doubledaggers
if namen="" then signal doubledaggers
call checkexist
if exis=0 then do;transmit tx.37;signal doubledaggers;end
sendmoney2:
transmit "c4You have:c1 "u.20" "tx.47
query tx.38
xtx=result
if left(xtx,1)="#" then signal theend
dx=datatype(xtx,'N')
if dx=0 then signal sendmoney2
if xtx=0 then signal doubledaggers
if xtx>u.20 then do;transmit tx.39;signal doubledaggers;end
if xtx<1 then do;Transmit tx.40;signal doubledaggers;end
atemp="Daggers:inter/TransAction";call inter
signal doubledaggers

Suicide:
Transmit tx.41
query tx.42
xtx = result
if left(xtx,1)="#" then signal theend
if upper(left(xtx,1))="Y" then signal Deleteplayer
return
deleteplayer:
atemp="Daggers:inter/Suicide"
call inter
shutdown
exit

Council:
atemp="Daggers:inter/council";call inter
if xtx="#" then signal theend
if xtx="H" then signal AboutDungeon
if xtx="Y" then call showstats
if xtx="L" then call otherplayers
if xtx="Q" then signal doubledaggers
signal council
AboutDungeon:
Text1path=DAGPATH||"text/DaggersHelp"
sendfile (Text1Path)
transmit tx.10
signal council

CASINO:
Transmit tx.10
if u.20<1 then do;transmit tx.43;signal doubledaggers;end
sendfile ("Daggers:text/Casinomenu")
query "n1c3Casino Cmd:c7 "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="Q" then signal doubledaggers
if xtx="1" then signal NumberGuesser
if xtx="2" then signal execution
if xtx="3" then signal cointoss
signal casino

cointoss:
sendfile (DAGPATH||"text/CoinToss")
transmit "n1c3You have: c7"u.20" "tx.47
query "n1c4Place your bet[max=25]: "
xtx=result
if left(xtx,1)="#" then signal theend
cx=datatype(xtx,'N')
if cx=0 then signal casino
if xtx>u.20 then do;transmit tx.39;signal casino;end
if xtx<1 then do;transmit tx.40;signal casino;end
if xtx>25 then do;transmit tx.44;signal casino;end
bet=xtx
exe3:
query "c4n1Headsc2 or c4Tails:c7[H/T]: c1"
x=upper(left(result,1))
if x="H" then do;Transmit "c3Betting on Heads.";x=1;signal toss2;end
if x="T" then do;transmit "c3Betting on Tails.";x=2;signal toss2;end
if x="#" then signal theend
signal exe3
toss2:
atemp="Daggers:inter/CoinToss2";call inter
signal casino

execution:
sendfile (DAGPATH||"text/Execution")
transmit "n1c3You have: c7"u.20" "tx.47
query "n1c4Place your bet[max=500]: "
xtx=result
if left(xtx,1)="#" then signal theend
cx=datatype(xtx,'N')
if cx=0 then signal casino
if xtx>u.20 then do;transmit tx.39;signal casino;end
if xtx<1 then do;transmit tx.40;signal casino;end
if xtx>500 then do;transmit tx.44;signal casino;end
bet=xtx
exe2:
query "c1n1How many chops(1-20): c3"
xtx=result
if left(xtx,1)="#" then signal theend
cx=datatype(xtx,'N')
if cx=0 then signal exe2
if xtx>20 then signal exe2
if xtx<1 then signal exe2
atemp="Daggers:inter/ChickenKill1";call inter
if win=0 then do;transmit tx.46;u.20=u.20-bet;signal casino;end
x=win*bet
transmit "c3You won c7" x ""tx.47
u.20=u.20+x
transmit tx.10
signal casino

NumberGuesser:
rannum=random(1,100,time('s'))
transmit "c1Ok, The Number has Been Chosen."
Transmit "the Range of Numbers is 1-100 ,1 and 100 are Included."
Transmit "n1c3Gold: c7"u.20
query "c1What is your Bet?<max=50>: "
xtx=result
if upper(left(result,1))="#" then signal theend
cx=datatype(result,'N')
if cx=0 then signal casino
if xtx<1 then signal casino
if xtx>u.20 then do;transmit tx.39;signal casino;end
if xtx>50 then do;Transmit tx.44;signal casino;end
bet=xtx
numcount=1
Picknum:
query "c3Try #"numcount": "
xtx=result
if upper(left(result,1))="#" then signal theend
cx=datatype(result,'N')
if cx=0 then signal picknum
if xtx<1 then signal picknum
if xtx<rannum then do;transmit "c1Number is Higher!";end
if xtx>rannum then do;Transmit "c1Number is Lower!";end
if xtx=rannum then do;Transmit "c1You got it!";signal winguess;end
numcount=numcount+1;if numcount=7 then do;Transmit "c1Too Many Tries!";signal loseguess;end
signal picknum
Winguess:
winnings=bet*2
u.20=u.20+winnings
transmit tx.48""winnings""tx.47
signal casino
loseguess:
u.20=u.20-bet
transmit tx.49""bet" "tx.47
signal casino
OtherPlayers:
Transmit "f1c1 Other Players n1"
call open(ulist,DAGpath||"ULIST","R")
xrrr=0
transmit "c2Players Name                Class        lev     Race      Located "
transmit "c1--------------------   ----------------  ---  -----------  ------- "
do until eof(ulist)=1
xrrr=xrrr+1
temp=readln(ulist)
if temp="" then do;call close ulist;return;end
path2=DAGPATH||"users/"||temp
if exists(path2) then do;call open(other,path2,'R');do i=1 to 60;zzn.i=readln(other);end;call close other;end
if zzn.34=1 then oloc="c4Dungeon "
if zzn.34=2 then oloc="c4Forest  "
if zzn.34=0 then oloc="c4Town    "
if zzn.3<0 then  oloc="c4Hospital"
statline="c7"||left(temp,20)||"  c5 "||left(zzn.27,16)||"   "||left(zzn.18,2)||"  c4"||left(zzn.2,11)||"c3  "||Oloc
if ~exists(path2) then statline="c7"||left(temp,20)||"c3   c4 Unknown Stats"
if temp="" then do;call close ulist;transmit "n1";return;end
if temp~="" then do;transmit statline;end
end
call close ulist
transmit "n1"
return

INN:
Transmit "f1c1Blue Belly Inn!n1"
Transmit "c3<S>c7tay the Night"
transmit "c3<Q>c7uit to Town"
query "n1c1Choice: "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="Q" then signal DoubleDaggers
if xtx="S" then call staynight
signal inn
Staynight:
Transmit "n1c5It costs 50 Gold coins to stay the night."
query "c1Do you pay the 50? "
xtx=upper(left(Result,1))
if xtx="#" then signal theend
if xtx="N" then signal inn
if xtx="Y" then signal Staynightyes
signal staynight
staynightyes:
if u.20<50 then do;transmit tx.39;signal inn;end
atemp="Daggers:inter/inn1";call inter
signal doubledaggers

randomgold:
gp=random(1,10,time('s'))
return

BROTHEL:
Transmit "f1c1The House of Pleasures.n1"
loadGIRLS:
atemp="Daggers:inter/loadgirls";call inter
Displaychicks:
atemp="Daggers:inter/displaygirls";call inter
choosechick:
Transmit "n1c1 Enter 0 to Leave.."
query "c7Who might Yea be Interested in? "
xtx=Upper(left(result,1))
if xtx="#" then signal theend
if xtx="0" then do;signal Doubledaggers;end
do z=1 to maxgirls
if xtx=girlkey.z then do;signal checkoutchick;end
end
Transmit "c1n1Sorry I don't see anyone by that name.."
signal brothel
checkoutchick:
atemp="Daggers:inter/ChooseChick";call inter
if xtx="#" then signal theend
if xtx="Y" then signal BUYCHICK
transmit "c3Sorry, I don't work for peanuts."
signal brothel
buychick:
if girlcost.z>u.20 then do;transmit tx.39;signal doubledaggers;end
u.20=u.20-girlcost.z
Transmit "c1n2You hand "girlname.z" "girlcost.z" Gold Coins.."
sendfile (girltext.z)
transmit tx.10
if girldis.z~="0" then do;transmit tx.50;dis=girldis.z;call diseasecrap;end
signal doubledaggers 
diseasecrap:
u.23=dis
if dis="1" then Transmit "You are A carrier of Hendrixia."
if dis="2" then transmit "You have a common Cold." 
if dis="3" then transmit "You Have Toximilous."
if dis="4" then trasnmit "You have Astenian Fever."
return

BANK:
transmit tx.10"f1The Red Roof Bankn1"
Transmit "c2<C>heck Balance"
transmit "c2<D>epoit"
transmit "c2<W>ithdraw"
transmit "c2<Q>uit to Town"
query "n1c1Bank Cmd: "
xtx=upper(left(Result,1))
if xtx="#" then signal theend
if xtx="C" then do;Transmit "n1c1Your Account Balance is "u.21;signal bank;end
if xtx="Q" then signal doubledaggers
if xtx="D" then signal bankdeposit
if xtx="W" then signal banktake
Signal Bank
bankdeposit:
Transmit "c7n1r1 Deposit r0"
transmit "c3You have "u.20""tx.47" in Hand."
query "c1n1Deposit How Much? "
xtx=result
if xtx="" then signal bank
if upper(left(result,1))="#" then signal theend
if datatype(xtx,'N')=0 then signal deposit
if xtx<1 then signal bank
if xtx>u.20 then do;Transmit tx.39;signal bank;end
u.20=u.20-xtx;u.21=u.21+xtx
transmit "c1You deposit "xtx""tx.47
signal bank
banktake:
transmit "c7n1r1 WithDraw r0"
transmit "c3You have "u.21""tx.47" in the Bank."
query "c1n1WithDraw How Much? "
xtx=result
if xtx="" then signal bank
if upper(left(result,1))="#" then signal theend
if datatype(xtx,'N') =0 then signal banktake
if xtx<1 then signal bank
if xtx>u.21 then do;transmit tx.39;signal bank;end
u.20=u.20+xtx;u.21=u.21-xtx
transmit "c1You withdrew "xtx""tx.47
signal bank

GROCER:
transmit tx.10
transmit "f1c1Arnies Food Goods"
transmit "c2----------------------->"
transmit "c1<B> c2Buy Food     "
transmit "c1<Q> c2Exit to Town "
query "n1c1Choice:c3 "
txx = upper(left(result,1))
if txx="Q" then signal DoubleDaggers
if txx="#" then signal theend
if txx="B" then signal BUYFOOD
signal grocer
BUYFOOD:
bufferflush
transmit tx.60" "FoodCost" Gold / Ration"
Query tx.53
fb=result
if fb=0 then signal grocer
if fb="#" then signal theend
ck=datatype(fb,'N')
if ck=0 then signal buyfood
if fb<1 then signal buyfood
if fb*foodcost>u.20 then do;transmit tx.39;signal grocer;end
cost=fb*foodcost
u.20=u.20-cost;transmit tx.61" "cost" "tx.47" and he gives you a Sack of Food."
u.37=u.37+fb
signal grocer

SPELLLIST:
if u.45=0 then do;transmit "c1Members of your Profession CanNOT cast spells.";return;end
transmit "f1c1Which of your Spell books do you wish to open?n1 "
transmit "c3[H]c7 Book of Healing "
transmit "c3[C]c7 Book of Combat"
transmit "c3[M]c7 Book of All Else"
Sendstring tx.9;getchar
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="H" then do;transmit "Healing";sptype=2;signal spelllist2;end
if xtx="C" then do;transmit "Combat!";sptype=1;signal spelllist2;end
if xtx="M" then do;transmit "Miscellaneous";sptype=3;signal spelllist2;end
Transmit "None"
signal gohome
spelllist2:
atemp="Daggers:inter/Spell1"
call inter
do r=1 to maxspell
if (u.5+1)> mananeed.r & spellaction.r=sptype then do;Sendstring "c1("left(spellkey.r,3)")  "left(mananeed.r,5)"c4 ";end
if spellaction.r=1 & (U.5+1)>mananeed.r & spellaction.r=sptype then sendstring "Combat "
if spellaction.r=2 & (u.5+1)>mananeed.r & spellaction.r=sptype then sendstring "Healing"
if spellaction.r=3 & (u.5+1)>mananeed.r & spellaction.r=sptype then sendstring "Unknown"
if (u.5+1)>mananeed.r & Spellaction.r=sptype then transmit "c7  "left(spellname.r,20)
end
transmit "c3----------------------------------------"
bufferflush
Query "c7n1Cast Which Spell?<0=none> ";xtx=""
veri=result
xtx=upper(left(veri,2))
xxtx=upper(left(veri,1))
if xxtx="#" then signal theend
if xxtx="0" then do;transmit "n1c1Putting away spell book";return;end
do v=1 to maxspell
if xtx=spellkey.v then signal Castit
end
transmit "c1I don't know any spell by that name."
return
Castit:
if spellaction.v=2 & U.49~="1" then do;transmit "c1You cannot cast Healing Spells!";return;end
if spellaction.v=1 & U.50~="1" then do;Transmit "c1You cannot Cast Combat Spells!";return;end
if mananeed.v>u.5 then do;transmit "c1Not enough Spell Points!";return;end
u.5=u.5-mananeed.v
if u.5<1 then u.5=0
if spellfails=1 & Clloc=1 then do;Transmit tx.51;return;end
if spellfails=1 & clloc=2 then do;Transmit tx.52;return;end
if spellfails=1 & clloc=0 then do;Transmit tx.52;return;end
call close cast
call open(cast,spellcastpath.v,'R')
do until eof(cast)=1
interpret readln(cast)
end
call close cast
return

TAVERN:
transmit "c1Black Dragon Tavern.. n1"
pat.1=random(1,maxpatrons,time('s'))
Locflow1:
pat.2=random(1,maxpatrons,time('s'))
if pat.2=pat.1 then signal locflow1
atemp="Daggers:inter/patron1";call inter
tavern2:
Query "n1c7Tavern:[?]Menu: "
xtx=upper(left(Result,1))
if xtx="#" then signal theend
if xtx="?" then do;Transmit "n1c1 Tavern Menu n2c7r1[H]r0 Tavern Helpn1c7r1[A]r0ttempt to Pickpocket Someonen1r1[T]r0alk to Patronn1r1[B]r0uy a Drinkn1r1[Q]r0uit to Town";end
if xtx="B" then signal buydrink
if xtx="A" then signal pickpocket
if xtx="T" then signal patrontalk
if xtx="Q" then do;signal doubledaggers;end
if xtx="H" then signal Tavernhelp
signal tavern2
TavernHelp:
atemp="Daggers:inter/TavernHelp"
call inter
signal tavern2
pickpocket:
Transmit "c1n1You walk up to an Unsuspecting Patron...w1"
Transmit "c3You Carefully...w1Stick your hand in thier Purse...w1"
chance=random(1,100,time('s'))
if u.46=0 then Transmit "c2You got Caught!!!";signal CatchThief;end
if chance>u.39 then do;Transmit "c2You got Caught!!!";signal Catchthief;end
call randomgold
transmit "c7You Manage to get "gp""tx.47;u.20=u.20+gp
signal tavern2
CatchThief:
atemp="Daggers:inter/CatchThief";call inter
signal doubledaggers
BuyDrink:
atemp="Daggers:inter/DrinkMenu";call inter
if xtx="#" then signal theend
if xtx="1" then signal BuyBeer
if xtx="2" then signal buyale
if xtx="3" then signal buywine
if xtx="4" then signal Bloodymary
if xtx="0" then signal tavern
signal buydrink
BuyBeer:
transmit "c1The cost is 2 coins..";if u.20<2 then do;transmit "Get out!";signal doubledaggers;end
transmit "c2The bartender hands you a Beer, You give him 2 coins.";u.20=u.20-2
Transmit "c3After drinking your beer, you Feel Refreshed.."
signal tavern2
Buyale:
Transmit "c1The cost is 5 coins..";if u.20<5 then do;transmit "Get out!";signal doubledaggers;end
Transmit "c2The Bartnder hands you a Frosty Mug of Ale, you give him 5 coins.";u.20=u.20-5
Transmit "c3Ahh.. The Good Life, you sit back and drink your Ale."
signal tavern2
buyWine:
transmit "c1The cost is 7 Coins..";if u.20<7 then do;transmit "Get out!";signal doubledaggers;end
transmit "c2the Bartender hands you a Glass of Wine, you give him 7 Coins."
transmit "c3You Tantalize your senses as you Gingerly Sip your Wine."
signal tavern2
bloodymary:
Transmit "c1The Cost is 30 Coins..";if u.20<30 then do;Transmit "Get out!";signal doubledaggers;end
Transmit "c4You hand the Bartender 30 Coins.w1He goes into the backroom.."
transmit "w1c2You hear a Girl Screaming....w1"
transmit "He Comes back out with a Glass of Red liquid..pours some Rum into it and hands it to ya.."
Transmit "c3You Sit back and drink your Pleasure..w1The Liquid is Still Warm..Ahh.. so nice."
signal tavern2
Patrontalk:
Transmit "n1c3(1) "patron1.1", "patron1.3
transmit "c3(2) "Patron2.1", "patron2.3
query "n1c7Who do you want to talk to?(0=Exit): "
xtx=upper(Left(result,1))
if xtx="#" then signal theend
if xtx="0" then signal tavern2
if xtx="1" then do i=1 to 7;patty.i=Patron1.i;end
if xtx="2" then do i=1 to 7;patty.i=patron2.i;end
if xtx="1" then signal patrontalk2
if xtx="2" then signal patrontalk2
signal patrontalk
patrontalk2:
Transmit "f1c1You go over and Talk to "patty.1
Transmit "n1c3"Patty.1" returns the conversation."
sendfile (patty.2)
Transmit "n1c1Enter "BYE" to Leave"
Quiver:
Query "n1c3Response:c1 "
xtx=upper(Result)
if left(xtx,1)="#" then signal theend
if left(xtx,3)="BYE" then do;Transmit "c3See Ya Around "handle;signal tavern2;end
if xtx=patty.4 then sendfile (patty.6)
if xtx=Patty.5 then sendfile (Patty.7)
if xtx="###PANIC" then signal theend
signal quiver

SUPPLIES:
atemp="Daggers:inter/Supply1";call inter
if xtx="#" then signal theend
if xtx="T" then signal buytorches
if xtx="M" then signal Buymatches
if xtx="Q" then signal doubledaggers
if xtx="R" then signal BUYROPE
if xtx="P" then signal BUYPICKS
if xtx="L" then signal BuyLantern
if xtx="O" then signal BuyOil
signal supplies

buylantern:
Transmit "c1A Lantern Goes for 1000 Gold!"
query tx.54
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="Y" then signal payforlantern
signal supplies
payforlantern:
if u.20<1000 then do;transmit tx.39;signal supplies;end
u.20=u.20-100;transmit tx.61" 1000 "tx.47
u.30=1;transmit "c7He hands you a Nice New Lantern!"
signal supplies

buyOil:
transmit "c1Oil Costs "OilCost""tx.47" per Unit."
query tx.53
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal buyoil
if xtx<1 then signal supplies
if xtx="#" then signal theend
cost=xtx*oilcost
if cost>u.20 then do;transmit tx.39;signal supplies;end
u.31=u.31+xtx;transmit "c3He Fills a Skin with "xtx" Units of Oil."
u.20=u.20-cost;Transmit "c7deducted "cost""tx.47
signal supplies

buyrope:
Transmit "c1Rope goes for $100."
query tx.54
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="Y" then signal payforrope
signal supplies
payforrope:
if u.20<100 then do;transmit tx.39;signal supplies;end
u.20=u.20-100;transmit tx.61" 100 Gold Coins."
u.42=1;transmit "c7He hands you a 50' Rope."
signal supplies

buypicks:
transmit "c1Thieves Picks & Tools Go for $150"
query tx.54
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="Y" then signal payforpicks
signal supplies
payforpicks:
if u.20<150 then do;transmit tx.39;signal supplies;end
u.20=u.20-150;transmit tx.61" 150 Gold Coins."
u.43=1;transmit "c7He hands you a Nice New Set of Thieves Tools."
signal supplies

BUYTORCHES:
Transmit "c1Torches cost "TorchCost""tx.47" Each."
query tx.53
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal buytorches
if xtx<1 then signal supplies
if xtx="#" then signal theend
if xtx*TorchCost>u.20 then do;Transmit tx.39;signal Supplies;end
u.20=u.20-(xtx*torchcost);transmit xtx*torchcost "c7"tx.47" Deducted."
u.28=u.28+xtx;Transmit "c3He hands you "xtx" Torches."
signal supplies

BUYMATCHES:
transmit "c1Matches Cost 1 "tx47" Each."
query tx.53
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal buymatches
if xtx<1 then signal supplies
if xtx="#" then signal theend
if xtx>u.20 then do;transmit tx.39;signal supplies;end
u.29=u.29+xtx;transmit "c3He hands you "xtx" Matches."
u.20=u.20-xtx;Transmit "c7deducted "xtx""tx.47
signal supplies

MONSTERFIND:
atemp="Daggers:inter/monsterfind";call inter
DISPLAYMONSTER:
DIST=30
if clloc=1 then Transmit tx.55
if clloc=2 then transmit tx.56
if clloc=0 then transmit tx.57
Transmit  monster.10
call fixplayer3
transmit " "
signal fight
fight:
atemp="Daggers:inter/fight01";call inter
fight2:
Transmit "n1c3z5 Distance--->:z0c7 "dist
sendstring "c3z5 Combat type :z0c7 "
if dist=10 then transmit "Any";else transmit "Ranged Only!"
Transmit   "c3z5 Your Health :z0c3 "u.3" Hit points"
Transmit   "c3z5 Your Move   :z0c3 "u.57"0 Feet per Round."
transmit   "c3z5 Enemy Move  :z0c3 "monster.15"0 Feet per Round."
sendstring "n1c7z1 Fight Cmd:z0c3z4<?>z0:c7 "
getchar
xtx=upper(left(result,1))
if xtx="&" then do;Transmit "Use Magic Item";signal usemagic;end
if xtx="?" then do;Transmit "Menu";call fightmenu;end
if xtx="#" then signal Theend
if xtx="Y" then do;transmit "Your Status.";call quickstats;end
if xtx="A" then do;Transmit "Attack.";signal Attack;end
if xtx="D" then do;Transmit "Drink Healing.";call Drinkhealing;signal monsterattack;end
if xtx="C" then do;Transmit "Cast Spell.";Ft=1;call spelllist;signal checkmonstershit;end
if xtx="E" then do;transmit "Drink Mind-Elixer";call drinkelixer;signal monsterattack;end
if xtx="+" then do;Transmit "Advance!";signal advance;end
if xtx="-" then do;transmit "Retreat!";signal retreat;end
if xtx="W" then do;transmit "Wait.";signal monsterattack;end
if xtx="P" then do;Transmit "Pull out "u.24;call changeweapons;signal monsterattack;end
signal fight2

changeweapons:
if u.24=0 then do;Transmit tx.58;return;end
if u.24="None" then do;Transmit tx.58;return;end
if u.24="Hands" then do;transmit tx.58;return;end
Transmit "n1c7Putting "u.12" Away."
temp1=u.12;temp2=u.14;temp3=u.16;temp4=u.58
u.12=u.24;u.14=u.25;u.16=u.26;u.58=u.52
u.24=temp1;u.25=temp2;u.26=temp3;u.52=temp4
call fixplayer3
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
transmit "n1c7Pulling out "u.12"."
return

fightmenu:
atemp="Daggers:inter/Fightcmds"
call inter
return

Advance:
if dist=10 then do;Transmit "c1You are as close as you can get!";signal monsterattack;end
dist=dist-(U.57*10)
if dist<10 then do;dist=10;end
transmit "c1You Advance Towards your Foe!"
signal monsterattack

Retreat:
dist=dist+(u.57*10)
if dist>60 then do;transmit "c1You've Completely Retreated!";fr=0;signal gohome;end
else transmit "c1You are Retreating..."
signal monsterattack

Drinkhealing:
if u.35<1 then do;transmit "c7You have no Healing Potions!";return;end
atemp="Daggers:inter/drinkhealing"
call inter
return
DrinkElixer:
if u.48<1 then do;transmit "c7You have No Mind Elixers!";return;end
atemp="Daggers:inter/drinkElixer"
call inter
return

attack:
attack1:
if dist>10 & ptyp=3 then signal attack3
if dist>10 & ptyp=4 then signal attack3
if dist=10 then signal attack3
Transmit "c1You are too far away!"
signal monsterattack
attack3:
atemp="Daggers:inter/fight3";call inter
checkmonstershit:
if monster.14<1 then do;call gore;signal takeweapon;end
signal monsterattack

Gore:
atemp="daggers:inter/Gore"
call inter
return

takeweapon:
if monster.9=0 then do;Transmit "He has no weapon for you to take.";signal takeweapon2;end
query "c1Do you wish to take his "monster.5"? "
xtx=upper(left(result,1))
if xtx~="Y" then signal takeweapon2
query "c1n1Put Weapon in [P]rimary or [S]econdary Spot or [F]orget it:c3 "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="P" then do;u.12=monster.5;u.14=monster.6;u.16=monster.7;u.58=monster.11;transmit "c7You drop your Weapon and take his.";call fixplayer3;end
if xtx="S" then do;u.24=monster.5;u.25=monster.6;u.26=monster.7;u.52=monster.11;transmit "c7You drop your Weapon and Take his.";call fixplayer3;end
takeweapon2:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
if monster.12=0 then do;transmit "he has no treasure...";signal takewep3;end
if monster.12>0 then do;transmit "c1 the "monster.1" had c7"monster.12" Gold Coins.n1c3You take them.";u.20=u.20+monster.12
call gettres;end
takewep3:
if realchar=1 then signal saveenemycharacter
fr=0
zz=random(1,100,time('s'))
if zz>7 & zz<14 then signal loadfoundmagic
signal gohome

gettres:
atemp="Daggers:inter/gettres"
call inter
return

monsterattack:
if dist>10 & monster.11=3 then signal monsterattack2
if dist>10 & monster.11=4 then signal monsterattack2
if dist=10 then signal monsterattack2
signal monsteris
monsterattack2:
atemp="Daggers:inter/MonsterAttack2"
call inter
if u.3<1 then do;Transmit "c2***You were killed by the "monster.1;signal characterdies;end
if hit=hischancetohit & monster.11=5 then do;Transmit "c2Extreme Pain...Arrrghh.";u.22=1;end
signal fight

monsteris:
rv=random(1,10,time('s'))
if rv=5 & dist>10 then Do;dist=dist-(Monster.15*10);transmit "c1The "monster.1" "tx.59;signal fight2;end
if rv=1 & dist>10 then Do;dist=dist-(Monster.15*10);transmit "c1The "monster.1" "tx.59;signal fight2;end
if rv=3 then do;dist=dist+(monster.15*10);transmit "c1The "monster.1" is Retreating!";signal fight2;end
if rv=4 & dist>10 then Do;dist=dist-(monster.15*10);transmit "c1The "monster.1" "tx.59;signal fight2;end
if dist>60 then do;transmit "c1The "monster.1" Escapes!";fr=0;signal gohome;end
Transmit "c1The "monster.1" Is Waiting..."
signal fight2
signal monsterattack2

MAGICSHOP:
atemp="Daggers:inter/magicshop"
call inter
if xtx="Q" then do;az=0;signal doubledaggers;end
if xtx="H" then signal buypotions
if xtx="M" then signal BuyMindElixer
if xtx="S" then signal BuyScrolls
signal magicshop
BuyScrolls:
atemp="daggers:inter/buyscrolls"
call inter
if xtx="#" then signal theend
if xtx="1"|xtx="2"|xtx="3"|xtx="4"|xtx="5"|xtx="6"|xtx="7" then signal buymagicitem
if xtx="-" then signal magicshop
signal buyscrolls

BuyMagicItem:
az=1
zxz=xtx
if datatype(zxz,'N')=0 then do;az=0;signal buyScrolls;end
query "c4How Many charges?(200gp/Charge):c1 "
xtx=Result
if datatype(xtx,'N')=0 then do;az=0;signal buyscrolls;end
if xtx<1 | xtx>25 then do;transmit "c2Max 25,Min 1 Charge Permissive.";az=0;signal buyscrolls;end
cost=200*xtx
if cost>u.20 then do;Transmit tx.39;signal magicShop;signal findmagic;end
u.20=u.20-cost
if zxz="1" then do;fm.1="Scroll of Cure Blindness";fm.2=Dagpath||"Maction/SCureBlind";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="2" then do;fm.1="Scroll of Cure Disease";fm.2=Dagpath||"Maction/SCureDisease";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="3" then do;fm.1="Scroll of Cure Poison";fm.2=Dagpath||"Maction/SCurePoison";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="4" then do;fm.1="Gem of Light";fm.2=Dagpath||"Maction/GemOfLight";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="5" then do;fm.1="Scroll of Fire Blast";fm.2=Dagpath||"Maction/SFireBlast";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="6" then do;fm.1="Wand of Stars";fm.2=Dagpath||"Maction/WandOfStars";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
if zxz="7" then do;fm.1="Ring of Ice";m.2=Dagpath||"Maction/RingOfIce";fm.3="0";fm.4="0";fm.5=zxz;fm.6="0";signal findmagic;end
az=0
signal buyscrolls

BuyMindElixer:
Transmit "r1c6 Mind Elixers r0"
Transmit tx.60" "ElixerCost" Gold per Elixer."
query "n1c4Buy How many Elixers?c1 "
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal magicshop
if xtx<1 then signal magicshop
cost=(xtx*elixercost)
if cost>u.20 then do;Transmit tx.39;signal Magicshop;end
u.20=u.20-cost;transmit "c3You buy "xtx" Elixers."
u.48=u.48+xtx;transmit tx.61" "cost""tx.47
signal magicshop
buypotions:
Transmit "r1c6 Healing Potions r0"
transmit tx.60" "HealPcost" Gold per Potion."
Query "n1c4Buy how many potions? "
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal magicshop
if xtx<1 then signal magicshop
cost=(xtx*healpcost)
if cost>u.20 then do;transmit tx.39;signal magicshop;end
u.20=u.20-cost;transmit "c3You Buy "xtx" Potions."
u.35=u.35+xtx;transmit tx.61""cost""tx.47
signal magicshop

TRAINING:
Transmit tx.10"f1Training Guild...n1"
if u.19<u.47 then do;transmit "c1You need to be More Experienced.";signal doubledaggers;end
atemp="Daggers:inter/Training"
call inter
signal doubledaggers

enemycharacter:
Realchar=1
if ~exists(dhabi) then do;fr=0;signal gohome;end
call open(dload,dhabi,'R')
do i=1 to 15;monster.i=readln(dload);end
call close dload
if monster.1=Handle then do;fr=0;signal gohome;end
namen=monster.1
call checkexist
if exis=1 then do
enemystatspot=DAGPATH||"users/"||monster.1
if ~exists(enemystatspot) then do;Transmit "c1They Run From you.";fr=0;signal gohome;end
call open(enmon,enemystatspot,'R')
do i=1 to 60;en.i=readln(enmon);end
call close enmon
end
call displaymonster

gohome:
if az=1 then signal magicshop
if fr=1 then signal CheckMonsterShit
if tinkering=1 then do;tinkering=0;call killitem;end
if clloc=1 then signal dungeon2
if clloc=2 then signal forest2
if clloc=0 then signal town2
signal doubledaggers

SaveenemyCharacter:
atemp="daggers:inter/saveenemy1";call inter
if realchar=1 then do;if monster.15<1 then do;delpath="$0delete "||dhabi||"";transmit delpath;end;if monster.14<1 then do
paptext="c1"||handle||"c2 Defeated thec3 "||monster.1
call paperadd
transmit "h9h4Enemy Saved!"
end
end
fr=0
signal gohome

Paperadd:
atemp="daggers:inter/paperadd";call inter
return

CheckHealth:
if u.22=1 then do;Transmit tx.62;u.3=u.3-.5;end
if u.23=1 then do;Transmit tx.63;u.3=u.3-.5;end
return

ChooseDungeon:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
if u.3<1 then do;Transmit tx.64;u.33=dungeonexit;signal doubledaggers;end
if u.37<1 then do;Transmit tx.65;u.33=dungeonexit;signal doubledaggers;end
atemp="daggers:inter/choosedung1";call inter
Chodun1:
Transmit "f1n1c4r1 -+- The Dungeons -+- r0n1"
DO I=1 to max
Transmit "c7[c2"key.i"c7] c3"dname.i
end
query "c4n1Pick your Fate or c3(0=Back to Town):c1 "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="0" then do; u.33=dungeonexit;signal doubledaggers;end
do z=1 to max
if xtx=key.z then Signal Godungeon
end
signal chodun1

GoDungeon:
u.55=dpat.z
transmit "f1c1r1 "dname.z" r0n1"
sendfile (dtxt.z)
transmit tx.10
signal dungeon

DUNGEON:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
dpath=u.55
if u.55=0 then do;Transmit "c1Dungeon Alterations Have occurred..You are sent back to town...";signal doubledaggers;end
u.34=1;clloc=1
dtext=DAGPATH||"TEXT/DUNGEONMENU"
Transmit "c1Descending..."
dungeon0:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
u.32=right(u.32,3,"0")
droom=DAGPATH||Dpath||"/"||u.32||"/rooms/room."||u.33
Dhabi=DAGPATH||Dpath||"/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||dpath||"/"||U.32||"/Tres/Room."||u.33
oroom=droom;ohabi=dhabi
droom=DAGPATH||Dpath||"/"||u.32||"/rooms/room."||u.33
Dhabi=DAGPATH||Dpath||"/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||dpath||"/"||U.32||"/Tres/Room."||u.33
if awoke=1 then call cleardungeon
dungeon3:
atemp="daggers:inter/dungeon31";call inter
if u.53=1 & u.56~=1 & code.26=1 then call drawmap2D
if u.53=1 & u.56~=1 & code.26=0 then call drawmap1D
if u.38<1 & u.56~=1 then transmit tx.66
if u.56=1 then transmit tx.67
if exists(dhabi) then do;call enemycharacter;end
atemp="Daggers:inter/dungeonFX";call inter
if Exists(Dtres) then call findtres
Dungeon2:
u.37=u.37-.25;if u.37<1 then call starvation
ft=0
if u.3<1 then signal Characterdies
if u.38~=0 then do;u.38=u.38-1;end
encount=random(1,100,time('s'));if encount>75 then signal monsterfind
call checkforevent
tleft1=time('E')
tleft=tlimit-tleft1
tleft2=tleft/60
Transmit "n1c1Time Left:c3 "tleft2
if tleft2<1 then do;transmit tx.68;signal theend;end
call checkhealth
Sendstring "c2n2Dungeon Cmd:c1 c3<?>c1 ";getchar
spellfails=0
xtx=upper(left(result,1))
fr=0
if xtx="#" then signal theend
if xtx="K" then signal messwithitem
if xtx="&" then do;Transmit tx.113;signal usemagic;end
if xtx="N" & code.2 ="999" then do;u.32="000";u.33=dungeonexit;Transmit tx.69;signal doubledaggers;end
if xtx="S" & code.3 ="999" then do;u.32="000";u.33=dungeonexit;transmit tx.70;signal doubledaggers;end
if xtx="E" & code.4 ="999" then do;u.32="000";u.33=dungeonexit;Transmit tx.71;signal doubledaggers;end
if xtx="W" & code.5 ="999" then do;u.32="000";u.33=dungeonexit;Transmit tx.72;signal doubledaggers;end
if xtx="N" & code.2 ~= "000" then do;u.33=code.2;Transmit tx.69;signal dungeon0;end
if xtx="S" & code.3 ~= "000" then do;u.33=code.3;Transmit tx.70;signal dungeon0;end
if xtx="E" & code.4 ~= "000" then do;u.33=code.4;transmit tx.71;signal dungeon0;end
if xtx="W" & code.5 ~= "000" then do;u.33=code.5;Transmit tx.72;signal dungeon0;end
if xtx="U" & code.7 ="999" then do;u.32="000";u.33=dungeonexit;Transmit tx.73;signal doubledaggers;transmit "c1You climb out of the Dungeon!";end
if xtx="U" & code.7 ="998" then do;u.32=u.32-1;u.33=code.9;transmit tx.73;signal dungeon0;end
if xtx="D" & code.8 ="998" then do;u.32=u.32+1;u.33=code.10;transmit tx.74;signal dungeon0;end
if xtx="U" & code.7 ~="000" then do;u.33=code.7;transmit tx.73;signal dungeon0;end
if xtx="D" & code.8 ~="000" then do;u.33=code.8;Transmit tx.74;signal dungeon0;end
if xtx="Q" then do;u.34="1";Transmit tx.75;call Dungeonsave;end
if xtx="L" then do;transmit tx.76;signal DUNGEON3;end
if xtx="I" then do;transmit tx.77;signal Ignite ;end
if xtx="T" then do;transmit tx.78;signal Fountain;end
if xtx="C" then do;Transmit tx.79;signal CheckforSecretDoors;end
if xtx="Y" then do;Transmit tx.80;call quickstats;end
if xtx="H" then do;transmit tx.81;call drinkhealing;end
if code.16=0 then spellfails=1
if xtx="P" then do;Transmit tx.82;call spelllist;end
if xtx="R" then do;transmit tx.83;call rest;end
if xtx="1" then do;Transmit tx.84;bbscommand "WHO";end
if xtx="2" then do;Transmit tx.85;BBSCOMMAND "OLM";end
if xtx="?" then do;Transmit tx.86;sendfile (dtext);end
if xtx="M" then do;transmit tx.87;call drinkelixer;end
if xtx="Z" & u.53=0 then do;u.53=1;transmit tx.88;signal dungeon2;end
if xtx="Z" & u.53=1 then do;u.53=0;transmit tx.89;signal dungeon2;end
if xtx="%" & u.54=0 then do;u.54=1;transmit tx.90;signal dungeon2;end
if xtx="%" & u.54=1 then do;u.54=0;transmit tx.91;signal dungeon2;end
if xtx="!" then do;Transmit tx.92;signal lightlantern;end
signal Dungeon2

LightLantern:
if u.30~="1" then do;transmit "c2You have No lantern!";signal dungeon2;end
if u.31<1 then do;transmit "c2You have No Oil!";signal dungeon2;end
if u.29<1 then do;Transmit "c2You have No Matches!";signal dungeon2;end
Transmit "c4n1Filling Lantern with Oil...w1";u.31=u.31-1
Transmit "c4Lighting it...w1";u.29=u.29-1
Transmit "c7Ah! Light!";u.38=u.38+51
signal dungeon3

needarope:
Transmit "Sorry, You need a Rope to go that Way!"
signal gohome

Rest:
atemp="Daggers:inter/rest";call inter
return

checkforevent:
atemp="daggers:inter/checkforevent";call inter
return

quickstats:
atemp="Daggers:inter/quickstats"
call inter
return

checkforsecretdoors:
rum=random(1,100,time('S'))
if rum>40 then do;transmit tx.93""tx.98""tx.99;signal Dungeon2;end
if code.6="000" then do;Transmit tx.93""tx.98""tx.99;signal Dungeon2;end 
transmit tx.95""tx.98""tx.99
query tx.94""tx.98""tx.99
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx~="Y" then signal dungeon2
transmit tx.96""tx.98""tx.99
if code.6="999" then do;u.32="000";u.33=DungeonExit;signal doubledaggers;end
u.33=code.6
signal dungeon0


checkdeath:
if u.3<1 then do; transmit tx.109;signal theend;end
return

FOUNTAIN:
if code.18=0 then do;transmit tx.102;signal dungeon2;end
atemp="Daggers:inter/Fountain1"
call inter
signal dungeon2
characterdies:
u.34=0;u.32="000";u.33="001"
sendfile ("Daggers:text/DeathScene")
u.3=0
signal theend

ignite:
if u.28="0" then do;Transmit tx.103;signal dungeon2;end
if u.29="0" then do;transmit tx.104" to light the Torches!";signal dungeon2;end
u.28=u.28-1
u.29=u.29-1;transmit tx.105
u.38=u.38+15
Transmit tx.106
signal dungeon3

FOREST:
sendfile (dagpath||"text/ForestIntro")
if u.3<1 then do;Transmit tx.64;signal doubledaggers;end
if u.37<1 then do;Transmit tx.65;signal doubledaggers;end
u.34=2;clloc=2;dtext=DAGPATH||"TEXT/FORESTMENU";Transmit "c1Entering The Forest..."
Forest0:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
u.32=right(u.32,3,"0")
droom=DAGPATH||"Forest/"||u.32||"/rooms/room."||u.33;Dhabi=DAGPATH||"Forest/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||"Forest/"||U.32||"/Tres/Room."||u.33
oroom=droom;ohabi=dhabi
droom=DAGPATH||"Forest/"||u.32||"/rooms/room."||u.33;Dhabi=DAGPATH||"Forest/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||"Forest/"||U.32||"/Tres/Room."||u.33

if awoke=1 then call cleardungeon
Forest3:
if ~exists(Droom) then do;transmit tx.107;droom=oroom;dhabi=ohabi;end
atemp="Daggers:inter/forest1";call inter
Transmit "n1"
if u.53=1 & u.56~=1 & code.18=1 then call drawmap2F
if u.53=1 & u.56~=1 & code.18=0 then call drawmap1F
if exists(dhabi) then do;call enemycharacter;end
atemp="Daggers:inter/Forest2";call inter
if Exists(Dtres) then call findtres
Forest2:
temp=right(u.32,3,'0')
u.37=u.37-.25;if u.37<1 then call starvation
ft=0;if u.3<1 then signal Characterdies
encount=random(1,100,time('s'));if encount>75 then signal monsterfind
call checkforevent2
tleft1=time('E');tleft=tlimit-tleft1;tleft2=tleft/60;Transmit "c1n1Time Left:c3 "tleft2
if tleft2<1 then do;transmit tx.68;signal theend;end
call checkhealth
Sendstring "c5n2Forest Cmd:c7 c3<?>c1 ";getchar
spellfails=0
xtx=upper(left(result,1))
fr=0
if xtx="#" then signal theend
if xtx="K" then signal messwithitem
if xtx="&" then do;Transmit tx.113;signal usemagic;end
if xtx="N" & code.2 ="999" then do;u.32="000";u.33=ForestExit;Transmit tx.69;signal doubledaggers;end
if xtx="N" & code.2 ~= "000" then do;u.33=code.2;Transmit tx.69;signal Forest0;end
if xtx="S" & code.3 ="999" then do;u.32="000";u.33=ForestExit;transmit tx.70;signal doubledaggers;end
if xtx="S" & code.3 ~= "000" then do;u.33=code.3;Transmit tx.70;signal Forest0;end
if xtx="E" & code.4 ="999" then do;u.32="000";u.33=ForestExit;Transmit tx.71;signal doubledaggers;end
if xtx="E" & code.4 ~= "000" then do;u.33=code.4;Transmit tx.71;signal Forest0;end
if xtx="W" & code.5 ="999" then do;u.32="000";u.33=ForestExit;Transmit tx.72;signal doubledaggers;end
if xtx="W" & code.5 ~= "000" then do;u.33=code.5;Transmit tx.72;signal Forest0;end
if xtx="U" & code.16 = "999" then do;u.32="000";u.33=ForestExit;Transmit tx.73;signal doubledaggers;end
if xtx="U" & code.16 = "998" then do;u.32=u.32+1;u.33=code.6;Transmit tx.73;signal Forest0;end
if xtx="D" & code.17 = "998" then do;u.32=u.32-1;u.33=code.7;Transmit tx.74;signal Forest0;end
if xtx="U" & code.16 ~="000" then do;u.33=code.16;Transmit tx.73;signal Forest0;end
if xtx="D" & code.17 ~="000" then do;u.33=code.17;Transmit tx.74;signal Forest0;end
if xtx="Q" then do;u.34="2";Transmit tx.75;call Dungeonsave;end
if xtx="L" then do;Transmit tx.76;signal Forest3;end
if xtx="T" then Do;Transmit tx.78;signal Fountain2;end
if xtx="Y" then Do;Transmit tx.80;call quickstats;end
if xtx="H" then do;Transmit tx.81;call drinkhealing;end
if code.10=0 then spellfails=1
if xtx="P" then do;Transmit tx.82;call spelllist;end
if xtx="R" then do;transmit tx.83;call rest;end
if xtx="1" then do;Transmit "Who?";bbscommand "WHO";end
if xtx="2" then do;Transmit "Olm";BBSCOMMAND "OLM";end
if xtx="?" then do;Transmit tx.86;sendfile (dtext);end
if xtx="M" then do;Transmit tx.87;call drinkelixer;end
if xtx="C" then do;transmit "Check for hidden Pathways...";call checkforsecretdoors2;end
if xtx="Z" & u.53=0 then do;u.53=1;transmit tx.88;signal forest2;end
if xtx="Z" & u.53=1 then do;u.53=0;transmit tx.89;signal forest2;end
if xtx="%" & u.54=0 then do;u.54=1;transmit tx.90;signal forest2;end
if xtx="%" & u.54=1 then do;u.54=0;transmit tx.91;signal forest2;end
signal Forest2

DrawMap1D:
if u.38<1 then return
atemp="Daggers:inter/Map01";call inter
return
DrawMap1F:
atemp="Daggers:inter/map02";call inter
return
DrawMap2D:
if u.38<1 then return
atemp="Daggers:inter/map03";call inter
return
DrawMap2F:
atemp="Daggers:inter/map04";call inter
return

checkforsecretdoors2:
rum=random(1,100,time('S'))
if rum>20 then do;transmit tx.93""tx.97""tx.100"s";signal Forest2;end
if code.12="000" then do;Transmit tx.93""tx.97""tx.100"s";signal Forest2;end 
transmit tx.95""tx.97""tx.100
query tx.94""tx.97""tx.100"? "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx~="Y" then signal Forest2
transmit tx.96""tx.97""Tx.100
if code.12="999" then do;u.32="000";u.33=ForestExit;signal doubledaggers;end
u.33=code.12
signal Forest0

checkforsecretdoors3:
rum=random(1,100,time('S'))
if rum>20 then do;transmit tx.93""tx.97""tx.101"s";signal Town2;end
if code.12="000" then do;Transmit tx.93""Tx.97""tx.101"s";signal Town2;end 
transmit tx.95""tx.97""tx.101
query tx.94""tx.97""tx.101"? "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx~="Y" then signal Town2
transmit tx.96""tx.97""tx.101
if code.12="999" then do;u.32="000";u.33="001";signal doubledaggers;end
u.33=code.12
signal Town0

checkforevent2:
atemp="Daggers:inter/checkforevent2";call inter
return

checkforevent3:
atemp="Daggers:inter/checkforevent2";call inter
return

FOUNTAIN2:
if code.11=0 then do;transmit tx.102;signal Forest2;end
atemp="Daggers:inter/fountain1"
call inter
signal Forest2

FOUNTAIN3:
if code.11=0 then do;transmit tx.102;signal Town2;end
atemp="Daggers:inter/fountain1"
call inter
signal Town2

Starvation:
Transmit tx.108
u.3=u.3-1;if u.3<1 then u.3=0
if u.3=0 then Transmit tx.109;signal characterdies
return

HEALER: 
atemp="Daggers:inter/Healer1";call inter
if xtx="#" then signal theend
if xtx="Q" then signal Doubledaggers
if xtx="H" then Signal Healwounds
if xtx="P" then signal Healpoisons
if xtx="D" then signal HealDiseases
if xtx="B" then signal HealBlind
signal healer
HEALDISEASES:
if u.23="0" then do;transmit "c1You are not Diseased!";signal healer;end
transmit "c2it will cost you 50 Gold to cure your Diseases."
query "c1n1Do you wish to do so? "
xtx=upper(left(result,1));if xtx="#" then signal theend
if xtx~="Y" then signal healer
if u.20<50 then do;transmit tx.39;signal Healer;end
u.20=u.20-50;transmit "c7You hand the Healer 50 "tx.47
u.23=0;transmit "c3He mumbles Some Mumbo-Jumbo...w1...then Touches your head..."
Transmit "You are no longer Diseased!"
signal healer

HEALBLIND:
if u.56="0" then do;transmit "c1You are not Blind!";signal healer;end
transmit "c2it will cost you 50 Gold to cure your Blindness."
query "c1n1Do you wish to do so? "
xtx=upper(left(result,1));if xtx="#" then signal theend
if xtx~="Y" then signal healer
if u.20<50 then do;transmit tx.39;signal Healer;end
u.20=u.20-50;transmit "c7You hand the Healer 50 "tx.47
u.56=0;transmit "c3She mumbles Some Mumbo-Jumbo...w1...then Touches your head..."
Transmit "You are no longer Blind!"
signal healer

HEALPOISONS:
if u.22="0" then do;Transmit "c1You are not poisoned!";signal healer;end
transmit "c2It will cost 35 Gold to Cure The Poison in your system."
Query "c1n1Do you wish to do so? "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx~="Y" then signal healer
if u.20<35 then do;transmit tx.39;signal healer;end
u.20=u.20-35;transmit "c7You hand the Healer 35 "tx.47
u.22=0;transmit "c3He Mumbles a Few words...w1...Then touches your head.."
transmit "You are No longer poisoned."
signal healer
 
healwounds:
transmit "c1Each Point Costs "u.18*healcost" Gold to cure."
totalhealneed=u.4-u.3
transmit "c3You need "totalhealneed" Points Healed to be Totally healed."
transmit "which would cost youc7 "totalhealneed*(u.18*healcost)tx.47
query "n1c1How many do you wish to heal? "
xtx=result
ck=datatype(xtx,'N')
if ck=0 then signal healer
if xtx<1 then signal healer
if xtx="#" then signal theend
if xtx="" then signal healer
if xtx=0 then signal healer
if xtx>0 then cost=xtx*(u.18*healcost)
if xtx>totalhealneed then do;transmit "Your body can't heal that much!";signal healer;end
if cost>u.20 then do; Transmit tx.39;signal healer;end
u.20=u.20-cost;transmit "c3You Hand himc7 "cost""tx.47
transmit "c3He lays his hands upon thy wounds...w1"
u.3=u.3+xtx
transmit "c7You feel Better!"
signal healer

WEAPON:
atemp="Daggers:inter/weaponintro";call inter
if cmn="B" then call loadweaponlist
if cmn="Q" then do;signal Doubledaggers;end
if cmn="#" then signal theend
if cmn="S" then call sellweapon
signal Weapon
sellweapon:
query "c4Sell [P]rimary or [S]econdary Weapon [F]orget it:c1 "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if xtx="P" then signal sellweapon1
if xtx="S" then signal sellweapon2
if xtx="F" then signal weapon
signal weapon

SELLweapon1:
transmit "c4Attempting to Sell Primary Weaponn1"
if u.12="Hands" then do;Transmit "c1I AM NO FOOL!!! You can't sell your Hands!!n1c3GET OUT!!!";signal doubledaggers;end
offer=(U.14*2)+u.16
Transmit "c7I'll Offer ya "offer ""tx.47" for your "u.12
query "c1ACCEPTc3<y/n>:c1 "
cdx=upper(left(result,1))
if cdx="#" then signal theend
if cdx="N" then signal weapon
if cdx="Y" then do;u.12="Hands";u.14="1";u.16="5";u.20=u.20+offer;u.58=0
transmit "c3You Give him your weapon and Pocket the "offer""tx.47
signal weapon
SELLweapon2:
transmit "c4Attempting to Sell Secondary Weaponn1"
if u.24="None" then do;Transmit "c1I AM NO FOOL!!! You Have no Weapon there!!n1c3GET OUT!!!";signal doubledaggers;end
if u.24=0 then do;transmit "c1Get lost!";signal weapon;end
offer=(U.25*2)+u.26
Transmit "c7I'll Offer ya "offer ""tx.47" for your "u.24
query "c1ACCEPTc3<y/n>:c1 "
cdx=upper(left(result,1))
if cdx="#" then signal theend
if cdx="N" then signal weapon
if cdx="Y" then do;u.24="None";u.25="0";u.26="0";u.20=u.20+offer;u.52=0
transmit "c3You Give him your weapon and Pocket the "offer""tx.47
signal weapon
LOADweaponLIST:
atemp="Daggers:inter/Loadweapon";call inter
call tpcon1
DISPLAYweapon:
atemp="Daggers:inter/Displayweapon";call inter
BUYweapon:
Query" n1c1Buy Which c3(0=Exit)c1"
zxr=upper(left(result,1))
if zxr="#" then call theend
if zxr="0" then return
do z=1 to max
if upper(key.z)=zxr then do;wtp=wtype.z;tap=tp.z;ar=itm.z;pn=pnts.z;pw=pow.z;call checkweapon;end
end
return
checkweapon:
if cost.z>u.20 then do;transmit tx.39;signal weapon;end
u.20=u.20-cost.z
checkweapon9:
query "c4Put this weapon where [P]rimary [S]econdary [F]orget it!: "
xtx=upper(left(result,1))
if xtx="#" then signal theend
prim=0;second=0
if xtx="F" then signal weapon
if xtx="P" then do;prim=1;second=0;end
if xtx="S" then do;prim=0;second=1;end
if prim=0 & Second=0 then signal checkweapon9
if prim=1 then do;u.12=ar;u.14=pw;u.16=pn;u.58=tap;u.61=Wtp;end
if prim=0 then do;u.24=ar;u.25=pw;u.26=pn;u.52=tap;u.62=wtp;end
Transmit "c1You Bought the "ar" for "cost.z""tx.47
Transmit "c1It has an Weapon Rating of "pw" and has "pn" Resistance Points."
signal weapon

cleardungeon:
awoke=0
delpath="$0delete "||dhabi||""
transmit delpath
return

TPCON1:
atemp="Daggers:inter/tpcon1";call inter
return

Dungeonsave:
if ~exists(dhabi) then signal savethem
if exists(dhabi) then do;transmit "c1You can't save in this room!";return;end
savethem:
atemp="Daggers:inter/savethem";call inter
signal theend

ARMORY:
if u.51~="1" then do;Transmit "c1Members of your Profession Cannot Wear Armor!";signal doubledaggers;end
atemp="Daggers:inter/armorintro";call inter
if cmn="B" then call loadarmorlist
if cmn="Q" then do;signal doubledaggers;end
if cmn="#" then signal THEEND
if cmn="S" then call SellArmor
signal Armory
SELLARMOR:
if u.13="None" then do;Transmit "c1I AM NO FOOL!!! GET OUT!!!";signal doubledaggers;end
offer=(U.15*3)
Transmit "c7I'll Offer ya "offer ""tx.47" for your "u.13
query "c1ACCEPTc3<y/n>:c1 "
cdx=upper(left(result,1))
if cdx="#" then signal theend
if cdx="N" then signal Armory
if cdx="Y" then do;u.13="None";u.15="0";u.17="0";u.20=u.20+offer
transmit "c3You Give him your Armor and Pocket the "offer""tx.47
signal armory
LOADARMORLIST:
atemp="Daggers:inter/loadArmor"
call inter
DISPLAYARMOR:
Transmit tx.110
Transmit "n1c4KEY   Item Name                Cost  "
transmit "c1--- ----------------------   --------"
do z = 1 to max;if (u.20+1)>cost.z then Transmit "c1("key.z")c2 "left(itm.z,26,".")" c7 "cost.z;end
BUYARMOR:
if u.13~="None" then do;Transmit "c1Sell Old Armor FIRST!!!";signal armory;end
Query" n1c1Buy Which c3(0=Exit)c1"
zxr=upper(left(result,1))
if zxr="#" then call theend
if zxr="0" then return
do z=1 to max
if upper(key.z)=zxr then do;ar=itm.z;pn=pnts.z;pw=pow.z;call checkarmor;end
end
return
checkarmor:
if cost.z>u.20 then do;transmit tx.39;signal ARMORY;end
atemp="Daggers:inter/checkArmor";call inter
signal armory

FindTres:
atemp="Daggers:inter/FindTres"
call inter
return

THEEND:
Transmit "c7n1Thanks for Playing... "
transmit "c4n1This program Brought to you By D.N.K.n1"
transmit tx.111
call savecharacter;call quit

TOWNSHIP:
u.34=0;clloc=0;dtext=DAGPATH||"TEXT/TOWNMENU"
TOWN0:
pnam=u.12;ppow=u.14;psdc=u.16;ptyp=u.58;pdes=u.61
u.32=right(u.32,3,"0")
droom=DAGPATH||"TOWN/"||u.32||"/rooms/room."||u.33;Dhabi=DAGPATH||"TOWN/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||"TOWN/"||U.32||"/Tres/Room."||u.33
oroom=droom;ohabi=dhabi
droom=DAGPATH||"TOWN/"||u.32||"/rooms/room."||u.33;Dhabi=DAGPATH||"TOWN/"||u.32||"/HABI/Room."||u.33
dtres=dagpath||"TOWN/"||U.32||"/Tres/Room."||u.33
if awoke=1 then call cleardungeon
Town3:
if ~exists(Droom) then do;transmit tx.107;droom=oroom;dhabi=ohabi;end
atemp="Daggers:inter/town1";call inter
if u.53=1 & u.56~=1 & code.18=1 then call drawmap2F
if u.53=1 & u.56~=1 & code.18=0 then call drawmap1F
if exists(dhabi) then do;call enemycharacter;end
atemp="Daggers:inter/town2";call inter
if code.19~="000" then call checkbuilding
if code.19~="000" then transmit " - c2[c7Xc2]c3 To Enter c5"xrr
if code.11 = "1" then Transmit "n1z4c7 There is Water Here. z0"
if Exists(Dtres) then call findtres
TOWN2:
temp=right(u.32,3,'0')
if u.37<20 then transmit "z1c7 You are LOW on Food! z0"
ft=0;if u.3<1 then do;u.3=1;transmit tx.112;end
encount=random(1,100,time('s'));if encount>85 then signal monsterfind
call checkforevent3
tleft1=time('E');tleft=tlimit-tleft1;tleft2=tleft/60;Transmit "c1n1Time Left:c3 "tleft2
if tleft2<1 then do;transmit tx.68;signal theend;end
call checkhealth
Sendstring "c5n2TOWN Cmd:c7 c3<?>c1 ";getchar
spellfails=0
xtx=upper(left(result,1))
fr=0
if xtx="#" then signal theend
if xtx="V" then do;transmit "View Town Map.";sendfile (Dagpath||"TownMap");transmit tx.10;end
if xtx="K" then signal messwithitem
if xtx="&" then do;Transmit tx.113;signal usemagic;end
if xtx="N" & code.2 ="999" then do;u.32="000";u.33=S"001";Transmit tx.69;signal doubledaggers;end
if xtx="N" & code.2 ~= "000" then do;u.33=code.2;Transmit tx.69;signal TOWN0;end
if xtx="S" & code.3 ="999" then do;u.32="000";u.33="001";transmit tx.70;signal doubledaggers;end
if xtx="S" & code.3 ~= "000" then do;u.33=code.3;Transmit tx.70;signal TOWN0;end
if xtx="E" & code.4 ="999" then do;u.32="000";u.33="001";Transmit tx.71;signal doubledaggers;end
if xtx="E" & code.4 ~= "000" then do;u.33=code.4;Transmit tx.71;signal TOWN0;end
if xtx="W" & code.5 ="999" then do;u.32="000";u.33="001";Transmit tx.72;signal doubledaggers;end
if xtx="W" & code.5 ~= "000" then do;u.33=code.5;Transmit tx.72;signal TOWN0;end
if xtx="U" & code.16 = "999" then do;u.32="000";u.33="001";Transmit tx.73;signal doubledaggers;end
if xtx="U" & code.16 = "998" then do;u.32=u.32+1;u.33=code.6;Transmit tx.73;signal TOWN0;end
if xtx="D" & code.17 = "998" then do;u.32=u.32-1;u.33=code.7;Transmit tx.74;signal TOWN0;end
if xtx="U" & code.16 ~="000" then do;u.33=code.16;Transmit tx.73;signal TOWN0;end
if xtx="D" & code.17 ~="000" then do;u.33=code.17;Transmit tx.74;signal TOWN0;end
if xtx="L" then do;Transmit tx.76;signal TOWN3;end
if xtx="T" then Do;Transmit tx.78;signal Fountain3;end
if xtx="Y" then Do;Transmit "Status";call ShowStats;end
if xtx="X" & code.19~="000" then do;transmit "Enter Building...";call gobuilding;end
if xtx="H" then do;Transmit tx.81;call drinkhealing;end
if code.10=0 then spellfails=1
if xtx="P" then do;Transmit tx.82;call spelllist;end
if xtx="R" then do;transmit tx.83;call rest;end
if xtx="1" then do;Transmit "Who?";bbscommand "WHO";end
if xtx="2" then do;Transmit "Olm";BBSCOMMAND "OLM";end
if xtx="?" then do;Transmit tx.86;sendfile (dtext);end
if xtx="M" then do;Transmit tx.87;call drinkelixer;end
if xtx="C" then do;transmit "Check for hidden Pathways...";call checkforsecretdoors3;end
if xtx="Z" & u.53=0 then do;u.53=1;transmit tx.88;signal TOWN2;end
if xtx="Z" & u.53=1 then do;u.53=0;transmit tx.89;signal TOWN2;end
if xtx="%" & u.54=0 then do;u.54=1;transmit tx.90;signal TOWN2;end
if xtx="%" & u.54=1 then do;u.54=0;transmit tx.91;signal TOWN2;end
if xtx="Q" then do;transmit "Quit & Save.";signal theend;end
signal TOWN2
gobuilding:
if code.19="900" Then do;Flzz="01" ;transmit tx.114" c7Armory";call display;end
if code.19="901" Then do;Flzz="02" ;transmit tx.114" c7Weaponry";call display;end
if code.19="902" Then do;Flzz="03" ;transmit tx.114" c7Healers";call display;end
if code.19="903" Then do;Flzz="04" ;transmit tx.114" c7Dungeon";call display;end
if code.19="904" Then do;Flzz="05" ;transmit tx.114" c7Forest";call display;end
if code.19="905" Then do;Flzz="06" ;transmit tx.114" c7Bunk House(Save Game)";call display;end
if code.19="906" Then do;Flzz="07" ;transmit tx.114" c7Training Guild";call display;end
if code.19="907" Then do;Flzz="08" ;transmit tx.114" c7Magic Shoppe";call display;end
if code.19="908" Then do;Flzz="09" ;transmit tx.114" c7Supply Depot";call display;end
if code.19="909" Then do;Flzz="10" ;transmit tx.114" c7Black Dragon Tavern";call display;end
if code.19="910" Then do;Flzz="11" ;transmit tx.114" c7Grocer";call display;end
if code.19="911" Then do;Flzz="12" ;transmit tx.114" c7Brothel";call display;end
if code.19="912" Then do;Flzz="13" ;transmit tx.114" c7Inn";call display;end
if code.19="913" Then do;Flzz="14" ;transmit tx.114" c7Grog's Casino";call display;end
if code.19="914" Then do;Flzz="16" ;transmit tx.114" c7The High council";call display;end
if code.19="915" Then do;Flzz="18" ;transmit tx.114" c7Red Roof Bank";call display;end
if code.19="916" Then do;Flzz="19" ;transmit tx.114" c7Post Office";call display;end
if code.19="917" Then do;Flzz="24" ;transmit tx.114" c7The Suicide Pit";call display;end
if code.19="918" Then do;Flzz="25" ;transmit tx.114" c7Money Express Send";call display;end
if code.19="919" Then do;Flzz="26" ;transmit tx.114" c7Dream Tavern(Msg Base)";call display;end
signal town2

checkbuilding:
atemp="Daggers:inter/checkBuilding"
call inter
return

MessWithItem:
if ~exists(dtres) then do;transmit tx.115;signal town2;end
tinkering=1
locked=0
if dt.6=1 then locked=1
mess2:
atemp="Daggers:inter/tinker1";call inter
if xtx="#" then signal theend
if xtx="L" Then do;transmit "leave";tinkering=0;signal town2;end
if xtx="R" & dt.1=3 then do;Transmit "Read";sendfile (dt.5);end
if xtx="R" & dt.1~=3 then do;transmit "Read What?";end
if xtx="T" then do;transmit "Take";call takeitem;end
if xtx="E" then do;transmit "Examine";call examineitem;end
if xtx="C" then do;Transmit "Check for Traps";call checktraps;end
if xtx="O" & dt.1=1 then do;Transmit "Open";call openchest;end
if xtx="O" & dt.1~=1 then do;transmit "c7Open What?";end
if xtx="D" then do;transmit "Disarm";call disarmtrap;end
if xtx="J" then do;transmit "Jimmy The Lock";call jimmylock;end
signal mess2
takeitem:
if dt.4~=1 then do;Transmit "c7Item cannot be taken!";return;end
if dt.1=2 then do;mpath=dt.5;signal foundmagic2;end
if dt.1=4 then do;u.20=u.20+dt.2;transmit "c1You take the Coins.";signal gohome;end
return
JimmyLock:
if u.46=0 then do;transmit "c3You have no Skill for that!";return;end
if u.43=0 then do;transmit "c4You have no Tools!";return;end
if dt.6=1 then do
xv=random(1,100,time('s'))
if xv<=u.44 then do;Transmit "c7You picked the Lock!";locked=0;return;end
if xv>u.44 then do;Transmit "c7You failed to pick the lock!";locked=1;return;end
end
transmit "c7What Lock?"
return
disarmtrap:
if u.46=0 then do;transmit "c3You have no Skill for that!";return;end
xzx=random(1,100,time('s'))
if xzx<u.41 & dt.7=1 then do;transmit "c7You Disarmed a Trap!";armed=2;return;end
if xzx>=u.41 & dt.7=1 then do;transmit "c7You Failed!";call traphurt;return;end
transmit "c7What Trap?"
return
traphurt:
xr=random(1,10,time('s'))
transmit "You set off the Trap!"
transmit "c3It caused "xr" dmg to you!"
u.3=u.3-xr
call checkdeath
return
examineitem:
transmit "n1c4You carefully examine the item..c3n1"dt.3
if dt.6=1 then do;locked=1;transmit "c3You notice "tx.116;end
return
checkTraps:
if u.46=0 then do;transmit "c3You have no Skill for that!";return;end
xvx=random(1,100,time('s'))
if xvx<u.40 & dt.7=1 then do;transmit "You Found a Trap!";trapf=1;armed=1;end
if xvx>=u.40 & dt.7=1 then do;Transmit "You found no Traps!";trapf=0;armed=1;end
return
openchest:
if dt.6=1 & locked=1 then do;Transmit tx.116;return;end
if dt.6=1 & locked=0 then do;transmit "c1You open it!"
if dt.7=1 & armed~=2 then do;Transmit "c2The Chest was Trapped!";call traphurt;end
Transmit "c3And Find "dt.2" Coins inside!";u.20=u.20+dt.2
transmit "c7You take them!"
signal killitem
end
if dt.6~=1 then Transmit tx.117
return
killitem:
transmit "Wait..."
pathx="$0delete "||dtres||""
transmit pathx
transmit "h8"
tinkering=0
signal gohome

loadFoundMagic:
r=random(1,maxmagic,time('s'))
mpath=dagpath||"mitems/MagicItem."||r
foundmagic2:
if ~exists(Mpath) then do;Transmit "c2Error in Magic System...sorry";signal gohome;end
call open(fle,mpath,"R")
do i=1 to 6;fm.i=readln(fle);end
call close fle
wantmagic:
Transmit "n1c5You found c1"fm.1"c5."
sendstring "c4Do you wish to take this Item?[y/n]:c7 "
getchar
xtx=Upper(result)
if xtx="#" then signal theend
if xtx="Y" then do;transmit tx.118;signal findmagic;end
if xtx="N" then do;transmit tx.119;signal gohome;end
Signal wantmagic

FindMagic:
call showmagic
findm2:
query "c5Put "fm.1" into which Slot?c2[c71c2-c114c2]:c7 "
xtx=result
if left(xtx,1)="#" then signal theend
if datatype(xtx,'N')=0 then signal findm2
z=xtx
if z>14 then signal findm2
if z<1 then signal findm2
if left(ma1.z,5)~="Empty" then do;transmit "c7That Slot is not Empty!";call dropmitem;end
transmit "c5You take the "fm.1"!"
ma1.z=fm.1;ma2.z=fm.2;ma3.z=fm.3;ma4.z=fm.4;ma5.z=fm.5;ma6.z=fm.6
signal gohome

dropmitem:
sendstring "c4Do you wish to drop the "ma1.z"?c7 "
Getchar
xtx=upper(result)
if xtx="#" then signal theend
if xtx="Y" then do;transmit tx.118;ma1.z=fm.1;ma2.z=fm.2;ma3.z=fm.3;ma4.z=fm.4;ma5.z=fm.5;ma6.z=fm.6;Transmit "c4n1You Dropped It and took the "fm.1".";signal gohome;end
transmit tx.119
signal findm2

Usemagic:
call showmagic
magi2:
Query "c5n1Use Which Item:c7 "
xtx=upper(left(result,1))
if xtx="#" then signal theend
if datatype(xtx,'N')=0 then signal Magi2
if xtx<1 then do;transmit tx.121;signal gohome;end
if xtx>14 then do;transmit tx.121;signal gohome;end
v=xtx
if left(ma1.v,5)="Empty" then do;transmit tx.121;signal gohome;end
transmit "c4n1Using c1"ma1.v
ma6.v=1
if ma5.v~=999 then do;ma5.v=ma5.v-1;transmit "c3Expending 1 Charge!";end
if ~exists(ma2.v) then do;transmit "c2 NOTIFY SYSOP that ITEM doesNOT work!!!";signal gohome;end
call open(mitem,ma2.v,'R')
do until eof(mitem)=1;interpret readln(mitem);end
call close mitem
if ma5.v=0 then do;Transmit "c4Your Item has Expended it's Final Charge...Poof.";ma1.v="Empty";ma2.v=0;ma3.v=0;ma4.v=0;ma5.v=0;ma6.v=0;end
signal gohome

INTER:
call open(ick,atemp,"R")
do until eof(ick)=1
interpret readln(ick)
end
call close ick
return

IOERR:
SYNTAX:
ERROR:
Transmit "c1n1Program Cannot Continue.. Some type of Error"

transmit "line "SIGL
transmit "Last Inter file was "Atemp
x = storage()
transmit x
transmit tx.10
LOGERRORS:
Transmit "c1r1 Scribing Error Log r0"
if ~exists("Daggers:ERRORLOG") then do
signal off error;call open(fle,"DAGGERS:ERRORLOG","W")
writeln(fle,"c1 Double Daggers II Error Log c7")
signal on error
call close fle
end
call open(Fle,"Daggers:ErrorLog","A")
text1="Error in line "||SIGL
text2="Free Ram      "||x
text3="last Inter    "||atemp
text4="last Room     "||droom
signal off error
writeln(fle,"   ")
writeln(fle,text1)
writeln(fle,text2)
writeln(fle,text3)
writeln(fle,text4)
call close fle
signal on error
signal quit

