Current Action Ability Data Setting / Multi Hit Formulas

From Final Fantasy Hacktics Wiki
Revision as of 16:47, 23 August 2019 by Raijinili (talk | contribs) (Marking dupe.)
Jump to navigation Jump to search
Duplicate of Determining Multi Hit Formulas. Please resolve.

0017d4a0: 27bdffe8 addiu r29,r29,0xffe8
0017d4a4: 3c038019 lui r3,0x8019
0017d4a8: 8c63f5f0 lw r3,-0x0a10(r3)		load reaction byte
0017d4ac: 34020001 ori r2,r0,0x0001
0017d4b0: afbf0014 sw r31,0x0014(r29)
0017d4b4: afb00010 sw r16,0x0010(r29)
0017d4b8: 3c018019 lui r1,0x8019
0017d4bc: a02238c2 sb r2,0x38c2(r1)			store 01 number of hits?
0017d4c0: 3c018019 lui r1,0x8019
0017d4c4: a02038c3 sb r0,0x38c3(r1)			clear hit counter
0017d4c8: 3c018019 lui r1,0x8019
0017d4cc: a42038c8 sh r0,0x38c8(r1)			clear ??
0017d4d0: 3c018019 lui r1,0x8019
0017d4d4: a02038ed sb r0,0x38ed(r1)			clear can poach
0017d4d8: 14600009 bne r3,r0,0x0017d500		branch if reacting
0017d4dc: 00002821 addu r5,r0,r0
not reacting
0017d4e0: 3c018019 lui r1,0x8019
0017d4e4: a02038e8 sb r0,0x38e8(r1)			clear can learn experience
0017d4e8: 3c018019 lui r1,0x8019
0017d4ec: a02038e7 sb r0,0x38e7(r1)			clear experience earned
0017d4f0: 3c018019 lui r1,0x8019
0017d4f4: a020390c sb r0,0x390c(r1)			clear ability type
0017d4f8: 3c018019 lui r1,0x8019
0017d4fc: a020390d sb r0,0x390d(r1)			clear ability element
0017d500: 9082016f lbu r2,0x016f(r4)		load skillset of last attack
0017d504: 3c018006 lui r1,0x8006
0017d508: 00220821 addu r1,r1,r2
0017d50c: 90265cb4 lbu r6,0x5cb4(r1)		load action menu byte
0017d510: 3c018019 lui r1,0x8019
0017d514: a020f7ec sb r0,-0x0814(r1)		clear used ability flags
0017d518: 9082001d lbu r2,0x001d(r4)		load right hand weapon
0017d51c: 3c018019 lui r1,0x8019
0017d520: a02238c4 sb r2,0x38c4(r1)			store right arm equip ID
0017d524: 9082001f lbu r2,0x001f(r4)		load left hand weapon
0017d528: 3c038019 lui r3,0x8019
0017d52c: 906338c4 lbu r3,0x38c4(r3)		load right hand weapon
0017d530: 3c018019 lui r1,0x8019
0017d534: a02238c5 sb r2,0x38c5(r1)			store left hand weapon ID
0017d538: 340200ff ori r2,r0,0x00ff
0017d53c: 14620008 bne r3,r2,0x0017d560		branch if right hand weapon exists
0017d540: 30c300ff andi r3,r6,0x00ff		r3 = action menu byte
0017d544: 9083001f lbu r3,0x001f(r4)		load left hand weapon
0017d548: 340200ff ori r2,r0,0x00ff
0017d54c: 3c018019 lui r1,0x8019
0017d550: a02238c5 sb r2,0x38c5(r1)			move left hand weapon to right hand
0017d554: 3c018019 lui r1,0x8019
0017d558: a02338c4 sb r3,0x38c4(r1)			move left hand weapon to right hand
0017d55c: 30c300ff andi r3,r6,0x00ff		r3 = action menu byte
0017d560: 34020002 ori r2,r0,0x0002
0017d564: 14620006 bne r3,r2,0x0017d580		branch if action menu byte isn't weapon inventory
0017d568: 00000000 nop
Weapon inventory
0017d56c: 90820176 lbu r2,0x0176(r4)		load used item/equip ID
0017d570: 3c018019 lui r1,0x8019
0017d574: a02238c4 sb r2,0x38c4(r1)			store as primary weapon
0017d578: 0805f5bd j 0x0017d6f4				jump to end
0017d57c: 00000000 nop
0017d580: 10600003 beq r3,r0,0x0017d590		branch if action menu byte is default
0017d584: 34020006 ori r2,r0,0x0006		
0017d588: 1462002b bne r3,r2,0x0017d638		branch if action menu byte isn't monster
0017d58c: 30c300ff andi r3,r6,0x00ff		r3 = action menu byte
Default/Monster
0017d590: 84830170 lh r3,0x0170(r4)			load attack used ID
0017d594: 00000000 nop
0017d598: 04610004 bgez r3,0x0017d5ac		branch if nothing stored?
0017d59c: 000310c0 sll r2,r3,0x03
0017d5a0: 28620170 slti r2,r3,0x0170		
0017d5a4: 1040000b beq r2,r0,0x0017d5d4		branch if ability used is potion or above
0017d5a8: 000310c0 sll r2,r3,0x03
0017d5ac: 00431023 subu r2,r2,r3
0017d5b0: 00021040 sll r2,r2,0x01
0017d5b4: 3c038006 lui r3,0x8006
0017d5b8: 2463fbf0 addiu r3,r3,0xfbf0		load ability data pointer
0017d5bc: 00431021 addu r2,r2,r3
0017d5c0: 90430003 lbu r3,0x0003(r2)		load flags 1
0017d5c4: 3c018019 lui r1,0x8019
0017d5c8: a023f7ec sb r3,-0x0814(r1)		store flags 1
0017d5cc: 90500009 lbu r16,0x0009(r2)		load ability X
0017d5d0: 90450008 lbu r5,0x0008(r2)		load ability formula
0017d5d4: 00000000 nop
0017d5d8: 24a2ffe2 addiu r2,r5,0xffe2		ability formula - 1e	
0017d5dc: 2c420002 sltiu r2,r2,0x0002		check if ability formula is 1e or 1f
0017d5e0: 10400010 beq r2,r0,0x0017d624		branch if not
0017d5e4: 30a300ff andi r3,r5,0x00ff		r3 = ability formula
0017d5e8: 3c028019 lui r2,0x8019
0017d5ec: 8c42f5fc lw r2,-0x0a04(r2)		load targeting/execute check
0017d5f0: 00000000 nop
0017d5f4: 1440000c bne r2,r0,0x0017d628		branch if targeting/mimic/AI consideration
0017d5f8: 3402005e ori r2,r0,0x005e		
0017d5fc: 0c0088c3 jal 0x0002230c			RNG 
0017d600: 00000000 nop
0017d604: 02020018 mult r16,r2				ability X*Random
0017d608: 00001012 mflo r2
0017d60c: 04410002 bgez r2,0x0017d618		make sure number is positive	
0017d610: 00000000 nop
0017d614: 24427fff addiu r2,r2,0x7fff
0017d618: 000213c3 sra r2,r2,0x0f
0017d61c: 0805f5bb j 0x0017d6ec				jump to store number of hits
0017d620: 24420001 addiu r2,r2,0x0001		r2 = number of hits
0017d624: 3402005e ori r2,r0,0x005e
0017d628: 14620003 bne r3,r2,0x0017d638		branch if formula is not 5e
0017d62c: 30c300ff andi r3,r6,0x00ff		r3 = ability formula
0017d630: 0805f5bb j 0x0017d6ec				jump to store number of hits
0017d634: 26020001 addiu r2,r16,0x0001		# of hits = ability X + 1
0017d638: 34020009 ori r2,r0,0x0009
0017d63c: 1062002d beq r3,r2,0x0017d6f4		branch if action menu = jump
0017d640: 34020008 ori r2,r0,0x0008
0017d644: 10620009 beq r3,r2,0x0017d66c		branch if attack
0017d648: 3402000a ori r2,r0,0x000a
0017d64c: 10620007 beq r3,r2,0x0017d66c		branch if action menu = charge
0017d650: 00000000 nop
0017d654: 3c028019 lui r2,0x8019
0017d658: 9042f7ec lbu r2,-0x0814(r2)		load ability flags 1
0017d65c: 00000000 nop
0017d660: 30420020 andi r2,r2,0x0020		Ranged Weapon Check
0017d664: 10400023 beq r2,r0,0x0017d6f4		branch if not
0017d668: 00000000 nop
0017d66c: 9082005a lbu r2,0x005a(r4)		load current status 3
0017d670: 90850091 lbu r5,0x0091(r4)		load support 3
0017d674: 30420002 andi r2,r2,0x0002		
0017d678: 14400006 bne r2,r0,0x0017d694		branch if frogged
0017d67c: 340200ff ori r2,r0,0x00ff		
0017d680: 90820006 lbu r2,0x0006(r4)		Load gender
0017d684: 00000000 nop
0017d688: 30420020 andi r2,r2,0x0020
0017d68c: 10400005 beq r2,r0,0x0017d6a4		branch if not monster
0017d690: 340200ff ori r2,r0,0x00ff
0017d694: 3c018019 lui r1,0x8019
0017d698: a02238c4 sb r2,0x38c4(r1)			store no right hand weapon
0017d69c: 3c018019 lui r1,0x8019
0017d6a0: a02238c5 sb r2,0x38c5(r1)			store no left hand weapon
0017d6a4: 3c048019 lui r4,0x8019
0017d6a8: 248438c4 addiu r4,r4,0x38c4
0017d6ac: 94830000 lhu r3,0x0000(r4)		load right and left hand weapon ID
0017d6b0: 3402ffff ori r2,r0,0xffff
0017d6b4: 1062000a beq r3,r2,0x0017d6e0		branch if both don't exist
0017d6b8: 340300ff ori r3,r0,0x00ff
0017d6bc: 90820000 lbu r2,0x0000(r4)		load right hand weapon ID
0017d6c0: 00000000 nop
0017d6c4: 1043000b beq r2,r3,0x0017d6f4		branch if right hand weapon doesn't exist
0017d6c8: 00000000 nop
0017d6cc: 3c028019 lui r2,0x8019
0017d6d0: 904238c5 lbu r2,0x38c5(r2)		load left hand weapon ID
0017d6d4: 00000000 nop
0017d6d8: 10430006 beq r2,r3,0x0017d6f4		branch if left hand weapon doesn't exist
0017d6dc: 00000000 nop
0017d6e0: 30a20001 andi r2,r5,0x0001
0017d6e4: 10400003 beq r2,r0,0x0017d6f4		branch if 2 swords not active
0017d6e8: 34020002 ori r2,r0,0x0002
0017d6ec: 3c018019 lui r1,0x8019
0017d6f0: a02238c2 sb r2,0x38c2(r1)			store number of hits
0017d6f4: 8fbf0014 lw r31,0x0014(r29)
0017d6f8: 8fb00010 lw r16,0x0010(r29)
0017d6fc: 27bd0018 addiu r29,r29,0x0018
0017d700: 03e00008 jr r31
0017d704: 00000000 nop