#include <define.h>

//#define NAME                    SCRIPT_

#include <command.h>
//#include <ModReact.h>



procedure start;
#include <push.h>
procedure do_dialogue;
procedure weapon_check;
procedure set_requisition;
procedure Talus00;
procedure Talus01;
procedure Talus02;
procedure Talus05;
procedure Talus06;
procedure Talus07;
procedure Talus08;
procedure Talus09;
procedure Talus10;
procedure Talus11;
procedure Talus12;
procedure Talus13;
procedure Talus14;
procedure Talus14a;
procedure Talus15;
procedure Talus16;
procedure Talus17;
procedure Talus18;
procedure Talus19;
procedure Talus20;
procedure Talus21;
procedure Talus22;
procedure Talus23;
procedure Talus24;
procedure Talus25;
procedure Talus26;
procedure Talus27;
procedure Talus28;
procedure Talus29;
procedure Talus30;
procedure Talus31;
procedure Talus31a;
procedure Talus32;
procedure Talus33;
procedure Talus34;
procedure Talus35;
procedure Talus37;
procedure Talus38;
procedure Talus39;
procedure Talus40;
procedure Talus41;
procedure Talus42;
procedure Talus43;
procedure Talus44;
procedure Talus45;
procedure Talus46;
procedure Talus47;
procedure Talus49;
procedure Talus50;
procedure Talus51;
procedure Talus51a;
procedure Talus51b;
procedure Talus51c;
procedure Talus51d;
procedure Talus53;
procedure Talus54;
procedure Talus55;
procedure TalusBackground;
procedure TalusAmmo;
procedure TalusEnd;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;

variable armed;
variable temp;
variable flag1;
variable flag5;
variable who_vree;
variable who_rhombus;
variable who_maxson;
variable line16flag;
variable Only_Once := 1;
variable Hostile;
variable drugs;
variable awardex;

procedure Get_Reaction;
procedure React_To_Level;
procedure Level_To_React;
procedure Up_React;
procedure Down_React;
procedure Bottom_React;
procedure Top_React;
procedure Big_Up_React;
procedure Big_Down_React;
procedure Up_React_Level;
procedure Down_React_Level;
procedure Goodbyes;

variable exit_line;

procedure Talus36;


procedure start
begin
	if (Only_Once) then begin
		Only_Once := 0;
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 44);
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_BROTHERHOOD_PALADIN);
		add_timer_event(self_obj, game_ticks(30), 2);
	end
	if (script_action == look_at_proc) then begin
		call look_at_p_proc;
	end
	else begin
		if (script_action == pickup_proc) then begin
			call pickup_p_proc;
		end
		else begin
			if (script_action == talk_proc) then begin
				call talk_p_proc;
			end
			else begin
				if (script_action == timed_event_proc) then begin
					if (global_var(GVAR_ENEMY_BROTHERHOOD) == 0) then begin
						call TalusBackground;
					end
				end
				else begin
					if (script_action == critter_proc) then begin
						call critter_p_proc;
					end
					else begin
						if (script_action == destroy_proc) then begin
							call destroy_p_proc;
						end
					end
				end
			end
		end
	end
end

procedure do_dialogue
begin
	call weapon_check;
	if (armed) then begin
		if (local_var(6) == 0) then begin
			call Talus11;
		end
		else begin
			if (local_var(6) == 1) then begin
				call Talus12;
			end
			else begin
				call Talus13;
			end
		end
	end
	else begin
		if ((global_var(GVAR_FIND_LOST_INITIATE) == 2) and (local_var(8) == 0)) then begin
			if (local_var(7) == 0) then begin
				call Talus49;
			end
			else begin
				call Talus47;
			end
		end
		else begin
			if (local_var(7) == 0) then begin
				call Talus00;
			end
			else begin
				if (local_var(1) == 1) then begin
					call Talus22;
				end
				else begin
					call Talus14;
				end
			end
		end
	end
	set_local_var(7, 1);
