// portalflag.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.

beginterrainscript; 

variables;
short choice;
	
body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;
 

beginstate STEP_INTO_SPOT_STATE;
		if (get_terrain(21,15) != 268) {
			end();
		}
			
	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(65);
	}
break;

beginstate 65;
	set_flag(65,1,21);
	set_flag(65,2,22);
	run_town_script(11);
break;

