#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure do_dialogue;
procedure social_skills;
procedure weapon_check;
procedure Barracus00;
procedure Barracus01;
procedure Barracus02;
procedure Barracus03;
procedure Barracus04;
procedure Barracus05;
procedure Barracus05a;
procedure Barracus06;
procedure Barracus07;
procedure Barracus08;
procedure Barracus09;
procedure Barracus10;
procedure Barracus11;
procedure Barracus12;
procedure Barracus13;
procedure Barracus14;
procedure Barracus14a;
procedure Barracus15;
procedure Barracus16;
procedure Barracus17;
procedure Barracus18;
procedure Barracus19;
procedure Barracus20;
procedure Barracus21;
procedure Barracus22;
procedure Barracus23;
procedure Barracus24;
procedure Barracus25;
procedure Barracus26;
procedure Barracus26a;
procedure Barracus27;
procedure Barracus28;
procedure Barracus29;
procedure Barracus30;
procedure Barracus31;
procedure Barracus32;
procedure Barracus33;
procedure Barracus34;
procedure Barracus35;
procedure Barracus35a;
procedure Barracus36;
procedure Barracus37;
procedure Barracus38;
procedure Barracus38a;
procedure Barracus39;
procedure Barracus40;
procedure Barracus41;
procedure Barracus42;
procedure Barracus43;
procedure Barracus44;
procedure Barracus45;
procedure Barracus46;
procedure Barracus47;
procedure Barracus48;
procedure Barracus49;
procedure Barracus50;
procedure Barracus51;
procedure Barracus52;
procedure Barracus53;
procedure Barracus54;
procedure Barracus55;
procedure BarracusCombat;
procedure BarracusEnd;

variable hostile1;
variable armed;
variable Only_Once := 1;

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 start
begin
	if (Only_Once) then begin
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 20);
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_CHILDREN_TRUE);
		Only_Once := 0;
	end
	if (script_action == talk_proc) then begin
		call do_dialogue;
	end
	else begin
		if ((script_action == look_at_proc) or (script_action == description_proc)) then begin
			script_overrides;
			if (local_var(4) == 1) then begin
				display_msg(message_str(SCRIPT_BARRACUS, 100));
			end
			else begin
				display_msg(message_str(SCRIPT_BARRACUS, 101));
			end
		end
		else begin
			if (script_action == destroy_proc) then begin
				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_BAD_MONSTER, global_var(GVAR_BAD_MONSTER) + 1);
					if ((global_var(GVAR_BAD_MONSTER) % 6) == 0) then begin
						set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) + 1);
					end
				end
			end
			else begin
				if (script_action == pickup_proc) then begin
					hostile1 := 1;
				end
				else begin
					if (script_action == critter_proc) then begin
						if (hostile1) then begin
							hostile1 := 0;
							attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
						end
					end
				end
			end
		end
	end
end

procedure do_dialogue
begin
	call weapon_check;
	call Get_Reaction;
	start_gdialog(SCRIPT_BARRACUS, self_obj, 4, -1, -1);
	gsay_start;
	if (armed) then begin
		call Barracus04;
	end
	else begin
		if (local_var(4) == 1) then begin
			call Barracus03;
		end
		else begin
			if (dude_is_male) then begin
				call Barracus06;
			end
			else begin
				if (get_critter_stat(dude_obj, 3) > 6) then begin
					call Barracus07;
				end
				else begin
					call Barracus06;
				end
			end
		end
	end
	gsay_end;
	end_dialogue;
	set_local_var(4, 1);
end

procedure social_skills
begin
	call Get_Reaction;
	dialogue_system_enter;
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 Barracus00
begin
	variable LVar0 := 0;
	if (dude_is_male) then begin
		gsay_reply(SCRIPT_BARRACUS, message_str(SCRIPT_BARRACUS, 106));
	end
	else begin
		gsay_reply(SCRIPT_BARRACUS, message_str(SCRIPT_BARRACUS, 107));
	end
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusCombat, NEUTRAL_REACTION);
end

procedure Barracus01
begin
	gsay_reply(SCRIPT_BARRACUS, 108);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus02
begin
	gsay_reply(SCRIPT_BARRACUS, 109);
	giq_option(7, SCRIPT_BARRACUS, 110, Barracus08, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 111, Barracus09, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 112, Barracus10, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 113, Barracus11, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 114, Barracus12, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 115, BarracusCombat, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_BARRACUS, 116, Barracus13, NEUTRAL_REACTION);
