1
0
Selaa lähdekoodia

Reformatted Notebook entries to remove excess whitespace.

KeyMasterOfGozer 5 vuotta sitten
vanhempi
säilyke
6079915dee
2 muutettua tiedostoa jossa 134 lisäystä ja 115 poistoa
  1. 72 81
      locations/obj_din.qsrc
  2. 62 34
      locations/spellBook.qsrc

+ 72 - 81
locations/obj_din.qsrc

@@ -2358,78 +2358,65 @@ end
 
 if $ARGS[0] = 'records':
 	*clr & cla
-	'<center><h1>Notebook</h1></center>'
-	if MagikDostup = 0:
-		gs 'spellBook','$nonComSpells'
-	end
-	gs 'housing', 'rent'
 	act 'Put your notebook down': gt $loc, $metka
-	if pavSharedAptEnabled = 1:'You share an apartment with three others in Pavlovsk. Bills are paid by the other tennants in exchange for your house services'
-	*nl
-	if home_owned[1] = 1:'You rent a two-room apartment, in the city residential area. Rent for the apartment is subtracted automatically, in sum of <<home_rent[1]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL>></b> days'
-	*nl
-	if home_owned[1] = 2:'You own a two-room apartment, in the city residential area. Utility bills are on the 25th of each month.'
-	*nl
-	if home_owned[1] = 3:'You own a two-room apartment, in the city residential area. It''s currently occupied by your tenants.'
-	*nl
-	if home_owned[2] > 0:'You live in a two-room apartment, in a large apartment complex, with your parents and siblings in Pavlovsk.'
-	*nl
-	if home_owned[3] > 0:'You own small holiday cottage with an adjacent allotment in the communal village.'
-	*nl
-	if home_owned[4] > 0:'You rent a two-room apartment, in Pushkin. Rent for the apartment is subtracted automatically, in sum of <<home_rent[4]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL4>></b> days'
-	*nl
-	if home_owned[5] = 1:'You own a vacant block, in the city suburbs. Utility bills are on the 25th of each month.'
-	*nl
-	if home_owned[5] = 2:'You own a block in the city suburbs, upon which, you are building a house. Utility bills are on the 25th of each month.'
-	*nl
-	if home_owned[5] = 3:'You own an impressive manion in the suburbs of St. Petersburg. Utility bills are on the 25th of each month.'
-	*nl
-	if workPTU > 2:'You work as a teacher at the Lycée. Working days Mon-Sat, with 14.00 to 16.00. Salary 300r/day. Dress code - office clothes, Strict. The road from the apartment to the Lyceum takes 2 hours 10 minutes.'
-	*nl
-	if (work = 1 or cheatWork = 1) and workKafe > 0:'You are working as a waitress at The Roadhouse cafe. You need to come to work between 11 and 12, working days: Tuesday, Wednesday and Thursday. At work, you can receive tips from customers, and payment is received on 25th of each month.'
-	*nl
-	if (work = 1 or cheatWork = 1) and workhosp > 0:'You work as a nurse in the city residential area clinic. You need to come to work between 8 and 9, during the week. Salary is automatically transferred on 25th of each month.'
-	*nl
-	if (work = 1 or cheatWork = 1) and worksalon > 0:'You work as a masseuse in the city at the Beauty Bar. You need to come to work with 9 to 10, working days, Monday, Wednesday, Friday. Salary is automatically transferred on 25th of each month.'
-	*nl
-	if (work = 1 or cheatWork = 1) and workSec > 0:'You work as a secretary at Titran-Express. At work you need to come up 9, during the week. Salary is automatically transferred on 25th of each month.'
-	*nl
-	if (work = 1 or cheatWork = 1) and tanwork > 0:'You work as a governess for Tanya, at Nicholas'' luxury city apartment. Salary is automatically transferred on the 25th of each month.'
-	*nl
-	if (work = 1 or cheatWork = 1) and young_shop_work = 1:'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 15, Monday to Friday. The salary shall be issued once a week on Fridays.'
-	*nl
-	if (work = 1 or cheatWork = 1) and young_shop_work1 = 1:'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 9, Saturday and Sunday. The salary shall be issued once a week on Fridays.'
-	*nl
-	if (work = 1 or cheatWork = 1) and young_shop_work2 = 1:'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 9, Monday to Friday. The salary shall be issued once a week on Fridays.'
-	*nl
-	if (work = 1 or cheatWork = 1) and workFabrika = 1:'You work as a seamstress in a factory in Pavlovsk. Work is every day except Saturday and Sunday. Salary is automatically transferred on 25th of each month.'
-	*nl
-	if workrin = 1:'You are working at the market in Arthur''s tent as clothing saleswoman. Work on Tuesday, Thursday and Saturday, starting at 8 AM. Salary depends on sales.'
-	*nl
-	if maidqw = 1:'You can work in Pavlovsk hotel as a maid. Work is every day from 16 to 19. Salary is 250 plus tips.'
-	*nl
-	if postjobQW = 2 or postjobQW = 4:'You can deliver mail for the postmaster. Work starts each Saturday between 11:00 and 12:00. Salary is 450.'
-	*nl
-	if (work = 1 or cheatWork = 1) and gpoliuborka > 1:'You can work part-time as a cleaner in pavlovo clinic. Work is from 16 to 21.'
-	*nl
-	if stripwork >= 1:'You can work as a stripper in the city industrial region. Free schedule, every day from 15 to midnight. No salary, only tips.'
-	*nl
-	if film > 0:'You are working in the city industrial region as pornographic actress under the name <<$pfname>>'
-	*nl
-	if bumtolik = 4:'You have been asked to help the homeless at the Mercy Clinic in the city industrial region.'
-	*nl
-	if bumtolik >= 5:'You volunteer at the Mercy Clinic in the city industrial region, working with the homeless. Working hours are from 9 to 17, Saturday and Sunday.'
-	*nl
-	if husband > 0:'You have been married for <<husbanday>> days. Your husband <<$husName>> <<$husBody>> <<$husFat>> <<$husHair>>. Member <<husDick>> Relationship <<husband>>.'
+	gs 'housing', 'rent'
+
+	$NoteBookLine = {
+		$result = "<br><<$ARGS[0]>>"
+	}
+
+	$tab_text = '<center><h1>Notebook</h1></center>'
+	if MagikDostup = 0:
+		$tab_text += '<center><h2>Spells to Cast</h2></center><br>'
+		$tab_text += func('spellBook','cast','$nonComSpells')
+		$tab_text += '<br><center><h2>Spell Learning</h2></center><br>'
+		$tab_text += '<br><center><h3>Combat</h3></center><br>'
+		$tab_text += func('spellBook','learn','$combatSpells')
+		$tab_text += '<br><center><h3>Non-Combat</h3></center><br>'
+		$tab_text += func('spellBook','learn','$nonComSpells')
+	end
+
+	$tab_text += '<center><h2>Housing</h2></center>'
+	if pavSharedAptEnabled = 1:$tab_text += dyneval($NoteBookLine,'You share an apartment with three others in Pavlovsk. Bills are paid by the other tennants in exchange for your house services')
+	if home_owned[1] = 1:$tab_text += dyneval($NoteBookLine,'You rent a two-room apartment, in the city residential area. Rent for the apartment is subtracted automatically, in sum of <<home_rent[1]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL>></b> days')
+	if home_owned[1] = 2:$tab_text += dyneval($NoteBookLine,'You own a two-room apartment, in the city residential area. Utility bills are on the 25th of each month.')
+	if home_owned[1] = 3:$tab_text += dyneval($NoteBookLine,'You own a two-room apartment, in the city residential area. It''s currently occupied by your tenants.')
+	if home_owned[2] > 0:$tab_text += dyneval($NoteBookLine,'You live in a two-room apartment, in a large apartment complex, with your parents and siblings in Pavlovsk.')
+	if home_owned[3] > 0:$tab_text += dyneval($NoteBookLine,'You own small holiday cottage with an adjacent allotment in the communal village.')
+	if home_owned[4] > 0:$tab_text += dyneval($NoteBookLine,'You rent a two-room apartment, in Pushkin. Rent for the apartment is subtracted automatically, in sum of <<home_rent[4]>> <b>₽</b> us electric bill on 25th of each month. You are currently paid up for <b><<ArendHouseSL4>></b> days')
+	if home_owned[5] = 1:$tab_text += dyneval($NoteBookLine,'You own a vacant block, in the city suburbs. Utility bills are on the 25th of each month.')
+	if home_owned[5] = 2:$tab_text += dyneval($NoteBookLine,'You own a block in the city suburbs, upon which, you are building a house. Utility bills are on the 25th of each month.')
+	if home_owned[5] = 3:$tab_text += dyneval($NoteBookLine,'You own an impressive manion in the suburbs of St. Petersburg. Utility bills are on the 25th of each month.')
+	$tab_text += '<center><h2>Work</h2></center>'
+	if workPTU > 2:$tab_text += dyneval($NoteBookLine,'You work as a teacher at the Lycée. Working days Mon-Sat, with 14.00 to 16.00. Salary 300r/day. Dress code - office clothes, Strict. The road from the apartment to the Lyceum takes 2 hours 10 minutes.')
+	if (work = 1 or cheatWork = 1) and workKafe > 0:$tab_text += dyneval($NoteBookLine,'You are working as a waitress at The Roadhouse cafe. You need to come to work between 11 and 12, working days: Tuesday, Wednesday and Thursday. At work, you can receive tips from customers, and payment is received on 25th of each month.')
+	if (work = 1 or cheatWork = 1) and workhosp > 0:$tab_text += dyneval($NoteBookLine,'You work as a nurse in the city residential area clinic. You need to come to work between 8 and 9, during the week. Salary is automatically transferred on 25th of each month.')
+	if (work = 1 or cheatWork = 1) and worksalon > 0:$tab_text += dyneval($NoteBookLine,'You work as a masseuse in the city at the Beauty Bar. You need to come to work with 9 to 10, working days, Monday, Wednesday, Friday. Salary is automatically transferred on 25th of each month.')
+	if (work = 1 or cheatWork = 1) and workSec > 0:$tab_text += dyneval($NoteBookLine,'You work as a secretary at Titran-Express. At work you need to come up 9, during the week. Salary is automatically transferred on 25th of each month.')
+	if (work = 1 or cheatWork = 1) and tanwork > 0:$tab_text += dyneval($NoteBookLine,'You work as a governess for Tanya, at Nicholas'' luxury city apartment. Salary is automatically transferred on the 25th of each month.')
+	if (work = 1 or cheatWork = 1) and young_shop_work = 1:$tab_text += dyneval($NoteBookLine,'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 15, Monday to Friday. The salary shall be issued once a week on Fridays.')
+	if (work = 1 or cheatWork = 1) and young_shop_work1 = 1:$tab_text += dyneval($NoteBookLine,'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 9, Saturday and Sunday. The salary shall be issued once a week on Fridays.')
+	if (work = 1 or cheatWork = 1) and young_shop_work2 = 1:$tab_text += dyneval($NoteBookLine,'You work in the city as a store clerk at Pussy-Cats - youth clothing store. Work starts at 9, Monday to Friday. The salary shall be issued once a week on Fridays.')
+	if (work = 1 or cheatWork = 1) and workFabrika = 1:$tab_text += dyneval($NoteBookLine,'You work as a seamstress in a factory in Pavlovsk. Work is every day except Saturday and Sunday. Salary is automatically transferred on 25th of each month.')
+	if workrin = 1:$tab_text += dyneval($NoteBookLine,'You are working at the market in Arthur''s tent as clothing saleswoman. Work on Tuesday, Thursday and Saturday, starting at 8 AM. Salary depends on sales.')
+	if maidqw = 1:$tab_text += dyneval($NoteBookLine,'You can work in Pavlovsk hotel as a maid. Work is every day from 16 to 19. Salary is 250 plus tips.')
+	if postjobQW = 2 or postjobQW = 4:$tab_text += dyneval($NoteBookLine,'You can deliver mail for the postmaster. Work starts each Saturday between 11:00 and 12:00. Salary is 450.')
+	if (work = 1 or cheatWork = 1) and gpoliuborka > 1:$tab_text += dyneval($NoteBookLine,'You can work part-time as a cleaner in pavlovo clinic. Work is from 16 to 21.')
+	if stripwork >= 1:$tab_text += dyneval($NoteBookLine,'You can work as a stripper in the city industrial region. Free schedule, every day from 15 to midnight. No salary, only tips.')
+	if film > 0:$tab_text += dyneval($NoteBookLine,'You are working in the city industrial region as pornographic actress under the name <<$pfname>>')
+	if bumtolik = 4:$tab_text += dyneval($NoteBookLine,'You have been asked to help the homeless at the Mercy Clinic in the city industrial region.')
+	if bumtolik >= 5:$tab_text += dyneval($NoteBookLine,'You volunteer at the Mercy Clinic in the city industrial region, working with the homeless. Working hours are from 9 to 17, Saturday and Sunday.')
+	$tab_text += '<center><h2>Relationships</h2></center>'
+	if husband > 0:$tab_text += dyneval($NoteBookLine,'You have been married for <<husbanday>> days. Your husband <<$husName>> <<$husBody>> <<$husFat>> <<$husHair>>. Member <<husDick>> Relationship <<husband>>.')
 	if kid > 0:
 		i = 0
 		if kid = 1:
