Author Topic: FAO CamDawg, devSin, or Idobek (or any WeiDU ninja)  (Read 4564 times)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
FAO CamDawg, devSin, or Idobek (or any WeiDU ninja)
« on: April 15, 2006, 11:40:31 AM »
I changed this code:

Code: [Select]
/////////////////////////////////////////////////////////
// Fixes do to the results of CamDawg's Inventory Checker
COPY_EXISTING AASIM.CRE OVERRIDE // Aasim (AR0615, Iron Throne Building)
WRITE_ASCII 0x478 ~SHLD04~ #8    // Change SHIELD04 to SHLD04
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ALDETH.CRE OVERRIDE // Aldeth Sashenstar: MAGE04 (blur ring)
WRITE_SHORT 0x486 0xffff          // Removes from Inventory Item 1
WRITE_SHORT 0x464 0x0005          // Adds to Left Ring slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ANDRIS.CRE OVERRIDE // Andris: CLCK12 (Knave's Robe)
WRITE_SHORT 0x746 0xffff          // Removes from Cloak slot
WRITE_SHORT 0x726 0x0009          // Adds to Armor slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING BHEREN.CRE OVERRIDE // Bheren: CLCK01 (Cloak of Protection +1)
WRITE_SHORT 0x444 0xffff          // Removes from Quick Item 1
WRITE_SHORT 0x442 0x0002          // Adds to Cloak slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING DEZKIE.CRE OVERRIDE // Dezkiel: CLCK22 (Shandalar's Cloak)
WRITE_SHORT 0x5cc 0xffff          // Removes from Quick Item 1
WRITE_SHORT 0x5ca 0x0006          // Adds to Cloak slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING DRATAN.CRE OVERRIDE // Dra'tan: AROW01 (Arrows)
WRITE_SHORT 0x482 0xffff          // Removes from Quick Item 2
WRITE_SHORT 0x478 0x0004          // Adds to Cloak slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING MARCEL.CRE OVERRIDE // Marcellus: CLCK13 (Traveller's Robe)
WRITE_SHORT 0x576 0xffff          // Removes from Cloak slot
WRITE_SHORT 0x556 0x0006          // Adds to Armor slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING NADARI.CRE OVERRIDE // Nadarin: BOOT02 (Boots of Stealth)
WRITE_SHORT 0x444 0xffff          // Removes from Quick Item 1
WRITE_SHORT 0x430 0x0002          // Adds to Boots slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING RINNIE.CRE OVERRIDE // Rinnie: LEAT01 (Leather Armor)
WRITE_SHORT 0x446 0x0000          // Change SW1H07 to LEAT01
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING SHANDAL2.CRE OVERRIDE // Shandalar: CLCK16 (Cloak of the Neutral Archmagi)
WRITE_SHORT 0x4e2 0xffff            // Removes from Cloak slot
WRITE_SHORT 0x4c2 0x0001            // Adds to Armor slot
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ZHURLO.CRE OVERRIDE // Zhurlong: LEAT01 (Leather Armor)
WRITE_SHORT 0x40e 0x0000          // Change SW1H07 to LEAT01
BUT_ONLY_IF_IT_CHANGES

Into this:

