Browse Source

Merge remote-tracking branch 'slanon/master'

KevinSmarts 4 years ago
parent
commit
15f37c0b92

+ 2 - 7
locations/AnalPR.qsrc

@@ -60,13 +60,7 @@ if $ARGS[0] = '2':
 		gs 'stat'
 	end
 
-	picanRand = RAND(1,6)
-	if picanRand = 1:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl1.jpg"></center>'
-	if picanRand = 2:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl2.jpg"></center>'
-	if picanRand = 3:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl3.jpg"></center>'
-	if picanRand = 4:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl4.jpg"></center>'
-	if picanRand = 5:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl5.jpg"></center>'
-	if picanRand = 6:'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl6.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl<<rand(1, 6)>>.jpg"></center>'
 
 	'As soon as you lie down on the hood of the car, the man parts your legs and eagerly presses the tip of his cock against your anus.'
 	gs 'arousal', 'anal', 10, 'sub', 'unknown', 'prostitution'
@@ -103,6 +97,7 @@ if $ARGS[0] = '2':
 		gs 'arousal', 'anal', 10, 'sub', 'unknown', 'prostitution'
 		gs 'arousal', 'end'
 		gs 'stat'
+		killvar 'cumanalRand'
 	end
 end
 

+ 0 - 40
locations/BDman.qsrc

@@ -2,14 +2,9 @@
 if $ARGS[0] = 'givi':
 	!!stopboy = 0
 	gs 'boyStat', 'A41'
-	$boydesc = $npc_usedname['A41']
 	$boybody = 'small'
 	$boybod = 'thick'
 	$boyface = 'bald'
-	!!long cock
-	dick = npc_dick['A41']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A41']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -30,14 +25,9 @@ end
 if $ARGS[0] = 'ashot':
 	!!stopboy = 0
 	gs 'boyStat', 'A42'
-	$boydesc = $npc_usedname['A42']
 	$boybody = 'average growth'
 	$boybod = 'muscular'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A42']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A42']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 1
 	!!check in appearance, a parameter pcs_apprnc
@@ -58,14 +48,9 @@ end
 if $ARGS[0] = 'arthur':
 	!!stopboy = 0
 	gs 'boyStat', 'A73'
-	$boydesc = $npc_usedname['A73']
 	$boybody = 'average growth'
 	$boybod = 'muscular'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A73']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A73']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -86,14 +71,9 @@ end
 if $ARGS[0] = 'abdula':
 	!!stopboy = 0
 	gs 'boyStat', 'A91'
-	$boydesc = $npc_usedname['A91']
 	$boybody = 'long'
 	$boybod = 'skinny'
 	$boyface = 'gray'
-	!!long cock
-	dick = npc_dick['A91']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A91']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -114,14 +94,9 @@ end
 if $ARGS[0] = 'hasan':
 	!!stopboy = 0
 	gs 'boyStat', 'A92'
-	$boydesc = $npc_usedname['A92']
 	$boybody = 'average growth'
 	$boybod = 'abdominous'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A92']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A92']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -142,14 +117,9 @@ end
 if $ARGS[0] = 'kamil':
 	!!stopboy = 0
 	gs 'boyStat', 'A97'
-	$boydesc = $npc_usedname['A97']
 	$boybody = 'average growth'
 	$boybod = 'thin'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A97']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A97']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -170,14 +140,9 @@ end
 if $ARGS[0] = 'aslan':
 	!!stopboy = 0
 	gs 'boyStat', 'A98'
-	$boydesc = $npc_usedname['A98']
 	$boybody = 'small'
 	$boybod = 'thin'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A98']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A98']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc
@@ -198,14 +163,9 @@ end
 if $ARGS[0] = 'muhtar':
 	!!stopboy = 0
 	gs 'boyStat', 'A99'
-	$boydesc = $npc_usedname['A99']
 	$boybody = 'small'
 	$boybod = 'thick'
 	$boyface = 'black-haired'
-	!!long cock
-	dick = npc_dick['A99']
-	!! sexual force of 0 prior_to 2
-	silaVag = npc_sexskill['A99']
 	!!security, is responsible for the money and requirements 0 beggar, 1 middle_peasant 2 rich
 	finance = 2
 	!!check in appearance, a parameter pcs_apprnc

+ 40 - 58
locations/BDsex.qsrc

@@ -29,15 +29,13 @@ if $ARGS[0] = 'start':
 		'<<$boydesc>> skillfully caresses your breasts.'
 		gs 'arousal', 'foreplay', 5
 		gs 'stat'
-		brand = rand(0, 100)
 
-		if brand < 70:
+		if rand(0, 100) < 70:
 			'<<$boydesc>> strokes and caresses your pussy with his fingers.'
 			gs 'arousal', 'vaginal_finger', -5, 'sub'
 			gs 'stat'
-			trand = rand(0, 2)
 
-			if trand < 2:
+			if rand(0, 2) < 2:
 				'<<$boydesc>> moves to lay you down on your back.'
 
 				act 'Lie on your back and spread your legs ':gt 'BDsex', 'sex'
@@ -59,15 +57,15 @@ if $ARGS[0] = 'start':
 		'<<$boydesc>> hugs you and passionately caress your breasts.'
 		gs 'arousal', 'foreplay', 5
 		gs 'stat'
-		brand = rand(0, 100)
+		tmpbrand = rand(0, 100)
 
-		if brand < 70:
+		if tmpbrand < 70:
 			'<<$boydesc>> caresses your pussy with his fingers.'
 			gs 'arousal', 'vaginal_finger', -5, 'sub'
 			gs 'stat'
-			trand = rand(0, 2)
+			killvar 'tmpbrand'
 
-			if trand < 2:
+			if rand(0, 2) < 2:
 				'<<$boydesc>> moves to lay you down on your back.'
 
 				act 'Lie on your back and spread your legs ':gt 'BDsex', 'sex'
@@ -76,8 +74,9 @@ if $ARGS[0] = 'start':
 
 				act 'Go on all fours':gt 'BDsex', 'sex2'
 			end
-		elseif brand >= 70 and brand < 90:
+		elseif tmpbrand >= 70 and tmpbrand < 90:
 			'<<$boydesc>> grabs the back of your head and pulls you to face his penis.'
+			killvar 'tmpbrand'
 
 			act 'Take by mouth':gt 'BDsex', 'minet'
 			gs 'willpower', 'bj', 'resist', 'easy'