end

procedure Barracus03
begin
	gsay_reply(SCRIPT_BARRACUS, 117);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus04
begin
	variable LVar0 := 0;
	if (dude_is_male) then begin
		gsay_reply(SCRIPT_BARRACUS, message_str(SCRIPT_BARRACUS, 120));
	end
	else begin
		gsay_reply(SCRIPT_BARRACUS, message_str(SCRIPT_BARRACUS, 121));
	end
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus05
begin
	gsay_reply(SCRIPT_BARRACUS, 122);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 124, Barracus16, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 125, Barracus17, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 126, Barracus18, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 127, Barracus19, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_BARRACUS, 116, Barracus20, NEUTRAL_REACTION);
end

procedure Barracus05a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Barracus14;
	end
	else begin
		call Barracus15;
	end
end

procedure Barracus06
begin
	gsay_reply(SCRIPT_BARRACUS, 128);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 129, Barracus20, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 130, Barracus21, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 131, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 132, Barracus23, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 133, Barracus24, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_BARRACUS, 116, Barracus13, NEUTRAL_REACTION);
end

procedure Barracus07
begin
	gsay_reply(SCRIPT_BARRACUS, 134);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 135, Barracus25, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 136, Barracus26, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 131, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 137, Barracus27, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_BARRACUS, 116, Barracus13, NEUTRAL_REACTION);
end

procedure Barracus08
begin
	gsay_reply(SCRIPT_BARRACUS, 138);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus09
begin
	gsay_reply(SCRIPT_BARRACUS, 139);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus10
begin
	gsay_reply(SCRIPT_BARRACUS, 140);
	giq_option(4, SCRIPT_BARRACUS, 141, Barracus28, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 142, Barracus29, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 143, Barracus30, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 144, BarracusCombat, NEUTRAL_REACTION);
end

procedure Barracus11
begin
	gsay_reply(SCRIPT_BARRACUS, 145);
	giq_option(7, SCRIPT_BARRACUS, 146, Barracus10, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 147, Barracus31, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 148, Barracus30, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 149, BarracusCombat, NEUTRAL_REACTION);
end

procedure Barracus12
begin
	gsay_reply(SCRIPT_BARRACUS, 150);
	giq_option(7, SCRIPT_BARRACUS, 146, Barracus10, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 151, Barracus31, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 148, Barracus30, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 149, BarracusCombat, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 152, BarracusCombat, NEUTRAL_REACTION);
end

procedure Barracus13
begin
	gsay_reply(SCRIPT_BARRACUS, 153);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus14
begin
	gsay_reply(SCRIPT_BARRACUS, 154);
	giq_option(7, SCRIPT_BARRACUS, 155, Barracus14a, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 156, Barracus33, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 157, Barracus46, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 158, Barracus47, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 159, Barracus21, NEUTRAL_REACTION);
end

procedure Barracus14a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Barracus32;
	end
	else begin
		call Barracus15;
	end
end

procedure Barracus15
begin
	gsay_reply(SCRIPT_BARRACUS, 160);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus16
begin
	gsay_reply(SCRIPT_BARRACUS, 161);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus17
begin
	gsay_reply(SCRIPT_BARRACUS, 162);
	giq_option(7, SCRIPT_BARRACUS, 163, Barracus05a, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 164, Barracus34, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 165, Barracus30, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 166, Barracus35, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 167, Barracus10, NEUTRAL_REACTION);
end

procedure Barracus18
begin
	gsay_reply(SCRIPT_BARRACUS, 168);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus19
begin
	gsay_reply(SCRIPT_BARRACUS, 169);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus20
begin
	gsay_reply(SCRIPT_BARRACUS, 170);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 171, Barracus36, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 131, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 172, Barracus37, NEUTRAL_REACTION);
end

procedure Barracus21
begin
	gsay_reply(SCRIPT_BARRACUS, 173);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus22
begin
	gsay_reply(SCRIPT_BARRACUS, 174);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus23
begin
	gsay_reply(SCRIPT_BARRACUS, 175);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus24
begin
	gsay_reply(SCRIPT_BARRACUS, 176);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 171, Barracus36, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 131, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 172, Barracus37, NEUTRAL_REACTION);
end

procedure Barracus25
begin
	gsay_reply(SCRIPT_BARRACUS, 177);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus26
begin
	gsay_reply(SCRIPT_BARRACUS, 178);
	giq_option(7, SCRIPT_BARRACUS, 179, Barracus26a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 180, Barracus25, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 181, Barracus26, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 182, Barracus39, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 183, BarracusCombat, NEUTRAL_REACTION);
