Skip to content

Commit

Permalink
V7
Browse files Browse the repository at this point in the history
  • Loading branch information
btigi committed Jan 7, 2007
1 parent e6fda39 commit 0828aef
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 3 deletions.
Binary file modified Setup-iiTweak.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions iiTweak/English/Setup.tra
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@20 = ~Remove Cursed Item Flag (maintain information string)~
@21 = ~Cursed Item Tweak~
@22 = ~Cursed item equipped~
@23 = ~All stores buy stolen goods~
@24 = ~All stores buy all item types~

@100 = ~View Readme~
@101 = ~Show readme after installation~
Expand Down
14 changes: 12 additions & 2 deletions iiTweak/Readme-iiTweak.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
iiTweak 6.00
iiTweak 7.00
------------

+) Contents
Expand Down Expand Up @@ -83,6 +83,12 @@ R) Zero Weight Items
S) Remove Cursed Item Flag
This component removes the cursed flag from any cursed items. This does not prevent or remove any negative effects of a cursed item, but does remove the requirement that a 'Remove Curse' spell be cast on the affected player to remove the item. The component also removes the "item cursed" text that appears when a cursed item is equipped - this text can optionally be reproduced in the main game screen (as opposed to the inventory screen).

T) All stores buy stolen goods
This component simply ensures that all store keepers will buy goods marked as stolen.

U) All stores buy all item types
This component ensures that all store keepers will buy good of all types (this affects container items too).


+) Section 4. Known Issues
==========================
Expand All @@ -93,7 +99,11 @@ If you find any errors, please let me know immediately, specifying as much as yo

+) Section 5. Version History
=============================
V5 [19/11/2006]
V7 [07/01/2007]
- Added 'All stores buy stolen goods' component
- Added 'All stores buy all item types' component

V6 [19/11/2006]
- Added Zero Weight Items
- Added Remove Cursed Item Flag
- Updated to WeiDU 197
Expand Down
94 changes: 93 additions & 1 deletion iiTweak/iiTweak.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ AUTHOR ~igi~
ASK_EVERY_COMPONENT
LANGUAGE ~English~ ~English~ ~iiTweak/English/setup.tra~


// ------------------------------------------------------------------------------------------------------------------------
// Readme stuff
// Some people like to view the readme
Expand Down Expand Up @@ -328,4 +329,95 @@ COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
END
END
IF ~ITM~
BUT_ONLY_IF_IT_CHANGES
BUT_ONLY_IF_IT_CHANGES

// ------------------------------------------------------------------------------------------------------------------------
// All stores buy stolen goods
BEGIN @23
COPY_EXISTING_REGEXP GLOB ~.*\.sto~ ~override~
PATCH_IF (SOURCE_SIZE > 0x74) THEN
BEGIN
READ_BYTE 0x11 "flags"
WRITE_BYTE 0x11 ("%flags%" BOR 0b00010000)
END
BUT_ONLY_IF_IT_CHANGES

// ------------------------------------------------------------------------------------------------------------------------
// All stores buy all item types
BEGIN @24
COPY_EXISTING_REGEXP GLOB ~.*\.sto~ ~override~
PATCH_IF (SOURCE_SIZE > 0x74) THEN
BEGIN
SET presetcount = 73
WHILE (0 < %presetcount%)
BEGIN
SET $itemtypearray("%presetcount%") = 0
SET %presetcount% = %presetcount% - 1
END


READ_LONG 0x2c "offset"
READ_LONG 0x30 "actualcount"

READ_LONG 0x34 "itemsoldoffset"
READ_LONG 0x4c "drinksoldoffset"
READ_LONG 0x70 "spellsoldoffset"

SET count = actualcount

// According to the IESDP, there are 73 (potentially) valid item-types
PATCH_IF (%count% != 73) THEN
BEGIN
WHILE (0 < %count%)
BEGIN
READ_LONG (%offset% + ((%count% -1) * 4)) itemtype
// read the current item-types bought, and set the array element for each one
SET $itemtypearray("%itemtype%") = 1
SET %count% = %count% - 1
END
END

SET addeditemtypes = 0
SET %count% = 73
WHILE (0 < %count%)
BEGIN
// for each array element not set (i.e. each item-type not bought)
PATCH_IF ($itemtypearray("%count%") = 0) THEN
BEGIN
PATCH_PRINT "not set %count%"
//%count% is not set - we need to add it to the file
INSERT_BYTES %offset% 4
WRITE_LONG %offset% %count%
SET actualcount = actualcount + 1
SET addeditemtypes = addeditemtypes + 1
END

SET %count% = %count% - 1
END

// if another struct comes after the item-types, we need to update the offset to it
PATCH_IF (offset < itemsoldoffset) THEN
BEGIN
SET itemsoldoffset = itemsoldoffset + (addeditemtypes * 4)
END

// if another struct comes after the item-types, we need to update the offset to it
PATCH_IF (offset < drinksoldoffset) THEN
BEGIN
SET drinksoldoffset = itemsoldoffset + (addeditemtypes * 4)
END

// if another struct comes after the item-types, we need to update the offset to it
PATCH_IF (offset < spellsoldoffset) THEN
BEGIN
SET spellsoldoffset = itemsoldoffset + (addeditemtypes * 4)
END

WRITE_LONG 0x34 itemsoldoffset
WRITE_LONG 0x4c drinksoldoffset
WRITE_LONG 0x70 spellsoldoffset

WRITE_LONG 0x30 actualcount

END
BUT_ONLY_IF_IT_CHANGES

0 comments on commit 0828aef

Please sign in to comment.