Jump to content

BG1 Tweaks: Sellable Items


Miloch

Recommended Posts

The readme says this was deprecated due to erroneous store prices on said items. I converted it locally and it seems to work fine. Quarterstaves and clubs sell (and are bought) for 1 GP - this would be the expected behaviour, no?

Link to comment

Expected, yes. But when I deprecated it, you would sell for 1gp, but buy back for something else, and never the same price twice in new games. Since I'm tinkering with new tweaks for the next version, I'll have another look at it with the latest WeiDU and see if it works.

Link to comment
But when I deprecated it, you would sell for 1gp, but buy back for something else, and never the same price twice in new games.
I assume you mean before you deprecated it, since you couldn't sell those items at all otherwise. And the price fluctuation should be expected too, since store prices vary based on charisma, reputation and the individual store markup prices. As long as those items aren't going for 100s of gp, it should be fine (and really shouldn't be any different from the BG2 engine behaviour, not AFAIK anyway).

 

I used this code (identical to BG2 Tweaks minus the BG2 items)

BEGIN ~Sellable Items~
DESIGNATED 3200

PRINT ~This step may take a few moments ...~
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
 READ_SHORT 0x1c "type"  ELSE 0 // 17 - mace, 18 - sling, 26 - staff, 37 - book
 READ_LONG  0x34 "price" ELSE 0
 PATCH_IF ((("%type%" = 17) OR ("%type%" = 18) OR ("%type%" = 26) OR ("%type%" = 37)) AND ("%price%" = 0)) BEGIN
WRITE_LONG 0x34 1 // set price to 1 gp
 END
BUT_ONLY_IF_IT_CHANGES

// stores which buy arrows now buy bolts (mainly affects BGT/Tutu)
COPY_EXISTING_REGEXP GLOB ~^.+\.sto$~ ~override~
 READ_LONG 0x2c "buy_off"   ELSE 0
 READ_LONG 0x30 "buy_num"   ELSE 0
 READ_LONG 0x34 "sale_off"  ELSE 0
 READ_LONG 0x4c "drink_off" ELSE 0
 READ_LONG 0x70 "cure_off"  ELSE 0
 SET "bolts" = 0
 FOR (index = 0; index < buy_num; index = index + 1) BEGIN
READ_LONG ("%buy_off%" + ("%index%" * 0x04)) "item"
PATCH_IF ("%item%" = 5) BEGIN // arrows
  SET "bolts" = 1
END ELSE
PATCH_IF ("%item%" = 31) BEGIN // bolts
  SET "bolts" = 2
  SET "index" = "%buy_num%" // kills loop
END
 END
 PATCH_IF ("%bolts%" = 1) BEGIN // if arrows but no bolts
INSERT_BYTES "%buy_off%" 0x04
  WRITE_LONG "%buy_off%" 31
WRITE_LONG 0x30 ("%buy_num%" + 1)
// adjust offsets for older-formatted stores
PATCH_IF ("%sale_off%" > "%buy_off%") BEGIN
  WRITE_LONG 0x34 ("%sale_off%" + 0x04)
END
  PATCH_IF ("%drink_off%" > "%buy_off%") BEGIN
WRITE_LONG 0x4c ("%drink_off%" + 0x04)
END
PATCH_IF ("%cure_off%" > "%buy_off%") BEGIN
  WRITE_LONG 0x70 ("%cure_off%" + 0x04)
END
 END
BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...