Difference between revisions of "Learn on hit 1"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0018e6b8: 3c028019 lui r2,0x8019 0018e6bc: 8c4238bc lw r2,0x38bc(r2) load ?? 0018e6c0: 27bdffc0 addiu r29,r29,0xffc0 0018e6c4: afb60030 sw r...")
 
m (Add duplicated link)
Line 1: Line 1:
<font face='Courier New'>
+
Duplicated page here : [[Process_Learn_on_Hit]]
 
   
 
   
 
  0018e6b8: 3c028019 lui r2,0x8019
 
  0018e6b8: 3c028019 lui r2,0x8019
Line 128: Line 128:
 
  0018e8a4: 03e00008 jr r31
 
  0018e8a4: 03e00008 jr r31
 
  0018e8a8: 00000000 nop
 
  0018e8a8: 00000000 nop
</font>
 

Revision as of 13:22, 27 November 2021

Duplicated page here : Process_Learn_on_Hit

0018e6b8: 3c028019 lui r2,0x8019
0018e6bc: 8c4238bc lw r2,0x38bc(r2)				load ??
0018e6c0: 27bdffc0 addiu r29,r29,0xffc0
0018e6c4: afb60030 sw r22,0x0030(r29)
0018e6c8: 0080b021 addu r22,r4,r0				0x10 monster talk?
0018e6cc: afb70034 sw r23,0x0034(r29)
0018e6d0: 00a0b821 addu r23,r5,r0				stack
0018e6d4: afbf0038 sw r31,0x0038(r29)
0018e6d8: afb5002c sw r21,0x002c(r29)
0018e6dc: afb40028 sw r20,0x0028(r29)
0018e6e0: afb30024 sw r19,0x0024(r29)
0018e6e4: afb20020 sw r18,0x0020(r29)
0018e6e8: afb1001c sw r17,0x001c(r29)
0018e6ec: 14400062 bne r2,r0,0x0018e878			fail if hamedoing?
0018e6f0: afb00018 sw r16,0x0018(r29)
0018e6f4: 3c038019 lui r3,0x8019
0018e6f8: 84633d44 lh r3,0x3d44(r3)				load acting units used ability
0018e6fc: 00000000 nop
0018e700: 1060005d beq r3,r0,0x0018e878			branch if attack
0018e704: 000318c0 sll r3,r3,0x03
0018e708: 3c028006 lui r2,0x8006
0018e70c: 2442ebf0 addiu r2,r2,0xebf0			
0018e710: 0062a821 addu r21,r3,r2
0018e714: 92a20003 lbu r2,0x0003(r21)			
0018e718: 00000000 nop
0018e71c: 30420020 andi r2,r2,0x0020			learn on hit
0018e720: 14400007 bne r2,r0,0x0018e740			branch if learn on hit
0018e724: 00008821 addu r17,r0,r0
0018e728: 08063a1f j 0x0018e87c
0018e72c: 2402ffff addiu r2,r0,0xffff
0018e730: 3c038019 lui r3,0x8019
0018e734: 94633d44 lhu r3,0x3d44(r3)			load used ability
0018e738: 08063a1f j 0x0018e87c
0018e73c: a6e30000 sh r3,0x0000(r23)			store used ability
0018e740: 27b20010 addiu r18,r29,0x0010
0018e744: 0000a021 addu r20,r0,r0
<Unit Loop>
0018e748: 12d10047 beq r22,r17,0x0018e868		branch if unit is attacking unit
0018e74c: 00000000 nop
0018e750: 3c028019 lui r2,0x8019
0018e754: 244208cc addiu r2,r2,0x08cc			load unit data
0018e758: 02828021 addu r16,r20,r2
0018e75c: 92020189 lbu r2,0x0189(r16)			load ??
0018e760: 00000000 nop
0018e764: 30420002 andi r2,r2,0x0002
0018e768: 1040003f beq r2,r0,0x0018e868			branch if target isn't hit by ability
0018e76c: 34020004 ori r2,r0,0x0004
0018e770: 92030006 lbu r3,0x0006(r16)			load gender
0018e774: 00000000 nop
0018e778: 30630020 andi r3,r3,0x0020
0018e77c: 1460003a bne r3,r0,0x0018e868			branch if monster
0018e780: a2020189 sb r2,0x0189(r16)			store 0x04
0018e784: 02002021 addu r4,r16,r0
0018e788: 0c01786c jal 0x0005e1b0				check status
0018e78c: 34050004 ori r5,r0,0x0004
0018e790: 14400035 bne r2,r0,0x0018e868			branch status present
0018e794: 00000000 nop
0018e798: 92030003 lbu r3,0x0003(r16)			load job
0018e79c: 92130012 lbu r19,0x0012(r16)			load primary skillset
0018e7a0: 2862004a slti r2,r3,0x004a			set if special job
0018e7a4: 10400003 beq r2,r0,0x0018e7b4			branch if not
0018e7a8: 00000000 nop
0018e7ac: 080639ee j 0x0018e7b8
0018e7b0: 00001821 addu r3,r0,r0
0018e7b4: 2463ffb6 addiu r3,r3,0xffb6			job ID - 0x4a
0018e7b8: 02402021 addu r4,r18,r0				r4 = stack
0018e7bc: 00031040 sll r2,r3,0x01				job ID*2
0018e7c0: 00431021 addu r2,r2,r3				job ID*3
0018e7c4: 00501021 addu r2,r2,r16				unit data + job ID*3
0018e7c8: 24430099 addiu r3,r2,0x0099			
0018e7cc: 26450003 addiu r5,r18,0x0003
0018e7d0: 90620000 lbu r2,0x0000(r3)			load learned abilities?
0018e7d4: 00000000 nop
0018e7d8: a0820000 sb r2,0x0000(r4)				store learned abilities on stack?
0018e7dc: 24840001 addiu r4,r4,0x0001
0018e7e0: 0085102a slt r2,r4,r5
0018e7e4: 1440fffa bne r2,r0,0x0018e7d0
0018e7e8: 24630001 addiu r3,r3,0x0001
0018e7ec: 00008021 addu r16,r0,r0
Ability Loop
0018e7f0: 06010002 bgez r16,0x0018e7fc			branch if counter valid
0018e7f4: 02001021 addu r2,r16,r0
0018e7f8: 26020007 addiu r2,r16,0x0007
0018e7fc: 000210c3 sra r2,r2,0x03				counter/8
0018e800: 000220c0 sll r4,r2,0x03				counter - 3?
0018e804: 02042023 subu r4,r16,r4				
0018e808: 34030080 ori r3,r0,0x0080
0018e80c: 02421021 addu r2,r18,r2
0018e810: 90420000 lbu r2,0x0000(r2)			load abilities
0018e814: 00831807 srav r3,r3,r4				check certain ability
0018e818: 00431024 and r2,r2,r3
0018e81c: 1440000e bne r2,r0,0x0018e858			branch if known
0018e820: 00000000 nop
0018e824: 326400ff andi r4,r19,0x00ff			r4 = known ability address?
0018e828: 0c01695a jal 0x0005a568				load ability from skillset
0018e82c: 02002821 addu r5,r16,r0				r5 = counter (ability number)
0018e830: 3c038019 lui r3,0x8019
0018e834: 84633d44 lh r3,0x3d44(r3)				acting units used ID
0018e838: 3042ffff andi r2,r2,0xffff
0018e83c: 14430006 bne r2,r3,0x0018e858			branch if used ability != ability being checked
0018e840: 00000000 nop
0018e844: 92a50002 lbu r5,0x0002(r21)			load chance to learn
0018e848: 0c017833 jal 0x0005e0cc				check if random > chance
0018e84c: 34040064 ori r4,r0,0x0064				base chance = 100%
0018e850: 1040ffb7 beq r2,r0,0x0018e730			branch if learned?
0018e854: 02201021 addu r2,r17,r0
0018e858: 26100001 addiu r16,r16,0x0001
0018e85c: 2a020018 slti r2,r16,0x0018
0018e860: 1440ffe3 bne r2,r0,0x0018e7f0
0018e864: 00000000 nop
0018e868: 26310001 addiu r17,r17,0x0001
0018e86c: 2a220015 slti r2,r17,0x0015
0018e870: 1440ffb5 bne r2,r0,0x0018e748			check all units
0018e874: 269401c0 addiu r20,r20,0x01c0
0018e878: 2402ffff addiu r2,r0,0xffff
0018e87c: 8fbf0038 lw r31,0x0038(r29)
0018e880: 8fb70034 lw r23,0x0034(r29)
0018e884: 8fb60030 lw r22,0x0030(r29)
0018e888: 8fb5002c lw r21,0x002c(r29)
0018e88c: 8fb40028 lw r20,0x0028(r29)
0018e890: 8fb30024 lw r19,0x0024(r29)
0018e894: 8fb20020 lw r18,0x0020(r29)
0018e898: 8fb1001c lw r17,0x001c(r29)
0018e89c: 8fb00018 lw r16,0x0018(r29)
0018e8a0: 27bd0040 addiu r29,r29,0x0040
0018e8a4: 03e00008 jr r31
0018e8a8: 00000000 nop