begintalkscript;

variables;
short
bmessage;

begintalknode 1;
 state = -1;
 nextstate = 1;
 question = "Iffy";
 text1 = "You stand before a gigantic 20ft high, flaming muffin. He is surrounded by small amounts of treasure. He stares at you.";
 text2 = "_Interesting. I've never seen humans before. And stop cowering in fear. It's boring. I won't eat you_";
 text3 = "_Well, what do you want?_";

begintalknode 2;
 state = 1;
 nextstate = 2;
 question = "Who are you?";
 text1 = "_My name is Infernal Flamming Muffin. Call me Iffy, for short. Well go on, tell me about what happened to you._";begintalknode 3;
 state = 2;
 nextstate = -1;
 question = "Well, we are...and what happened was...(tell him)";
 text1 = "_Interesting. Well since you are here, why don't we talk? Maybe you could help me help you._";
begintalknode 4;
 state = 1;
 nextstate = -1;
 question = "I think you are ugly and a freak.";
 text1 = "_Lets not chat about the obvious, shall we?_"; begintalknode 5;
 state = 1;
 nextstate = 3;
 condition = (get_flag(1,15) == 0);
  question = "So how can we get out of this hell?";
 text1 = "_By doing what I say, of course. If you can complete a quest for me, I will tell you everything. As well as the mission._";
begintalknode 6;
 state = 3;
 nextstate = -1;
 condition = (get_flag(1,15) == 0);
 
question = "So what do we have to do?";
 text1 = "_Go to a cave that is east from here. In there you will find two portals. Take the left one. The other leads to Hell._";
 text2 = "_After that, search everywhere. I think a muffin making laboratory is there._";  
 code =  
 toggle_quest(0,1);
 break;
 
code = set_flag(1,15,1);
 break;
  
begintalknode 7;
 state = 1;
 nextstate = 4;
 condition = (get_flag(0,23) == 1);
 question = "We looked, but nothing was there.";
 text1 = "_Crap, this isn't good. Oh well, we will just have to go to that crazy demon's fort._";
 text2 = "_Oh, and as for the portal, the magic was disruped there so I could plant one there._";
  
  code =
 set_flag(0,23,1);
 break;
begintalknode 8;
 state = 4;
 nextstate = 5;
 question = "So there is some crazy demon out there?";
 text1 = "_Yes, and the very same who has given you the lovely muffins that try to bite your head off._";
 text2 = "_He has never annonced his name, a muffin told me they know him as Infernal Flaming Demon, which I am sure is just to look cool to the muffins._";
 text3 = "_Yes, we need to kill him. If he decides to go and get me, I am finished. And if he absorbes me, he will have complete control over making muffins._";
 text4 = "_And I guess I need to tell you my life story._";
begintalknode 9;
 state = 5;
 nextstate = 6;
 question = "Yes, please do.";
 text1 = "_The demon was experimenting. He was experimenting with a muffin. He thought that creating living muffins would be an effective weopon._";
 text2 = "_He did many attempts, and eventually made one. He made many others. He even forced a demon and a muffin into one. He made a few of those._";
 text3 = "_Now about me. He tried to make the ultimate muffin, forming it with so much magick. He made me. The way he made it, it drained him. He can't make more of me unless he absorbs me._";
 text4 = "_I noticed this and ran away. I quickly learned teleportation. Don't ask why. He sends me meal after meal...I mean muffin after muffin._";
 text5 = "_Eventually he was go to me himself, and I would be finished. So, I cleverly made sure some people would come to help me. That is where you came in._";
 text6 = "_Please. I really need your help. Will you help me? Will you help me kill the evil dude?_";
 begintalknode 10;
 state = 6;
 nextstate = -1;
 condition = (get_flag(0,23) == 1);
  question = "No. I can't. Sorry.";
 text1 = "Iffy looks down. He looks really sad. _Go to your commander then. You will be given a way out._";
 
code = set_flag(0,23,2);
 break;
 
begintalknode 11;
 state = 6;
 nextstate = 1;
 condition = (get_flag(0,23) == 1);
   question = "Yes, I will.";
 text1 = "Iffy smiles. _Thank you. This is greatly appreciated._";
 code = set_flag(0,23,3);
 break;
 
begintalknode 12;
 state = 1;
 nextstate = 7;
 condition = (get_flag(0,23) == 3);
 question = "So what now?";
 text1 = "_Now you must go to the castle. You need to get to his tower and go to him. And don't worry, I have a plan._";
 code =  set_flag(0,23,5);
 break;
 