ShoalCave_LowTideEntranceRoom_MapScripts:: map_script MAP_SCRIPT_ON_TRANSITION, ShoalCave_LowTideEntranceRoom_OnTransition .byte 0 ShoalCave_LowTideEntranceRoom_OnTransition: special UpdateShoalTideFlag goto_if_set FLAG_SYS_SHOAL_TIDE, ShoalCave_LowTideEntranceRoom_EventScript_SetHighTide goto ShoalCave_LowTideEntranceRoom_EventScript_SetLowTide ShoalCave_LowTideEntranceRoom_EventScript_SetHighTide:: setmaplayoutindex LAYOUT_SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM end ShoalCave_LowTideEntranceRoom_EventScript_SetLowTide:: setmaplayoutindex LAYOUT_SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM end ShoalCave_LowTideEntranceRoom_EventScript_ShellBellExpert:: lock faceplayer dotimebasedevents call_if_set FLAG_SYS_SHOAL_ITEM, ShoalCave_LowTideEntranceRoom_EventScript_ResetShoalItems checkitem ITEM_SHOAL_SALT, 4 compare VAR_RESULT, FALSE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells checkitem ITEM_SHOAL_SHELL, 4 compare VAR_RESULT, FALSE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells msgbox ShoalCave_LowTideEntranceRoom_Text_WouldYouLikeShellBell, MSGBOX_YESNO compare VAR_RESULT, NO goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell checkitemspace ITEM_SHELL_BELL, 1 compare VAR_RESULT, FALSE call_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed compare VAR_RESULT, 2 goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell msgbox ShoalCave_LowTideEntranceRoom_Text_MakeShellBellRightAway, MSGBOX_DEFAULT removeitem ITEM_SHOAL_SALT, 4 removeitem ITEM_SHOAL_SHELL, 4 giveitem ITEM_SHELL_BELL compare VAR_RESULT, FALSE goto_if_eq Common_EventScript_ShowBagIsFull msgbox ShoalCave_LowTideEntranceRoom_Text_ExplainShellBell, MSGBOX_DEFAULT setflag FLAG_TEMP_2 release end @ If the bag is full, check if a slot will be freed when 4 Shoal Salt or Shells are given ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed:: checkitem ITEM_SHOAL_SALT, 5 compare VAR_RESULT, TRUE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells return ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells:: checkitem ITEM_SHOAL_SHELL, 5 compare VAR_RESULT, TRUE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed return ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed:: setvar VAR_RESULT, 2 return ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell:: msgbox ShoalCave_LowTideEntranceRoom_Text_NoSpaceInYourBag, MSGBOX_DEFAULT release end ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells:: checkitem ITEM_SHOAL_SALT, 1 compare VAR_RESULT, TRUE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell checkitem ITEM_SHOAL_SHELL, 1 compare VAR_RESULT, TRUE goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell msgbox ShoalCave_LowTideEntranceRoom_Text_AreYouPlanningOnGoingInThere, MSGBOX_DEFAULT release end ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell:: msgbox ShoalCave_LowTideEntranceRoom_Text_BringMe4ShoalSaltAndShells, MSGBOX_DEFAULT release end ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell:: msgbox ShoalCave_LowTideEntranceRoom_Text_WantedToMakeShellBell, MSGBOX_DEFAULT release end ShoalCave_LowTideEntranceRoom_EventScript_ResetShoalItems:: clearflag FLAG_RECEIVED_SHOAL_SALT_1 clearflag FLAG_RECEIVED_SHOAL_SALT_2 clearflag FLAG_RECEIVED_SHOAL_SALT_3 clearflag FLAG_RECEIVED_SHOAL_SALT_4 clearflag FLAG_RECEIVED_SHOAL_SHELL_1 clearflag FLAG_RECEIVED_SHOAL_SHELL_2 clearflag FLAG_RECEIVED_SHOAL_SHELL_3 clearflag FLAG_RECEIVED_SHOAL_SHELL_4 clearflag FLAG_SYS_SHOAL_ITEM return