return function(mod) local blocks = {} for i = 1, 30 do blocks[i] = 10 end blocks[8], blocks[9] = 11, 11 local pallet = mod.content.maps:get("PALLET_TOWN") local palletBlocks = {} for i, block in ipairs(pallet.blocks) do palletBlocks[i] = block end palletBlocks[7 * pallet.width] = 10 mod.content.maps:register("TUTORIAL_ROUTE", { id = "TUTORIAL_ROUTE", label = "TutorialRoute", index = 1000, tileset = "OVERWORLD", width = 6, height = 5, blocks = blocks, borderBlock = 10, connections = { west = { map = "PALLET_TOWN", offset = -2 } }, objects = { { index = 91, x = 4, y = 2, sprite = "SPRITE_POKE_BALL", movement = "STAY", range = "NONE", item = "NUGGET", text = "TEXT_TUTORIAL_NUGGET", name = "TUTORIAL_ROUTE_NUGGET", }, }, }) mod.content.maps:patch("PALLET_TOWN", { connections = { east = { map = "TUTORIAL_ROUTE", offset = 2 } }, blocks = palletBlocks, objects = { __append = { { index = 90, x = 8, y = 7, sprite = "SPRITE_BEAUTY", movement = "STAY", range = "NONE", text = "TEXT_TUTORIAL_WORLD", name = "TUTORIAL_WORLD_NPC", }, { index = 92, x = 12, y = 8, sprite = "SPRITE_SCIENTIST", movement = "STAY", range = "NONE", text = "TEXT_TUTORIAL_QUEST", name = "TUTORIAL_QUEST_GIVER", }, } }, }) mod.content.encounters:register("TUTORIAL_ROUTE", { grass = { rate = 25, slots = { { species = "PIDGEY", level = 3 }, { species = "RATTATA", level = 3 }, { species = "PIDGEY", level = 4 }, { species = "RATTATA", level = 4 }, { species = "PIDGEY", level = 5 }, { species = "RATTATA", level = 5 }, { species = "PIDGEY", level = 3 }, { species = "RATTATA", level = 3 }, { species = "PIDGEY", level = 6 }, { species = "RATTATA", level = 6 }, } }, }) mod.content.map_scripts:register("PALLET_TOWN", { talk = { TEXT_TUTORIAL_WORLD = { { "face_player" }, { "show_text", "Welcome to the\nTutorial World!" }, }, TEXT_TUTORIAL_QUEST = { { "check_flag", "mod:done" }, { "jump_if_true", "thanks" }, { "check_flag", "mod:stage" }, { "jump_if_true", "pending" }, { "set_field", "mod:stage", true }, { "show_text", "Please bring me\na NUGGET." }, { "jump", "end" }, { "label", "pending" }, { "check_item", "NUGGET" }, { "jump_if_false", "wait" }, { "take_item", "NUGGET", 1 }, { "set_field", "mod:done", true }, { "show_text", "Quest complete!" }, { "jump", "end" }, { "label", "wait" }, { "show_text", "The NUGGET is on\nTUTORIAL ROUTE." }, { "jump", "end" }, { "label", "thanks" }, { "show_text", "Thanks again!" }, { "label", "end" }, }, }, }) end