@@ -88,8 +87,8 @@ if $ARGS[0] = 'start':
 				act 'Lie on your back and spread your legs (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 				act 'Stand on all fours (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 			end
-		elseif brand >= 90:
-
+		elseif tmpbrand >= 90:
+			killvar 'tmpbrand'
 			'<<$boydesc>> tells you that he wants to take you in the ass.'
 
 			act 'Do anal':gt 'BDsex', 'anal2'
@@ -141,10 +140,9 @@ if $ARGS[0] = 'sex':
 	gs 'arousal', 'vaginal', 10, 'sub'
 	gs 'stat'
 	gs 'BDsex', 'org'
-	givfinrand = rand(0, 10)
 
 	if harakBoy > 0:
-		if givfinrand >= 8:
+		if rand(0, 10) >= 8:
 			'Suddenly <<$boydesc>> pulls out of you and takes you by the shoulders, guiding you to your knees before him.'
 
 			act 'Take it on the face':gt 'BDsex', 'facial'
@@ -154,10 +152,8 @@ if $ARGS[0] = 'sex':
 		end
 	end
 
-	givfinrand = rand(0, 10)
-
 	if harakBoy = 2:
-		if givfinrand >= 8:
+		if rand(0, 10) >= 8:
 			'Suddenly <<$boydesc>> pulls his member out and begins to fondle your ass, preparing it for penetration.'
 
 			act 'Do anal':gt 'BDsex', 'anal2'
@@ -175,15 +171,13 @@ end
 if $ARGS[0] = 'sex2':
 	pose = 1
 	gs 'stat'
-	picrand = rand(1, 5)
-	'<center><img <<$set_imgh>> src="images/shared/sex/vag/doggy/vagdog<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/vag/doggy/vagdog<<rand(1, 5)>>.jpg"></center>'
 	gs 'arousal', 'vaginal', 10, 'sub'
 	gs 'stat'
 	gs 'BDsex', 'org'
-	givfinrand = rand(0, 10)
 
 	if harakBoy > 0:
-		if givfinrand >= 8:
+		if rand(0, 10) >= 8:
 			'Suddenly <<$boydesc>> pulls out of you and takes you by the shoulders, guiding you to your knees before him.'
 
 			act 'Take it on the face':gt 'BDsex', 'facial'
@@ -193,10 +187,8 @@ if $ARGS[0] = 'sex2':
 		end
 	end
 
-	givfinrand = rand(0, 10)
-
 	if harakBoy = 2:
-		if givfinrand >= 8:
+		if rand(0, 10) >= 8:
 			'Suddenly <<$boydesc>> withdraws and begins to fondle your ass, preparing it for penetration.'
 
 			act 'Anal':gt 'BDsex', 'anal2'
@@ -214,8 +206,7 @@ end
 if $ARGS[0] = 'sex3':
 	pose = 0
 	gs 'stat'
-	picrand = rand(1, 5)
-	'<center><img <<$set_imgh>> src="images/shared/sex/vag/cowgirl/vagcow<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/vag/cowgirl/vagcow<<rand(1, 5)>>.jpg"></center>'
 	gs 'arousal', 'vaginal', 10, 'sub'
 	gs 'stat'
 	gs 'BDsex', 'org'
@@ -231,15 +222,13 @@ end
 
 
 if $ARGS[0] = 'anal2':
-	picrand = rand(1, 10)
-	'<center><img <<$set_imgh>> src="images/shared/sex/anal/doggy/anal2<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/anal/doggy/anal2<<rand(1, 10)>>.jpg"></center>'
 	gs 'arousal', 'anal', 10, 'sub'
 	gs 'stat'
 	gs 'bdsex', 'an'
-	givfinrand = rand(0, 10)
 
 	if harakBoy > 0:
-		if givfinrand >= 8:
+		if rand(0, 10) >= 8:
 			'Suddenly <<$boydesc>> pulls out of you and takes you by the shoulders, guiding you to your knees before him.'
 
 			act 'Take it on the face':gt 'BDsex', 'facial'
@@ -267,9 +256,8 @@ if $ARGS[0] = 'hj':
 	'You take his <<dick>> centimeter penis and begin to caress the shaft, moving the skin over the crimson head.'
 	gs 'arousal', 'hj', 5
 	gs 'stat'
-	bjrand = rand(0, 100)
 
-	if bjrand >= 75:
+	if rand(0, 100) >= 75:
 		if harakBoy = 0:
 			'<<$boydesc>> moans, "I''m going to come."'
 
@@ -313,15 +301,15 @@ if $ARGS[0] = 'hj':
 			act 'Take by mouth':gt 'BDsex', 'minet'
 			act 'Lie on your back and spread her legs ':gt 'BDsex', 'sex'
 		else
-			brand = rand(0, 100)
+			tmpbrand = rand(0, 100)
 
-			if brand < 70:
+			if tmpbrand < 70:
 				'<<$boydesc>> caresses your pussy with his fingers.'
 				gs 'arousal', 'vaginal_finger', -5, 'sub'
 				gs 'stat'
-				trand = rand(0, 2)
+				killvar 'tmpbrand'
 
-				if trand < 2:
+				if rand(0, 2) < 2:
 					'<<$boydesc>> attempts to lay you down on your back.'
 
 					act 'Lie on your back and spread your legs ':gt 'BDsex', 'sex'
@@ -330,8 +318,9 @@ if $ARGS[0] = 'hj':
 
 					act 'Stand on all fours':gt 'BDsex', 'sex2'
 				end
-			elseif brand >= 70 and brand < 80:
+			elseif tmpbrand >= 70 and tmpbrand < 80:
 				'<<$boydesc>> tells you that he wants your ass.'
+				killvar 'tmpbrand'
 
 				act 'Anal':gt 'BDsex', 'anal2'
 
@@ -349,8 +338,9 @@ if $ARGS[0] = 'hj':
 				else
 					act 'Take him into your mouth (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 				end
-			elseif brand >= 80:
+			elseif tmpbrand >= 80:
 				'<<$boydesc>> forces your face down on his member.'
+				killvar 'tmpbrand'
 
 				act 'Take by mouth':gt 'BDsex', 'minet'
 			end
@@ -365,14 +355,12 @@ end
 
 if $ARGS[0] = 'minet':
 	!!blowjob
-	picrand = rand(24, 28)
-	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<rand(24, 28)>>.jpg"></center>'
 	gs 'arousal', 'bj', 10, 'sub'
 	gs 'stat'
 	gs 'bdsex', 'autobj'
-	bjrand = rand(0, 100)
 
-	if bjrand >= 75:
+	if rand(0, 100) >= 75:
 		if harakBoy = 0:
 			'<<$boydesc>> moans, "I''m going to come."'
 
@@ -403,15 +391,12 @@ if $ARGS[0] = 'minet':
 
 			act 'Lie on your back and spread your legs ':gt 'BDsex', 'sex'
 		else
-			brand = rand(0, 100)
-
-			if brand < 70:
+			if rand(0, 100) < 70:
 				'<<$boydesc>> caresses your pussy with his fingers.'
 				gs 'arousal', 'vaginal_finger', -10, 'sub'
 				gs 'stat'
-				trand = rand(0, 2)
 
-				if trand < 2:
+				if rand(0, 2) < 2:
 					'<<$boydesc>> tries to lay you down on your back.'
 
 					act 'Lie on your back and spread your legs ':gt 'BDsex', 'sex'
@@ -420,7 +405,7 @@ if $ARGS[0] = 'minet':
 
 					act 'Stand on all fours':gt 'BDsex', 'sex2'
 				end
-			elseif brand >= 70:
+			else
 				'<<$boydesc>> tells you that he wants your ass.'
 
 				act 'Anal':gt 'BDsex', 'anal2'
@@ -469,8 +454,7 @@ end
 if $ARGS[0] = 'facial':
 	facial += 1
 	minut += 3
-	picrand = rand(11, 15)
-	'<center><img <<$set_imgh>> src="images/shared/sex/cum/facial/facial<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/cum/facial/facial<<rand(11, 15)>>.jpg"></center>'
 	if protect = 1:
 		'<<$boydesc>> finishes, filling the condom with his cum.'
 		protect = 0
@@ -487,8 +471,7 @@ end
 
 if $ARGS[0] = 'swallow':
 	minut += 3
-	picrand = rand(20, 29)
-	'<center><img <<$set_imgh>> src="images/shared/sex/cum/mouth/cum<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/cum/mouth/cum<<rand(20, 29)>>.jpg"></center>'
 	if protect = 1:
 		'<<$boydesc>> finishes, and you feel the condom balloon up in your mouth.'
 		protect = 0
@@ -561,11 +544,11 @@ if $ARGS[0] = 'end':
 		act 'Leave':dynamic $brodilr
 	elseif GoToGuy = 0:
 		act 'Leave':
-			gorand = rand(0, 2)
+			tmpgorand = rand(0, 2)
 
-			if gorand = 0:dynamic $brodilr
-			if gorand = 1:gt 'down'
-			if gorand = 2:gt 'nord'
+			if tmpgorand = 0: killvar 'tmpgorand' & dynamic $brodilr
+			if tmpgorand = 1: killvar 'tmpgorand' & gt 'down'
+			if tmpgorand = 2: killvar 'tmpgorand' & gt 'nord'
 		end
 	else
 		act 'Leave':dynamic $brodilr
@@ -723,8 +706,7 @@ end
 if $ARGS[0] = 'cum':
 	if protect ! 1:
 	!!unprotected sex
-	finrand = rand(0, 1)
-		if finrand = 0:
+		if rand(0, 1) = 0:
 			!!inside
 			sexpartkno = 1
 			gs 'cum_manage'
@@ -733,7 +715,7 @@ if $ARGS[0] = 'cum':
 			gs 'stat'
 			pcs_mood -= 15
 			gs 'cuminsidereact'
-		elseif finrand = 1:
+		else
 			!!out
 			if pose = 0:
 				spafinloc = 14

+ 7 - 6
locations/Club2.qsrc

@@ -154,12 +154,13 @@ if $ARGS[0] = 'toilet2':
 					
 					gs 'arousal', 'bj', 10, 'sub', 'group'
 					
-					horand = rand(1, 100)
-
-					if horand > pcs_horny:pcs_horny += 10 & 'You were not satisfied.'
-					$orgasm_or = 'no'
-					if horand <= pcs_horny:pcs_horny = 0 & 'Orgasm washes over you.'
-					$orgasm_or = 'yes'
+					if rand(1, 100) > pcs_horny:
+						pcs_horny += 10 & 'You were not satisfied.'
+						$orgasm_or = 'no'
+					else
+						pcs_horny = 0 & 'Orgasm washes over you.'
+						$orgasm_or = 'yes'
+					end
 					gs 'stat'
 
 					act 'Continue':

+ 16 - 16
locations/Prostitute.qsrc

@@ -97,8 +97,8 @@ if $ARGS[0] = 'start':
 									'You realize he''s not going to let you off the hook easily, and that he probably has enough connections to get you into serious trouble. It''s probably easiest to treat him as just another customer, maybe he''ll let you go if you do a good job...'
 
 									act 'Reach for his groin':
-											gs 'npcgeneratec', 0, 'Bandit', rand(18,45)
-											gs 'boyStat', $npclastgenerated
+										gs 'npcgeneratec', 0, 'Bandit', rand(18,45)
+										gs 'boyStat', $npclastgenerated
 										gt 'blowPR', 'start'
 									end
 								end
@@ -186,6 +186,7 @@ if $ARGS[0] = 'start':
 								end
 							end
 						end
+						killvar 'proseventrand'
 					end
 				end
 			end
@@ -258,7 +259,7 @@ if $ARGS[0] = 'work1':
 				if $ARGS[1] = 'anal':KlientMON = rand(5, 40)
 
 				if KlientMON >= ProsMoney:
-					gt 'prostitute', 'work2', $ARGS[1]
+					killvar 'KlientMON' & gt 'prostitute', 'work2', $ARGS[1]
 					exit
 				else
 					if rand(0, 1) = 1:
@@ -266,11 +267,12 @@ if $ARGS[0] = 'work1':
 
 						act 'Agree':
 							ProsMoney = KlientMON
+							killvar 'KlientMON'
 							gt 'prostitute', 'work2', $ARGS[1]
 							exit
 						end
 
-						act 'Refuse':gt 'prostitute', 'start'
+						act 'Refuse': killvar 'KlientMON' & gt 'prostitute', 'start'
 						exit
 					end
 				end
@@ -291,9 +293,9 @@ if $ARGS[0] = 'work2':
 		cla
 		clr
 		*clr
-		gs 'boy'
 		gs 'npcgeneratec', 0, '"John"', rand(18,45)
 		gs 'boyStat', $npclastgenerated
+		!! gs 'boy', 'details'    & !! does not seem to be needed for "Johns"
 		slutty += 1
 		guy += 1
 		if pcs_throat < dick: pcs_throat += 1
@@ -320,6 +322,7 @@ if $ARGS[0] = 'work2':
 				else
 					'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bjp<<picrand>>.jpg"></center>'
 				end
+				killvar 'picrand'
 				'You put a condom between your lips and slowly guide your mouth to his penis, you gently roll it down using only your lips. You can tell the guy is really impressed with your skills.'
 
 				if $ARGS[1] = 'blow job':
@@ -419,8 +422,7 @@ if $ARGS[0] = 'work2':
 				*clr
 				gs 'dinSex', 'std_trigger_oral'
 				gs 'stat'
-				picrand = rand(8, 13)
-				'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bjp<<picrand>>.jpg"></center>'
+				'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bjp<<rand(8, 13)>>.jpg"></center>'
 				'You close your lips around his member and flick your tongue over the tip of his cock teasingly.'
 				gs 'arousal', 'bj', 5, 'prostitution', 'unknown'
 				gs 'stat'
@@ -498,6 +500,7 @@ if $ARGS[0] = 'work2':
 								gs 'stat'
 							end
 						end
+						killvar 'bjrand'
 						gs 'arousal', 'end'
 						gs 'stat'
 						act 'Get out of his car':gt 'prostitute', 'start'
@@ -517,27 +520,25 @@ if $ARGS[0] = 'work2':
 
 							if prostRand <= 50:
 								pose = 1
-								picpRand = rand(1, 7)
-								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<picpRand>>.jpg"></center>'
+								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<rand(1, 7)>>.jpg"></center>'
 								'You lean against the car and expose your bare ass to the man. He''s not wasting any time and immediately gets behind you, eagerly rubbing his cock against your vagina. The feeling of a rock hard erection rubbing on your pussy lips excites you. Your hips move involuntarily seeking out more friction. The man smiles at your eagerness to be fucked and grants your wish by slamming powerfully his hard member deep into your willing vagina. '
 								gs 'arousal', 'vaginal', 10, 'prostitution', 'unknown'
 								gs 'stat'
 							elseif prostRand <= 75:
 								pose = 1
-								picpRand = rand(8, 10)
-								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<picpRand>>.jpg"></center>'
+								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<rand(8, 10)>>.jpg"></center>'
 								'You get down on your hands and knees like he wants you to, and brace yourself against the car when you feel him pressing his cock against your pussy in a none too gentle fashion, wasting no time as he roughly uses your tender vagina for his pleasure. You groan in pain, which only encourages the man to fuck you even harder. '
 								gs 'arousal', 'vaginal', 10, 'prostitution', 'unknown', 'rough'
 								gs 'stat'
 							else
 								pose = 0
-								picpRand = rand(11, 17)
-								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<picpRand>>.jpg"></center>'
+								'<center><img <<$set_imgh>> src="images/locations/shared/sex/car/sexcar<<rand(11, 17)>>.jpg"></center>'
 								'He groans in your ear: "Get on the hood, on your back!"'
 								'You quickly do as he says, and let out a soft moan when he rubs his cock against your pussy lips.'
 								gs 'arousal', 'vaginal', 10, 'prostitution', 'unknown'
 								gs 'stat'
 							end
+							killvar 'prostRand'
 
 							'He exerted himself a great deal while he was fucking you, and is slowly catching his breath while you straighten your clothes.'
 							'With a satisfied smile on his face, he gives you the money he owes you and drives off.'
@@ -560,9 +561,7 @@ if $ARGS[0] = 'work2':
 							if dickK < 1:dickK = 1
 							pcs_ass += dickK
 
-							!! the first cowl image is cowl, not cowl1
-							picrand = rand(1, 6)
-							'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl<<picrand>>.jpg"></center>'
+							'<center><img <<$set_imgh>> src="images/shared/sex/anal/mis/cowl<<rand(1, 6)>>.jpg"></center>'
 							'As soon as you lie down on the hood of the car, the man parts your legs and eagerly presses the tip of his cock against your anus.'
 							gs 'arousal', 'foreplay', 1, 'prostitution', 'unknown'
 							gs 'stat'
@@ -677,6 +676,7 @@ if $ARGS[0] = 'work2':
 									'Suddenly the man groans loudly, and he holds still with his cock deep inside you. Then he very slowly pulls out, and a trickle of his sperm slowly runs out of your slightly gaping ass.'
 									'He admires his work for a moment, before giving the money he owes you with a satisfied smile on his face.'
 								end
+								killvar 'cumanalRand'
 
 								gs 'arousal', 'end'
 								gs 'stat'

+ 1 - 1
locations/Snpc.qsrc

@@ -235,7 +235,7 @@ if numnpc = 23:
 end
 
 !!Chat
-if narkoman = 1 and npcnum = 1 and npc_rel['A1'] > 100:
+if narkoman = 1 and numnpc = 1 and npc_rel['A1'] >= 100:
 	'You don''t want to but the you feel miserable and everything hurts, you crave the rush that you''ve come to enjoy so much'
 	'"Please Dimka, can I have some pale lady?"'
 	if dimaRevenge = 0:

+ 0 - 2
locations/abductionCustomer.qsrc

@@ -136,8 +136,6 @@ if $ARGS[0] = 'abdCustomer':
 		$charType = 'neutral'
 	elseif charTypeRand >= 5:
 		$charType = 'sadistic'
-	elseif charTypeRand < 999 and buyout = 1:
-		$charType = 'sadistic'
 	end
 
 	if bodyTypeRand <= 1:

+ 6 - 8
locations/albinahome.qsrc

@@ -256,13 +256,11 @@ if $ARGS[0] = 'poledancing':
 	npc_rel['A23'] += 1
 	if pcs_stren >= 40 and pcs_dancero > 50:
 		if pcs_inhib < 60:inhib_exp += rand(2,3)
-		timemult = 8
 		loopcount = 1
 		:timeloop1
 		gs 'exercise', 'tier2', 0, 'stren_exp', 'vital_exp', 'dancpol_exp'
-		if loopcount < timemult: loopcount += 1 & jump 'timeloop1'
-		loopcount = 0
-		timemult = 0
+		if loopcount < 8: loopcount += 1 & jump 'timeloop1'
+		killvar 'loopcount'
 		gs 'stat'
 		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/girl/albina/poledance.jpg"></center>'
 		'Albina taught you various acrobatic moves on the pole.'
@@ -274,13 +272,11 @@ if $ARGS[0] = 'poledancing':
 		'Albina grins "You''re still too weak for poledancing, we can practice developing your strength instead."'
 		act 'Develop strength (2:00)':
 			*clr & cla
-			timemult = 8
 			loopcount = 1
 			:timeloop2
 			gs 'exercise', 'tier2', 0, 'stren_exp', 'vital_exp'
-			if loopcount < timemult: loopcount += 1 & jump 'timeloop2'
-			loopcount = 0
-			timemult = 0
+			if loopcount < 8: loopcount += 1 & jump 'timeloop2'
+			killvar 'loopcount'
 			gs 'stat'
 			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/girl/albina/stren.jpg"></center>'
 			'Albina shows you how to develop your strength using various exercises.'
@@ -503,6 +499,8 @@ if $ARGS[0] = 'game_bet':
 			'Although you tried your best, Albina is just simply outplays you at every turn. You really stand no chance and she easily beats you. Laughing like the villain of a theater play, she slaps you on the ass with the palm of her hand, saying "Show me your ass, <<$pcs_nickname>>! You are my bitch now!" Well a bets a bet, you start talking off your clothes as she start putting the harness on.'
 			act 'Get fucked by a strapon': gt 'albinahome', 'receive_strapon'
 		end
+		killvar 'gameresult'
+		killvar 'albplay'
 	end
 end
 

+ 1 - 2
locations/alex.qsrc

@@ -12,8 +12,7 @@ act 'Get on your knees and take it in your mouth':
 	*clr & cla
 	npc_sex[$boy] += 1
 	alexeySex += 1
-	picrand = rand(29, 41)
-	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<rand(29, 41)>>.jpg"></center>'
 	'Kneeling before him, you unbutton his pants and take a firm grasp of his erect cock.'
 	'Leaning in closer, you give it a quick kiss with your <<$liptalk>> before guiding it your mouth.'
 	'As you suck on his hard dick, Alexey relaxes in his chair letting you take care of his needs.'

+ 2 - 4
locations/alexgang.qsrc

@@ -22,8 +22,7 @@ act 'Get on your knees and give head':
 	*clr & cla
 	alexgangbang += 1
 	gs 'stat'
-	picrand = rand(29, 41)
-	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<rand(29, 41)>>.jpg"></center>'
 	'Kneeling before him, you pull Alexei''s pants all the way down and take a firm grasp of his erect cock.'
 	'Leaning in closer, you give it a quick kiss with your <<$liptalk>> before guiding it into your mouth.'
 	'As you suck on his hard dick, Alexei relaxes in his chair, letting you take care of his needs.'
@@ -45,8 +44,7 @@ act 'Get on your knees and give head':
 		gs 'cum_manage'
 		swallow += 1
 		gs 'stat'
-		picrand = rand(16, 25)
-		'<center><img <<$set_imgh>> src="images/shared/sex/group/gang<<picrand>>.jpg"></center>'
+		'<center><img <<$set_imgh>> src="images/shared/sex/group/gang<<rand(16, 25)>>.jpg"></center>'
 		'Standing on all fours, you start sucking Sasha''s limp cock. As you lick, suck and roll your tongue around his dick, you can feel it slowly stiffening in your mouth.'
 		gs 'dinSex', 'wear_condom'
 		'The position you''re in doesn''t make it easy for you to move your head the right way. However, with some determination you manage to keep Sasha''s cock in your mouth.'

+ 1 - 0
locations/anekdot.qsrc

@@ -126,6 +126,7 @@ elseif anrand = 38:
 elseif anrand = 39:
 	'I tried water polo but my horse drowned.'
 end
+killvar 'anrand'
 
 --- anekdot ---------------------------------
 

+ 15 - 14
locations/annafrends.qsrc

@@ -58,7 +58,7 @@ if $ARGS[0] = 'scene1':
 							end
 						end
 					elseif temprand = 1:
-						'Anya quips "And you''re just sad because you can''t get any girls Roma."'
+						'Anya quips "And you''re just sad because you can''t get any girls, Roma."'
 
 						if rand(0, 10) = 0:'Rex grins "Yeah, our eternal virgin Roma is truly able to enliven the conversation with the topic of anal gases."'
 					else
@@ -174,13 +174,13 @@ if $ARGS[0] = 'scene1':
 
 			if rand(0, 3) = 0:
 				'As Roma pours beer in the cups, they suddenly tip over and spill all the beer on the ground.'
-				temprand3 = rand(0, 2)
+				temprand = rand(0, 2)
 
-				if temprand3 = 0:
+				if temprand = 0:
 					'Outraged, Rex screams "You puny, armless ass! No one can trust you! Didn''t your mother ever tell you, ''Always pour with two hands!''"'
-				elseif temprand3 = 1:
+				elseif temprand = 1:
 					'Outraged, Rex says "How the fuck could you spill that?"'
-				elseif temprand3 = 2:
+				elseif temprand = 2:
 					'Indignantly, Anya says "Always the same; never let somebody else pour if you can do it yourself instead."'
 				end
 			end
@@ -211,6 +211,7 @@ if $ARGS[0] = 'scene1':
 			end
 		end
 	end
+	killvar 'temprand'
 
 	if npc_QW['A33'] = 1:
 		act 'Meet your sister''s boyfriend':
@@ -246,6 +247,7 @@ if $ARGS[0] = 'scene1':
 					'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/reks/event/community/rexpod<<rand(1,3)>>.jpg"></center>'
 					'You cross your foot over your leg, doing your best to appear seductive without being obvious.'
 					act 'Continue to drink beer':gt 'annafrends', 'scene2'
+					killvar 'temp'
 					exit
 				end
 			end
@@ -357,8 +359,8 @@ if $ARGS[0] = 'scene1':
 			else
 				'"<<$pcs_nickname>>, you should come to Rex''s party next week, we find out when they are held on Tuesday morning so ask me during the week so you don''t miss it."'
 				sisboyparty = -1
-			exit	
-			
+				killvar 'temp'
+				exit
 			end
 	
 			act 'Yes':
@@ -414,6 +416,7 @@ if $ARGS[0] = 'scene1':
 				end
 			end
 		end
+		killvar 'temp'
 	end
 end
 
@@ -429,13 +432,15 @@ if $ARGS[0] = 'scene2':
 
 		if gennpc = 0:
 			'Anya walks up to you and asks "<<$pcs_nickname>>, let''s go to the toilet."'
+			act 'Go together':gt 'annafrends', 'scene3', 'Anya'
 		elseif gennpc = 1:
 			'Lena walks up to you and asks "<<$pcs_nickname>>, do you want to go to the toilet?"'
+			act 'Go together':gt 'annafrends', 'scene3', 'Lena'
 		elseif gennpc = 2:
 			'Ira walks up to you and asks "<<$pcs_nickname>>, do you want to go somewhere?"'
+			act 'Go together':gt 'annafrends', 'scene3', 'Ira'
 		end
-
-		act 'Go together':gt 'annafrends', 'scene3'
+		killvar 'gennpc'
 	else
 		'The boys went around the corner of the club to empty their bladder, leaving the girls alone.'
 	end
@@ -449,13 +454,9 @@ if $ARGS[0] = 'scene3':
 	gs 'arousal', 'voyeur', 5
 	gs 'stat'
 
-	if gennpc = 0:$annafrendname = 'Anya' & $annafrendname2 = 'Anya'
-	if gennpc = 1:$annafrendname = 'Lena' & $annafrendname2 = 'Lena'
-	if gennpc = 2:$annafrendname = 'Ira' & $annafrendname2 = 'Ira'
-
 	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/anya/community/piss.jpg"></center>'
 	*nl
-	'You follow <<$annafrendname>> to the bushes behind the club. <<$annafrendname2>> looks around, lifts her skirt, pulls down her panties, squats and begins to pee.'
+	'You follow <<$ARGS[1]>> to the bushes behind the club. <<$ARGS[1]>> looks around, lifts her skirt, pulls down her panties, squats and begins to pee.'
 
 	act 'Leave':SiSonWork = 0 & SiSgdk = 0 & gt'gdk'
 

+ 13 - 7
locations/anushapt.qsrc

@@ -263,6 +263,7 @@ if $ARGS[0] = 'home':
 			act 'Leave': gt 'pavComplex','start'
 			act 'Enter': gt 'anushapt','hallway'
 		end
+		killvar 'nushdoor'
 	else
 		'You knock on the door several times but no one answers. There is probably no one home at the moment.'
 		act 'Move away from the door': gt 'pavComplex','start'
@@ -337,7 +338,7 @@ if $ARGS[0] = 'bathroom':
 		dynamic $showerdin
 		gs 'stat'
 		temp = rand(0,4)
-		if ((hour >= 20 and hour < 23) or (week > 5 and hour >= 8 and hour < 16) or (week > 5 and hour >= 18 and hour < 23)) and temp = 0:
+		if temp = 0 and ((hour >= 20 and hour < 23) or (week > 5 and hour >= 8 and hour < 16) or (week > 5 and hour >= 18 and hour < 23)):
 			inhib_exp += 1
 			'Despite the pattering noise of the running water, you hear the bathroom door open and you look past the shower curtain to see Eduard walking up to the toilet, unzipping his pants.'
 			act 'Uhm excuse me?':
@@ -389,6 +390,7 @@ if $ARGS[0] = 'bathroom':
 			end
 			act 'Get out of the shower': gt 'anushapt','bathroom'
 		end
+		killvar 'temp'
 	end
 	dynamic $bath
 	dynamic $bteeth
@@ -857,6 +859,7 @@ if $ARGS[0] = 'computer':
 							gs 'stat'
 							act 'Find something else to do':gt 'anushapt','anushroom'
 						end
+						killvar 'temp'
 					end
 				end
 			end
@@ -1062,7 +1065,7 @@ if $ARGS[0] = 'snack':
 	elseif snacktime <= 5 and ((week < 6 and hour >= 20 and hour < 23) or (week >= 6 and (hour >= 8 and hour < 16) or (hour >= 18 and hour < 23))):
 		gs 'stat'
 		'As you walk into the kitchen you see Eduard standing at the counter making a sandwich, when the two of you walk in he looks up and gives you both a friendly smile. "So what are you girls up to?"'
-		'Anushka replies to him. "Getting some snacks to get our energy up, so we can go to a orgy later."'
+		'Anushka replies to him. "Getting some snacks to get our energy up, so we can go to an orgy later."'
 		'Her dad frowns at that. "That''s not funny, you shouldn''t even joke about stuff like that."'
 		'Anushka grins. "Oh come on it was a little funny."'
 		'He just sighs and shakes his head slightly in resignation of what his daughter is like. "So do you girls want a sandwich?"'
@@ -1174,6 +1177,7 @@ if $ARGS[0] = 'snack':
 		'While you are doing that, she grabs a couple of drinks from the fridge and once you both have your spoils from your raid on the kitchen you head back to her room.'
 		act 'Back to her room':AnushkaLoc=2&gt'anushapt','anushroom'
 	end
+	killvar 'snacktime'
 end
 	
 if $ARGS[0] = 'livingroom':
@@ -1197,6 +1201,7 @@ if $ARGS[0] = 'livingroom':
 		'As you start to walk into the living room you overhear some muffled voices that are getting louder and louder as they go on... You notice that the door being a bit ajar as you make sure to sneak towards it to overhear what is being said.'
 		act 'Leave':gt 'anushapt','hallway'
 		act 'Listen in':
+			cla & *nl
 			valedlisten = daystart
 			'You see Valeria standing in front of the tv, yelling at Eduard, "I want to see that little bitch punished, for real this time!!!"'
 			'Eduard sighs, clearly annoyed by Valeria being in the way, "What''s wrong now, Valeria? I just want to relax and watch the tv..."'
@@ -1410,7 +1415,7 @@ if $ARGS[0] = 'livingroom':
 					'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/anushapt/eduard.jpg"></center>'
 					'You smile to Eduard. "Hello Mr Konstantinov, is Anushka around?"'
 					'He turns and looks at you and gives you a friendly smile. "Call me Ed and I have no idea where that girl is, you can check her room if you want. If she''s not there, then there is no telling where she is." He says as he goes back to watching tv.'
-					'You nod. "Ok thanks sorry to have bothered you, I''ll be quiet so you can watch you show."'
+					'You nod. "Ok thanks sorry to have bothered you, I''ll be quiet so you can watch your show."'
 					*nl
 					'Eduard laughs at that, "We have three kids running ''round here, there''s no need for that. Besides if I see you trying to be quiet and sneaking around I would think you was up to something. Nush taught me long ago if you see a kid being quiet or suddenly going quiet it means they are up to something." He shakes his head with a fond smile. "But that does reminded me of a time when Nush was younger..." He trails off and looks up at you. "Don''t mind me, just reminiscing, I''m sure you''re not interested in hearing about that."'
 					act 'It''s fine, I would love to hear a story':gt 'anushapt', 'nushkidstory'
@@ -1432,8 +1437,7 @@ if $ARGS[0] = 'livingroom':
 				menu_off = 1
 				gs 'stat'
 				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/anushapt/living.jpg"></center>'
-				livingroomsneak = rand(1,2)
-				if livingroomsneak = 1:
+				if rand(1,2) = 1:
 					'You turn and carefully tread out of the living room while Eduard is busy watching the tv, you make quietly make it to the door way to the hallway, with a final glance back he is still sitting there watching tv, obviously having not noticed you coming in at all.'
 					act 'Leave':gt 'anushapt','hallway'
 				else
@@ -1493,6 +1497,7 @@ if $ARGS[0] = 'livingroom':
 			'Nobody''s here right now.'
 		end
 	end
+	killvar 'livingev'
 end
 
 if $ARGS[0] = 'kitchen':
@@ -1536,6 +1541,7 @@ if $ARGS[0] = 'kitchen':
 		dynamic $fill_bottle
 		dynamic $driwater
 	end
+	killvar 'kitchenev'
 end
 
 if $ARGS[0] = 'fridge':
@@ -1653,7 +1659,6 @@ if $ARGS[0] = 'anushparents':
 	CLOSE ALL
 	*clr & cla
 	minut += 1
-	temp = rand(0,1)
 	gs 'stat'
 	'<center><b><font color = maroon>Anushka''s parent''s room</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/anushapt/parroom.jpg"></center>'
@@ -1661,7 +1666,7 @@ if $ARGS[0] = 'anushparents':
 	if hour < 7:
 		'You look into the bedroom and see Anushka''s parents asleep, they are sleeping as far apart as the bed allows. Not wanting to disturb them you close the door and leave.'
 		act 'Leave':gt 'anushapt','hallway'
-	elseif valeriaIntroduced = 1 and temp = 0:
+	elseif valeriaIntroduced = 1 and rand(0,1) = 0:
 		menu_off = 1
 		gs 'stat'
 		'As you walk inside the parents bedroom you see Valeria laying down on the bed watching some drama TV show while snacking on something.'
@@ -2012,6 +2017,7 @@ if $ARGS[0] = 'nushkidstory':
         'You continue on talking for a while about Anushka''s adventures while she was younger, "This makes so much sense to why she''s like that now..." you comment.'
         '"Yeah, anyways the little free spirited wild child looking for trouble my Nush..." Eduard responds.'
 	end
+	killvar 'nushkidstory'
 	act 'Leave': gt 'anushapt', 'hallway'
 end
 

+ 3 - 3
locations/anushaptbr.qsrc

@@ -214,7 +214,7 @@ if $ARGS[0] = 'brotherroom':
 					end
 				end	
 			end
-		elseif brotherroom = 3 and maksimQW = 2: 
+		elseif brotherroom = 3 and maksimQW = 2:
 			gs 'stat'
 			'You open the door and look in the brothers'' room. You see Maksim in there alone playing some first person shooter on the play station.'
 			act 'Ask where Timofey is':
@@ -305,6 +305,7 @@ if $ARGS[0] = 'brotherroom':
 			'Timofey looks over and adds. "Yeah get lost, no girls allowed." After that they just ignore you.'
 			act 'Leave': gt 'anushapt', 'hallway'
 		end
+		killvar 'brotherroom'
 	end
 end 
 
@@ -314,12 +315,11 @@ if $ARGS[0] = 'rematch':
 	menu_off = 0
 	CLOSE ALL
 	*clr & cla
-	rematch = rand(1,2)
 	minut += 1
 	gs 'stat'
 	'<center><b><font color = maroon>Anushka''s brother''s room</font></b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/anushapt/broroom.jpg"></center>'
-	if rematch = 1:
+	if rand(1,2) = 1:
 		'The two of you enter her brothers room. They immediately stop doing what they were doing. The older one gathers some courage; "What do you want?" Then he notices you and starts staring at your tits. "I see you brought you groupie with you again."'
 		'Anushka quickly replies; "I just wanted to see if you were up for a rematch" indicating the gaming console in their room.'
 		'Maksim glances at his brother a moment then back to Anushka. "Ok fine."'

+ 0 - 3
locations/arturHome.qsrc

@@ -14,9 +14,6 @@ act 'Go to his home':
 	minut += 60
 	gs 'drugs', 'alcohol', 'vodka', 2
 	gs 'boyStat', 'A73'
-	$boydesc = $npc_usedname['A73']
-	silavag = npc_sexskill['A73']
-	dick = npc_dick['A73']
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/arthur/artur.jpg"></center>'
 	'Arthur has generously set the table with food and you eat meat wrapped in grape leaves and roasted on skewers. You drink strong Chacha with your food and quickly find yourself getting tipsy. Once you''re nearly done with your meal Arthur turns on some music before approaching, a look of lust on his face. "Come to me girl." He says authoritatively'

+ 1 - 0
locations/arturSex.qsrc

@@ -58,6 +58,7 @@ act 'Enjoy his touch':
 	if temp = 0:act 'Continue': gt 'arturdin', 'bed'
 	if temp = 1:act 'Continue': gt 'arturdin', 'bedmiss'
 	if temp = 2:act 'Continue': gt 'arturdin', 'facefuck'
+	killvar 'temp'
 end
 
 --- arturSex ---------------------------------

+ 9 - 31
locations/arturdin.qsrc

@@ -6,8 +6,7 @@ $location_type = 'event'
 if $ARGS[0] = 'facefuck':
 	artfacefucktimes += 1
 	artbj += 1
-	picrand = rand(0, 5)
-	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/arthur/sex/facefuck<<picrand>>.jpg"></center>'
+	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/arthur/sex/facefuck<<rand(0, 5)>>.jpg"></center>'
 	'<<$artbef>> You feel Arthur''s fingers lace tightly into your hair before he pushes his huge dick roughly into your mouth, stretching your lips.'
 
 	if pcs_throat < dick:
@@ -25,15 +24,9 @@ if $ARGS[0] = 'facefuck':
 	end
 
 	if artfacefucktimes < 2:
-		tipsexart = rand(0, 1)
-
-		if tipsexart = 0:act 'Continue': gt 'arturdin', 'artlick'
-		if tipsexart = 1:act 'Continue': gt 'arturdin', 'artchik'
+		act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'artlick', 'artchik')
 	elseif artfacefucktimes >= 2:
