#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure use_skill_on_p_proc;
procedure timed_event_p_proc;

variable initialized1;


procedure start
begin
	if (not(initialized1)) then begin
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 21);
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_DOG);
		add_timer_event(self_obj, game_ticks(random(3, 30)), 0);
		initialized1 := 1;
	end
	else begin
		if (script_action == use_skill_on_proc) then begin
			call use_skill_on_p_proc;
		end
		else begin
			if (script_action == timed_event_proc) then begin
				call timed_event_p_proc;
			end
		end
	end
end

procedure use_skill_on_p_proc
begin
	if (action_being_used == 10) then begin
		script_overrides;
	end
end

procedure timed_event_p_proc
begin
	animate_move_obj_to_tile(self_obj, tile_num_in_direction(tile_num(self_obj), random(0, 5), random(1, 3)), ANIMATE_WALK);
	add_timer_event(self_obj, game_ticks(random(3, 30)), 0);
end