Jump to content

Search Item Extended Headers for Opcode


Recommended Posts

I have code that will search all spells' extended headers for a specific opcode and output it - how do I do the same for item extended headers? (e): Wait, would it literally just be change "SPL_V10_HEADERS" to "ITM_V10 HEADERS" plus change the file type to .itm instead of .spl? ... (e): Yes, yes it would be - okay, well, never mind that - read the question below instead, :p.

COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ override // remove spellstates
  GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS
  PHP_EACH ab_array AS int => ab_off BEGIN
    GET_OFFSET_ARRAY2 fx_array ab_off ITM_V10_HEAD_EFFECTS
    PHP_EACH fx_array AS int => fx_off BEGIN
      READ_SHORT fx_off fx_type
      PATCH_IF fx_type = 49 BEGIN
        PATCH_PRINT "%SOURCE_RES%.spl has opcode %fx_type%"
      END
    END
  END
BUT_ONLY

...Also, what would I do to to make it so the "PATCH_IF fx_type = 49 BEGIN" line supports multiple opcodes? (i.e. if I want to search for both 49 and 44...or more!) I tried adding an "OR 44", but it just displayed every single opcode on every single spell in the game as if I had specified a wildcard instead.

Thanks in advance.

Edited by Bartimaeus
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...