end

procedure Barracus26a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Barracus38;
	end
	else begin
		call Barracus25;
	end
end

procedure Barracus27
begin
	gsay_reply(SCRIPT_BARRACUS, 184);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus28
begin
	gsay_reply(SCRIPT_BARRACUS, 185);
	giq_option(7, SCRIPT_BARRACUS, 186, Barracus40, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 187, Barracus41, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 188, Barracus42, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 189, Barracus29, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 190, Barracus43, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 191, Barracus19, NEUTRAL_REACTION);
end

procedure Barracus29
begin
	gsay_reply(SCRIPT_BARRACUS, 192);
	giq_option(7, SCRIPT_BARRACUS, 193, Barracus44, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 190, Barracus43, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 194, Barracus31, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 195, Barracus45, NEUTRAL_REACTION);
end

procedure Barracus30
begin
	gsay_reply(SCRIPT_BARRACUS, 196);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus31
begin
	gsay_reply(SCRIPT_BARRACUS, 197);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus32
begin
	gsay_reply(SCRIPT_BARRACUS, 198);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus33
begin
	gsay_reply(SCRIPT_BARRACUS, 199);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus34
begin
	gsay_reply(SCRIPT_BARRACUS, 200);
	giq_option(7, SCRIPT_BARRACUS, 123, Barracus05a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 171, Barracus36, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 131, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 172, Barracus37, NEUTRAL_REACTION);
end

procedure Barracus35
begin
	gsay_reply(SCRIPT_BARRACUS, 201);
	giq_option(7, SCRIPT_BARRACUS, 202, Barracus35a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 203, Barracus36, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 204, Barracus22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 205, Barracus21, NEUTRAL_REACTION);
end

procedure Barracus35a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Barracus48;
	end
	else begin
		call Barracus15;
	end
end

procedure Barracus36
begin
	gsay_reply(SCRIPT_BARRACUS, 206);
	giq_option(7, SCRIPT_BARRACUS, 207, Barracus49, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 208, Barracus15, NEUTRAL_REACTION);
	giq_option(7, SCRIPT_BARRACUS, 209, Barracus50, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 210, Barracus51, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 211, Barracus52, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 212, Barracus53, NEUTRAL_REACTION);
end

procedure Barracus37
begin
	gsay_reply(SCRIPT_BARRACUS, 213);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus38
begin
	gsay_reply(SCRIPT_BARRACUS, 214);
	giq_option(7, SCRIPT_BARRACUS, 215, Barracus38a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 216, Barracus39, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 217, Barracus25, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_BARRACUS, 218, Barracus19, NEUTRAL_REACTION);
end

procedure Barracus38a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Barracus54;
	end
	else begin
		call Barracus55;
	end
end

procedure Barracus39
begin
	gsay_reply(SCRIPT_BARRACUS, 219);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus40
begin
	gsay_reply(SCRIPT_BARRACUS, 220);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus41
begin
	gsay_reply(SCRIPT_BARRACUS, 221);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus42
begin
	gsay_reply(SCRIPT_BARRACUS, 222);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus43
begin
	gsay_reply(SCRIPT_BARRACUS, 223);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus44
begin
	gsay_reply(SCRIPT_BARRACUS, 224);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus45
begin
	gsay_reply(SCRIPT_BARRACUS, 225);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus46
begin
	gsay_reply(SCRIPT_BARRACUS, 226);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus47
begin
	gsay_reply(SCRIPT_BARRACUS, 227);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus48
begin
	gsay_reply(SCRIPT_BARRACUS, 228);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus49
begin
	gsay_reply(SCRIPT_BARRACUS, 229);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus50
begin
	gsay_reply(SCRIPT_BARRACUS, 230);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus51
begin
	gsay_reply(SCRIPT_BARRACUS, 231);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus52
begin
	gsay_reply(SCRIPT_BARRACUS, 232);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus53
begin
	gsay_reply(SCRIPT_BARRACUS, 233);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus54
begin
	gsay_reply(SCRIPT_BARRACUS, 234);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure Barracus55
begin
	gsay_reply(SCRIPT_BARRACUS, 235);
	giq_option(0, SCRIPT_BARRACUS, 104, BarracusEnd, NEUTRAL_REACTION);
end

procedure BarracusCombat
begin
	hostile1 := 1;
end

procedure BarracusEnd
begin
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