-			'You have a child, a <<$polreb[0]>> named <<$kidname[0]>>. Born <<daykid[0]>>-<<monthkid[0]>>-<<yearkid[0]>>. Aged <<kidage[0]>>.'
+			$tab_text += dyneval($NoteBookLine,'You have a child, a <<$polreb[0]>> named <<$kidname[0]>>. Born <<daykid[0]>>-<<monthkid[0]>>-<<yearkid[0]>>. Aged <<kidage[0]>>.')
 		else
-			'You have children:'
+			$tab_text += dyneval($NoteBookLine,'You have children:')
 			:LoopKidCounter
 			if i <= kid + 1:
-				' a <<$polreb[i]>> named <<$kidname[i]>>. Born <<daykid[i]>>-<<monthkid[i]>>-<<yearkid[i]>>. Aged <<kidage[i]>>.'
+				$tab_text += '<br> a <<$polreb[i]>> named <<$kidname[i]>>. Born <<daykid[i]>>-<<monthkid[i]>>-<<yearkid[i]>>. Aged <<kidage[i]>>.')
 				i += 1
 				jump 'LoopKidCounter'
 			end
@@ -2437,7 +2424,7 @@ if $ARGS[0] = 'records':
 		*nl
 	end
 	*nl
-	if $bfsex > 0:'<<$bfsex>>'
+	if $bfsex > 0:$tab_text += dyneval($NoteBookLine,'<<$bfsex>>')
 	*nl
 	if loverGender[0] = 0:
 		$obj_loverintro = 'Your boyfriend'
