STF

From OHRRPGCE-Wiki
Jump to: navigation, search

.STF holds shop stuff. The length of each record is stored in BINSIZE.BIN and is currently 84 bytes. 50 records per shop corresponding to 50 items.

There are always at least 1 more record in the .STF lump then the last store needs. The reason why, it is a secret to everyone.

If you have more than one shop, there should be at least this many records..:

( ( num_shops - 1 ) * 50 ) + num_things_in_last_shop.

When the file size is smaller than this, the last N shops are empty (and hence no data ever got stored for them.)

The last shop having <50 records as shown above, is caused by OHRRPGCE's use of random-access I/O.

If a record is stored but not used, it is likely to be uninitialised.

Offsets are in INTs from the start of the record.

About Formal Specs

Offset Data Meaning
0-16 VSTR(1i+16i=34b) Thing name
17 INT Thing type (0 = item, 1 = hero)
18 INT Number
19 INT In stock
20 INT Buy require tag.. (0 = n/a, -n = tag n must be off +n = tag n must be on)
21 INT Sell require tag.. (see Buy)
22 INT Buy set tag
23 INT Sell set tag
24 INT Buy price
25 INT Must trade in item 1 type (item ID + 1 or 0 for none)
26 INT If this is an item, Sell type:

0 = Normal (selling to store does not affect its inventory)
1 = Aquire Inventory (store aquires infinite inventory)
2 = Increment Inventory (store gains 1 item if it already has some)
3 = Refuse to Buy
If this is a hero, Level:
-1 = Default
0-99 = Level

27 INT Sell price
28 INT Trade in for type (item ID + 1 or 0 for none)
29 INT Trade in for amount - 1
30 INT Must trade in item 1 number - 1
31 INT Must trade in item 2 type (item ID + 1 or 0 for none)
32 INT Must trade in item 2 number - 1
33 INT Must trade in item 3 type (item ID + 1 or 0 for none)
34 INT Must trade in item 3 number - 1
35 INT Must trade in item 4 type (item ID + 1 or 0 for none)
36 INT Must trade in item 4 number - 1
37-41 INT * 3 unused

[edit] Price defaulter proposal

Never implemented

I started implementing this last June, but never checked it in because I thought we were only a week or two away from a stable release at the time :) --Bob the Hamster

Offset Data Meaning
37 INT Buy Price defaulter:

0 is No default
>=1 is percentage of default value
100 is full default value

38 INT Sell Price defaulter:

0 is No default
>=1 is percentage of default value
100 is full default value

Personal tools