begintownscript;

variables;

int i,j,k,r1,choice;

body;

beginstate INIT_STATE;
        if (get_flag(0,9) == 0) {
                reset_dialog();
                add_dialog_str(0,"You land on a high cliff on the northern part of Cherayeng Island. Above you, you see little except for snow-covered mountains and clear blue sky.",0);
                add_dialog_str(1,"This cliff is inhabited by a large group of eyebeasts, who get in and out by flying. In the distance, there is a staircase. Someone else must have used the aerie before the eyebeasts got here, as they have no need for stairs.",0);
                run_dialog(1);
                set_flag(0,9,1);
        }
        add_range_to_group(6,36,1);
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
        //code called every turn
break;

beginstate 10;
        if (get_flag(0,10) == 0) {
                reset_dialog();
                add_dialog_str(0,"Immediately ahead of you, you see three chests, which the eyebeasts probably use to store their treasure. This is confirmed by the glowing magical field blocking the path.",0);
                add_dialog_str(1,"You could try to pass through it, but you have no idea what it will do if you touch it.",0);
                add_dialog_choice(0,"Try to walk through the field.");
                add_dialog_choice(1,"Leave.");
                choice = run_dialog(1);
                if (choice == 1)  {
                        add_dialog_str(0,"The moment you touch the field, it pops without affecting you. However, there is a loud squealing noise. You think the noise can be heard all over the aerie.",0);
                        set_flag(0,10,1);
                        alert_char(1001);
                        inc_flag(0,18,1);
                }
                if (choice == 2)  {
                        block_entry(1);
                }
        }
break;

beginstate 11;
        move_to_new_town(4,7,8);
break;