
Jmpi_= R83, 00000003, 254 // If Register 83 is equal to 3 (ultimate difficulty), jump to function 254. Jmpi_= R83, 00000002, 253 // If Register 83 is equal to 2 (very hard difficulty), jump to function 253.

Jmpi_= R83, 00000001, 252 // If Register 83 is equal to 1 (hard difficulty), jump to function 252.

This runs when you talk to the guild lady after the quest is clear.Ģ50: jmpi_= R83, 00000000, 251 // If Register 83 is equal to 0 (normal difficulty), jump to function 251. Let's take the quest success function (250) as an example. Registers are used to make the script jump to other functions depending on how they are set, causing different events if you've done something in the quest which causes a register to be set.

When a quest starts, every single Register is set to 0 (and therefore does not actually exist, apart from certain reserved registers) and can be changed throughout the script. Registers are like containers that hold certain numbers inside them. You MUST remember to use ret when you want the script to stop, otherwise you might cause a lot of unwanted things to happen. However, if a function is called using the call OPCode, it will return back to the function that called it. Once the script starts, it will never stop (the function numbers are more like bookmarks than separate scripts) until it hits a ret. Ret is the OPCode (these are the strings of text) that stops the script from running, in most cases. Get_difflvl2 R83 // Store the difficulty level in Register 83 (0 = Normal, 1 = Hard, 2 = Very Hard, 3 = Ultimate) (3rd byte is unknown)īB_Map_Designate 01, 0001, 00, 01 // Set Floor 1 (Forest 1) to be Map 1 (Forest 1) and Variant 1.īB_Map_Designate 02, 0002, 00, 01 // Set Floor 2 (Forest 2) to be Map 2 (Forest 2) and Variant 1. Set_qt_success 250 // When Register 255 is set (more on that later, but basically when the quest is clear), run Function 250 when talking to the guild lady.īB_Map_Designate 00, 0000, 00, 00 // Set Floor 0 (Pioneer 2) to be Map 0 (Pioneer 2) and Variant 0. Set_floor_handler 00000002, 152 // Whenever Floor 2 (Forest 2) is entered, run Function 152. Set_floor_handler 00000001, 151 // Whenever Floor 1 (Forest 1) is entered, run Function 151. Set_floor_handler 00000000, 150 // Whenever Floor 0 (Pioneer 2) is entered, run Function 150. (This is not actually in the script as the quest is from V1/2, which didn't have episodes, but let's pretend it is) Outside of simple object placing and progressing through a map of monster waves, the script does everything else.Ġ: set_episode 00000000 // Sets the quest to Episode 1. Now that you (hopefully) know how monsters, objects and map events work, it's time to look at the complicated part of the quest file, the script.įor the quest to actually work, it needs a script to run, so that it knows what maps to define, when to run cutscenes, when to know that the quest is cleared, what NPCs will say, etc. (note that any door with ID -1 will always be unlocked)

Place your monsters, set their waves and write events to make sure the waves are processed accordingly, and unlock doors after certain waves are cleared. Wave 1 will be called, then after Wave 1 is finished, call Wave 2, then after Wave 2 is finished, call Wave 3, then after Wave 3 is finished, unlock doors 4, 5 and 6.įor the meat of the quest, this is all you have to do. Unlock 6 // After the wave is cleared, doors with Door ID 6 will be unlocked. Unlock 5 // After the wave is cleared, doors with Door ID 5 will be unlocked. Unlock 4 // After the wave is cleared, doors with Door ID 4 will be unlocked. #1112 // Calls Wave 3 in Map Section 11, with a delay of 50 frames after the event is called. #1111 // Calls Wave 2 in Map Section 11, with a delay of 50 frames after the event is called.Ĭall 1112 // After the wave is cleared, event 1112 will run. #111 // Calls Wave 1 in Map Section 11, with a delay of 50 frames after the event is called.Ĭall 1111 // After the wave is cleared, event 1111 will run.