-		tipsexart = rand(0, 1)
-
-		if tipsexart = 0:act 'Continue': gt 'arturdin', 'bed'
-		if tipsexart = 1:act 'Continue': gt 'arturdin', 'bedmiss'
+		act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'bed', 'bedmiss')
 	end
 end
 
@@ -87,6 +80,7 @@ if $ARGS[0] = 'bed':
 		if artrand = 1:act 'Continue': gt 'arturdin', 'cum'
 		if artrand = 2:act 'Continue': gt 'arturdin', 'anal_cum'
 	end
+	killvar 'artrand'
 end
 
 if $ARGS[0] = 'bedmiss':
@@ -99,10 +93,7 @@ if $ARGS[0] = 'bedmiss':
 	if artfucktimes < 2:
 		act 'Continue': gt 'arturdin', 'sexmiss'
 	elseif artfucktimes >= 2:
-		artrand = rand(0, 1)
-
-		if artrand = 0:act 'Continue': gt 'arturdin', 'sexmiss_cum'
-		if artrand = 1:act 'Continue': gt 'arturdin', 'cum'
+		act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'sexmiss_cum', 'cum')
 	end
 end
 
@@ -118,10 +109,7 @@ if $ARGS[0] = 'sexmiss':
 	gs 'stat'
 	
 	gs 'dinsex','vaginal_sex',10
