// dirt.txt
// A patch of dirt that generates an item when used, if
// the nature lore skill is high enough.

// Cell 0 - The necessary total nature lore in the party.
// Cell 1 - The item that is given.

beginobjectscript;

variables;

short reward;

body;

beginstate INIT_STATE;
	reward = get_memory_cell(1);
	if (reward == 0)
		reward = 289;
	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; 
break;

beginstate 3;
	
break;

beginstate USE_STATE;
	if (get_stat_total(16) < get_memory_cell(0)) {
		print_str_color("Search: You think there might be something here, but you don't know",2);
		print_str_color("  enough Nature Lore to locate it.",2);
		}
		else {
			print_str_color("Search: You think there might be something here, so you dig in the gravel.",2);
			print_str_color("  Sure enough, there is something hidden here.",2);
			reward_give(reward);
			kill_object(ME,0);
			inc_flag(170,9,1);
			play_sound(249);
			}
break;