:: quest_therapist
<<switch $location_var[$here][0]>>
	<<case 'title'>>
		<<set $result ="Psychologist">>
	<<case 'start'>>
		<<set $quest('therapist').numTimesHypnoed = 0>>
		<<set $quest('therapist').hypnoStage = 0>>
		<<set $quest('therapist').hypnoStrength = 0>>
		<<set $quest('therapist').hypnoTime = 0>>
		<<set $quest('therapist').hypnoTimesResistedStage = 0>>
		<<set $quest('therapist').hypnoAddict = 0>>
		<<set $quest('therapist').hypnoSchedule = 0>>
		<<set $quest('therapist').hypnoWithdrawal = 0>>
		<<set $quest('therapist').therapistday = 0>>
		/*<<run $quest('school').registerEvent('therapist_daily',0,0,null,null,null,'daily')>>*/
	<<case 'stageDescription'>>
		<<switch $location_var[$here][1]>>
			<<case 0>>
				<<set $result =`You have met the psychologist, <<npc 'A186'>><</npc>>, in his office in the hospital of Pavlovsk.`>>
			<<case 10>>
				<<set $result =`You had a regular therapy session with <<npc 'A186'>><</npc>>, the Psychologist of the hospital of Pavlovsk.
				He suggested a hypno-session for the next time you visit. It might be more effective.`>>
			<<case 20>>
				<<set $result =`You had a hypno-session with <<npc 'A186'>><</npc>>, the Psychologist of the hospital of Pavlovsk.
				It felt great. You certainly have to repeat this.`>>
		<</switch>>
	<<case 'vars'>>
		<<switch $location_var[$here][1]>>
			<<case 'therapistId'>>
				<<set $result = 'A186'>>
			<<case 'therapistInterest'>>
				<<set _thingsTheTherapistLikes = 0>>
				<<if $pc.age < 18>>
					<<set _thingsTheTherapistLikes += 1>>
				<</if>>
				<<if $pc.isSchoolStudent>>
					<<setn _thingsTheTherapistLikes += 1>>
				<</if>>
				<<set $result = _thingsTheTherapistLikes>>
		<</switch>>
	<<case 'event'>>
		<<switch $location_var[$here][1]>>
			<<case 'therapist_daily'>>
				<<set $timeTresh = 76 - 4 * $quest('therapist').hypnoTime>>
				<!-- !!Withdrawal effect begings if too strong influence and no visitation-->
				<<if $time.daystart - getvar("$hypnoDay") > 7>>
					<<if $quest('therapist').hypnoAddict == 1>>
						<<set $quest('therapist').hypnoWithdrawal = 1>>
					<<elseif $quest('therapist').hypnoAddict == 2>>
						<<set $quest('therapist').hypnoWithdrawal = 2>>
					<</if>>
				<</if>>
				<!-- !!daily weaning of therapist influence-->
				<<if $quest('therapist').hypnoStrength > 0>>
					<<setn $quest('therapist').hypnoStrength -= 1>>

				<</if>>
				<<if $quest('therapist').hypnoTime > 0 and $quest('therapist').hypnoStrength == 0>>
					<<if $quest('therapist').hypnoAddict == 0>>
						<<set $quest('therapist').hypnoStrength = 19>>
						<<set $quest('therapist').hypnoTime -= 1>>
					<<elseif $quest('therapist').hypnoAddict == 1>>
						<<if rand(0,1) == 0>>
							<<set $quest('therapist').hypnoStrength = 19>>
							<<set $quest('therapist').hypnoTime -= 1>>
							<<if $quest('therapist').hypnoTime < 7>>
							<<set $quest('therapist').hypnoAddict = 0>> <<set $quest('therapist').hypnoWithdrawal = 0>>

						<</if>>
						<</if>>
					<<else>>
						<<if rand(0,4) == 0>>
							<<set $quest('therapist').hypnoStrength = 19>>
							<<set $quest('therapist').hypnoTime -= 1>>
							<<if $quest('therapist').hypnoTime < 10>>
							<<set $quest('therapist').hypnoAddict = 1>> <<set $quest('therapist').hypnoWithdrawal = 1>>

						<</if>>
						<</if>>
					<</if>>
				<</if>>
		<</switch>>
<</switch>>