-	tipsexart = rand(0, 1)
-
-	if tipsexart = 0:act 'Continue': gt 'arturdin', 'bed'
-	if tipsexart = 1:act 'Continue': gt 'arturdin', 'bedmiss'
+	act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'bed', 'bedmiss')
 end
 
 if $ARGS[0] = 'sexmiss_cum':
@@ -152,10 +140,7 @@ if $ARGS[0] = 'sexdog':
 	gs 'stat'
 	
 	gs 'dinsex','vaginal_sex',10
-	tipsexart = rand(0, 1)
-
-	if tipsexart = 0:act 'Continue': gt 'arturdin', 'bed'
-	if tipsexart = 1:act 'Continue': gt 'arturdin', 'bedmiss'
+	act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'bed', 'bedmiss')
 end
 
 if $ARGS[0] = 'sexdog_cum':
@@ -187,10 +172,7 @@ if $ARGS[0] = 'anal':
 	gs 'stat'
 	
 	gs 'dinSex','boy_wants_anal','lubri' & gs 'dinsex','analsex'
-	tipsexart = rand(0, 1)
-
-	if tipsexart = 0:act 'Continue': gt 'arturdin', 'bed'
-	if tipsexart = 1:act 'Continue': gt 'arturdin', 'bedmiss'
+	act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'bed', 'bedmiss')
 end
 
 if $ARGS[0] = 'anal_cum':
@@ -281,11 +263,7 @@ if $ARGS[0] = 'fist':
 		gs 'arousal', 'anal_finger', 5, 'rough', 'sub'
 		gs 'stat'
 	end
-
-	tipsexart = rand(0, 1)
-
-	if tipsexart = 0:act 'Continue': gt 'arturdin', 'bed'
-	if tipsexart = 1:act 'Continue': gt 'arturdin', 'bedmiss'
+	act 'Continue': gt 'arturdin', iif(rand(0, 1) = 0, 'bed', 'bedmiss')
 end
 
 --- arturdin ---------------------------------

