scoreboard objectives add s-intro dummy
scoreboard players add @a[scores={s-intro=0..},tag=!stop_sequence] s-intro 1

execute as @p[scores={s-intro=0..}] run scoreboard players operation @a s-intro = @s s-intro

scoreboard objectives add pointer_id dummy
scoreboard players add @e[type=eternal:pointer] pointer_id 0
execute as @p[scores={s-intro=0..}] as @e[type=eternal:pointer,scores={pointer_id=0}] at @s run scoreboard players operation @s pointer_id = @p id
execute as @p[scores={s-intro=0..}] as @e[type=eternal:pointer] at @s if score @s pointer_id = @p id at @p positioned ^^2.5^3 run teleport @s ~~~ 


execute as @p[scores={s-intro=1}] run tag @a remove intro_title
execute as @p[scores={s-intro=1}] run tag @a remove music_intro
execute as @p[scores={s-intro=1}] run event entity @e[type=eternal:theia_guide] e:add-instant_despawn
execute as @p[scores={s-intro=1}] run summon eternal:theia_guide "Guide" -62 103 -419
execute as @p[scores={s-intro=1}] as @e[type=eternal:theia_guide] run teleport @s -62 103 -419 facing -62 103 -420
execute as @p[scores={s-intro=1}] run event entity @e[type=eternal:pointer] e:add-instant_despawn
execute as @p[scores={s-intro=1}] as @a at @s run summon eternal:pointer ~ ~ ~
execute as @p[scores={s-intro=1}] run fill -63 106 -414 -64 108 -414 minecraft:barrier []
execute as @p[scores={s-intro=1}] run fill -64 106 -412 -63 108 -412 minecraft:barrier []
execute as @p[scores={s-intro=1}] run tickingarea add circle -63 105 -413 4 portal_1
execute as @p[scores={s-intro=1}] run tickingarea add circle 50003 95 -11 4 portal_2


execute as @p[scores={s-intro=2}] run tag @a add stop_sequence
execute as @p[scores={s-intro=2}] run dialogue change @e[type=eternal:theia_guide,c=1] eternal.guide_ui.dialogue1 @a

execute as @p[scores={s-intro=2..24}] run title @a actionbar §gTalk to the §dGuide
execute as @p[scores={s-intro=2..24}] as @e[type=eternal:pointer] at @s run teleport @s ~~~ facing -62 104 -419

execute as @p[scores={s-intro=13}] run dialogue change @e[type=eternal:theia_guide,c=1] eternal.guide_ui.dialogue2 @a
execute as @p[scores={s-intro=13}] run dialogue open @e[type=eternal:theia_guide,c=1] @a eternal.guide_ui.dialogue2
execute as @p[scores={s-intro=14}] run tag @a add stop_sequence

execute as @p[scores={s-intro=23}] run dialogue change @e[type=eternal:theia_guide,c=1] eternal.guide_ui.dialogue3 @a
execute as @p[scores={s-intro=23}] run dialogue open @e[type=eternal:theia_guide,c=1] @a eternal.guide_ui.dialogue3

execute as @p[scores={s-intro=24}] run tag @a add stop_sequence

execute as @p[scores={s-intro=25}] run fill -63 106 -414 -64 108 -414 minecraft:air []
execute as @p[scores={s-intro=25}] run fill -64 106 -412 -63 108 -412 minecraft:air []
execute as @p[scores={s-intro=25}] run event entity @e[type=eternal:pointer] e:add-instant_despawn
execute as @p[scores={s-intro=25}] as @a at @s run summon eternal:pointer ~ ~ ~

execute as @p[scores={s-intro=26}] run tag @a add stop_sequence
execute as @p[scores={s-intro=26}] as @e[type=eternal:pointer] at @s run teleport @s ~~~ facing -63 107 -413
execute as @p[scores={s-intro=26},tag=!teleporting] run title @a actionbar §gGet in the §dTheia portal
execute as @p[scores={s-intro=26},tag=teleporting] run title @a actionbar eternal.actionbar.hide
execute as @p[scores={s-intro=26},tag=finished_teleporting] run title @a actionbar eternal.actionbar.hide
execute as @p[scores={s-intro=731}] run tag @a remove stop_sequence
execute as @p[scores={s-intro=731}] run tag @a add intro_title

execute as @p[scores={s-intro=732}] run tag @a add stop_sequence

execute as @p[scores={s-intro=732}] run dialogue change @e[type=eternal:theia_guide,c=1] eternal.guide_ui.dialogue4 @a
execute as @p[scores={s-intro=732}] as @s[x=-67,y=105,z=-414,dx=7,dy=0,dz=-2] run tag @s remove stop_sequence
execute as @p[scores={s-intro=732}] as @s[x=-67,y=105,z=-414,dx=7,dy=0,dz=-2] run scoreboard players set @s s-intro 24
execute as @p[scores={s-intro=732}] run title @a actionbar §gTalk to the §dGuide
execute as @p[scores={s-intro=732}] as @e[type=eternal:pointer] at @s run teleport @s ~~~ facing 50003 96 -11

execute as @p[scores={s-intro=733}] run dialogue change @e[type=eternal:theia_guide,c=1] eternal.guide_ui.dialogue5 @a
execute as @p[scores={s-intro=733}] run dialogue open @e[type=eternal:theia_guide,c=1] @a eternal.guide_ui.dialogue5
execute as @p[scores={s-intro=734}] run tag @a add stop_sequence

execute as @p[scores={s-intro=740}] run event entity @e[type=eternal:pointer] e:add-instant_despawn
execute as @p[scores={s-intro=740}] as @a at @s run structure load "eternal/guide_book" ~~~
execute as @p[scores={s-intro=740..748}] as @a at @s run teleport @e[type=minecraft:item,r=5] @s

execute as @p[scores={s-intro=743}] as @a run give @s eternal:theia_map 1 0 { "item_lock": { "mode": "lock_in_inventory" }, "keep_on_death": {} }

execute as @p[scores={s-intro=746}] as @a at @s run playsound random.achievement2

execute as @p[scores={s-intro=747}] run tag @a add stop_sequence
execute as @p[scores={s-intro=747}] as @e[type=eternal:theia_guide] at @s unless entity @a[r=20] run tag @a remove stop_sequence

execute as @p[scores={s-intro=748}] run event entity @e[type=eternal:theia_guide] e:add-instant_despawn
# execute as @p[scores={s-intro=748}] run tag @a remove intro_title
execute as @p[scores={s-intro=748}] run tickingarea remove portal_1
execute as @p[scores={s-intro=748}] run tickingarea remove portal_2
execute as @p[scores={s-intro=748}] run scoreboard objectives remove s-intro