procedure start;
procedure use_p_proc;
procedure pickup_p_proc;
procedure look_at_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure chance;
procedure try_skill;
procedure fixed;
procedure failure;
variable Test;
variable temp;
variable bonus;
variable use_skill;
procedure start
begin
bonus := 0;
if (script_action == 21) then begin
call look_at_p_proc;
end
else begin
if (script_action == 6) then begin
call use_p_proc;
end
else begin
if (script_action == 4) then begin
call pickup_p_proc;
end
else begin
if (script_action == 8) then begin
call use_skill_on_p_proc;
end
else begin
if (script_action == 7) then begin
call use_obj_on_p_proc;
end
end
end
end
end
end
procedure use_p_proc
begin
if (source_obj != dude_obj) then begin
end
else begin
display_msg(message_str(936, 101));
end
end
procedure pickup_p_proc
begin
call use_p_proc;
end
procedure look_at_p_proc
begin
display_msg(message_str(936, 100));
end
procedure use_skill_on_p_proc
begin
use_skill := action_being_used;
call try_skill;
end
procedure use_obj_on_p_proc
begin
if (obj_pid(obj_being_used_with) == 75) then begin
bonus := 10;
use_skill := 13;
call use_skill_on_p_proc;
end
else begin
display_msg(message_str(936, 105));
end
end
procedure chance
begin
Test := roll_vs_skill(dude_obj, 13, bonus);
if (is_success(Test)) then begin
call fixed;
end
else begin
call failure;
end
end
procedure try_skill
begin
if (use_skill == 13) then begin
if (global_var(304) > 1) then begin
if (global_var(304) == 3) then begin
if (has_skill(dude_obj, 13) < 75) then begin
script_overrides;
display_msg(message_str(936, 103));
end
else begin
call chance;
end
end
else begin
call chance;
end
end
else begin
script_overrides;
display_msg(message_str(936, 102));
end
end
else begin
script_overrides;
display_msg(message_str(936, 105));
end
end
procedure fixed
begin
script_overrides;
set_global_var(304, 4);
display_msg(message_str(936, 104));
create_object_sid(3, 22475, 0, -1);
temp := 500;
display_msg(message_str(936, 107) + temp + message_str(936, 108));
give_exp_points(temp);
destroy_object(self_obj);
end
procedure failure
begin
script_overrides;
set_global_var(304, 3);
display_msg(message_str(936, 106));
end