+ 15 - 25
locations/autotraidF.qsrc

@@ -37,12 +37,12 @@ if $ARGS[0] = 'manager1':
 	'<center><img <<$set_imgh>> src="images/locations/city/industrial/usedcar/autotraid.jpg"></center>'
 	gs 'avb'
 
-	act 'Leave': minut += 5 & gt 'Nord'
+	act 'Leave': killvar 'bupay' & minut += 5 & gt 'Nord'
 	
 	if cardrive = 9 and car > 0:
 		'The shifty-looking salesman circles around your car a couple of times, making exaggerated displeased noises all the while and pointing out practically every speck of dust as if it was a huge damage. When he turns to you, he states that the best he can do is <<bupay>> <b>₽</b> - while he claims that he''s taking a risk with that price, you''re pretty sure he''s ripping you off.'
 
-		act 'No way, not at that price - Leave': minut += 5 & gt 'Nord'
+		act 'No way, not at that price - Leave': killvar 'bupay' & minut += 5 & gt 'Nord'
 		
 		act 'Sell ​your car (<<bupay>> <b>₽</b>) (1:00)':
 			cla
@@ -54,7 +54,7 @@ if $ARGS[0] = 'manager1':
 			'So, as much as you hate it, you give your car one last look before you shake hands with him and follow him into the tiny shed he calls his "office" to sign the papers. He hands you the money in cash and, with a nasty grin, suggests that you look around the yard.' 
 			'"Maybe you see something you like."'
 
-			act 'Leave': minut += 5 & gt 'Nord'
+			act 'Leave': killvar 'bupay' & minut += 5 & gt 'Nord'
 		end
 	elseif cardrive ! 9:
 		'The salesman tells you, his smile sneering rather than friendly, that he needs to look at you car before he can tell you how much it''s worth. "But if you want, I can have somebody tow it here. It only costs 3000 <b>₽</b>. Very cheap!"'
@@ -68,7 +68,7 @@ if $ARGS[0] = 'manager1':
 				money -= 3000
 				'You give him the money - certain that he''s ripping you off - and wait for an hour until the tow truck finally drives into the yard and your car.'
 
-				act 'Talk to the car salesman again':gt 'autotraidF', 'manager1'
+				act 'Talk to the car salesman again': killvar 'bupay' & gt 'autotraidF', 'manager1'
 			end
 		end
 	end	
@@ -90,7 +90,7 @@ if $ARGS[0] = 'car':
 	*nl
 	'It''s obvious that most, if not all of them have sustained some visible or invisible damage. Buying a car here could be a fantastic bargain... or a complete waste of money. If you are to buy any of them, you know that the first place to visit should be a service center.'
 
-	act 'Return': gt 'autotraidF', 'start'
+	act 'Return': killvar 'carT' & killvar 'bupay' & gt 'autotraidF', 'start'
 	
 	if hour <= 17:
 		act 'Inspect a 2107':
@@ -100,7 +100,6 @@ if $ARGS[0] = 'car':
 			'<center><b>2107</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car.jpg"></center>'
 			tehNT = 200
-			tehT = rand(10, tehNT)
 			carT = 1
 			gs 'avt'
 			'<<$tehT>> The car salesman wants <<bupay>> <b>₽</b> for it.'
@@ -120,7 +119,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt 'Nord'
 				end
 			end
@@ -132,8 +131,6 @@ if $ARGS[0] = 'car':
 			menu_off = 1
 			'<center><b>2107 (Broken engine)</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car.jpg"></center>'
-			tehNT = 200
-			tehT = rand(10, tehNT)
 			bupay = rand(10000, 50000)
 			'The car is basically a wreck. It doesn''t even start. When you ask the salesman how much it costs, he tells you "<<bupay>> <b>₽</b>" without hesitation.'
 
@@ -147,13 +144,13 @@ if $ARGS[0] = 'car':
 					car = 1
 					benz = 3
 					cardrive = 9
-					teh = tehT
 					tehcar = 200
+					teh = rand(10, tehcar)
 					wrek = 1
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you... and that''s it.' 
 					'If you want to get the car to a garage, you''ll have to go there and have it towed.'
-
+					killvar 'bupay'
 					act 'Leave': minut += 5 & gt 'Nord'
 				end
 			end
@@ -163,7 +160,6 @@ if $ARGS[0] = 'car':
 			*clr
 			menu_off = 1
 			tehNT = 300
-			tehT = RAND(10,tehNT)
 			carT = 1
 			'<center><b>VAZ 2115</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car2.jpg"></center>'
@@ -185,7 +181,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt'Nord'
 				end
 			end
@@ -195,7 +191,6 @@ if $ARGS[0] = 'car':
 			*clr
 			menu_off = 1
 			tehNT = 290
-			tehT = RAND(10,tehNT)
 			carT = 1
 			'<center><b>VAZ 2113</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car3.jpg"></center>'
@@ -217,7 +212,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt'Nord'
 				end
 			end
@@ -227,7 +222,6 @@ if $ARGS[0] = 'car':
 			*clr
 			menu_off = 1
 			tehNT = 300
-			tehT = RAND(10,tehNT)
 			carT = 1
 			'<center><b>VAZ 2114</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car4.jpg"></center>'
@@ -249,7 +243,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt'Nord'
 				end
 			end
@@ -259,7 +253,6 @@ if $ARGS[0] = 'car':
 			*clr
 			menu_off = 1
 			tehNT = 350
-			tehT = RAND(10,tehNT)
 			carT = 1
 			'<center><b>VAZ 2110</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car5.jpg"></center>'
@@ -281,7 +274,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt'Nord'
 				end
 			end
@@ -294,7 +287,6 @@ if $ARGS[0] = 'car':
 			'<center><b>3102 GAS</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car11.jpg"></center>'
 			tehNT = 1000
-			tehT = rand(10, tehNT)
 			carT = 2
 			gs 'avt'
 			'<<$tehT>> The car salesman wants <<bupay>> <b>₽</b> for it.'
@@ -314,7 +306,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt 'Nord'
 				end
 			end
@@ -327,7 +319,6 @@ if $ARGS[0] = 'car':
 			'<center><b>3110</b></center>'
 			'<center><img <<$set_imgh>> src="images/shared/accessories/car/car12.jpg"></center>'
 			tehNT = 800
-			tehT = rand(10, tehNT)
 			carT = 2
 			gs 'avt'
 			'<<$tehT>> The car salesman wants <<bupay>> <b>₽</b> for it.'
@@ -335,8 +326,7 @@ if $ARGS[0] = 'car':
 			act 'Look around some more':gt 'autotraidF', 'car'
 
 			if car = 0 and prava = 1 and money >= bupay:
-
-			act 'Buy (<<bupay>> <b>₽</b>)':
+				act 'Buy (<<bupay>> <b>₽</b>)':
 					cla
 					money -= bupay
 					$car = '3110'
@@ -348,7 +338,7 @@ if $ARGS[0] = 'car':
 					wrek = 0
 					'You agree. Before you know it, the car salesman and you have signed all the necessary documents, you hand over the <<bupay>> <b>₽</b> in cash and the car is yours.' 
 					'Since it''s crammed in between about a million other vehicles, the car salesman moves it outside near the yard''s entrance for you and warns you that there is very little gas in the tank.'
-
+					killvar 'bupay' & killvar 'tehT'
 					act 'Leave': minut += 5 & gt 'Nord'
 				end
 			end

+ 4 - 2
locations/avt.qsrc

@@ -1,6 +1,6 @@
 # avt
-!!tehNT = 200
-!!tehT = rand(10, 200)
+if tehNT = 0: tehNT = 200
+tehT = rand(10, tehNT)
 
 if tehT >= tehNT * 75 / 100:$tehT = 'Machine in excellent condition.'
 if tehT < tehNT * 75 / 100 and tehT >= tehNT * 50 / 100:$tehT = 'When the engine has what is background noise'
@@ -18,6 +18,8 @@ elseif carT = 2:
 	if tehT < tehNT * 50 / 100 and tehT >= tehNT * 25 / 100:bupay = rand(30000, 60000)
 	if tehT < tehNT * 25 / 100:bupay = rand(15000, 40000)
 end
+killvar 'tehNT'
+killvar 'carT'
 
 --- avt ---------------------------------
 

+ 1 - 3
locations/balkon2.qsrc

@@ -142,10 +142,8 @@ if $ARGS[0] = 'masopt':
 			cla
 			*clr
 			pcs_vag += rand(0, 2)
-			badildo = rand(1, 2)
 
-			if badildo = 1:'<center><img <<$set_imgh>> src="images/locations/city/residential/apartment/sex/balcony_dildo1.jpg"></center>'
-			if badildo = 2:'<center><img <<$set_imgh>> src="images/locations/city/residential/apartment/sex/balcony_dildo2.jpg"></center>'
+			'<center><img <<$set_imgh>> src="images/locations/city/residential/apartment/sex/balcony_dildo<<rand(1, 2)>>.jpg"></center>'
 
 			'You begin to rub yourself, having your hand moving in small circles as you feel your wetness growing. Feeling aroused enough you take out your dildo and begin teasing your clit by gently rubbing the area.'
 			'As you stop teasing yourself, you slowly push the head inside your vagina. You slowly begin to fuck yourself picking up the pace. The feeling of your inside being stretched out is great and you let out a quiet wimp as you keep on playing with the dildo.'

+ 3 - 2
locations/bank.qsrc

@@ -74,9 +74,9 @@ if $ARGS[0] = 'start':
 					bankDebtLimit = 5000
 				end
 				
-				'<br>You deposited <<kartaIN>> <b>₽</b>, your account balance is now <<karta>> <b>₽</b>.'
+				'<br>You deposited <<kartaIN>> <b>₽</b>, your account balance is now ' + iif(karta >= 0,'<<karta>>','<font color="red"><<karta>></font>') + ' <b>₽</b>.'
 			end
-
+			killvar 'kartaIN'
 			act 'Walk away':gt 'bank', 'start'
 		end
 	end
@@ -100,6 +100,7 @@ if $ARGS[0] = 'start':
 					'<br>You withdraw <<kartaOUT>> <b>₽</b>. <font color="red">Your bank account is overdrawn by <b><<karta>> ₽</b>.</font>'
 				end
 			end
+			killvar 'kartaOUT'
 			act 'Walk away':gt 'bank', 'start'
 		end
 	end

+ 1 - 1
locations/cikl.qsrc

@@ -975,7 +975,7 @@ klismaday1 = 0
 !! Resetting relationships that go over the max
 
 :toptemprel
-if temprel < 250:
+if temprel < aarraynumber:
 	temprel +=1
 	if npc_rel['A'+'<<temprel>>'] > 100:npc_rel['A'+'<<temprel>>'] = 100
 	jump 'toptemprel'

+ 47 - 54
locations/club.qsrc

@@ -293,19 +293,16 @@ if $ARGS[0] = 'dance':
 
 					act 'Kiss':
 						cla
-
-						dansexclub = rand(0, 1)
-
-						if dansexclub = 1:
+						
+						if rand(0, 1) = 1:
 							'You''re passionately kissing the guy, while he''s continuously groping you, always dedicating one of his hands to either your tits or your ass. "Why don''t we go to the VIP-Area. There we''ll have a bit more privacy.", he says inbetween kisses.'
 
 							gs 'arousal', 'kiss', 15, 'sub'
-							gs 'stat'
-							picrand = 38
+							gs 'stat'							
 
 							if pcs_horny < 70: act 'Go to the dance floor':gt 'club', 'dance'
-							act 'Go to Vip-room with the guy':$sexloc = 'vipclub' & xgt 'sex', 'var'
-						elseif dansexclub = 0:
+							act 'Go to Vip-room with the guy':picrand = 38 & $sexloc = 'vipclub' & xgt 'sex', 'var'
+						else
 							'You''re passionately kissing the guy, while he''s continuously groping you, always dedicating one of his hands to either your tits or your ass. "Let''s go to the toilet.", he says with a smile.'
 
 							gs 'arousal', 'kiss', 15, 'sub'
