Jump to content

Need help with code for temples


temnix

Recommended Posts

This piece of code is from CamDawg. I asked him for clarification about it, but I'm getting impatient with completing my mod. I hope he won't mind that I'm casting about here without waiting longer. The code is for adding cures to a temple. I need to add three. This does the job for the first cure, but something needs to be adjusted, offsets rewritten, for the second and so on. I just don't know what, and I really don't care to delve into the great science of hexadecimal numbers and coding to get this feature done. I'll acknowledge your contribution in the module, of course.

READ_LONG 0x70 cure_off  ELSE 0
    READ_LONG 0x74 cure_num  ELSE 0
    SET insert = cure_num
    
     INSERT_BYTES  (cure_off +        (insert * 0x0c)) 0x0c
      WRITE_ASCII (cure_off +        (insert * 0x0c)) ~SPELL~ // resref
      WRITE_LONG  (cure_off + 0x08 + (insert * 0x0c)) 100        // price
      WRITE_LONG 0x74 (cure_num + 1)
      PATCH_FOR_EACH offset IN 0x2c 0x34 0x4c BEGIN
        PATCH_IF offset > cure_off BEGIN
          WRITE_LONG offset (THIS + 0x0c)
        END
      END

So, this business needs to be repeated just below for the next cure. How exactly?       

Link to comment

You might want to take a look at this WeiDU function: ADD_STORE_CURE

It's one of several store-related (still) undocumented functions that are part of the base WeiDU interpreter (so no external library needed).

The general syntax is not unlike other WeiDU functions:

COPY_EXISTING ~mystore.sto~ ~override~
  LPF ADD_STORE_CURE
    INT_VAR
      price = 100
    STR_VAR
      spell_name = ~MYCURE~
      position = ~LAST~
  END
BUT_ONLY

 

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...