begintownscript;

variables;
 

short choice; 

body; 

beginstate INIT_STATE; if (get_flag(0,20) > 0) end();

message_dialog("You enter the cave but it appears to be a nondescript room. Odd.","");
 set_flag(0,20,1);
  break;


beginstate START_STATE;
 break;

beginstate EXIT_STATE;
 break;

beginstate 10;
  add_dialog_str(0,"There is a teleporter here. This is the one Iffy was talking about. If you go through, you might not be able to come back that way. Continue?",0);
 
add_dialog_choice(0,"Stay.");

add_dialog_choice(1,"Step through the portal.");
 choice = 
run_dialog(0);
 if (choice == 2)
 set_state_continue(21);
break;

beginstate 21;

teleport_party(16,14,0);
break;

beginstate 22;

message_dialog("Oooh it is the portal Iffy told you to stay away from. It leads further to hell, probably as a trap. You have a feeling that if you go through there, you will be tortured and killed. By demons.","");
 reset_dialog();

break;
 beginstate 23;

if (get_flag(0,23) > 0) end();

message_dialog("With no where else to go, and an army of muffins nearby, you step into the portal.","");
 toggle_quest(0,0);
 
set_flag(0,23,1);
 change_outdoor_location(1,1,1,24);
 
move_to_new_town(3,18,15);
 
break;
 
beginstate 24;
 if (get_flag(1,21) == 0){ 
message_dialog("You carefuly step into the room, but there is nothing there. You are also surprised to see that the room is grassy. ","");
 set_flag(1,21,1);
 } break;
beginstate 25;
 if (get_flag(1,20) == 0){ message_dialog("You search everywhere, but find nothing, and then everything went quiet. Too quiet. Then sounds were heard.","");
  message_dialog("It is a trap! The muffins set you up. But then a portal appears and a voice is heard. It is Iffy's. _Get in! Hurry!_.","");
 set_terrain(25,16,0);
 set_flag(1,20,1);
 } break;

 
beginstate 26;
 if (get_flag(1,15) == 0) {  block_entry(1);
 } break;
 
beginstate 27;
 if (get_flag(1,15) == 1) { message_dialog("You go to the north wall, and then you remember Iffy saying something was here. You search and find a secret passage.","");
 set_flag(1,15,2);
 reset_dialog();
 } break;
 
beginstate 28;
 if (get_flag(1,20) == 1){ message_dialog("Dude. There is something that way. You turn around.","");
 block_entry(1);
 } break;
 