@@ -321,20 +318,17 @@ if $ARGS[0] = 'dance':
 					*clr & cla
 					'<center><img <<$set_imgh>> src="images/locations/city/citycenter/nightclub/dancelezb.jpg"></center>'
 					'While you''re dancing you a hand groping your ass. You turn around to see who touched your butt, but you''re surprised to see a woman smiling at you, she is seductively biting her lip.'
-					dansexclub = rand(0, 1)
-
+					
 					act 'Stop dancing':gt 'club', 'inside'
 					
-					if dansexclub = 0:
+					if rand(0, 1) = 0:
 						act '"Let''s go to the toilet, to have fun."':gt 'club', 'lezbsort'
-					elseif dansexclub = 1:
-						picrand = rand(13, 17)
-
-						act '"Let''s go to VIP-Room, to have fun."':$sexloc = 'vipclub' & xgt 'lezbsex', 'var'
+					else
+						act '"Let''s go to VIP-Room, to have fun."': picrand = rand(13, 17) & $sexloc = 'vipclub' & xgt 'lezbsex', 'var'
 					end
 				end
 			end
-
+			killvar 'clrand'
 			act 'Go away':gt 'club', 'dance'
 		end
 
@@ -375,8 +369,7 @@ if $ARGS[0] = 'dance':
 							alexeySex += 1
 							alexeyClubSex += 1
 							gs 'stat'
-							picrand = rand(29, 41)
-							'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<picrand>>.jpg"></center>'
+							'<center><img <<$set_imgh>> src="images/shared/sex/blowjob/bj<<rand(29, 41)>>.jpg"></center>'
 							'You kneel down and wrap your <<$liptalk>> around his cock and you begin to suck on it. Alexei helped by moving his hips back and forth, you notice his moving is in sync to the beat of the music he''s playing. After a few minutes he groans, "You better swallow it all, I don''t want anyone to clean up our mess."'
 
 							gs 'arousal', 'bj', 10, 'sub'
@@ -392,8 +385,7 @@ if $ARGS[0] = 'dance':
 								spafinloc = 12
 								gs 'cum_manage'
 								gs 'stat'
-								picrand = rand(34, 47)
-								'<center><img <<$set_imgh>> src="images/shared/sex/cum/mouth/cum<<picrand>>.jpg"></center>'
+								'<center><img <<$set_imgh>> src="images/shared/sex/cum/mouth/cum<<rand(34, 47)>>.jpg"></center>'
 								'Streams of sperm hit you in the mouth and began to run down your <<$liptalk>>. Alexei wiped his dick on your <<$liptalk>> and put it away in his pants.'
 								'You began greedily to swallow his warm cum and use your finger to collect the drips, that escaped your mouth, then lick your finger clean. Once you''ve swallowed every last drop, you stand up again and thank him for this tasty snack.'
 
@@ -427,9 +419,12 @@ if $ARGS[0] = 'bar':
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/nightclub/club10.jpg"></center>'
 	'You have to squeeze yourself through the crowd to get to the bar. On your way, random guys try to lay their hands around you, try to convince you into dancing or drinking with them, some even try to grope your tits or ass and some play the white knight and try to get your attention by protecting you.'
 
-	if pcs_apprnc > 56:barsexrand = rand(0, 10)
-	if barsexrand = 1:gt 'club', 'bar0'
-	if barsexrand = 2:gt 'club', 'bar1'
+	if pcs_apprnc > 56:
+		barsexrand = rand(0, 10)
+		if barsexrand = 1: killvar 'barsexrand' & gt 'club', 'bar0'
+		if barsexrand = 2: killvar 'barsexrand' & gt 'club', 'bar1'
+		killvar 'barsexrand'
+	end
 
 	act 'Go back':gt 'club', 'inside'
 
@@ -445,7 +440,7 @@ if $ARGS[0] = 'bar':
 			'You''re so drunk, you can barely remember where you live.'
 
 			act 'Try to go home':gt 'street'
-
+			killvar 'temp'
 			exit
 		elseif temp = 6:
 			gs 'stat'
@@ -463,7 +458,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 7:
 			gs 'stat'
@@ -480,7 +475,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 8:
 			pcs_horny += 5
@@ -490,7 +485,7 @@ if $ARGS[0] = 'bar':
 			'You''re too drunk to continue partying here. The security has to escort you out.'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 9:
 			gs 'stat'
@@ -503,7 +498,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 10:
 			gs 'stat'
@@ -516,7 +511,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 11:
 			gs 'stat'
@@ -529,7 +524,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 12:
 			gs 'stat'
@@ -542,7 +537,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 13:
 			gs 'stat'
@@ -555,7 +550,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 14:
 			gs 'stat'
@@ -568,7 +563,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 15:
 			gs 'stat'
@@ -581,7 +576,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 16:
 			gs 'stat'
@@ -594,7 +589,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 17:
 			gs 'stat'
@@ -607,7 +602,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 18:
 			gs 'stat'
@@ -620,7 +615,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 19:
 			gs 'stat'
@@ -633,7 +628,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 20:
 			gs 'stat'
@@ -646,7 +641,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 21:
 			gs 'stat'
@@ -659,7 +654,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 22:
 			gs 'stat'
@@ -672,7 +667,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 23:
 			gs 'stat'
@@ -685,7 +680,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp = 24:
 			gs 'stat'
@@ -698,7 +693,7 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		elseif temp > 24:
 			gs 'stat'
@@ -711,9 +706,10 @@ if $ARGS[0] = 'bar':
 			gs 'stat'
 
 			act 'Leave':gt 'down'
-
+			killvar 'temp'
 			exit
 		end
+		killvar 'temp'
 	end
 
 	if money >= 300:
@@ -1049,6 +1045,7 @@ if $ARGS[0] = 'bar3':
 		spafinloc = 4
 		'You remove your panties and sit down sideways on one of the stools. The guy unzips his cock and quickly enters your pussy. Both of you start to moan in pleasure and he kisses your neck gently. About ten minutes later of rough fucking he cums on your ass check and you pull up your panties, still breathing heavy.'
 	end
+	killvar 't'
 
 	gs 'cum_manage'
 
@@ -1065,10 +1062,9 @@ if $ARGS[0] = 'rape':
 	SUB += 5
 	rape += 1
 	'<center><b><font color="maroon">Bar</font></b></center>'
-	barraperand = rand(0, 1)
 	gs 'npcgeneratec', 0, 'rapist in the club', rand(18,26)
 	gs 'boyStat', $npclastgenerated
-	if barraperand = 0:
+	if rand(0, 1) = 0:
 		'<center><img <<$set_imgh>> src="images/locations/city/citycenter/nightclub/sex/barminet.jpg"></center>'
 		'The guy notices you being heavily drunk and you couldn''t resits anything right now. He orders you to unbutton his pants, take out his cock and begin to suck on it. He grabs your hair and forces your to deepthroat it.'
 
@@ -1076,9 +1072,7 @@ if $ARGS[0] = 'rape':
 		gs 'stat'
 
 		act 'Further':
-			barraperand1 = rand(0, 1)
-
-			if barraperand1 = 0:
+			if rand(0, 1) = 0:
 				cla
 				*clr
 				spafinloc = 12
@@ -1092,7 +1086,7 @@ if $ARGS[0] = 'rape':
 				gs 'stat'
 
 				act 'Leave':gt 'club', 'inside'
-			elseif barraperand1 = 1:
+			else
 				cla
 				*clr
 				cumprecheck = 1
@@ -1111,7 +1105,7 @@ if $ARGS[0] = 'rape':
 				act 'Leave':gt 'club', 'inside'
 			end
 		end
-	elseif barraperand = 1:
+	else
 		gs 'cum_manage'
 		'<center><img <<$set_imgh>> src="images/locations/city/citycenter/nightclub/sex/barsex.jpg"></center>'
 		'You are trying to send it, but your tongue drunk guy is braided and seeing that you are not able to resist, pulls out his cock turns you on a stool and saliva-moistened member enters your vagina, it tears you to force shoving his dick as deep as possible, and finally finishing the leaves.'
@@ -1195,7 +1189,6 @@ if $ARGS[0] = 'vip':
 	elseif vipcart > 0 and vipday ! daystart:
 		act 'Go to the VIP-Area':
 			vipcart -= 1
-			vipday = 1
 			vipday = daystart
 			gt 'vipclub', 'start'
 		end
@@ -1242,8 +1235,8 @@ if $ARGS[0] = 'work':
 				if hour < 1 or hour >= 18:
 					act 'Get another job from Erik':gt 'club', 'work'
 				end
+				
 				act 'Go to dancefloor':gt 'club', 'inside'
-
 			end
 		end
 	elseif clubr = 1:
@@ -1266,7 +1259,6 @@ if $ARGS[0] = 'work':
 				end
 
 			act 'Go to dancefloor':gt 'club', 'inside'
-
 			end
 		end
 	elseif clubr = 2:
@@ -1294,6 +1286,7 @@ if $ARGS[0] = 'work':
 			act 'Go to dancefloor':gt 'club', 'inside'
 		end
 	end
+	killvar 'clubr'
 end
 
 --- club ---------------------------------

+ 4 - 8
locations/dinSex.qsrc

@@ -34,11 +34,9 @@ $penis_desc = $dick_girth + ', ' + $penis_desc
 if ARGS[0] = 'std_trigger':
 	tipvenerarand = rand(0, 10)
 	if protect = 1:
-		venrand = rand(0, 1000)
-		if venrand = 1000: gs 'dinSex', 'disease_picker'
+		if rand(0, 1000) = 1000: gs 'dinSex', 'disease_picker'
 	else
-		venrand = rand(0, 100)
-		if venrand >= 80:gs 'dinSex', 'disease_picker'
+		if rand(0, 100) >= 80: gs 'dinSex', 'disease_picker'
 	end
 end
 
@@ -84,11 +82,9 @@ end
 if ARGS[0] = 'std_trigger_oral':
 	tipvenerarand = rand(0, 10)
 	if protect = 1:
-		venrand = rand(0, 1000)
-		if venrand = 1000: gs 'dinSex', 'disease_picker_oral'
+		if rand(0, 1000) = 1000: gs 'dinSex', 'disease_picker_oral'
 	else
-		venrand = rand(0, 100)
-		if venrand >= 80: gs 'dinSex', 'disease_picker_oral'
+		if rand(0, 100) >= 80: gs 'dinSex', 'disease_picker_oral'
 	end
 end
 

+ 76 - 140
locations/gschool_events.qsrc

@@ -273,7 +273,7 @@ if $ARGS[0] = 'break_events':
 					grupvalue[1] += 1
 					grupvalue[2] += 2
 					grupvalue[4] += 3
-					npc_rel['A<<r>>'] -= 5
+					npc_rel[$school_static_num] -= 5
 					'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy1.jpg"></center>'
 					'The moment the hand makes contact with your bottom, you jump mid-stride and squeal at the stinging pain. You whip around and glare furiously at <<$rand_boy>> who is standing right behind you with a shit eating grin on his face. "What the fuck do you think you''re doing you fucking perv!" you scream in his face before swinging your hand, your smack causing a resounding clap that is echoed by the, "Ooooh!" of your observing classmates. Before giving him a chance to respond, you storm off in the direction you were originally headed'+iif($pantyworntype ! 'none', '.', ', though the whispers of your classmates regarding the sound of his hand on your naked ass cheeks follow you down the hallway.')
 					gs 'gschool_events', 'leave_break_events'
@@ -1668,18 +1668,12 @@ if $ARGS[0] = 'afterschool_events':
 		'As you are heading out of school, you see a group of gopniks ahead of you. Just before you walk past them Vitek steps in front of you blocking your path. You look at Vitek with contempt, "What the fuck do you want?" He''s not impressed in the slightest.'
 		*nl
 		'"I''ll show you what the fuck I want, slut." With these words, Vitek suddenly grabs you by the hair and presses your face against his desk. "What I want is your lips around my dick, right now. Everyone already knows you''re a <<$gnikname>>, you better start acting like it or there will be consequences." He turns to his friends and says, "Come on boys, this whore doesn''t understand her place in life. It''s about time we show her."'
