procedure start;
procedure do_dialogue;
procedure first;
procedure notfirst;
procedure garl00;
procedure garl01;
procedure garl01a;
procedure garl01b;
procedure garl01c;
procedure garl01d;
procedure garl02;
procedure garl03;
procedure garl03a;
procedure garl04;
procedure garl04a;
procedure garl04b;
procedure garl04c;
procedure garl05;
procedure garl06;
procedure garl06a;
procedure garl07;
procedure garl08;
procedure garl09;
procedure garl10;
procedure garl11;
procedure garl12;
procedure garl12a;
procedure garl12b;
procedure garl15;
procedure garl15a;
procedure garl16;
procedure garl17;
procedure garl17a;
procedure garl18;
procedure garl19;
procedure garl20;
procedure garl21;
procedure garl22;
procedure garl23;
procedure garl24;
procedure garl25;
procedure garl26;
procedure garl27;
procedure garl28;
procedure garl29;
procedure garl30;
procedure garl31;
procedure garl32;
procedure garl33;
procedure garl34;
procedure garl35;
procedure garl36;
procedure garl37;
procedure garl37a;
procedure garl38;
procedure garl38a;
procedure garl39;
procedure garl39a;
procedure garl40;
procedure garl41;
procedure garl42;
procedure garl43;
procedure garlx;
procedure garlend;
procedure freetandi;
procedure garlcbt;
procedure honorcbt;
procedure honorarea;
procedure garlbarter;
procedure return_to_map;
procedure Critter_Action;
procedure damage_p_proc;
import variable women_killed;
import variable signal_women;
import variable killing_women;
import variable Garls_Inven_Ptr;
variable HOSTILE;
variable only_once := 1;
variable temp;
variable tandi_pid_ptr;
import variable Cell_Door_Ptr;
procedure get_reaction;
procedure ReactToLevel;
procedure LevelToReact;
procedure UpReact;
procedure DownReact;
procedure BottomReact;
procedure TopReact;
procedure BigUpReact;
procedure BigDownReact;
procedure UpReactLevel;
procedure DownReactLevel;
procedure Goodbyes;
variable exit_line;
procedure start
begin
if (only_once) then begin
only_once := 0;
critter_add_trait(self_obj, 1, 6, 6);
critter_add_trait(self_obj, 1, 5, 22);
end
if (script_action == 11) then begin
call do_dialogue;
end
else begin
if (script_action == 22) then begin
if (fixed_param == 1) then begin
if (global_var(611) != 1) then begin
dialogue_system_enter;
end
end
else begin
if (fixed_param == 2) then begin
call freetandi;
end
else begin
if (fixed_param == 3) then begin
call honorarea;
end
else begin
if (fixed_param == 4) then begin
call return_to_map;
call freetandi;
end
end
end
end
end
else begin
if (script_action == 21) then begin
script_overrides;
display_msg(message_str(137, 100));
end
else begin
if (script_action == 4) then begin
HOSTILE := 1;
end
else begin
if (script_action == 12) then begin
call Critter_Action;
if (HOSTILE) then begin
HOSTILE := 0;
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
end
else begin
if (script_action == 14) then begin
call damage_p_proc;
end
else begin
if (script_action == 18) then begin
if (local_var(7) == 1) then begin
move_to(dude_obj, local_var(6), 0);
move_obj_inven_to_obj(Garls_Inven_Ptr, dude_obj);
set_global_var(26, 5);
set_map_var(2, 2);
obj_unlock(Cell_Door_Ptr);
end
if (source_obj == dude_obj) then begin
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
set_global_var(156, 1);
set_global_var(157, 0);
end
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(160) > (3 * global_var(159))) or (global_var(157) == 1))) then begin
set_global_var(157, 1);
set_global_var(156, 0);
end
set_global_var(160, global_var(160) + 1);
if ((global_var(160) % 6) == 0) then begin
set_global_var(155, global_var(155) + 1);
end
end
if (local_var(7) == 0) then begin
set_global_var(254, 1);
set_global_var(611, 0);
end
set_global_var(114, 1);
set_global_var(115, global_var(115) - 1);
end
end
end
end
end
end
end
end
procedure do_dialogue
begin
if (elevation(self_obj) == 1) then begin
float_msg(self_obj, message_str(137, 208), 2);
add_timer_event(self_obj, 5, 4);
end
else begin
if (killing_women) then begin
call garl39a;
end
else begin
set_local_var(3, 1);
call get_reaction;
start_gdialog(137, self_obj, 4, -1, -1);
gsay_start;
if (women_killed > 1) then begin
call garl11;
end
else begin
if (global_var(116)) then begin
call garl01;
end
else begin
if (local_var(4) < 1) then begin
call first;
set_local_var(4, 1);
end
else begin
call notfirst;
end
end
end
gsay_end;
end_dialogue;
end
end
if (obj_carrying_pid_obj(dude_obj, 212)) then begin
rm_obj_from_inven(dude_obj, tandi_pid_ptr);
destroy_object(tandi_pid_ptr);
set_global_var(26, 5);
set_map_var(2, 2);
obj_unlock(Cell_Door_Ptr);
add_timer_event(self_obj, 1, 2);
end
else begin
if (obj_carrying_pid_obj(self_obj, 212)) then begin
rm_obj_from_inven(self_obj, tandi_pid_ptr);
destroy_object(tandi_pid_ptr);
call garl20;
end
end
end
procedure first
begin
if (global_var(26) > 1) then begin
call garl43;
end
else begin
if (global_var(26) > 0) then begin
call garl12;
end
else begin
call garl32;
end
end
end
procedure notfirst
begin
if (global_var(26) > 1) then begin
call garl43;
end
else begin
if (global_var(26) > 0) then begin
call garl22;
end
else begin
call garl41;
end
end
end
procedure garl00
begin
gsay_message(137, 101, 50);
call garlcbt;
end
procedure garl01
begin
gsay_reply(137, 102);
giq_option(-3, 137, 207, garl09, 50);
giq_option(4, 137, 103, garl01a, 50);
giq_option(5, 137, 104, garl01b, 50);
giq_option(6, 137, 105, garl01c, 50);
end
procedure garl01a
begin
call garl02;
end
procedure garl01b
begin
call garl03;
end
procedure garl01c
begin
call garl04;
end
procedure garl01d
begin
gsay_reply(137, 106);
giq_option(4, 137, 107, garl02, 50);
giq_option(5, 137, 108, garl03, 50);
giq_option(6, 137, 109, garl04, 50);
end
procedure garl02
begin
gsay_message(137, 110, 50);
set_global_var(116, 0);
call garlcbt;
end
procedure garl03
begin
gsay_reply(137, 111);
giq_option(8, 137, 112, garl03a, 50);
end
procedure garl03a
begin
set_global_var(116, 0);
call garlcbt;
end
procedure garl04
begin
gsay_reply(137, 113);
giq_option(6, 137, 114, garl04a, 50);
giq_option(6, 137, 115, garl04b, 50);
end
procedure garl04a
begin
call garl06;
end
procedure garl04b
begin
call garl05;
end
procedure garl04c
begin
gsay_reply(137, 116);
giq_option(6, 137, 117, garl06, 50);
giq_option(6, 137, 118, garl05, 50);
end
procedure garl05
begin
gsay_message(137, 119, 50);
set_global_var(116, 0);
call garlcbt;
end
procedure garl06
begin
gsay_reply(137, 120);
if (global_var(26) == 1) then begin
giq_option(6, 137, 121, garl06a, 50);
end
giq_option(6, 137, 122, garl10, 50);
giq_option(6, 137, 123, garl10, 50);
end
procedure garl06a
begin
if (is_success(do_check(dude_obj, 3, 0)) or is_success(roll_vs_skill(dude_obj, 14, 10))) then begin
call garl08;
end
else begin
call garl09;
end
end
procedure garl07
begin
gsay_message(137, 124, 50);
giq_option(6, 137, 125, garl08, 50);
end
procedure garl08
begin
gsay_message(137, 126, 50);
set_global_var(116, 0);
call freetandi;
end
procedure garl09
begin
gsay_message(137, 127, 50);
call garlcbt;
end
procedure garl10
begin
gsay_message(137, 128, 50);
set_global_var(116, 0);
call garlcbt;
end
procedure garl11
begin
if (women_killed > 1) then begin
women_killed := 0;
gsay_message(137, 129, 50);
call garlcbt;
end
end
procedure garl12
begin
gsay_reply(137, 130);
if (global_var(218) == 1) then begin
giq_option(4, 137, 131, garl12b, 50);
giq_option(5, 137, 133, garl15, 50);
end
else begin
giq_option(5, 137, 200, garl12a, 50);
end
giq_option(4, 137, 132, garlcbt, 50);
giq_option(-3, 137, 134, garl17, 50);
end
procedure garl12a
begin
gsay_message(137, 201, 50);
end
procedure garl12b
begin
if (is_success(roll_vs_skill(dude_obj, 14, 10)) or is_success(do_check(dude_obj, 3, 0))) then begin
call garl15;
end
else begin
call garl10;
end
end
procedure garl15
begin
gsay_reply(137, 140);
if (has_skill(dude_obj, 14) >= 45) then begin
giq_option(6, 137, 141, garl15a, 50);
end
giq_option(6, 137, 142, garl18, 50);
giq_option(6, 137, 143, garl21, 50);
giq_option(5, 137, 203, garl28, 50);
end
procedure garl15a
begin
if (is_success(roll_vs_skill(dude_obj, 14, 10)) or is_success(do_check(dude_obj, 3, 0))) then begin
call garl16;
end
else begin
call garl17;
end
end
procedure garl16
begin
gsay_message(137, 145, 50);
call freetandi;
end
procedure garl17
begin
gsay_message(137, 146, 50);
call garlcbt;
end
procedure garl17a
begin
gsay_message(137, 204, 50);
call garlcbt;
end
procedure garl18
begin
tandi_pid_ptr := create_object_sid(212, 0, 0, -1);
add_obj_to_inven(self_obj, tandi_pid_ptr);
gsay_message(137, 147, 50);
call garlbarter;
end
procedure garl19
begin
float_msg(self_obj, message_str(137, 148), 2);
call freetandi;
end
procedure garl20
begin
if (get_critter_stat(dude_obj, 34) == 0) then begin
float_msg(self_obj, message_str(137, 149), 2);
end
else begin
float_msg(self_obj, message_str(137, 205), 2);
end
call garlcbt;
end
procedure garl21
begin
gsay_message(137, 150, 50);
call garlcbt;
end
procedure garl22
begin
gsay_reply(137, 151);
giq_option(4, 137, 152, garl23, 50);
giq_option(4, 137, 153, garl24, 50);
giq_option(-3, 137, 207, garl17, 50);
end
procedure garl23
begin
gsay_message(137, 155, 50);
end
procedure garl24
begin
gsay_reply(137, 156);
giq_option(4, 137, 157, garl25, 50);
giq_option(6, 137, 158, garl18, 50);
giq_option(6, 137, 159, garl15a, 50);
end
procedure garl25
begin
gsay_reply(137, 160);
giq_option(4, 137, 161, garl26, 50);
giq_option(4, 137, 162, garl27, 50);
end
procedure garl26
begin
gsay_message(137, 163, 50);
call garlcbt;
end
procedure garl27
begin
gsay_reply(137, 164);
giq_option(4, 137, 165, garl26, 50);
giq_option(4, 137, 166, garl28, 50);
giq_option(6, 137, 167, garl29, 50);
end
procedure garl28
begin
gsay_reply(137, 168);
giq_option(4, 137, 169, honorcbt, 50);
end
procedure garl29
begin
gsay_reply(137, 170);
giq_option(4, 137, 171, garlcbt, 50);
end
procedure garl30
begin
gsay_message(137, 172, 50);
call freetandi;
end
procedure garl31
begin
gsay_message(137, 173, 50);
end
procedure garl32
begin
gsay_reply(137, 174);
giq_option(4, 137, 175, garl33, 50);
giq_option(6, 137, 176, garl34, 50);
giq_option(-3, 137, 154, garl23, 50);
end
procedure garl33
begin
if (get_critter_stat(dude_obj, 34) == 0) then begin
gsay_message(137, 177, 50);
end
else begin
gsay_message(137, 206, 50);
end
call garlcbt;
end
procedure garl34
begin
gsay_reply(137, 178);
giq_option(6, 137, 179, garl35, 50);
giq_option(6, 137, 180, garl33, 50);
end
procedure garl35
begin
gsay_reply(137, 181);
giq_option(4, 137, 182, garl37, 50);
giq_option(4, 137, 183, garl36, 50);
end
procedure garl36
begin
gsay_message(137, 184, 50);
end
procedure garl37
begin
gsay_reply(137, 185);
giq_option(4, 137, 186, garl38, 50);
giq_option(4, 137, 187, garl37a, 50);
end
procedure garl37a
begin
signal_women := 2;
killing_women := 1;
add_timer_event(self_obj, game_ticks(15), 1);
end
procedure garl38
begin
women_killed := 0;
if (get_critter_stat(dude_obj, 34) == 0) then begin
gsay_message(137, 188, 50);
end
else begin
gsay_message(137, 189, 50);
end
call garlcbt;
end
procedure garl38a
begin
women_killed := 0;
if (get_critter_stat(dude_obj, 34) == 0) then begin
float_msg(self_obj, message_str(137, 188), 2);
end
else begin
float_msg(self_obj, message_str(137, 189), 2);
end
call garlcbt;
end
procedure garl39
begin
gsay_message(137, 190, 50);
call garlcbt;
end
procedure garl39a
begin
killing_women := 0;
if (women_killed > 1) then begin
call garl40;
end
else begin
call garl38a;
end
end
procedure garl40
begin
women_killed := 0;
call TopReact;
float_msg(self_obj, message_str(137, 191), 2);
temp := 500;
display_msg(message_str(238, 100) + temp + message_str(238, 102));
give_exp_points(temp);
set_global_var(155, global_var(155) + -2);
set_global_var(611, 1);
end
procedure garl41
begin
gsay_reply(137, 192);
giq_option(4, 137, 193, garl23, 50);
giq_option(6, 137, 194, garl42, 50);
giq_option(-3, 137, 195, garl23, 50);
end
procedure garl42
begin
gsay_message(137, 196, 50);
end
procedure garl43
begin
if (get_critter_stat(dude_obj, 34) == 0) then begin
gsay_message(137, 197, 50);
end
else begin
gsay_message(137, 198, 50);
end
call garlcbt;
end
procedure garlx
begin
end
procedure garlend
begin
end
procedure freetandi
begin
set_global_var(26, 5);
set_map_var(2, 2);
obj_unlock(Cell_Door_Ptr);
end
procedure garlcbt
begin
HOSTILE := 1;
end
procedure honorcbt
begin
add_timer_event(self_obj, game_ticks(1), 3);
end
procedure honorarea
begin
variable LVar0 := 0;
set_local_var(6, tile_num(dude_obj));
set_local_var(7, 1);
move_to(dude_obj, 20102, 1);
move_to(self_obj, 20301, 1);
LVar0 := critter_inven_obj(dude_obj, 0);
rm_obj_from_inven(dude_obj, LVar0);
move_obj_inven_to_obj(self_obj, Garls_Inven_Ptr);
move_obj_inven_to_obj(dude_obj, Garls_Inven_Ptr);
add_obj_to_inven(dude_obj, LVar0);
wield_obj_critter(dude_obj, LVar0);
if (party_member_obj(16777292) != 0) then begin
move_to(party_member_obj(16777292), tile_num_in_direction(tile_num(dude_obj), 0, 10), 1);
end
if (party_member_obj(16777518) != 0) then begin
move_to(party_member_obj(16777518), tile_num_in_direction(tile_num(dude_obj), 1, 10), 1);
end
if (party_member_obj(16777426) != 0) then begin
move_to(party_member_obj(16777426), tile_num_in_direction(tile_num(dude_obj), 2, 10), 1);
end
if (party_member_obj(16777338) != 0) then begin
move_to(party_member_obj(16777338), tile_num_in_direction(tile_num(dude_obj), 4, 10), 1);
end
if (party_member_obj(16777279) != 0) then begin
move_to(party_member_obj(16777279), tile_num_in_direction(tile_num(dude_obj), 5, 10), 1);
end
critter_add_trait(self_obj, 1, 6, 87);
critter_add_trait(self_obj, 1, 5, 43);
call garlcbt;
end
procedure garlbarter
begin
gdialog_mod_barter(0);
gsay_message(137, "", 50);
end
procedure return_to_map
begin
move_to(dude_obj, local_var(6), 0);
move_obj_inven_to_obj(Garls_Inven_Ptr, dude_obj);
set_global_var(26, 5);
set_map_var(2, 2);
obj_unlock(Cell_Door_Ptr);
end
procedure Critter_Action
begin
if (global_var(26) == 2) then begin
set_global_var(254, 1);
end
else begin
if (global_var(116)) then begin
set_global_var(254, 0);
end
else begin
if (global_var(213)) then begin
set_global_var(254, 1);
end
if (obj_can_see_obj(self_obj, dude_obj)) then begin
if (global_var(214)) then begin
set_global_var(254, 1);
end
end
end
end
if (global_var(254) and obj_can_see_obj(self_obj, dude_obj)) then begin
HOSTILE := 1;
end
if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
HOSTILE := 0;
end
end
procedure damage_p_proc
begin
if (local_var(7) == 0) then begin
set_global_var(254, 1);
end
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(155) > 0) then begin
set_local_var(0, local_var(0) + global_var(155));
end
else begin
set_local_var(0, local_var(0) - global_var(155));
end
end
else begin
if (local_var(3) == 1) then begin
set_local_var(0, local_var(0) - global_var(155));
end
else begin
set_local_var(0, local_var(0) + global_var(155));
end
end
if (global_var(158) > 2) then begin
set_local_var(0, local_var(0) - 30);
end
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(160) > (3 * global_var(159))) or (global_var(157) == 1))) then begin
set_local_var(0, local_var(0) + 20);
end
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
set_local_var(0, local_var(0) - 20);
end
call ReactToLevel;
end
end
procedure ReactToLevel
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 LevelToReact
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 UpReact
begin
set_local_var(0, local_var(0) + 10);
call ReactToLevel;
end
procedure DownReact
begin
set_local_var(0, local_var(0) - 10);
call ReactToLevel;
end
procedure BottomReact
begin
set_local_var(1, 1);
set_local_var(0, 1);
end
procedure TopReact
begin
set_local_var(0, 100);
set_local_var(1, 3);
end
procedure BigUpReact
begin
set_local_var(0, local_var(0) + 25);
call ReactToLevel;
end
procedure BigDownReact
begin
set_local_var(0, local_var(0) - 25);
call ReactToLevel;
end
procedure UpReactLevel
begin
set_local_var(1, local_var(1) + 1);
if (local_var(1) > 3) then begin
set_local_var(1, 3);
end
call LevelToReact;
end
procedure DownReactLevel
begin
set_local_var(1, local_var(1) - 1);
if (local_var(1) < 1) then begin
set_local_var(1, 1);
end
call LevelToReact;
end
procedure Goodbyes
begin
exit_line := message_str(634, random(100, 105));
end