@@ -2446,11 +2433,10 @@ if $ARGS[0] = 'records':
 		$obj_loverintro = 'Your girlfriend'
 		$obj_loverpron = 'She'
 	end		
-	if pcs_lovers[0] = 1:'<<$obj_loverintro>> <<$loverdesc[0]>> is <<$loverbody[0]>> height and <<$loverbod[0]>> build with <<$loverface[0]>> hair. <<$loverdesc[0]>> is <<$loverClo[0]>>. Your relationship is <<loverrelation[0]>> after <<loverdays[0]>> days dating.'
-	if haraklover[0] = 0 and loverrelation[0] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
-	if haraklover[0] = 1 and loverrelation[0] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
-	if haraklover[0] = 2 and loverrelation[0] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
-	*nl
+	if pcs_lovers[0] = 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverintro>> <<$loverdesc[0]>> is <<$loverbody[0]>> height and <<$loverbod[0]>> build with <<$loverface[0]>> hair. <<$loverdesc[0]>> is <<$loverClo[0]>>. Your relationship is <<loverrelation[0]>> after <<loverdays[0]>> days dating.')
+	if haraklover[0] = 0 and loverrelation[0] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s timid and lacks confidence.')
+	if haraklover[0] = 1 and loverrelation[0] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>> has a cheerful and sociable personality.')
+	if haraklover[0] = 2 and loverrelation[0] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s short-tempered and strict.')
 	if loverGender[1] = 0:
 		$obj_loverintro = 'Your boyfriend'
 		$obj_loverpron = 'He'