-		i = 0
-		:rand_jock_loop
 		gs 'gschool_events', 'rand_boy_arg', 0,1,0,0,0,0
-		if npc_gender['A<<r>>'] = 0 and npc_grupTipe['A<<r>>'] = 2 and npc_rel['A<<r>>'] > 50:
-			$jock = $npc_nickname['A<<r>>']
-			'As you try and pull away <<$jock>> comes over and pulls the gopnik off you and turns to him. "Leave her alone!"'
+		if npc_rel[$school_static_num] > 50 and npc_gender[$school_static_num] = 0 and npc_grupTipe[$school_static_num] = 2:
+			'As you try and pull away <<$rand_boy>> comes over and pulls the gopnik off you and turns to him. "Leave her alone!"'
 			'The gopnik turns towards him and narrows his eyes. "Or what pussy?"'
-			'<<$jock>> Steps up close crowding him. "Or I will fucking kick your ass right here!" Then they start shoving each other, but before more can happen a teacher interrupts. "What''s going on here, break it up all of you." With that everyone goes their own way as the teacher watches and you word a thank you to <<$jock>> as you slip away.'
+			'<<$rand_boy>> Steps up close crowding him. "Or I will fucking kick your ass right here!" Then they start shoving each other, but before more can happen a teacher interrupts. "What''s going on here, break it up all of you." With that everyone goes their own way as the teacher watches and you word a thank you to <<$jock>> as you slip away.'
 			act 'Continue': gt 'gschool_grounds', 'main'
-		elseif i < 1000:
-			i += 1
-			jump 'rand_jock_loop'
 		else
 			gs 'willpower', 'bj', 'resist'
 			if will_cost <= pcs_willpwr:
@@ -1801,24 +1795,22 @@ if $ARGS[0] = 'rand_scoolboy':
 	*clr & cla
 	if scoolboy = 1:
 		if DimaRudeBlock = 0 and rand(0,2) = 0:
-			r = 1
+			$school_static_num = 'A1'
 		elseif rand(0,1) = 0:
-			r = 4
+			$school_static_num = 'A4'
 		else
-			r = 147
+			$school_static_num = 'A147'
 		end
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_boy = $npc_nickname['A<<r>>']	
+		$rand_boy = $npc_nickname[$school_static_num]	
 	elseif scoolboy = 3:
 		if (artQW ! 3 and artQW ! 20) and rand(0,2) = 0:
-			r = 2
+			$school_static_num = 'A2'
 		elseif rand(0,1) = 0:
-			r = 6
+			$school_static_num = 'A6'
 		else
-			r = 152
+			$school_static_num = 'A152'
 		end
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_boy = $npc_nickname['A<<r>>']
+		$rand_boy = $npc_nickname[$school_static_num]
 	elseif scoolboy = 4:
 		if pav_sex >= 50 and kotovLoveQW <= 0:
 			gt 'gschool_events', 'rand_gopnic'
@@ -1828,8 +1820,8 @@ if $ARGS[0] = 'rand_scoolboy':
 	else
 		gs 'gschool_events', 'rand_boy_arg', 0, 1, 0, 0, 1, 0
 	end
-	'<center><img <<$set_imgh>> src="images/pc/npc_headshots/big<<r>>.jpg"></center>'
-	if npc_gender['A<<r>>'] = 0:
+	'<center><img <<$set_imgh>> src="images/pc/npc_headshots/big<<mid($school_static_num, 2)>>.jpg"></center>'
+	if npc_gender[$school_static_num] = 0:
 		if scoolboy = 3:
 			'You can tell from the embarrassed look on his face and the admiring glances of his friends that <<$rand_boy>> was the one touching your ass. Looks like he scored some points in his group today.'
 		elseif scoolboy = 2:
@@ -1851,7 +1843,7 @@ if $ARGS[0] = 'rand_scoolboy':
 		else
 			'Wait a minute... you don''t recognize any of these people! You must be in the wrong classroom!'
 		end
-		if npc_rel['A<<r>>'] <= 50 and npc_grupTipe['A<<r>>'] ! 5:
+		if npc_rel[$school_static_num] <= 50 and npc_grupTipe[$school_static_num] ! 5:
 			act 'Ignore it':
 				grupvalue[1] -= 1
 				grupvalue[2] -= 1
@@ -1865,7 +1857,7 @@ if $ARGS[0] = 'rand_scoolboy':
 					*clr & cla
 					gs 'willpower', 'pay', 'self'
 					gs 'stat'
-					npc_rel['A<<r>>'] -= 5
+					npc_rel[$school_static_num] -= 5
 					'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy1.jpg"></center>'
 					if mesec > 0:
 						'It''s bad enough he did it, it is worse because you are on your period. "You fucking pervert!" you shout angrily, and you slap him across the face as hard as you can. You shake the stinging out of your hand afterwards, while he clutches his cheek in agony. When he finally pulls his hands away from his face, the outline of your hand is clearly visible on his cheek that''s going to leave a bruise. The other boys laugh loudly, this is the best entertainment they''ve had during the break in a long time.'
@@ -1888,9 +1880,9 @@ if $ARGS[0] = 'rand_scoolboy':
 			else
 				act 'Slap him hard (<font color="red"><<will_cost>> Willpower</font>)': '<br><font color="red">You don''t have enough willpower to use this action.</font>'
 			end
-		elseif npc_rel['A<<r>>'] > 50:
+		elseif npc_rel[$school_static_num] > 50:
 			act 'Slap him playfully':
-				npc_rel['A<<r>>'] -= 2
+				npc_rel[$school_static_num] -= 2
 				*clr & cla
 				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy2.jpg"></center>'
 				'You think to yourself, "<<$rand_boy>> ain''t so bad... but still, I can''t just let him do this."'
@@ -1917,12 +1909,12 @@ if $ARGS[0] = 'rand_scoolboy':
 			act 'Continue': gt 'gschool_events', 'leave_break_events2'
 		end
 !! or npcsex[r]	> 0 can be removed if all remnants of the old school ID-System are gone	
-	elseif npc_sex['A<<r>>'] > 0 or npcsex[r] > 0:
+	elseif npc_sex[$school_static_num] > 0 or npcsex[mid($school_static_num,2)] > 0:
 		'You notice the confident stares of <<$rand_boy>> it must''ve been him.'
 		act 'Taunt him':
 			*clr & cla
 			pcs_horny += 50
-			gs 'boyStat', 'A<<r>>'
+			gs 'boyStat', $school_static_num
 			gs'stat'
 			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy4.jpg"></center>'
 			'He''s kind of cute. You''re so horny right now, you decide to tease him and see if you can push him into doing more. You put your finger in your mouth and quietly ask him in a lewd voice, "Come on <<$rand_boy>>, is that all you have for me?"'
@@ -2007,12 +1999,12 @@ if $ARGS[0] = 'rand_scoolboy':
 		end
 		!! apmeet=6 This closure molestation nerds, Well I think so from the code, who knows if there is no correct.
 		!! dimarudeblock=1 This video stolen from Nosov.
-		if (apmeet = 6 and (r = 6 or r = 2)) or (dimarudeblock = 1 and r = 1):
+		if (apmeet = 6 and (val(mid($school_static_num,2)) = 6 or val(mid($school_static_num,2)) = 2)) or (dimarudeblock = 1 and val(mid($school_static_num,2)) = 1):
 			*nl
 			'After all <<$rand_boy>> did with you, he''s still pinching your ass in school like that? He''s kinda cute, but still that''s just wrong!'
 			act 'Kick him in the balls':
 				*clr & cla
-				npc_rel['A<<r>>'] -= 10
+				npc_rel[$school_static_num] -= 10
 				grupvalue[4] += 5
 				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy8.jpg"></center>'
 				'You kick <<$rand_boy>> in the balls, sending him and all of his classmates the message that you will not put up with this behavior in school. You watch him writhe in pain on the floor for a second, before collecting your things and making your way to your next class.'
@@ -2029,6 +2021,7 @@ if $ARGS[0] = 'rand_gopnic':
 	else
 		r = rand(154,156)
 	end
+	$school_static_num = 'A<<r>>'
 
 	if grupTipe = 4:
 		*clr & cla
@@ -2088,7 +2081,7 @@ if $ARGS[0] = 'rand_gopnic':
 			end
 		end
 	else
-		gs 'boystat', 'A<<r>>'
+		gs 'boystat', $school_static_num
 		'<center><img <<$set_imgh>> src="images/pc/npc_headshots/big<<r>>.jpg"></center>'
 		'You look at <<$boydesc>> with contempt, "What the fuck do you want?" He''s not impressed in the slightest, your loose reputation undermining any authority you try to impose.'
 		act 'Continue':
@@ -2098,7 +2091,7 @@ if $ARGS[0] = 'rand_gopnic':
 			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/events/rand_scoolboy5.jpg"></center>'
 			'"I''ll show you what the fuck I want, slut." With these words, <<$boydesc>> suddenly grabs you by the hair and presses your face against his desk. "What I want is your lips around my dick, right now. Everyone already knows you''re a <<$gnikname>>, you better start acting like it or there will be consequences." He turns to his friends and says, "Come on boys, this whore doesn''t understand her place in life. It''s about time we show her."'
 			gs 'gschool_events', 'rand_boy_arg1', 0, 1, 0, 0, 0, 0
-			if npc_rel['A<<r>>'] > 50:
+			if npc_rel[$school_static_num] > 50:
 				'As you try and pull away <<$rand_boy1>> comes over and pulls the gopnik off you and turns to him. "Leave her alone!"'
 				'The gopnik turns towards him and narrows his eyes. "Or what pussy?"'
 				'<<$rand_boy1>> Steps up close crowding him. "Or I will fucking kick your ass right here!" Then they start shoving each other, but before more can happen a teacher interupts. "What''s going on here, break it up all of you." With that you word a thank you to <<$rand_boy1>> and slip away.'
@@ -2223,140 +2216,83 @@ end
 
 !!Random boy, arguments set to 1 mean included, groups are cool kids, jock, nerd, gopnik, outcast, teachers
 if $ARGS[0] = 'rand_boy_arg':
-	grup1 = 0
-	grup2 = 0
-	grup3 = 0
-	grup4 = 0
-	grup5 = 0
-	grup6 = 0
-	if ARGS[1] = 1:grup1 = 1
-	if ARGS[2] = 1:grup2 = 2
-	if ARGS[3] = 1:grup3 = 3
-	if ARGS[4] = 1:grup4 = 4
-	if ARGS[5] = 1:grup5 = 5
-	if ARGS[6] = 1:grup6 = 6
-	boy_counter = 0
-	:rnd_boy_loop
-	boy_counter += 1
-	r = rand(0,arrsize('npc_grupTipe'))
-	if npc_gender['A<<r>>'] = 0 and schoolenable['A<<r>>'] = 1 and npc_grupTipe['A<<r>>'] ! 0 and (npc_grupTipe['A<<r>>'] = grup1 or npc_grupTipe['A<<r>>'] = grup2 or npc_grupTipe['A<<r>>'] = grup3 or npc_grupTipe['A<<r>>'] = grup4 or npc_grupTipe['A<<r>>'] = grup5 or npc_grupTipe['A<<r>>'] = grup6):
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_boy = $npc_nickname['A<<r>>']
-		killvar 'boy_counter'
-	elseif boy_counter = 1000:
-		$school_static_num = 0
-		$rand_boy = 'boy you don''t know'
-		killvar 'boy_counter'
+	$school_static_num = func('gschool_events', 'random_pers', 0, ARGS[1], ARGS[2], ARGS[3], ARGS[4], ARGS[5], ARGS[6])
+	if $school_static_num ! 'A0':
+		$rand_boy = $npc_nickname[$school_static_num]
 	else
