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(64, 64, 7, 7, 52, 52, ExitArea_Enter)

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

  ac = AddActor_MTStopped("MgShopper", 31, 34, 0, [A_OldMan], ActorMotion.Down, Nothing)
  ac = AddStaticActor("MgShopperEve", 31, 35, 10, [A_Null], MgShopperEve_Contact)

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

  ac = AddActor_MTStopped("InnFront", 22, 23, 0, [A_Man], ActorMotion.Down, Nothing)
  ac = AddStaticActor("InnFrontEve", 22, 24, 10, [A_Null], InnFrontEve_Contact)

  ac = AddActor_MTStopped("DrugStore", 47, 45, 0, [A_Woman], ActorMotion.Down, Nothing)
  ac = AddStaticActor("DrugStoreEve", 47, 46, 10, [A_Null], DrugStoreEve_Contact)
  
  ac = AddActor_MTZonedRandom("Towner1", 35, 12, 0, _
    32, 10, 0, 38, 14, 0, [A_Man], Towner1_Contact)
  
  ac = AddActor_MTZonedRandom("Towner2", 47, 23, 0, _
    44, 21, 0, 50, 25, 0, [A_OldMan], Towner2_Contact)
    
  DoInsideWarp(startAt, SetEntranceEx({41, 16, 0}, {41, 52, 0}, {22, 29, 0}, {52, 29, 0}), False)
  
  ChangeBGM(Music.Town)
  PutAreaNameLabel()

  NotifyEntered()
  Idle(ProcessInput)
  NotifyExiting()

End Procedure

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

Procedure EqShopperEve_Contact()
  DoShop({[SteelSword], [BastardSword], [IronArmor], [SteelArmor], [IronShield], [SteelShield], [IronHelmet], [SteelHelmet]})
End Procedure

Procedure MgShopperEve_Contact()
  DoMagicShop({[CureAll], [Elec1], [AgiUp], [AgiDown], [Paralyze], [Blink], [Heal2], [Fire2], [Cold2], [Confuse], [PhysDPUp], [PhysDPDown]})
End Procedure

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

Procedure InnFrontEve_Contact()
  DoInn(50)
End Procedure

Procedure DrugStoreEve_Contact()
  Dim p_name = [TheHero].Name + "："
  Dim q_name = "薬師："
  If TestFlag("Enkera_1") Then
    DoShop({[Heal_T3], [MPHeal_T]})
  Else
    DoMsg(q_name, "いらっしゃいませ")
    DoMsg(p_name, "ここは薬屋さんですか？")
    DoMsg(q_name, "はい　そうです　どのような症状で？")
    DoMsg(p_name, "いや　" + [Movsin].Name + "という薬を頼まれまして")
    If DoYesNoMsg(q_name, [Movsin].Name + "ですか　それでしたら", _
      MoneyStr([Movsin].Price) + "になります") Then
      If PayMoney([Movsin].Price) Then
        DoMsg(q_name, "ちょうど最後の一個だったんです", _
          "いい時に来ましたね")
        Sleep(500)
        DoMsg(q_name, "これは２１包で１週間分です", _
          "毎食前に服用してください", _
          "間違っても　一気に飲まないでくださいね")
        DoMsg(q_name, "うちではいい傷薬を扱っていますから", _
          "ご入用になりましたら　またお越しください")
        GiveUsTool([Movsin])
        SetFlag("Enkera_1")
      Else
        DoMsg(p_name, "ちょっと今　手持ちがないので", _
          "また来ます")
      End If
    End If
  End If
End Procedure

Procedure Towner1_Contact()
  DoMsg("海岸沿いに北上すればメノームだ")
End Procedure

Procedure Towner2_Contact()
  DoMsg("砂漠が少しずつ広がりつつある", _
    "この世界も終わりかのう")
End Procedure
