begintownscript;

variables;
 
short 

body; 

beginstate
INIT_STATE;

// Setting crime level because this is a friendly town.

set_crime_tolerance(3);


set_name(16,"Commander G.");set_name(19,"Matt");
 break;beginstate START_STATE;text_bubble_on_char(19,"Mating season!");text_bubble_on_char(16,"I hate this place,");
 break;beginstate EXIT_STATE;
 break;
 
beginstate 10;
 if (get_flag(1,16) > 0) end();
 message_dialog("You actually find Commander G. again. You very reluctanly sit down.","");
 toggle_quest(1,0); set_flag(1,16,1);
  break;
 
beginstate 11;
 if (get_flag(0,10) == 1){ message_dialog("As you go towards Commander G's tent, you hear a big boom, and Iffy's voice. _Now you have a way to escape. Goodbye, adventurers. I hope to see you again._","");
 set_terrain(4,16,0);
 set_terrain(4,15,0);
 set_flag(0,10,2);
 } break;
 
beginstate 12;
 if (get_flag(0,10) == 2){ message_dialog("You look through the hole, and tell everyone that it is an exit. Everyone starts packing and you set off hoping Iffy really did make one.","");
 set_flag(0,10,3);
 } break;
 
beginstate 13;
 if (get_flag(0,23) == 2){ message_dialog("As you go towards Commander G's tent, you hear a big boom, and Iffy's voice. _Farewell all. I'm sorry I dragged you into this. Goodbye._","");
 set_terrain(4,16,0);
 set_terrain(4,15,0);
 set_flag(0,23,4);
 } break;
 
beginstate 14;
 if (get_flag(0,23) == 4){ message_dialog("You look through the hole, and tell everyone that it is an exit. As everyone is getting ready, you wonder if you did the right thing.","");
 set_flag(0,23,6);
 } break;
 