Last Item ID
dragonbane Jan 2nd, 2020 (edited) 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Last Item ID: 0x8040B177 (0 on initial game boot, not reset by softreset)
- Exclusively read by: 0x8011a8f0 d_a_alink::daAlink_c::procCoGetItemInit (only triggered when int(Link + 0x60c) = 0x100)
- When called with int(Link + 0x60c) = 0x100, procCoGetItemInit uses the Last Item ID to spawn the item Link will receive via f_op_actor_mng::fopAcM_createItemForPresentDemo
- fopAcM_createItemForPresentDemo calls d_event::dEvt_control_c::setGtItm which stores the received item ID back in 0x8040B177
- d_event::dEvt_control_c::setGtItm is called by fopAcM_createItemForPresentDemo and fopAcM_createItemForTrBoxDemo
- procCoGetItemInit is scheduled by the dialog text via daAlink_c::execute ---> daAlink_c::checkDemoAction
- Only in the rare case of int(Link + 0x60c) = 0x100 instead of 0x00 (only some NPCs and situations where Link goes from still to holding an item asap) procCoGetItemInit makes use of the Last Item ID in a read sense.
- fopAcM_createItemForPresentDemo or fopAcM_createItemForTrBoxDemo is always used first and then procCoGetItemInit is usually used to trigger the holding animation of Link and starting the created event. But some situations create a feedback loop by setting the item ID first by creating the event with fopAcM_createItemForPresentDemo and then scheduling it again from procCoGetItemInit because int(Link + 0x60c) = 0x100
- Auro break skips fopAcM_createItemForPresentDemo, but still schedules Link's animation and because int(Link + 0x60c) = 0x100, it will use the last item ID instead to also schedule the event. int(Link + 0x60c) = 0x100 is an integer value coming from the event_data for this cutscene. Set by 0x8011789c daAlink_c::setDemoData
- -An event_data driven cutscene (like Auro initial cinematic) that triggers an get_item command with the item ID 0x100 (256) which orders Link to get the last item ID as the item instead as an override via procCoGetItemInit
- -Need to hit this point in the cinematic while skipping over any fopAcM_createItemForPresentDemo calls that can set the last item ID value properly as intended. This is done by skipping over the text that triggers this function via NPC callback
RAW Paste Data