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, 1, 7, 41, 52, ExitArea_Enter)

  If Not TestFlag("SouthEvo") Then
    ac = AddActor_MTStopped("EqShopper", 11, 22, 0, [A_Man], ActorMotion.Down, Nothing)
    ac = AddStaticActor("EqShopperEve", 11, 23, 10, [A_Null], EqShopperEve_Contact)

    ac = AddActor_MTStopped("MgShopper", 13, 22, 0, [A_OldMan], ActorMotion.Down, Nothing)
    ac = AddStaticActor("MgShopperEve", 13, 23, 10, [A_Null], MgShopperEve_Contact)

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

    ac = AddActor_MTStopped("InnFront", 4, 11, 0, [A_Man], ActorMotion.Down, Nothing)
    ac = AddStaticActor("InnFrontEve", 4, 12, 10, [A_Null], InnFrontEve_Contact)
    
    ac = AddActor_MTZonedRandom("Towner1", 17, 34, 0, _
      14, 32, 0, 20, 36, 0, [A_Man], Towner1_Contact)
      
    ac = AddActor_MTZonedRandom("Towner2", 6, 45, 0, _
      3, 43, 0, 9, 47, 0, [A_OldMan], Towner2_Contact)
  Else
    SetStepsOfMaterial(4, 20)
    ResetStepsForEncountering()
    AddZone("EncZone01", 0, 0, 0, 63, 63, 0)
    RegisterEventHandler("EncZone01Step", EncZone01_Step)
  End If
  
  DoInsideWarp(startAt, SetEntranceEx({23, 7, 0}, {23, 52, 0}, {1, 18, 0}, {24, 18, 0}), False)
  
  If Not TestFlag("SouthEvo") Then
    ChangeBGM(Music.Town)
  Else
    ChangeBGM(Music.Tower)
  End If
  PutAreaNameLabel()

  NotifyEntered()
  Idle(ProcessInput)
  NotifyExiting()

End Procedure

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

Procedure EqShopperEve_Contact()
  DoShop({[BastardSword], [Katana], [SteelArmor], [TitanArmor], [SteelShield], [TitanShield], [SteelHelmet], [TitanHelmet]})
End Procedure

Procedure MgShopperEve_Contact()
  DoMagicShop({[Heal2], [Fire2], [Cold2], [Confuse], [PhysDPUp], [PhysDPDown], [HealAll1], [Revive1], [Elec2], [StrUp], [StrDown], [ColdDPUp]})
End Procedure

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

Procedure InnFrontEve_Contact()
  DoInn(100)
End Procedure

Procedure Towner1_Contact()
  DoMsg("海岸を西に進めば　国境の峠がある")
End Procedure

Procedure Towner2_Contact()
  DoMsg("最近不漁でのう……")
End Procedure

Procedure EncZone01_Step(mat)
  If TestEncountering(mat) Then
    Dim ep = CreateList()
    ep.Add({[E021], [E021]})
    ep.Add({[E112], [E112]})
    ep.Add({[E203], [E203], [E203]})
    ep.Add({[E203], [E204]})
    ep.Add({[E203], [E203], [E204]})
    ep.Add({[E204], [E204]})
    DoNormalBattle(ep)
    ResetStepsForEncountering()
  End If
End Procedure
