procedure talk_p_procbegin
variable LVar0 := 0;
LVar0 := critter_inven_obj(self_obj, 0);
set_local_var(19, 0);
if ((global_var(52) <= -1000) == 0) then begin
if (((global_var(291) - (global_var(291) % 100)) == 200) or ((global_var(291) - (global_var(291) % 100)) == 300)) then begin
if ((global_var(291) % 100) == 3) then begin
float_msg(self_obj, message_str(106, 450 + (20 * ((global_var(297) bwand 131072) != 0))), 8 + ((7 - 8) * has_trait(0, dude_obj, 22)));
end
end
else begin
if ((global_var(291) - (global_var(291) % 100)) == 100) then begin
float_msg(self_obj, message_str(106, 251), 8 + ((7 - 8) * has_trait(0, dude_obj, 22)));
end
else begin
script_overrides;
if (local_var(6) > 0) then begin
float_msg(self_obj, message_str(106, 150 + (get_critter_stat(dude_obj, 34) == 0)), 8);
end
else begin
if ((get_critter_stat(self_obj, 34) == 0) and (global_var(6) == 1) or ((get_critter_stat(self_obj, 34) == 1) and (global_var(6) == 2)) and (global_var(6) != 0) or (global_var(449) != 0)) then begin
if ((global_var(297) bwand 131072) != 0) then begin
float_msg(self_obj, message_str(106, 500), 8);
end
else begin
float_msg(self_obj, message_str(106, 152 + (get_critter_stat(dude_obj, 34) == 1)), 8);
end
end
else begin
did_node_14 := 0;
start_gdialog(106, self_obj, 4, -1, -1);
gsay_start;
if ((party_member_obj(16777380) != 0) or (local_var(9) != 0)) then begin
call Node100();
end
else begin
call Node000();
end
gsay_end;
end_dialogue;
end
end
set_local_var(5, local_var(5) + 1);
end
end
end
else begin
if (party_member_obj(obj_pid(self_obj)) != 0) then begin
debug_msg("abandon party: " + obj_name(self_obj));
party_remove(self_obj);
end
if (obj_pid(self_obj) == 16777380) then begin
debug_msg("start: set_dude_was_married");
if (global_var(6) == 1) then begin
debug_msg(" GVAR_PLAYER_WAS_MARRIED before == " + global_var(449));
set_global_var(449, global_var(6));
debug_msg(" GVAR_PLAYER_WAS_MARRIED after == " + global_var(449));
set_global_var(6, 0);
end
debug_msg("finished: set_dude_was_married");
end
if ((local_var(8) != -1) and (has_trait(1, self_obj, 6) == 0)) then begin
critter_add_trait(self_obj, 1, 6, local_var(8));
set_local_var(8, -1);
end
debug_msg("" + obj_name(self_obj) + " has abandoned the party");
call Node998();
if (critter_is_fleeing(self_obj)) then begin
if (anim_busy(self_obj) == 0) then begin
if ((tile_distance_objs(self_obj, dude_obj) < 8) or obj_can_see_obj(self_obj, dude_obj)) then begin
if (anim_busy(self_obj) == 0) then begin
global_temp := rotation_to_tile(tile_num(dude_obj), tile_num(self_obj));
animate_move_obj_to_tile(self_obj, tile_num_in_direction(tile_num(self_obj), global_temp, random(3, 10)), 1);
global_temp := (global_temp + 1) % 6;
while ((anim_busy(self_obj) == 0) and (global_temp != rotation_to_tile(tile_num(dude_obj), tile_num(self_obj)))) do begin
debug_msg("flee loop: rot == " + global_temp);
animate_move_obj_to_tile(self_obj, tile_num_in_direction(tile_num(self_obj), global_temp, random(3, 10)), 1);
global_temp := (global_temp + 1) % 6;
end
end
end
end
end
else begin
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
end
if (critter_inven_obj(self_obj, 0) != LVar0) then begin
if (critter_inven_obj(self_obj, 0) == 0) then begin
metarule3(107, self_obj, 16777367, 0);
float_msg(self_obj, message_str(106, random(6000, 6001)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 1) or (obj_pid(critter_inven_obj(self_obj, 0)) == 379)) then begin
metarule3(107, self_obj, 16777221, 0);
float_msg(self_obj, message_str(106, random(6005, 6006)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 232) or (obj_pid(critter_inven_obj(self_obj, 0)) == 3)) then begin
metarule3(107, self_obj, 16777217, 0);
float_msg(self_obj, message_str(106, random(6025, 6026)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 349) or (obj_pid(critter_inven_obj(self_obj, 0)) == 348)) then begin
metarule3(107, self_obj, 16777287, 0);
float_msg(self_obj, message_str(106, random(6030, 6031)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 240) or (obj_pid(critter_inven_obj(self_obj, 0)) == 380) or (obj_pid(critter_inven_obj(self_obj, 0)) == 2)) then begin
metarule3(107, self_obj, 16777223, 0);
float_msg(self_obj, message_str(106, random(6015, 6016)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 74) or (obj_pid(critter_inven_obj(self_obj, 0)) == 265)) then begin
metarule3(107, self_obj, 16777222, 0);
float_msg(self_obj, message_str(106, random(6010, 6011)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 239) or (obj_pid(critter_inven_obj(self_obj, 0)) == 17) or (obj_pid(critter_inven_obj(self_obj, 0)) == 381)) then begin
metarule3(107, self_obj, 16777219, 0);
float_msg(self_obj, message_str(106, random(6020, 6021)), 8);
end
else begin
if ((obj_pid(critter_inven_obj(self_obj, 0)) == 524) or (obj_pid(critter_inven_obj(self_obj, 0)) == 113)) then begin
metarule3(107, self_obj, 16777218, 0);
float_msg(self_obj, message_str(106, random(6035, 6036)), 8);
end
else begin
if (obj_pid(critter_inven_obj(self_obj, 0)) == 554) then begin
metarule3(107, self_obj, 16777320, 0);
float_msg(self_obj, message_str(106, random(6040, 6041)), 8);
end
end
end
end
end
end
end
end
end
restock_obj := critter_inven_obj(self_obj, 1);
debug_msg("armour pid == " + obj_pid(restock_obj));
rm_obj_from_inven(self_obj, restock_obj);
add_obj_to_inven(self_obj, restock_obj);
end
if (local_var(19) != 0) then begin
call Node2502();
set_local_var(19, 0);
end
return 0;
LVar0 := 0;
end