@@ -2458,11 +2444,10 @@ if $ARGS[0] = 'records':
 		$obj_loverintro = 'Your girlfriend'
 		$obj_loverpron = 'She'
 	end		
-	if pcs_lovers[1] = 1:'<<$obj_loverintro>> <<$loverdesc[1]>> is <<$loverbody[1]>> height and <<$loverbod[1]>> build with <<$loverface[1]>> hair. <<$loverdesc[1]>> is <<$loverClo[1]>>. Your relationship is <<loverrelation[1]>> after <<loverdays[1]>> days dating.'
-	if haraklover[1] = 0 and loverrelation[1] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
-	if haraklover[1] = 1 and loverrelation[1] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
-	if haraklover[1] = 2 and loverrelation[1] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
-	*nl
+	if pcs_lovers[1] = 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverintro>> <<$loverdesc[1]>> is <<$loverbody[1]>> height and <<$loverbod[1]>> build with <<$loverface[1]>> hair. <<$loverdesc[1]>> is <<$loverClo[1]>>. Your relationship is <<loverrelation[1]>> after <<loverdays[1]>> days dating.')
+	if haraklover[1] = 0 and loverrelation[1] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s timid and lacks confidence.')
+	if haraklover[1] = 1 and loverrelation[1] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>> has a cheerful and sociable personality.')
+	if haraklover[1] = 2 and loverrelation[1] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s short-tempered and strict.')
 	if loverGender[2] = 0:
 		$obj_loverintro = 'Your boyfriend'
 		$obj_loverpron = 'He'
