:raphael_talk_about_forest
  create villager Raphael 34,10,8
  
  wait 20

  Raphael "Hello, <name>. Do you have a minute?"
  Player "Sure. Is there anything wrong?"
  Raphael "Yeah. Have you been to the forest yet?"
  Player "I tried to, but I always get lost, so I didn't get very far."
  Raphael "So it happened to you too. I used to be able to get through the forest just fine. What could have happened?"
  Player "Someone told me there's a powerful spell on the forest. That's why we always get lost."
  Raphael "Hmm. That makes sense. We need to find a way to lift this spell, then. Do you want to help me?"
  Player "What can I do?"
  Raphael "When you have some time and I'm not busy working, talk to me and we will investigate the forest together."
  Player "Alright."

  wait 20
  move villager Raphael 43,10,8
  
  wait 60
  fade out
  remove Raphael
  speed Player restore
  fade in
  switch raphaelTalkedAboutForest ON
  accept curupira-task-1

:raphael_investigating_forest
  js $gameMap.createActionIconEventAt(287, 31, 2, 'raphael_ask_about_glass', true);
  + $gameParty.setFollowerPosition(1, 10, Direction.RIGHT);
  
  wait 30
  turn Player left
  wait 10
  Player "This is the place. I can't get anywhere past here."  
  Raphael "Same for me. Let's see if we can find some clues."

  wait 10
  turn Player right
  wait 10

:raphael_ask_about_glass
  turn Raphael up
  + Managers.Items.displayItemId = 'empty-glass';
  + this.character(0).erase();
  wait 10
  Raphael "Huh, you found something?"
  wait 10
  turn Player down
  Player "It's some kind of glass. It has a strong smell on it."
  Raphael "Let me see."
  wait 10
  displayItemId undefined
  wait 20
  Raphael "Hah, I know this smell. It's cachaça."
  Player "Cachaça, what's that?"
  Raphael "It's sugarcane rum. But who would drink this so far from the town?"
  Player "Should we ask about it on the restaurant?"
  Raphael "I don't think Chloe sells this, but sure, let's talk to her."
  switch talkedToRaphaelAboutCachaca ON
  switch playedRaphaelForestInvestigation ON

  replace task curupira-task-1 curupira-task-2