-		jump 'rnd_boy_loop'
+		$rand_boy = 'boy you don''t know'
 	end
 end
 
 if $ARGS[0] = 'rand_boy_arg1':
-	grup1 = 0
-	grup2 = 0
-	grup3 = 0
-	grup4 = 0
-	grup5 = 0
-	grup6 = 0
-	if ARGS[1] = 1:grup1 = 1
-	if ARGS[2] = 1:grup2 = 2
-	if ARGS[3] = 1:grup3 = 3
-	if ARGS[4] = 1:grup4 = 4
-	if ARGS[5] = 1:grup5 = 5
-	if ARGS[6] = 1:grup6 = 6
-	boy_counter = 0
 	:rnd_boy1_loop
-	boy_counter += 1
-	r = rand(0,arrsize('npc_grupTipe'))
-	if npc_gender['A<<r>>'] = 0 and schoolenable['A<<r>>'] = 1 and npc_grupTipe['A<<r>>'] ! 0 and (npc_grupTipe['A<<r>>'] = grup1 or npc_grupTipe['A<<r>>'] = grup2 or npc_grupTipe['A<<r>>'] = grup3 or npc_grupTipe['A<<r>>'] = grup4 or npc_grupTipe['A<<r>>'] = grup5 or npc_grupTipe['A<<r>>'] = grup6):
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_boy1 = $npc_nickname['A<<r>>']
+	$school_static_num = func('gschool_events', 'random_pers', 0, ARGS[1], ARGS[2], ARGS[3], ARGS[4], ARGS[5], ARGS[6])
+	if $school_static_num ! 'A0':
+		$rand_boy1 = $npc_nickname[$school_static_num]
 		if $rand_boy = $rand_boy1: jump 'rnd_boy1_loop'
-		killvar 'boy_counter'
-	elseif boy_counter = 1000:
-		$school_static_num = 0
-		$rand_boy1 = 'boy you don''t know'
-		killvar 'boy_counter'
 	else
-		jump 'rnd_boy1_loop'
+		$rand_boy1 = 'boy you don''t know'
 	end
 end
 
-if $ARGS[0] = 'rand_girl_arg':
-	grup1 = 0
-	grup2 = 0
-	grup3 = 0
-	grup4 = 0
-	grup5 = 0
-	grup6 = 0
-	if ARGS[1] = 1:grup1 = 1
-	if ARGS[2] = 1:grup2 = 2
-	if ARGS[3] = 1:grup3 = 3
-	if ARGS[4] = 1:grup4 = 4
-	if ARGS[5] = 1:grup5 = 5
-	if ARGS[6] = 1:grup6 = 6
-	girl_counter = 0
-	:rnd_girl_loop
-	girl_counter += 1
-	r = rand(0,arrsize('npc_grupTipe'))
-	if npc_gender['A<<r>>'] = 1 and schoolenable['A<<r>>'] = 1 and npc_grupTipe['A<<r>>'] ! 0 and (npc_grupTipe['A<<r>>'] = grup1 or npc_grupTipe['A<<r>>'] = grup2 or npc_grupTipe['A<<r>>'] = grup3 or npc_grupTipe['A<<r>>'] = grup4 or npc_grupTipe['A<<r>>'] = grup5 or npc_grupTipe['A<<r>>'] = grup6):
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_girl = $npc_nickname['A<<r>>']
-		killvar 'girl_counter'
-	elseif girl_counter = 1000:
-		$school_static_num = 0
-		$rand_girl = 'girl you don''t know'
-		killvar 'girl_counter'
+if $ARGS[0] = 'rand_girl_arg':	
+	$school_static_num = func('gschool_events', 'random_pers', 1, ARGS[1], ARGS[2], ARGS[3], ARGS[4], ARGS[5], ARGS[6])
+	if $school_static_num ! 'A0':
+		$rand_girl = $npc_nickname[$school_static_num]
 	else
-		jump 'rnd_girl_loop'
+		$rand_girl = 'girl you don''t know'
 	end
 end
 
 if $ARGS[0] = 'rand_girl_arg1':
-	grup1 = 0
-	grup2 = 0
-	grup3 = 0
-	grup4 = 0
-	grup5 = 0
-	grup6 = 0
-	if ARGS[1] = 1:grup1 = 1
-	if ARGS[2] = 1:grup2 = 2
-	if ARGS[3] = 1:grup3 = 3
-	if ARGS[4] = 1:grup4 = 4
-	if ARGS[5] = 1:grup5 = 5
-	if ARGS[6] = 1:grup6 = 6
-	girl_counter = 0
 	:rnd_girl1_loop
-	girl_counter += 1
-	r = rand(0,arrsize('npc_grupTipe'))
-	if npc_gender['A<<r>>'] = 1 and schoolenable['A<<r>>'] = 1 and npc_grupTipe['A<<r>>'] ! 0 and (npc_grupTipe['A<<r>>'] = grup1 or npc_grupTipe['A<<r>>'] = grup2 or npc_grupTipe['A<<r>>'] = grup3 or npc_grupTipe['A<<r>>'] = grup4 or npc_grupTipe['A<<r>>'] = grup5 or npc_grupTipe['A<<r>>'] = grup6):
-		$school_static_num = $school_static_num['A<<r>>']
-		$rand_girl1 = $npc_nickname['A<<r>>']
+	$school_static_num = func('gschool_events', 'random_pers', 1, ARGS[1], ARGS[2], ARGS[3], ARGS[4], ARGS[5], ARGS[6])
+	if $school_static_num ! 'A0':
+		$rand_girl1 = $npc_nickname[$school_static_num]
 		if $rand_girl = $rand_girl1: jump 'rnd_girl1_loop'
-		killvar 'girl_counter'
-	elseif girl_counter = 1000:
-		$school_static_num = 0
-		$rand_girl1 = 'girl you don''t know'
-		killvar 'girl_counter'
 	else
-		jump 'rnd_girl1_loop'
+		$rand_girl1 = 'girl you don''t know'
 	end
 end
 
 !!Random teacher, male
 if $ARGS[0] = 'rand_teacher_arg':
-	teacher_counter = 0
-	:rnd_teacher_loop
-	teacher_counter += 1
-	r = rand(0,arrsize('npc_grupTipe'))
-	if teacher_counter = 1000:
+	$school_static_num = func('gschool_events', 'random_pers', 0, ARGS[1], ARGS[2], ARGS[3], ARGS[4], ARGS[5], ARGS[6])
+	if $school_static_num ! 'A0':
+		$rand_teacher = $npc_nickname[$school_static_num]
+	else
 		$rand_teacher = 'Tsarev'
-		killvar 'teacher_counter'
-	elseif npc_grupTipe['A<<r>>'] ! 6 or npc_gender['A<<r>>'] = 1:
-		jump 'rnd_teacher_loop'
 	end
-	$rand_teacher = dyneval('$result = $npc_lastname[''A<<r>>'']')
+	$rand_teacher = dyneval('$result = $npc_lastname[<<$school_static_num>>]')
+end
+
+!{ random person by gender, groups (replaces old faulty random code)
+   set gender to -1 to include both genders, 0 for male, 1 for female
+   set groups to 1 to include, 0 otherwise
+   usage:
+	$x = func('gschool_events', 'random_pers', gender, g1, g2, g3, g4, g5, g6)
+ }
+if $ARGS[0] = 'random_pers':
+	!! create candidate array:
+	tmpArrIdx = 0
+	:rand_pers_fill_loop
+		$school_static_num = $school_static_num[tmpArrIdx]
+		if schoolenable[$school_static_num] = 1 and (ARGS[1] = -1 or npc_gender[$school_static_num] = ARGS[1]) and (npc_grupTipe[$school_static_num] = ARGS[2] or npc_grupTipe[$school_static_num] = ARGS[3]*2 or npc_grupTipe[$school_static_num] = ARGS[4]*3 or npc_grupTipe[$school_static_num] = ARGS[5]*4 or npc_grupTipe[$school_static_num] = ARGS[6]*5 or npc_grupTipe[$school_static_num] = ARGS[7]*6):
+			$tmpCandidateArr[] = $school_static_num
+		end
+		tmpArrIdx +=1
+	if tmpArrIdx < arrsize('$school_static_num'): jump 'rand_pers_fill_loop'
+
+	!! random person within candidates
+	if arrsize('tmpCandidateArr') > 0:
+		$result = $tmpCandidateArr[rand(0, arrsize('tmpCandidateArr') -1)]
+	else
+		$result = 'A0'
+	end
+
+	!! cleanup
+	killvar 'tmpArrIdx'
+	killvar 'tmpCandidateArr'
 end
 
 if $ARGS[0] = 'christinaphotos':

+ 7 - 5
locations/placer_sex.qsrc

@@ -1452,13 +1452,15 @@ if $args[0] = 'sleep':
 	:loopson
 	minut += 1
 	stime += 1
-	pcs_health += 5
-
-	if stime = 60:stime = 0 & pcs_sleep += 15
+	if recuperation = 0:pcs_health += 5
 
-	gs'stat'
+	if stime >= 60:
+		stime = 0
+		pcs_sleep += 15
+		gs 'stat'
+	end
 
-	if pcs_sleep > 100:
+	if pcs_sleep >= 100:
 		hour = 8
 		minut = 0
 		gs'stat'

+ 1 - 1
locations/preSYS.qsrc

@@ -467,7 +467,7 @@ if $ARGS[0] = 'charselect':
 	act 'Random personality':
 !! This allows the player to select a random personality.
 		*clr & cla
-		persrand = rand(0, 18)
+		persrand = rand(0, 17)
 		if persrand <= 3:
 		!! Nerd
 			gs 'preSYS', 'nerdinfo'

+ 12 - 11
locations/sex.qsrc

@@ -269,23 +269,22 @@ if $ARGS[0] = 'end':
 		orgasm += 1
 		'You feel so horny after bringing him to orgasm, you''re very close to having an orgasm also! You close your eyes and surrender yourself to the moment, quickly rubbing yourself to completion.'
 	end
-	pos = 0
 	if cuminside = 1: gs 'cuminsidereact'
 
 	gs 'arousal', 'end'
 
 	gs 'stat'
 	act 'Leave':
-		if picrand >= 54 and picrand <= 73:gt 'office', 'work'
-		if picrand >= 74 and picrand <= 76:gt 'vann', 'start'
-		if picrand >= 77 and picrand <= 80:gt 'tanhouse'
-		if picrand >= 81 and picrand <= 82:gt 'down'
-		if picrand >= 83 and picrand <= 84:dynamic $brodila
-		if picrand >= 85 and picrand <= 86:gt'down'
-		if picrand = 87 or picrand = 90:dynamic $brodilk
-		if picrand = 88:dynamic $brodils
-		if picrand = 89:gt 'bed', 'start'
-
+		if picrand >= 54 and picrand <= 73: killvar 'picrand' & gt 'office', 'work'
+		if picrand >= 74 and picrand <= 76: killvar 'picrand' & gt 'vann', 'start'
+		if picrand >= 77 and picrand <= 80: killvar 'picrand' & gt 'tanhouse'
+		if picrand >= 81 and picrand <= 82: killvar 'picrand' & gt 'down'
+		if picrand >= 83 and picrand <= 84: killvar 'picrand' & dynamic $brodila
+		if picrand >= 85 and picrand <= 86: killvar 'picrand' & gt'down'
+		if picrand = 87 or picrand = 90: killvar 'picrand' & dynamic $brodilk
+		if picrand = 88: killvar 'picrand' & dynamic $brodils
+		if picrand = 89: killvar 'picrand' & gt 'bed', 'start'
+		killvar 'picrand'
 		if svidboysex = 1:
 			svidboysex = 0
 			gt $svidboy_home, $svidboy_home_arg
@@ -293,6 +292,8 @@ if $ARGS[0] = 'end':
 
 		gt $sexloc, 'start'
 	end
+	killvar 'pos'
+	killvar 'textrand'
 end
 
 --- sex ---------------------------------