@@ -2470,10 +2455,10 @@ if $ARGS[0] = 'records':
 		$obj_loverintro = 'Your girlfriend'
 		$obj_loverpron = 'She'
 	end		
-	if pcs_lovers[2] = 1:'<<$obj_loverintro>> <<$loverdesc[2]>> is <<$loverbody[2]>> height and <<$loverbod[2]>> build with <<$loverface[2]>> hair. <<$loverdesc[2]>> is <<$loverClo[2]>>. Your relationship is <<loverrelation[2]>> after <<loverdays[2]>> days dating.'
-	if haraklover[2] = 0 and loverrelation[2] > 1:'<<$obj_loverpron>>''s timid and lacks confidence.'
-	if haraklover[2] = 1 and loverrelation[2] > 1:'<<$obj_loverpron>> has a cheerful and sociable personality.'
-	if haraklover[2] = 2 and loverrelation[2] > 1:'<<$obj_loverpron>>''s short-tempered and strict.'
+	if pcs_lovers[2] = 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverintro>> <<$loverdesc[2]>> is <<$loverbody[2]>> height and <<$loverbod[2]>> build with <<$loverface[2]>> hair. <<$loverdesc[2]>> is <<$loverClo[2]>>. Your relationship is <<loverrelation[2]>> after <<loverdays[2]>> days dating.')
+	if haraklover[2] = 0 and loverrelation[2] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s timid and lacks confidence.')
+	if haraklover[2] = 1 and loverrelation[2] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>> has a cheerful and sociable personality.')
+	if haraklover[2] = 2 and loverrelation[2] > 1:$tab_text += dyneval($NoteBookLine,'<<$obj_loverpron>>''s short-tempered and strict.')
 	*nl
 	
 !! Not implemented
@@ -2497,7 +2482,13 @@ if $ARGS[0] = 'records':
 !!	else
 !!		'Your oral virginity is intact'
 !!	end
-	
+
+	! Print out the page
+	*pl func('cleanHTML',$tab_text)
+
+	!clean up
+	killvar '$tab_text'
+
 	*nl
 	gs'Menu.Create','zapisMenu'
 	gs'Menu.Add','zapisMenu','Make a note with current date','','MenuLoc','zapisosn'

+ 62 - 34
locations/spellBook.qsrc

@@ -1,14 +1,16 @@
 #spellBook
 ! Make a table of Spells to Cast from a given list.  the list is in the form of the lists as done in thespellList file.
 !
-! 	$ARGS[0] = the name of the array to use for the spell list.
-!	$ARGS[1] = (optional) return Action Code - a dynamic piece of code to run instead of generic return.
-!	$ARGS[2] = (optional) Additional code to put in spell link (all spells)
+! 	$ARGS[0] = Type of List: cast, learn
+! 	$ARGS[1] = the name of the array to use for the spell list.
+!	$ARGS[2] = (optional) return Action Code - a dynamic piece of code to run instead of generic return.
+!	$ARGS[3] = (optional) Additional code to put in spell link (all spells)
 !
 
