# gschool_groups
!2021/05/02
! 14/09/22 - edited link to work with new hournal. 

gs 'themes', 'food_menu'

!npc_grupTipe[i] - social group
!1 - popular
!2 - jocks
!3 - nerds
!4 - Gopnik
!5 - outcasts
!6 - teachers

!1-5 use $npcGoSchool
!6 use $npcGo

if $ARGS[0] = 'teachers':
	killvar '$teach_text'
	killvar 'teach_count'
	i = 1
	'<center><table cellspacing="3">'
	:teach_loop
		if teach_count = 6 : $teach_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 6 and schoolenable['A<<i>>'] = 1:
			teach_count += 1
			$teach_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''teachers''', 'exec:numnpc = <<i>> & gt ''Snpc''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if teach_count< 6 and npc_grupTipe['A<<i>>'] = 6:
			$teach_text += '</td>'
		elseif teach_count = 6 and npc_grupTipe['A<<i>>'] = 6:
			$teach_text +='</td></tr><tr>' & teach_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'teach_loop'

	'<<$teach_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'nerds':
	killvar '$nerd_text'
	killvar 'nerd_count'
	i = 1
	'<center><table cellspacing="3">'
	:nerd_loop
		if nerd_count = 6 : $nerd_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 3 and schoolenable['A<<i>>'] = 1:
			nerd_count += 1
			$nerd_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''nerds''', 'exec:gt ''gschool_nerd_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if nerd_count< 6 and npc_grupTipe['A<<i>>'] = 3:
			$nerd_text += '</td>'
		elseif nerd_count = 6 and npc_grupTipe['A<<i>>'] = 3:
			$nerd_text +='</td></tr><tr>' & nerd_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'nerd_loop'

	'<<$nerd_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'jocks':
	killvar '$jock_text'
	killvar 'jock_count'
	i = 1
	'<center><table cellspacing="3">'
	:jock_loop
		if jock_count = 6 : $jock_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 2 and schoolenable['A<<i>>'] = 1:
			jock_count += 1
			$jock_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''jocks''', 'exec:gt ''gschool_jock_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if jock_count< 6 and npc_grupTipe['A<<i>>'] = 2:
			$jock_text += '</td>'
		elseif jock_count = 6 and npc_grupTipe['A<<i>>'] = 2:
			$jock_text +='</td></tr><tr>' & jock_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'jock_loop'

	'<<$jock_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'popular':
	killvar '$pop_text'
	killvar 'pop_count'
	i = 1
	'<center><table cellspacing="3">'
	:pop_loop
		if pop_count = 6 : $pop_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 1 and schoolenable['A<<i>>'] = 1:
			pop_count += 1
			$pop_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''popular''', 'exec:gt ''gschool_coolkid_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if pop_count< 6 and npc_grupTipe['A<<i>>'] = 1:
			$pop_text += '</td>'
		elseif pop_count = 6 and npc_grupTipe['A<<i>>'] = 1:
			$pop_text +='</td></tr><tr>' & pop_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'pop_loop'

	'<<$pop_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'gopniks':
	killvar '$gop_text'
	killvar 'gop_count'
	i = 1
	'<center><table cellspacing="3">'
	:gop_loop
		if gop_count = 6 : $gop_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 4 and schoolenable['A<<i>>'] = 1:
			gop_count += 1
			$gop_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''gopniks''', 'exec:gt ''gschool_gopnik_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if gop_count< 6 and npc_grupTipe['A<<i>>'] = 4:
			$gop_text += '</td>'
		elseif gop_count = 6 and npc_grupTipe['A<<i>>'] = 4:
			$gop_text +='</td></tr><tr>' & gop_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'gop_loop'

	'<<$gop_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'outcasts':
	killvar '$oc_text'
	killvar 'oc_count'
	i = 1
	'<center><table cellspacing="3">'
	:oc_loop
		if oc_count = 6 : $oc_text += '<tr>'

		if npc_grupTipe['A<<i>>'] = 5 and schoolenable['A<<i>>'] = 1:
			oc_count += 1
			$oc_text += '' + '<td><table bgcolor=<<$bcolor2>>><tr><td align="center"><a href="' + iif($ARGS[1] = 'journal', 'exec:gt ''journal_school'',''outcasts''', 'exec:gt ''gschool_outcast_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''') + '"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"></a></td></tr><tr><td align="center"><<$npc_usedname[''A<<i>>'']>></td></tr></table>'
		end
		if oc_count< 6 and npc_grupTipe['A<<i>>'] = 5:
			$oc_text += '</td>'
		elseif oc_count = 6 and npc_grupTipe['A<<i>>'] = 5:
			$oc_text +='</td></tr><tr>' & oc_count = 0
		end
		i += 1
	if i <= aarraynumber:jump 'oc_loop'

	'<<$oc_text>>'
	'</table></center>'
	killvar 'i'
