// portal.txt -  A portal that may move the party elsewhere. When it is searched, asks if the
// party wants to use it. If they do, they are moved immediately.

// Memory Cells - 
//   0 - Call a state in the town script.


beginterrainscript; 

variables;
short choice;
	
body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;
 

beginstate STEP_INTO_SPOT_STATE;
	if (is_combat() == 1) {
		reset_dialog();
		add_dialog_str(0,"You find a portal, a magical door made of pure energy. Wizards often create them to speed up transportation from one place to another.",0);
		add_dialog_str(1,"You can't enter portals in combat.",0);
	run_dialog(0);
	block_entry(1);
	}

	if (is_combat() != 1) {		
	reset_dialog();
		add_dialog_str(0,"You find a portal, a magical door made of pure energy. Wizards often create them to speed up transportation from one place to another.",0);
		add_dialog_str(1,"They're safe. Usually.",0);		
	add_dialog_choice(0,"Step away from it.");
	add_dialog_choice(1,"Walk into the portal.");
	choice = run_dialog(0);
	if (choice == 1) {
	block_entry(1);
			end();
	}
	set_state_continue(3);
	}
break;
	
beginstate 3;	
	if (get_memory_cell(0) > 9)
		run_town_script(get_memory_cell(0));
		
break;