:raphael_investigating_forest_2
  js Managers.FarmObjects.restoreMapTrees();
  + Managers.FarmObjects.updateMapEvents();

  switch hideFollowers ON
  create villager Raphael 1,10,right
  speed Player 3.5
  speed Raphael 3.5

  wait 40
  turn Player left
  wait 10
  Player "Let's leave the sugarcane rum somewhere around here and see if he shows up."
  Raphael "Leave it to me."

  wait 10
  turn Player right
  wait 10
  move villager Player 7,10,up
  move villager Raphael 9,10,up

  wait for Player
  move villager Player 7,7,right
  
  wait for Raphael
  move villager Raphael 9,7,left

  wait for Raphael
  wait for Player

  wait 10
  js window.cachacaEvent = $gameMap.createStaticIconEventAt(275, 8, 7, 0, true);

  move villager Raphael 10,7,up
  wait 5
  move villager Player 6,7,up

  wait for Raphael
  move villager Raphael 10,5,left
  
  wait for Player
  move villager Player 6,5,right

  wait for Raphael
  move villager Raphael 9,5,down

  wait for Player
  move villager Player 7,5,down
  
  wait for Raphael
  wait for Player

  wait 20
  Raphael "Now we wait."
  wait 30

  js Engine.Audio.fadeOutBgm(1);

  create villager Curupira 32,8,left
  speed Curupira 4.5
  speed Raphael 4.5
  speed Player 4.5
  move villager Curupira 8,8,up
  wait for Curupira

  wait 20
  Curupira "<wait>What is it that I see?<wait><wait><BR>A bottle of cachaça to drink!<wait><wait><BR>How dumb can they be?<wait><wait><BR>Much more than they think."

  wait 20
  move villager Raphael 10,5,down
  wait 5
  move villager Player 6,6,down
  move villager Raphael 10,6,down

  wait 15
  Curupira "<!:async>"
  js Managers.Villagers.jump('Curupira')
  wait 10
  js Managers.Villagers.jump('Curupira')
  wait 10

  wait for Player

  Curupira "<wait>The dumb ones were hidden.<wait><wait><BR>Try to catch me they will.<wait><wait><BR>In this forest forbidden.<wait><wait><BR>I won't stay still."
  js Engine.Audio.playBgmName('competition');
  wait 10
  js Managers.Villagers.jump('Curupira')
  wait for Curupira

  move villager Curupira 19,8,down
  
  wait 30

  move villager Raphael 19,7,down
  wait 5
  move villager Player 15,7,down
  
  wait for Curupira
  move villager Curupira 19,12,left
  
  wait for Raphael
  move villager Raphael 19,12,left

  wait for Curupira
  move villager Curupira 14,12,up

  wait for Raphael
  move villager Raphael 14,12,up

  wait for Curupira
  move villager Curupira 14,9,right

  wait for Raphael
  move villager Raphael 14,9,right

  wait for Curupira
  move villager Curupira 18,9,down

  wait for Raphael
  move villager Raphael 18,9,down

  wait for Curupira
  move villager Curupira 18,11,left

  wait for Curupira
  move villager Curupira 15,11,up

  wait for Raphael
  speed Raphael 4.1
  move villager Raphael 18,11,left
  

  wait for Curupira
  move villager Curupira 15,9,right

  wait for Raphael
  speed Raphael 4.5
  move villager Raphael 15,11,up
  wait for Curupira
  move villager Curupira 17,9,down
  wait for Raphael
  move villager Raphael 15,9,right
  wait for Curupira
  move villager Curupira 17,11,left
  wait for Raphael
  move villager Raphael 17,9,down
  wait for Curupira
  move villager Curupira 15,11,up
  wait for Raphael
  move villager Raphael 17,11,left
  wait for Curupira
  move villager Curupira 15,9,right

  wait for Raphael
  move villager Raphael 15,11,up
  wait for Curupira
  move villager Curupira 17,9,down
  wait for Raphael
  move villager Raphael 15,9,right
  wait for Curupira
  move villager Curupira 17,11,left
  wait for Raphael
  move villager Raphael 17,9,down
  wait for Curupira
  move villager Curupira 15,11,up
  wait for Raphael
  move villager Raphael 17,11,left
  wait for Curupira
  move villager Curupira 15,9,right

  wait for Raphael
  move villager Raphael 15,11,up
  wait for Curupira
  move villager Curupira 17,9,down
  wait for Raphael
  move villager Raphael 15,9,right
  wait for Curupira
  move villager Curupira 17,11,left

  move villager Player 15,9,down

  wait for Raphael
  move villager Raphael 17,9,down
  wait for Curupira
  move villager Curupira 15,11,up
  wait for Raphael
  move villager Raphael 17,11,left
  wait for Curupira
  move villager Curupira 15,10,up
  wait for Raphael
  move villager Raphael 15,11,up

  Curupira "<!:async>"
  js Managers.Villagers.jump('Curupira')
  wait 15
  js Managers.Villagers.jump('Curupira')
  wait 10

  js Engine.Audio.fadeOutBgm(1);

  turn Curupira down
  wait 10
  js Managers.Villagers.jump('Curupira')
  wait 15
  js Managers.Villagers.jump('Curupira')
  wait 10

  turn Curupira up
  wait 10

  speed Player restore

  wait 30
  Curupira "<wait>Humans were fast<wait><wait><BR>But Curupira has magic<wait><wait><BR>State what you want<wait><wait><BR>Or your fate will be tragic."

  refresh bgm
  wait 15

  Player "We just want to ask you why you put a spell on this forest."
  Curupira "<wait>When animals are mating<wait><wait><BR>Young ones will spawn<wait><wait><BR>If birdbrains come hunting<wait><wait><BR>Their families are done."
  Raphael "So you did this to protect the animals for mating season?"
  Player "That's understandable."
  Raphael "And when do you think you'll be able to lift this spell?"

  if Managers.Time.totalDays < 62
    Curupira "<wait>When the leaves turn yellow<wait><wait><BR>When the grapes become blue<wait><wait><BR>Young animals are mellow<wait><wait><BR>I'll lift it for you."
    Raphael "When the leaves turn yellow?"
    Player "And the grapes become blue. Do you mean in autumn?"
    Raphael "I guess we will have to wait until then."
  else
    Curupira "<wait>Animals have grown<wait><wait><BR>The new birds are flying<wait><wait><BR>The old spell is gone<wait><wait><BR>I swear I'm not lying."
    Raphael "So the animals have already grown. Does this mean we can cross the forest now?"
    Player "That is great. Thank you, Curupira."
    switch forestSpellLifted ON
  end

  Curupira "<wait>Curupira is done here<wait><wait><BR>Take cachaça and leave<wait><wait><BR>If humans hunt animals<wait><wait><BR>A curse I'll conceive."
  switch talkedToCurupira ON

  move villager Curupira 8,10,up
  wait 20
  turn Player left
  turn Raphael left

  wait for Curupira
  move villager Curupira 8,8,up
  wait for Curupira
  wait 20
  js window.cachacaEvent.erase();
  wait 20
  move villager Curupira 13,8,right
  wait for Curupira
  turn Player up
  turn Raphael up
  move villager Curupira 18,8,right
  wait for Curupira
  turn Player right
  turn Raphael right 
  move villager Curupira 32,8,right
  wait for Curupira
  remove villager Curupira

  wait 30

  turn Player down
  turn Raphael up

  wait 30
  Raphael "I guess we are done here."
  Player "Yeah, let's go back."
  
  wait 30

  move villager Player 0,9,left
  move villager Raphael 0,11,left
  speed Player 3
  speed Raphael 3

  wait 60

  fade out
  wait 30
  switch hideFollowers OFF
  js $gamePlayer.reserveTransfer(Maps.FOREST, 78, 60, Direction.LEFT, 0, true);

  wait 1
  end cutscene
  fade in

  js Managers.Relationship.markCharacterAsKnown('Curupira')
  complete curupira-task-5

:mailbox_raphael_forest_spell_lifted
  switch needsRaphaelLetterAboutForest OFF
  play child read_raphael_forest_spell_lifted

:read_raphael_forest_spell_lifted
  Letter "From: Raphael<BR><BR>Hey <name>, remember what the Curupira said about lifting the forest spell on autumun? It looks like he kept his word. I went to the forest today and finally managed to cross it."