end

if $ARGS[0] = 'fuckornot':
	killvar '$fu_text'
	killvar '$fu_count'
	j = 11
	'<center><table cellspacing="3">'
	:fu_loop_2
		j -= 1
		i = 1
		:fu_loop
			if fu_count = 6 : $fu_text += '<tr>'
			
			if hotcat = j and hotcat_rating_set = 0:
				fu_count += 1
				hotcat_rating_set = 1
				if player_avatar = 1:
					$fu_text += '' + '<td bgcolor=<<$bcolor2>> align="center"><img  height="100" src="images/avatar.jpg"><br>' + '<<$pcs_nickname>>, <<hotcat>>/10'
				else
					$fu_text += '' + '<td bgcolor=<<$bcolor2>> align="center"><img  height="100" src="<<FUNC(''$face_image'')>>"><br>' + '<<$pcs_nickname>>, <<hotcat>>/10'
				end
			elseif hotcat ! j or hotcat_rating_set = 1:
				if hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 1:
					fu_count += 1
					$fu_text += '' + '<td bgcolor=<<$bcolor2>> align="center"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"><br>' + '<<$npc_usedname[''A<<i>>'']>>, <<hotcat_rating[''A<<i>>'']>>/10'
				end
			end
			if fu_count < 6 and hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 1:
				$fu_text += '</td>'
			elseif fu_count = 6 and hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 1:
				$fu_text +='</td></tr><tr>' & fu_count = 0
			end
			if hotcat ! j or hotcat_rating_set = 1: i += 1
		if i <= aarraynumber:jump 'fu_loop'
	if j > 1: jump 'fu_loop_2'

	'<<$fu_text>>'
	'</table></center>'
	killvar 'hotcat_rating_set'
	killvar 'i'
	killvar 'j'
end

if $ARGS[0] = 'hotornot':
	killvar '$ho_text'
	killvar '$ho_count'
	j = 11
	'<center><table cellspacing="3">'
	:ho_loop_2
		j -= 1
		i = 1
		:ho_loop
			if ho_count = 6 : $ho_text += '<tr>'
			
			if hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 0:
				ho_count += 1
				$ho_text += '' + '<td bgcolor=<<$bcolor2>> align="center"><img  height="100" src="images/characters/shared/headshots_main/<<i>>.jpg"><br>' + '<<$npc_usedname[''A<<i>>'']>>, <<hotcat_rating[''A<<i>>'']>>/10'
			end
			if ho_count < 6 and hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 0:
				$ho_text += '</td>'
			elseif ho_count = 6 and hotcat_rating['A<<i>>'] = j and npc_grupTipe['A<<i>>'] > 0 and npc_grupTipe['A<<i>>'] < 6 and npc_gender['A<<i>>'] = 0:
				$ho_text +='</td></tr><tr>' & ho_count = 0
			end
			i += 1
		if i <= aarraynumber:jump 'ho_loop'
	if j > 1: jump 'ho_loop_2'

	'<<$ho_text>>'
	'</table></center>'
	killvar 'i'
	killvar 'j'
end

--- gschool_groups ---------------------------------

