Reference
  Area\Util.txt
  Util\Audio.txt
  Util\Party.txt
  Area\Service.txt
  Util\CommonDialog.txt
End Reference

Procedure Main(startAt)

  Dim ac = Nothing

  RegisterCommonEventHandlers()

  SetZoneOfTown(48, 48, 1, 1, 46, 46, ExitArea_Enter)

  ac = AddActor_MTStopped("EqShopper", 34, 16, 0, [A_Man], ActorMotion.Down, Nothing)
  ac = AddStaticActor("EqShopperEve", 34, 17, 10, [A_Null], EqShopperEve_Contact)

  ac = AddActor_MTStopped("MgShopper", 36, 16, 0, [A_OldMan], ActorMotion.Down, Nothing)
  ac = AddStaticActor("MgShopperEve", 36, 17, 10, [A_Null], MgShopperEve_Contact)

  ac = AddActor_MTStopped("GdShopper", 29, 5, 0, [A_Woman], ActorMotion.Down, Nothing)
  ac = AddStaticActor("GdShopperEve", 29, 6, 10, [A_Null], GdShopperEve_Contact)

  ac = AddActor_MTStopped("InnFront", 27, 5, 0, [A_Man], ActorMotion.Down, Nothing)
  ac = AddStaticActor("InnFrontEve", 27, 6, 10, [A_Null], InnFrontEve_Contact)
  
  ac = AddActor_MTZonedRandom("BoatMan", 17, 17, 0, _
    14, 15, 0, 20, 19, 0, [A_Man], BoatMan_Contact)
  
  ac = AddActor_MTZonedRandom("Towner1", 30, 28, 0, _
    27, 26, 0, 33, 30, 0, [A_Soldier], Towner1_Contact)
    
  ac = AddActor_MTZonedRandom("Towner2", 30, 39, 0, _
    27, 36, 0, 33, 42, 0, [A_Woman], Towner2_Contact)
    
  DoInsideWarp(startAt, SetEntranceEx({24, 1, 0}, {24, 46, 0}, {1, 35, 0}, {46, 12, 0}), False)
  
  ChangeBGM(Music.Town)
  PutAreaNameLabel()

  NotifyEntered()
  Idle(ProcessInput)
  NotifyExiting()

End Procedure

Procedure ExitArea_Enter()
  BeginOutsideWarp([Field], GetAreaObject().Tag)
End Procedure

Procedure EqShopperEve_Contact()
  If TestFlag("WestEvo") AndAlso Not TestFlag("Medrod_1") Then
    DoShop({[SonicBoom], [ZirconArmor], [CarbonArmor], [ZirconShield], [CarbonShield], [ZirconHelmet], [CarbonHelmet]})
  Else
    DoShop({[SonicBoom], [DragonTail], [ZirconArmor], [CarbonArmor], [ZirconShield], [CarbonShield], [ZirconHelmet], [CarbonHelmet]})
  End If
End Procedure

Procedure MgShopperEve_Contact()
  DoMagicShop({[Heal3], [Fire3], [IntUp], [IntDown], [Berserk], [FireDPUp], [HealAll2], [Cold3], [Elec3], [Charm], [ElecDPUp], [Revive2]})
End Procedure

Procedure GdShopperEve_Contact()
  DoShop({[Heal_T1], [Heal_T2], [CureAll_T], [Revive_T]})
End Procedure

Procedure InnFrontEve_Contact()
  DoInn(330)
End Procedure

Procedure BoatMan_Contact()
  If TestFlag("Serebe_3") Then
    DoMsg("必要になったら湖の岸に来てくれ", _
      "あんたならタダで乗せてやるよ")
  ElseIf TestFlag("Serebe_2") Then
    DoMsg("本当に倒しちまったのかい！", _
      "おどろいたな")
    DoMsg("まあ　これでまたボートを出せる", _
      "ありがとうよ")
    DoMsg("必要になったら湖の岸に来てくれ", _
      "あんたならタダで乗せてやるよ")
    SetFlag("Serebe_3")
  Else
    DoMsg("ほー　サマオリアから来たのかい", _
      "ずいぶん　遠回りだったろう")
    DoMsg("昔は南の大きな湖をボートで渡って", _
      "メノーム方面に行けたんだが", _
      "邪竜が岸辺に住み着いたんで", _
      "ボートを出せなくなってしまった", _
      "危ないから近づかないほうがいいぞ", _
      "倒せるんなら　別だがな")
    SetFlag("Serebe_1")
  End If
End Procedure

Procedure Towner1_Contact()
  DoMsg("南の大きな湖のほとりに", _
    "ミシキントという町がある", _
    "この自治区の中心都市だ")
End Procedure

Procedure Towner2_Contact()
  DoMsg("昔　ヨムシクルにいた魔法使いは", _
    "空間を操る魔法を知っていたみたい", _
    "お店では売ってないようだし", _
    "結構難しい魔法なのかも知れないわね")
End Procedure
