#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>

variable Shocked;


procedure start
begin
	if ((script_action == look_at_proc) or (script_action == description_proc)) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_GLOBLELV, 100));
	end
	else begin
		if (script_action == use_proc) then begin
			if ((local_var(0) == 0) and (global_var(GVAR_START_POWER) == 2)) then begin
				script_overrides;
				set_local_var(1, local_var(1) + 1);
				Shocked := random(1, 6) - 4 + local_var(1);
				if (Shocked <= 0) then begin
					display_msg(message_str(SCRIPT_GLOBLELV, 101));
				end
				else begin
					if (Shocked == 1) then begin
						display_msg(message_str(SCRIPT_GLOBLELV, 102));
						critter_dmg(dude_obj, Shocked, 0);
					end
					else begin
						display_msg(message_str(SCRIPT_GLOBLELV, 103) + Shocked + message_str(SCRIPT_GLOBLELV, 104));
						critter_dmg(dude_obj, Shocked, 0);
					end
				end
			end
		end
		else begin
			if (script_action == use_obj_on_proc) then begin
				if (obj_pid(obj_being_used_with) == 97) then begin
					set_local_var(0, 1);
					display_msg(message_str(SCRIPT_GLOBLELV, 105));
				end
				else begin
					display_msg(message_str(SCRIPT_GLOBLELV, 106));
				end
			end
		end
	end
end