Apply Exp gain / Level up

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Apply Exp Gain/Level up
0018eb50: 27bdffe8 addiu r29,r29,0xffe8
0018eb54: afb00010 sw r16,0x0010(r29)
0018eb58: 00808021 addu r16,r4,r0
0018eb5c: 3c028019 lui r2,0x8019
0018eb60: 8c42f5fc lw r2,-0x0a04(r2)		load ?? flag
0018eb64: 00a01821 addu r3,r5,r0
0018eb68: 14400024 bne r2,r0,0x0018ebfc		skip of 0
0018eb6c: afbf0014 sw r31,0x0014(r29)
0018eb70: 30a20080 andi r2,r5,0x0080		stolen exp??
0018eb74: 14400018 bne r2,r0,0x0018ebd8		branch if not ?
0018eb78: 306300ff andi r3,r3,0x00ff
0018eb7c: 92020021 lbu r2,0x0021(r16)		laod experience
0018eb80: 00000000 nop
0018eb84: 00431021 addu r2,r2,r3		add experience
0018eb88: 00401821 addu r3,r2,r0		
0018eb8c: 28420100 slti r2,r2,0x0100		set if less than 100
0018eb90: 14400002 bne r2,r0,0x0018eb9c		branch if exp < 100
0018eb94: 00000000 nop
0018eb98: 340300ff ori r3,r0,0x00ff		r3 = ff
0018eb9c: a2030021 sb r3,0x0021(r16)		store ff into experience
0018eba0: 0c017620 jal 0x0005d880		check if unit leveled up
0018eba4: 02002021 addu r4,r16,r0		
0018eba8: 10400014 beq r2,r0,0x0018ebfc		branch if didn't level up?
0018ebac: 00000000 nop
0018ebb0: 9203018a lbu r3,0x018a(r16)		load unit ID
0018ebb4: 3c028019 lui r2,0x8019
0018ebb8: 8c42f8c8 lw r2,-0x0738(r2)		Reaction ID?
0018ebbc: 00000000 nop
0018ebc0: 1462000e bne r3,r2,0x0018ebfc		branch if not equal
0018ebc4: 34020001 ori r2,r0,0x0001		
0018ebc8: 3c018019 lui r1,0x8019
0018ebcc: a022390c sb r2,0x390c(r1)		store ability type?
0018ebd0: 08063aff j 0x0018ebfc			skip to end
0018ebd4: 00000000 nop
0018ebd8: 92020021 lbu r2,0x0021(r16)		load experience
0018ebdc: 30a3007f andi r3,r5,0x007f
0018ebe0: 00431023 subu r2,r2,r3
0018ebe4: 00401821 addu r3,r2,r0
0018ebe8: 00021400 sll r2,r2,0x10
0018ebec: 04410002 bgez r2,0x0018ebf8
0018ebf0: 00000000 nop
0018ebf4: 00001821 addu r3,r0,r0
0018ebf8: a2030021 sb r3,0x0021(r16)		store new exp
0018ebfc: 8fbf0014 lw r31,0x0014(r29)
0018ec00: 8fb00010 lw r16,0x0010(r29)
0018ec04: 27bd0018 addiu r29,r29,0x0018
0018ec08: 03e00008 jr r31
0018ec0c: 00000000 nop

Return location

Battle.bin
0018c210: Attack_Finalisation_&_Reaction_Flagging