end

procedure weapon_check
begin
	if ((obj_item_subtype(critter_inven_obj(dude_obj, 1)) == 3) or (obj_item_subtype(critter_inven_obj(dude_obj, 2)) == 3)) then begin
		armed := 1;
	end
	else begin
		armed := 0;
	end
end

procedure set_requisition
begin
	set_local_var(5, 1);
	set_map_var(17, 1);
	set_map_var(9, 4);
	set_map_var(14, 1);
	set_map_var(10, 3);
end

procedure Talus00
begin
	gsay_reply(SCRIPT_TALUS, 101);
	giq_option(8, SCRIPT_TALUS, 102, Talus01, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 103, Talus02, NEUTRAL_REACTION);
	if (local_var(5) == 0) then begin
		giq_option(4, SCRIPT_TALUS, 104, Talus07, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 401, Talus28, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 402, Talus28, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_TALUS, 105, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus01
begin
	gsay_reply(SCRIPT_TALUS, 106);
	giq_option(4, SCRIPT_TALUS, 107, Talus05, NEUTRAL_REACTION);
	call Goodbyes;
	giq_option(4, 0, exit_line, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus02
begin
	gsay_reply(SCRIPT_TALUS, 108);
	giq_option(4, SCRIPT_TALUS, 107, Talus05, NEUTRAL_REACTION);
	call Goodbyes;
	giq_option(4, 0, exit_line, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus05
begin
	gsay_reply(SCRIPT_TALUS, 110);
	giq_option(7, SCRIPT_TALUS, 111, Talus06, NEUTRAL_REACTION);
	if (local_var(5) == 0) then begin
		giq_option(4, SCRIPT_TALUS, 112, Talus07, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 401, Talus28, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 402, Talus28, NEUTRAL_REACTION);
	call Goodbyes;
	giq_option(4, 0, exit_line, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus06
begin
	gsay_reply(SCRIPT_TALUS, 113);
	giq_option(4, SCRIPT_TALUS, 115, TalusEnd, NEUTRAL_REACTION);
	if (local_var(5) == 0) then begin
		giq_option(4, SCRIPT_TALUS, 112, Talus07, NEUTRAL_REACTION);
	end
end

procedure Talus07
begin
	gsay_reply(SCRIPT_TALUS, 116);
	call set_requisition;
	giq_option(4, SCRIPT_TALUS, 118, Talus08, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 119, Talus42, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 159, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus08
begin
	gsay_reply(SCRIPT_TALUS, 406);
	if (global_var(GVAR_FIND_LOST_INITIATE) != 2) then begin
		giq_option(4, SCRIPT_TALUS, 109, Talus32, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 121, Talus09, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 193, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus09
begin
	set_local_var(11, 1);
	call Down_React;
	gsay_message(SCRIPT_TALUS, 122, BAD_REACTION);
end

procedure Talus10
begin
	gsay_message(SCRIPT_TALUS, 123, NEUTRAL_REACTION);
	gsay_message(SCRIPT_TALUS, 124, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_TALUS, 125);
	giq_option(4, SCRIPT_TALUS, 126, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus11
begin
	gsay_message(SCRIPT_TALUS, 127, NEUTRAL_REACTION);
	set_local_var(6, local_var(6) + 1);
end

procedure Talus12
begin
	gsay_message(SCRIPT_TALUS, 128, NEUTRAL_REACTION);
	set_local_var(6, local_var(6) + 1);
end

procedure Talus13
begin
	gsay_message(SCRIPT_TALUS, 129, BAD_REACTION);
end

procedure Talus14
begin
	gsay_reply(SCRIPT_TALUS, message_str(SCRIPT_TALUS, 130) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_TALUS, 131));
	if (not(line16flag)) then begin
		giq_option(5, SCRIPT_TALUS, 132, Talus16, NEUTRAL_REACTION);
	end
	else begin
		giq_option(5, SCRIPT_TALUS, 133, Talus17, NEUTRAL_REACTION);
	end
	if (local_var(5) == 0) then begin
		giq_option(4, SCRIPT_TALUS, 134, Talus15, NEUTRAL_REACTION);
	end
	else begin
		giq_option(4, SCRIPT_TALUS, 135, TalusAmmo, NEUTRAL_REACTION);
	end
	if (local_var(11) == 1) then begin
		giq_option(4, SCRIPT_TALUS, 403, Talus44, BAD_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 404, Talus29, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 136, TalusEnd, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_TALUS, 105, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus14a
begin
	call Talus34;
end

procedure Talus15
begin
	gsay_message(SCRIPT_TALUS, 137, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_TALUS, 138);
	call set_requisition;
	giq_option(4, SCRIPT_TALUS, 118, Talus08, NEUTRAL_REACTION);
end

procedure Talus16
begin
	line16flag := 1;
	gsay_message(SCRIPT_TALUS, 141, NEUTRAL_REACTION);
	call Talus18;
end

procedure Talus17
begin
	gsay_message(SCRIPT_TALUS, 142, NEUTRAL_REACTION);
	call Talus18;
end

procedure Talus18
begin
	gsay_reply(SCRIPT_TALUS, 143);
	giq_option(4, SCRIPT_TALUS, 144, Talus19, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 145, Talus20, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 146, Talus21, NEUTRAL_REACTION);
end

procedure Talus19
begin
	who_rhombus := 1;
	gsay_message(SCRIPT_TALUS, 147, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_TALUS, 148);
	if (who_vree == 0) then begin
		giq_option(4, SCRIPT_TALUS, 145, Talus20, NEUTRAL_REACTION);
	end
	if (who_maxson == 0) then begin
		giq_option(4, SCRIPT_TALUS, 146, Talus21, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 151, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus20
begin
	who_vree := 1;
	gsay_message(SCRIPT_TALUS, 152, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_TALUS, 153);
	if (who_rhombus == 0) then begin
		giq_option(4, SCRIPT_TALUS, 144, Talus19, NEUTRAL_REACTION);
	end
	if (who_maxson == 0) then begin
		giq_option(4, SCRIPT_TALUS, 146, Talus21, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 156, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus21
begin
	who_maxson := 1;
	gsay_reply(SCRIPT_TALUS, 157);
	if (who_rhombus == 0) then begin
		giq_option(4, SCRIPT_TALUS, 144, Talus19, NEUTRAL_REACTION);
	end
	if (who_vree == 0) then begin
		giq_option(4, SCRIPT_TALUS, 145, Talus20, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 160, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus22
begin
	gsay_reply(SCRIPT_TALUS, 161);
	giq_option(4, SCRIPT_TALUS, 162, Down_React, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 163, TalusEnd, NEUTRAL_REACTION);
	if (local_var(5) == 1) then begin
		giq_option(4, SCRIPT_TALUS, 135, TalusAmmo, NEUTRAL_REACTION);
	end
	giq_option(-3, SCRIPT_TALUS, 164, Talus24, BAD_REACTION);
	giq_option(-3, SCRIPT_TALUS, 165, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus23
begin
	gsay_message(SCRIPT_TALUS, 166, BAD_REACTION);
	call Down_React;
end

procedure Talus24
begin
	gsay_message(SCRIPT_TALUS, 167, BAD_REACTION);
	call Down_React;
end

procedure Talus25
begin
	gsay_message(SCRIPT_TALUS, 168, NEUTRAL_REACTION);
	set_map_var(17, 1);
	temp := map_var(9) + 3;
	set_map_var(9, temp);
	temp := map_var(10) + 3;
	set_map_var(10, temp);
end

procedure Talus26
begin
	gsay_message(SCRIPT_TALUS, 169, NEUTRAL_REACTION);
end

procedure Talus27
begin
	gsay_message(SCRIPT_TALUS, 170, NEUTRAL_REACTION);
end

procedure Talus28
begin
	gsay_reply(SCRIPT_TALUS, 149);
	giq_option(4, SCRIPT_TALUS, 102, Talus02, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 103, Talus07, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 150, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus29
begin
	if (local_var(10) == 0) then begin
		set_local_var(10, 1);
		gsay_message(SCRIPT_TALUS, 154, NEUTRAL_REACTION);
	end
	else begin
		gsay_message(SCRIPT_TALUS, 155, NEUTRAL_REACTION);
	end
end

procedure Talus30
begin
	call Bottom_React;
	gsay_reply(SCRIPT_TALUS, 171);
	giq_option(4, SCRIPT_TALUS, 172, Talus37, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 173, Talus38, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 174, TalusEnd, BAD_REACTION);
end

procedure Talus31
begin
	gsay_reply(SCRIPT_TALUS, 175);
	giq_option(4, SCRIPT_TALUS, 176, Talus35, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 177, Big_Down_React, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 178, Talus31a, NEUTRAL_REACTION);
end

procedure Talus31a
begin
	if (local_var(9) == 0) then begin
		call Talus39;
	end
	else begin
		call TalusEnd;
	end
end

procedure Talus32
begin
	gsay_reply(SCRIPT_TALUS, 158);
	giq_option(4, SCRIPT_TALUS, 176, Talus35, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 177, Big_Down_React, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 178, Talus31a, GOOD_REACTION);
end

procedure Talus33
begin
	gsay_reply(SCRIPT_TALUS, 179);
	giq_option(4, SCRIPT_TALUS, 176, Talus35, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 177, Big_Down_React, BAD_REACTION);
	giq_option(4, SCRIPT_TALUS, 178, Talus31a, GOOD_REACTION);
end

procedure Talus34
begin
	gsay_message(SCRIPT_TALUS, 180, BAD_REACTION);
end

procedure Talus35
begin
	set_global_var(GVAR_FIND_LOST_INITIATE, 1);
	gsay_reply(SCRIPT_TALUS, 181);
	giq_option(4, SCRIPT_TALUS, 182, Talus31a, GOOD_REACTION);
	giq_option(4, SCRIPT_TALUS, 183, Talus46, NEUTRAL_REACTION);
end

procedure Talus37
begin
	gsay_message(SCRIPT_TALUS, 185, BAD_REACTION);
end

procedure Talus38
begin
	gsay_message(SCRIPT_TALUS, 186, BAD_REACTION);
end

procedure Talus39
begin
	gsay_message(SCRIPT_TALUS, 187, GOOD_REACTION);
end

procedure Talus40
begin
	gsay_reply(SCRIPT_TALUS, 191);
	giq_option(4, SCRIPT_TALUS, 193, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus41
begin
	gsay_message(SCRIPT_TALUS, 194, NEUTRAL_REACTION);
end

procedure Talus42
begin
	call Down_React;
	gsay_message(SCRIPT_TALUS, 195, BAD_REACTION);
end

procedure Talus43
begin
	gsay_reply(SCRIPT_TALUS, 196);
	giq_option(4, SCRIPT_TALUS, 192, Talus41, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 193, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus44
begin
	call Down_React;
	gsay_message(SCRIPT_TALUS, 198, BAD_REACTION);
end

procedure Talus45
begin
	call Big_Down_React;
	gsay_message(SCRIPT_TALUS, 199, BAD_REACTION);
end

procedure Talus46
begin
	gsay_message(SCRIPT_TALUS, 200, NEUTRAL_REACTION);
end

procedure Talus47
begin
	gsay_reply(SCRIPT_TALUS, message_str(SCRIPT_TALUS, 201) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_TALUS, 202));
	giq_option(4, SCRIPT_TALUS, 205, Talus51, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_TALUS, 206, Talus50, NEUTRAL_REACTION);
end

procedure Talus49
begin
	gsay_reply(SCRIPT_TALUS, 207);
	giq_option(4, SCRIPT_TALUS, 205, Talus51, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_TALUS, 206, Talus50, NEUTRAL_REACTION);
end

procedure Talus50
begin
	gsay_message(SCRIPT_TALUS, 209, NEUTRAL_REACTION);
end

procedure Talus51
begin
	gsay_reply(SCRIPT_TALUS, 210);
	giq_option(4, SCRIPT_TALUS, 212, Talus51a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 213, Talus51b, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TALUS, 214, Talus51c, NEUTRAL_REACTION);
	if (global_var(GVAR_PLAYER_REPUTATION) > 15) then begin
		giq_option(4, SCRIPT_TALUS, 407, Talus51d, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_TALUS, 215, TalusEnd, NEUTRAL_REACTION);
end

procedure Talus51a
begin
	set_map_var(9, map_var(9) + 1);
	set_map_var(12, 1);
	call Talus53;
end

procedure Talus51b
begin
	set_map_var(9, map_var(9) + 1);
	set_map_var(13, 1);
	call Talus53;
end

procedure Talus51c
begin
	set_map_var(9, map_var(9) + 1);
	set_map_var(20, 1);
	call Talus53;
end

procedure Talus51d
begin
	set_map_var(9, map_var(9) + 1);
	set_map_var(15, 1);
	call Talus53;
end

procedure Talus53
begin
	set_local_var(8, 1);
	awardex := 1;
	gsay_message(SCRIPT_TALUS, 216, NEUTRAL_REACTION);
end

procedure Talus54
begin
	set_local_var(9, 1);
	set_map_var(9, map_var(9) + 1);
	set_map_var(15, 1);
	gsay_message(SCRIPT_TALUS, message_str(SCRIPT_TALUS, 201) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_TALUS, 217), NEUTRAL_REACTION);
end

procedure Talus55
begin
	set_local_var(9, 1);
	gsay_message(SCRIPT_TALUS, 218, NEUTRAL_REACTION);
end

procedure TalusBackground
begin
	variable LVar0 := 0;
	LVar0 := random(1, 5);
	if (LVar0 == 1) then begin
		LVar0 := message_str(SCRIPT_TALUS, 219);
	end
	else begin
		if (LVar0 == 2) then begin
			LVar0 := message_str(SCRIPT_TALUS, 220);
		end
		else begin
			if (LVar0 == 3) then begin
				LVar0 := message_str(SCRIPT_TALUS, 221);
			end
			else begin
				if (LVar0 == 4) then begin
					LVar0 := message_str(SCRIPT_TALUS, 222);
				end
				else begin
					if (LVar0 == 5) then begin
						LVar0 := message_str(SCRIPT_TALUS, 223);
					end
				end
			end
		end
	end
	float_msg(self_obj, LVar0, FLOAT_MSG_NORMAL);
	add_timer_event(self_obj, game_ticks(180), 2);
end

procedure TalusAmmo
begin
	if (map_var(17) > 0) then begin
		call Talus27;
	end
	else begin
		call Talus25;
	end
end

procedure TalusEnd
begin
end

procedure critter_p_proc
begin
	if (global_var(GVAR_ENEMY_BROTHERHOOD)) then begin
		Hostile := 1;
	end
	if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
		Hostile := 0;
	end
	if (Hostile) then begin
		set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
		Hostile := 0;
		attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
	end
end

procedure pickup_p_proc
begin
	if (source_obj == dude_obj) then begin
		Hostile := 1;
	end
end

procedure talk_p_proc
begin
	call Get_Reaction;
	if (local_var(7) == 0) then begin
		if (local_var(1) == 1) then begin
			set_local_var(1, 2);
			call Level_To_React;
		end
	end
	start_gdialog(SCRIPT_TALUS, self_obj, 4, -1, -1);
	gsay_start;
	call do_dialogue;
	gsay_end;
	end_dialogue;
	if (awardex) then begin
		awardex := 0;
		temp := 1500;
		display_msg(message_str(SCRIPT_TALUS, 408) + temp + message_str(SCRIPT_TALUS, 409));
		set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) + 1);
		give_exp_points(temp);
	end
end

procedure destroy_p_proc
begin
	set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
	rm_timer_event(self_obj);
	if (source_obj == dude_obj) then begin
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
			set_global_var(GVAR_BERSERKER_REPUTATION, 1);
			set_global_var(GVAR_CHAMPION_REPUTATION, 0);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
			set_global_var(GVAR_CHAMPION_REPUTATION, 1);
			set_global_var(GVAR_BERSERKER_REPUTATION, 0);
		end
		set_global_var(GVAR_GOOD_MONSTER, global_var(GVAR_GOOD_MONSTER) + 1);
		if ((global_var(GVAR_GOOD_MONSTER) % 2) == 0) then begin
			set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 1);
		end
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_TALUS, 100));
end

procedure Get_Reaction
begin
	if (local_var(2) == 0) then begin
		set_local_var(0, 50);
		set_local_var(1, 2);
		set_local_var(2, 1);
		set_local_var(0, local_var(0) + (5 * get_critter_stat(dude_obj, 3)) - 25);
		set_local_var(0, local_var(0) + (10 * has_trait(0, dude_obj, 10)));
		if (has_trait(0, dude_obj, 39)) then begin
			if (global_var(GVAR_PLAYER_REPUTATION) > 0) then begin
				set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
			end
			else begin
				set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
			end
		end
		else begin
			if (local_var(3) == 1) then begin
				set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
			end
			else begin
				set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
			end
		end
		if (global_var(GVAR_CHILDKILLER_REPUTATION) > 2) then begin
			set_local_var(0, local_var(0) - 30);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
			set_local_var(0, local_var(0) + 20);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
			set_local_var(0, local_var(0) - 20);
		end
		call React_To_Level;
	end
end

procedure React_To_Level
begin
	if (local_var(0) <= 25) then begin
		set_local_var(1, 1);
	end
	else begin
		if (local_var(0) <= 75) then begin
			set_local_var(1, 2);
		end
		else begin
			set_local_var(1, 3);
		end
	end
end

procedure Level_To_React
begin
	if (local_var(1) == 1) then begin
		set_local_var(0, random(1, 25));
	end
	else begin
		if (local_var(1) == 2) then begin
			set_local_var(0, random(26, 75));
		end
		else begin
			set_local_var(0, random(76, 100));
		end
	end
end

procedure Up_React
begin
	set_local_var(0, local_var(0) + 10);
	call React_To_Level;
end

procedure Down_React
begin
	set_local_var(0, local_var(0) - 10);
	call React_To_Level;
end

procedure Bottom_React
begin
	set_local_var(1, 1);
	set_local_var(0, 1);
end

procedure Top_React
begin
	set_local_var(0, 100);
	set_local_var(1, 3);
end

procedure Big_Up_React
begin
	set_local_var(0, local_var(0) + 25);
	call React_To_Level;
end

procedure Big_Down_React
begin
	set_local_var(0, local_var(0) - 25);
	call React_To_Level;
end

procedure Up_React_Level
begin
	set_local_var(1, local_var(1) + 1);
	if (local_var(1) > 3) then begin
		set_local_var(1, 3);
	end
	call Level_To_React;
end

procedure Down_React_Level
begin
	set_local_var(1, local_var(1) - 1);
	if (local_var(1) < 1) then begin
		set_local_var(1, 1);
	end
	call Level_To_React;
end

procedure Goodbyes
begin
	exit_line := message_str(SCRIPT_MODREACT, random(100, 105));
end

procedure Talus36
begin
	gsay_message(SCRIPT_TALUS, 184, BAD_REACTION);
end