execute at @n[nbt={Item:{components:{"minecraft:custom_data":{curse_book:tag}}}}] run function survivalplus:giant_deal/convert/converteffect
execute at @n[nbt={Item:{components:{"minecraft:custom_data":{curse_book:tag}}}}] run summon item ~ ~ ~ {PickupDelay:40s,Glowing:1b,Tags:[itemguard,special],CustomName:{"text":"Choose from a list of strong abilites","color": "yellow"},CustomNameVisible:1b,NoGravity:1b,Item:{id:"minecraft:written_book",components:{"minecraft:custom_data":{devil_deal:tag,takebook:tag,nodupe:tag},"minecraft:written_book_content":{pages:[[["",{"text":"Damage Reduction","color":"blue","click_event":{"action":"run_command","command":"/trigger titanmenu set 1"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\n-4 damage per hit\n\nApplies to all players","color":"reset"}]],[["",{"text":"+20 Max HP","color":"blue","click_event":{"action":"run_command","command":"/trigger titanmenu set 2"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nA second health bar\n\nApplies to all players","color":"reset"}]],[["",{"text":"Crits","color":"blue","click_event":{"action":"run_command","command":"/trigger titanmenu set 3"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nGain a 10% chance to deal +100% damage on hit\n\nApplies to all players","color":"reset"}]],[["",{"text":"Defbuff Imbued","color":"blue","click_event":{"action":"run_command","command":"/trigger titanmenu set 4"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nImbue attacks with weakness and slowness for 5 seconds\n\nApplies to all players","color":"reset"}]],[["",{"text":"Stronger Souls","color":"blue","click_event":{"action":"run_command","command":"/trigger titanmenu set 9"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nXp orbs grant more experience"}]]],title:"Option Book",author:Titan,generation:3}}}}
kill @n[nbt={Item:{components:{"minecraft:custom_data":{curse_book:tag}}}}]
tag @p add titans_gambit
tellraw @a[tag=titans_gambit] {"text":"Choose...","italic":true,"color":"gray"}