Users browsing this thread: 1 Guest(s)
Rare Item Drop Odds
Does anyone know a way to modify the odds of a rare item dropping without expanding the monster data? Is it possible? I know the program ff6exped exists that expands the monster drop list and can change the odds, but I don't really want to expand the data this late in my testing phase and potentially break the mod with real hardware (which is a huge priority of mine). I was hoping there would be a simple hack to modify the odds of one or two monster/item drops.
08-23-2018, 05:35 PM
It's on my TODO list as well but I haven't checked yet other than a quick glance. The code about item drop seems to be located around here:
C2/5F1C: F0 30 BEQ $5F4E (if not, skip this enemy)
C2/5F1E: 20 5A 4B JSR $4B5A (random, 0 to 255)
C2/5F21: C9 20 CMP #$20 (carry=0 if A = 20h)
C2/5F23: C2 30 REP #$30 (Acc and Index regs 16-bit)
C2/5F25: 7B TDC (clear A)
C2/5F26: 6A ROR (put carry in highest bit of A)
C2/5F27: 79 01 20 ADC $2001,Y (enemy number $2001 is filled by code handling F2 script command, which handles enemy formation)
C2/5F2A: 0A ASL (multiply enemy # by 2, as Dropped Item block is 2 bytes)
C2/5F2B: 2A ROL (put carry into lowest bit. Rare when bit is 0, Common for 1)
C2/5F2C: AA TAX (updated index with enemy num and rare/common slot)
C2/5F2D: BF 02 30 CF LDA $CF3002,X (item dropped - CF3002 is rare, CF3003 is common)
C2/5F31: E2 30 SEP #$30 (Acc and index regs 8-bit)
C2/5F33: C9 FF CMP #$FF (does chosen enemy slot have empty FF item?)
C2/5F1C: F0 30 BEQ $5F4E (if not, skip this enemy)
C2/5F1E: 20 5A 4B JSR $4B5A (random, 0 to 255)
C2/5F21: C9 20 CMP #$20 (carry=0 if A = 20h)
C2/5F23: C2 30 REP #$30 (Acc and Index regs 16-bit)
C2/5F25: 7B TDC (clear A)
C2/5F26: 6A ROR (put carry in highest bit of A)
C2/5F27: 79 01 20 ADC $2001,Y (enemy number $2001 is filled by code handling F2 script command, which handles enemy formation)
C2/5F2A: 0A ASL (multiply enemy # by 2, as Dropped Item block is 2 bytes)
C2/5F2B: 2A ROL (put carry into lowest bit. Rare when bit is 0, Common for 1)
C2/5F2C: AA TAX (updated index with enemy num and rare/common slot)
C2/5F2D: BF 02 30 CF LDA $CF3002,X (item dropped - CF3002 is rare, CF3003 is common)
C2/5F31: E2 30 SEP #$30 (Acc and index regs 8-bit)
C2/5F33: C9 FF CMP #$FF (does chosen enemy slot have empty FF item?)
Vanilla odds are 1/8 for rare drop and 7/8 common drop. You need to change that CMP at $C25F21. #$20 is 1/8, if as an example you do CMP #$40, odd will be 1/4 for rare and 3/4 for common.
08-23-2018, 09:43 PM
(08-23-2018, 07:44 PM)madsiur Wrote: Vanilla odds are 1/8 for rare drop and 7/8 common drop. You need to change that CMP at $C25F21. #$20 is 1/8, if as an example you do CMP #$40, odd will be 1/4 for rare and 3/4 for common.
I'm guessing you are talking about a universal number here, and not per monster, right?
08-23-2018, 10:34 PM
(08-23-2018, 09:43 PM)Lightning Wrote: I'm guessing you are talking about a universal number here, and not per monster, right?
Yes, if you want per monster you would need a table with as an example one byte for each monster (or if you really want to optimize divide that total by 2 or 3 depending what is your maximum rare odd) and get from that table with the monster ID the odd to check the random number against.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)