begintalkscript;

variables;

int i,j,k,r1,choice;

begintalknode 1;
        state = -1;
        personality = 2;
        nextstate = 1;
        condition = 1;
        question = "";
        text1 = "Danor is a short man who looks like he's spent a lot of time outdoors, not only recently, but over the past few months.";
        text2 = "He is looking at a piece of fruit, trying to determine what parts of it can be eaten. When you get close, he puts it down and turns to you. _I'm Danor._";
        text5 = "Danor is looking at some potential food. He stops to talk to you, glad to have a break.";
        action = INTRO;
begintalknode 2;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = 1;
        question = "How do you pass your time on the island?";
        text1 = "Danor tends to talk slowly, so you wait as he completes his sentence. _There's plenty of food in the area I can inspect, and when I'm not inspecting food, I play games with Cerund.";
        text2 = "Cerund grumbles _And you usually win!_";
begintalknode 3;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = get_flag(0,27) == 0;
        question = "Is the food surveying going well?";
        text1 = "He thinks for a couple of minutes, and then says _It is going so-so. About a third of the possible food I find is edible. That's enough to keep us alive, but more variety would be good.";
        text2 = "He thinks a bit more. _Actually, there's something you could help me with. Just northeast of here is a grove, which looks like it contains some good food. Whenever I get close, a pack of spirits shows up and scares me off._";
        text3 = "If you could go up there and investigate, I would be very grateful._";
        code = 
                toggle_quest(3,1);
        break;
begintalknode 4;
        state = 1;
        personality = 2;
        nextstate = -1;
        condition = get_flag(0,27) == 1;
        question = "The dryads won't stop you from picking food from the grove.";
        text1 = "He is very relieved at this news. _Thank you very much for that service. In return, I have a reward for you.";
        text2 = "Having spent years looking through remote areas for potential food sources has taught Danor a few tricks. If you haven't trained too much in Nature Lore and Pathfinder already, you now know more about them.";
        code = 
                toggle_quest(3,0);
                award_party_xp(500,30);
                set_flag(0,27,2);
                if (get_highest_skill(16) < 20) {
                        alter_stat(1000,16,1);
                }
                if (get_highest_skill(24) < 20) {
                        alter_stat(1000,24,1);
                }
        break;
begintalknode 5;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = get_flag(0,27) > 1;
        question = "Is the food surveying going well?";
        text1 = "He thinks for about a minute, and then says _Yes, it's going very well. Thanks again for your help dealing with the spirits.";
begintalknode 6;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = 1;
        question = "Do you regret losing the people who couldn't make it to shore?";
        text1 = "He thinks carefully, and then says _Yes, I do. Everyone here does. However, we can't let our regrets interfere with what needs doing: escaping the island._";
begintalknode 7;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = (get_flag(2,2) == 0);
        question = "Is there any food we could have?";
        text1 = "_Yes. Let me go get it._ He is gone for a few minutes, and comes back with a few pieces of food. _This is all that's available for you right now, but I should have more later.";
        code = 
                reward_give(get_ran(1,4,6));
                reward_give(get_ran(1,8,11));
                reward_give(get_ran(1,397,398));
                set_flag(2,2,1);
        break;
begintalknode 8;
        state = 1;
        personality = 2;
        nextstate = 1;
        condition = ((0) && (get_flag(2,2) != 0));
        question = "Is there any food we could have?";
        text1 = "_No. I've already given you your ration for the moment, and need what's left to feed us. I should have found more food by tomorrow._";
        code = 

        break;

begintalknode 21;
        state = -1;
        personality = 1;
        nextstate = 10;
        condition = 1;
        question = "";
        text1 = "Inala is a tall woman of average weight. She is looking at a map she's drawn in the ground, and occassionally makes an adjustment.";
        text2 = "She looks away from the map, and asks you _Is there anything you'd like to know?_";
        text5 = "Inala is still working on the map she's drawn in the ground. She asks you if you'd like any information.";
        action = INTRO;
begintalknode 22;
        state = 10;
        personality = 1;
        nextstate = -1;
        condition = (get_flag(0,18) <= 1);
        question = "Have you been able to explore the beach area?";
        text1 = "Inala considers this briefly, and says _Not so far, but I should be able to soon._";
begintalknode 23;
        state = 10;
        personality = 1; //Inala's node
        nextstate = -1;
        condition = ((get_flag(0,18) > 2) && (get_flag(0,19) == 0));
        question = "Have you been able to explore the beach area?";
        text1 = "Inala considers this briefly, and says _Yes. I've located a cavern in the mountains to the north. I wasn't able to get in, however._";
        code = 
                set_town_visibility(6,1);
                set_flag(0,19,1);
        break;

begintalknode 41;
        state = -1;
        personality = 0;
        nextstate = 20;
        condition = 1;
        question = "";
        text1 = "Cerund is a thin, white-haired wizard who is very old. He is playing a boardgame that he likely summoned himself.";
        text2 = "As you get close, he finishes the move he was making and gives you his attention.";
        text5 = "Cerund is still playing the game. He puts down his piece and asks you _Can I help you with anything?_";
        action = INTRO;
begintalknode 42;
        state = 20;
        personality = 0;
        nextstate = -1;
        condition = 1;
        question = "We have some items that need identification. Can you identify them?";
        text1 = "He looks at your inventory. _Yes, I know what they are, and I'll tell you for a coin each.";
        action = ID 1;
begintalknode 43;
        state = 20;
        personality = 0;
        nextstate = -1;
        condition = get_flag(0,16) == 1;
        question = "We found this key in a nearby unicorn lair. Can you tell us anything about it?";
        text1 = "He looks at it quickly. _No, but the presence of a key suggests that there's something intelligent on this island. You should..._ He hears a noise in the distance, and says _Something is coming. Wait here._";
        action = END_TALK;
        code =
                activate_hidden_group(1);
                set_flag(0,16,2);
        break;
begintalknode 44;
        state = 20;
        personality = 0;
        nextstate = -1;
        condition = get_flag(0,16) == 3;
        question = "What were you saying?";
        text1 = "He thinks for a minute, trying to remember. _I was about to tell you that you should try to find out who left the key there._ He thinks a bit more. _I didn't sense those scorpions before. Someone obviously doesn't want us around._";
        code =
                set_flag(0,16,4);
        break;
begintalknode 45;
        state = 20;
        personality = 0;
        nextstate = 21;
        condition = get_flag(0,14) == 1;
        question = "The Ball Lightning spell looks like it will be very useful. Can you teach us how to cast it?";
        text1 = "He thinks briefly, and then says _Unfortunately, no. You don't have the years of specialized training necessary to use it properly, and even if you did, the Empire would punish me severly for doing so._";
        text2 = "He thinks a bit more. _I could tell you how to protect yourself from it; doing so would take several hours, however._";
begintalknode 46;
        state = 21;
        personality = 0;
        nextstate = -1;
        condition = get_flag(0,14) == 1;
        question = "Please tell us how to protect ourselves from the Ball Lightning spell.";
        text1 = "He quickly says _All right._";
        text2 = "He spends several hours training you in deflecting incoming Ball Lightning attacks. When he's done, you feel confident that you will be able to stop any incoming balls in the future._";
        code =
                set_flag(0,14,2);
                set_ticks_forward(1250);
        break;