-$spellBookVar['Array'] = $ARGS[0]
-$spellBookVar['ActionCode'] = $ARGS[1]
-$spellBookVar['CodeAfterSpell'] = $ARGS[2]
+$spellBookVar['Type'] = $ARGS[0]
+$spellBookVar['Array'] = $ARGS[1]
+$spellBookVar['ActionCode'] = $ARGS[2]
+$spellBookVar['CodeAfterSpell'] = $ARGS[3]
 
 ! Make sure opptional variables have defaults
 if $spellBookVar['ActionCode'] = '':
@@ -26,50 +28,76 @@ if spellMana['fog'] = 0:
 	gs 'spellList'
 end
 
-! Build the table
-$SpellListStr = "
-<center>
-	<h1>Choose a Spell to cast.</h1>
-	<br>
-	<table CELLPADDING = '5'>
-		<tr>
-			<th align='left'>Spell</th>
-			<th align='left'>Mana</th>
-			<th align='left'>Description</th>
-		</tr>"
+! Build the table - Choose Header for Type
+if $spellBookVar['Type'] = 'learn':
+	$spellBookVar['TableText'] = "
+	<center>
+		<table CELLPADDING = '5'>
+			<tr>
+				<th align='left'>Spell</th>
+				<th align='left'>Percent Learned</th>
+			</tr>"
+	$spellBookVar['RowCode'] = {
+		if spellLearn[$ThisSpellName] > 0 and spellKnown[$ThisSpellName] ! 1:
+			$result = " 
+			<tr>
+				<td align='left'><<$spellName[$ThisSpellName]>></td>
+				<td align='right'><<spellLearn[$ThisSpellName]>></td>
+			</tr>"
+			spellBookVar['Counter'] += 1
+		else
+			$result = ''
+		end
+	}
+else
+	! Default is list of castable spells.
+	$spellBookVar['TableText'] = "
+	<center>
+		<table CELLPADDING = '5'>
+			<tr>
+				<th align='left'>Spell</th>
+				<th align='left'>Mana</th>
+				<th align='left'>Description</th>
+			</tr>"
+	$spellBookVar['RowCode'] = {
+		if spellKnown[$ThisSpellName] = 1:
+			$result = " 
+			<tr>
+				<td align='left'><a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>'& <<$spellBookVar['CodeAfterSpell']>>""><<$spellName[$ThisSpellName]>></a></td>
+				<td align='right'><<spellMana[$ThisSpellName]>></td>
+				<td align='left'><<$spellDesc[$ThisSpellName]>></td>
+			</tr>"
+			spellBookVar['Counter'] += 1
+		else
+			$result = ''
+		end
+	}
+end
+
 i = 0
 spellBookVar['ArraySize'] = dyneval("result = arrsize('<<$spellBookVar['Array']>>')")
-numSpellsKnown = 0
+spellBookVar['Counter'] = 0
 :SpellListLoop
 $ThisSpellName = dyneval("$result = <<$spellBookVar['Array']>>[<<i>>]")
 if i < spellBookVar['ArraySize']:
-	if spellKnown[$ThisSpellName] = 1:
-		$SpellListStr = $SpellListStr + " 
-		<tr>
-			<td align='left'><a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>'& <<$spellBookVar['CodeAfterSpell']>>""><<$spellName[$ThisSpellName]>></a></td>
-			<td align='right'><<spellMana[$ThisSpellName]>></td>
-			<td align='left'><<$spellDesc[$ThisSpellName]>></td>
-		</tr>"
-		numSpellsKnown += 1
-	end
+	!$spellBookVar['RowCode']
+	$spellBookVar['TableText'] += dyneval($spellBookVar['RowCode'])
 	i += 1
 	jump 'SpellListLoop'
 end
 
-$SpellListStr = $SpellListStr + " 
+$spellBookVar['TableText'] += " 
 	</table>
 </center>"
 
-if numSpellsKnown = 0:
-	"You don't know any spells of this type."
-else
-	*pl func('cleanHTML',$SpellListStr)
+if spellBookVar['Counter'] = 0:
+	$spellBookVar['TableText'] = "<center>You have no spells in this list.</center>"
 end
 
+$result = func('cleanHTML',$spellBookVar['TableText'])
+
 killvar 'i'
-killvar 'numSpellsKnown'
 killvar '$ThisSpellName'
-killvar '$SpellListStr'
 killvar '$spellBookVar'
 killvar 'spellBookVar'
 --- spellBook ---------------------------------