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)

  If Not TestFlag("EastEvo") Then
    ac = AddActor_MTStopped("EqShopper", 34, 28, 0, [A_Man], ActorMotion.Down, Nothing)
    ac = AddStaticActor("EqShopperEve", 34, 29, 10, [A_Null], EqShopperEve_Contact)

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

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

    ac = AddActor_MTStopped("InnFront", 27, 17, 0, [A_Man], ActorMotion.Down, Nothing)
    ac = AddStaticActor("InnFrontEve", 27, 18, 10, [A_Null], InnFrontEve_Contact)
    
    ac = AddActor_MTZonedRandom("Towner1", 6, 9, 0, _
      3, 7, 0, 9, 11, 0, [A_Man], Towner1_Contact)
    
    ac = AddActor_MTZonedRandom("Towner2", 6, 32, 0, _
      3, 30, 0, 9, 34, 0, [A_Woman], Towner2_Contact)
  Else
    SetStepsOfMaterial(4, 20)
    ResetStepsForEncountering()
    AddZone("EncZone01", 0, 0, 0, 47, 47, 0)
    RegisterEventHandler("EncZone01Step", EncZone01_Step)
  End If

  DoInsideWarp(startAt, SetEntranceEx({12, 1, 0}, {24, 46, 0}, {1, 23, 0}, {46, 23, 0}), False)
  
  If Not TestFlag("EastEvo") 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({[IronSword], [SteelSword], [BronzeArmor], [IronArmor], [BronzeShield], [IronShield], [BronzeHelmet], [IronHelmet]})
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(25)
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({[E012], [E012]})
    ep.Add({[E106], [E106]})
    ep.Add({[E201], [E201], [E201]})
    ep.Add({[E201], [E202]})
    ep.Add({[E201], [E201], [E202]})
    ep.Add({[E202], [E202]})
    DoNormalBattle(ep)
    ResetStepsForEncountering()
  End If
End Procedure