Code: [Select]
/////////////////////////////////////////////////////////
// Fixes do to the results of CamDawg's Inventory Checker
COPY_EXISTING AASIM.CRE OVERRIDE // Aasim (AR0615, Iron Throne Building)
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN // searches through items
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "SHIELD04" = 0) BEGIN // find invalid resref
      WRITE_ASCII ("%itm_off%" + (0x14 * "%index%")) "SHLD04" #8 // corrected resref
      SET "index" = "%itm_num%" // kills loop
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING RINNIE.CRE OVERRIDE // Rinnie: LEAT01 (Leather Armor)
              ZHURLO.CRE OVERRIDE // Zhurlong: LEAT01 (Leather Armor)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "LEAT01" = 0)
    BEGIN
      FOR (index2 = 0 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" + 0x02)) "ref"
        PATCH_IF ("%ref%" = 0x01) BEGIN // if incorrect reference in armor
          WRITE_SHORT ("%slot_off%" + ("%index2%" + 0x02)) "%index%" // adds reference to item
          SET "index2" = 36 // kills loop
        END
        PATCH_IF ("%index2%" = 0) BEGIN // if end of armor slots, skip ahead to inventory
          SET "index2" = 20 // otherwise go to inventory slots
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ANDRIS.CRE OVERRIDE   // Andris: CLCK12 (Knave's Robe)
              MARCEL.CRE OVERRIDE   // Marcellus: CLCK13 (Traveller's Robe)
              SHANDAL2.CRE OVERRIDE // Shandalar: CLCK16 (Cloak of the Neutral Archmagi)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck12" = 0) OR
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck13" = 0) OR
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck16" = 0)
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x02) "%index%" // puts in armor slot
      WRITE_SHORT ("%slot_off%" + 0x22) 0xffff    // removes entry from cloak slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING DEZKIE.CRE OVERRIDE // Dezkiel: CLCK22 (Shandalar's Cloak)
              BHEREN.CRE OVERRIDE // Bheren: CLCK01 (Cloak of Protection +1)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck22" = 0) OR
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck01" = 0)
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x22) "%index%" // puts in cloak slot
      WRITE_SHORT ("%slot_off%" + 0x24) 0xffff    // removes entry from quick item 1 slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING DRATAN.CRE OVERRIDE // Dra'tan: AROW01 (Arrows)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "arow01" = 0) BEGIN
      FOR (index2 = 13 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through quiver slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "ref"
        PATCH_IF ("%ref%" = 0xffff) BEGIN // first null reference in quivers
          WRITE_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "%index%" // adds reference to item
          SET "index2" = 36 // kills loop
        END
        PATCH_IF ("%index2%" = 16) BEGIN // if end of quiver slots, skip ahead to inventory
          SET "index2" = 20
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING NADARI.CRE OVERRIDE // Nadarin: BOOT02 (Boots of Stealth)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "boot02" = 0) OR
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x10) "%index%" // puts in boots slot
      WRITE_SHORT ("%slot_off%" + 0x26) 0xffff    // removes entry from quick item 2 slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING ALDETH.CRE OVERRIDE // Aldeth Sashenstar: MAGE04 (blur ring)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "mage04" = 0) BEGIN
      FOR (index2 = 4 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through ring slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "ref"
        PATCH_IF ("%ref%" = 0xffff) BEGIN // first null reference in rings
          WRITE_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "%index%" // adds reference to item
          WRITE_SHORT ("%slot_off%" + 0x30) 0xffff    // removes entry from inventory 1 slot
          SET "index2" = 36 // kills loop
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES

I'm 99% certain that I've fucked up the index2 values and the WRITE_SHORT values that set the value to -1 (0xffff).  There may even be an easier way to do this, but I just don't have a good enough grasp on this stuff yet.

Help.   :-[
« Last Edit: April 15, 2006, 12:32:22 PM by icelus »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: FAO CamDawg, devSin, or Idobek (or any WeiDU ninja)
« Reply #1 on: April 15, 2006, 01:22:39 PM »
Works now!  Thanks, Dawg!

Code: [Select]
/////////////////////////////////////////////////////////
// Fixes do to the results of CamDawg's Inventory Checker
COPY_EXISTING AASIM.CRE OVERRIDE // Aasim (AR0615, Iron Throne Building)
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN // searches through items
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "SHIELD04" = 0) BEGIN // find invalid resref
      WRITE_ASCII ("%itm_off%" + (0x14 * "%index%")) "SHLD04" #8 // corrected resref
      SET "index" = "%itm_num%" // kills loop
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING RINNIE.CRE OVERRIDE // Rinnie: LEAT01 (Leather Armor)
              ZHURLO.CRE OVERRIDE // Zhurlong: LEAT01 (Leather Armor)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "LEAT01" = 0)
    BEGIN
      FOR (index2 = 0 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" + 0x02)) "ref"
        PATCH_IF ("%ref%" = 0x01) BEGIN // if incorrect reference in armor
          WRITE_SHORT ("%slot_off%" + ("%index2%" + 0x02)) "%index%" // adds reference to item
          SET "index2" = 36 // kills loop
        END
        PATCH_IF ("%index2%" = 0) BEGIN // if end of armor slots, skip ahead to inventory
          SET "index2" = 20 // otherwise go to inventory slots
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ANDRIS.CRE OVERRIDE   // Andris: CLCK12 (Knave's Robe)
              MARCEL.CRE OVERRIDE   // Marcellus: CLCK13 (Traveller's Robe)
              SHANDAL2.CRE OVERRIDE // Shandalar: CLCK16 (Cloak of the Neutral Archmagi)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck12" = 0) OR
             ("%item%" STRING_COMPARE_CASE "clck13" = 0) OR
             ("%item%" STRING_COMPARE_CASE "clck16" = 0)
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x02) "%index%" // puts in armor slot
      WRITE_SHORT ("%slot_off%" + 0x22) 0xffff    // removes entry from cloak slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING DEZKIE.CRE OVERRIDE // Dezkiel: CLCK22 (Shandalar's Cloak)
              BHEREN.CRE OVERRIDE // Bheren: CLCK01 (Cloak of Protection +1)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "clck22" = 0) OR
             ("%item%" STRING_COMPARE_CASE "clck01" = 0)
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x22) "%index%" // puts in cloak slot
      WRITE_SHORT ("%slot_off%" + 0x24) 0xffff    // removes entry from quick item 1 slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING DRATAN.CRE OVERRIDE // Dra'tan: AROW01 (Arrows)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "arow01" = 0) BEGIN
      FOR (index2 = 13 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through quiver slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "ref"
        PATCH_IF ("%ref%" = 0xffff) BEGIN // first null reference in quivers
          WRITE_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "%index%" // adds reference to item
          SET "index2" = 36 // kills loop
        END
        PATCH_IF ("%index2%" = 16) BEGIN // if end of quiver slots, skip ahead to inventory
          SET "index2" = 20
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING NADARI.CRE OVERRIDE // Nadarin: BOOT02 (Boots of Stealth)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "boot02" = 0)
    BEGIN
      WRITE_SHORT ("%slot_off%" + 0x10) "%index%" // puts in boots slot
      WRITE_SHORT ("%slot_off%" + 0x24) 0xffff    // removes entry from quick item 2 slot
    END
  END
  BUT_ONLY_IF_IT_CHANGES
 
COPY_EXISTING ALDETH.CRE OVERRIDE // Aldeth Sashenstar: MAGE04 (blur ring)
  READ_LONG  0x2b8 "slot_off" ELSE 0
  READ_LONG  0x2bc "itm_off" ELSE 0
  READ_LONG  0x2c0 "itm_num" ELSE 0
  FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
    READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
    PATCH_IF ("%item%" STRING_COMPARE_CASE "mage04" = 0) BEGIN
      FOR (index2 = 4 ; index2 < 36 ; index2 = index2 + 1) BEGIN // search through ring slots and add reference to first null slot
        READ_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "ref"
        PATCH_IF ("%ref%" = 0xffff) BEGIN // first null reference in rings
          WRITE_SHORT ("%slot_off%" + ("%index2%" * 0x02)) "%index%" // adds reference to item
          WRITE_SHORT ("%slot_off%" + 0x2a) 0xffff    // removes entry from inventory 1 slot
          SET "index2" = 36 // kills loop
        END
      END
    END
  END
  BUT_ONLY_IF_IT_CHANGES
<Moongaze> Luckily BWL has a very understanding and friendly admin.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: