Difference between revisions of "Set AI Flags/Usable Abilities"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Set AI Flags/Usable Abilities 0019a2f0: 27bdffc0 addiu r29,r29,0xffc0 0019a2f4: afb3002c sw r19,0x002c(r29) 0019a2f8: 00809821 addu r19,r4,r0 r19 = Unit's ID 0019a2fc: a...")
 
Line 97: Line 97:
 
  0019a46c: 02602021 addu r4,r19,r0 r4 = Unit's ID
 
  0019a46c: 02602021 addu r4,r19,r0 r4 = Unit's ID
 
  0019a470: 92450012 lbu r5,0x0012(r18) Load Unit's Primary Skillset
 
  0019a470: 92450012 lbu r5,0x0012(r18) Load Unit's Primary Skillset
  0019a474: 0c06697e jal 0x 0019a5f8 Usable Ability Setting
+
  0019a474: 0c06697e jal 0x 0019a5f8 [[Usable_Ability_Setting]]
 
  0019a478: 02203021 addu r6,r17,r0 r6 = Counter
 
  0019a478: 02203021 addu r6,r17,r0 r6 = Counter
 
  0019a47c: 92430012 lbu r3,0x0012(r18) Load Unit's Primary Skillset
 
  0019a47c: 92430012 lbu r3,0x0012(r18) Load Unit's Primary Skillset
Line 106: Line 106:
 
  0019a490: 02602021 addu r4,r19,r0 r4 = Unit's ID
 
  0019a490: 02602021 addu r4,r19,r0 r4 = Unit's ID
 
  0019a494: 92450013 lbu r5,0x0013(r18) Load Unit's Secondary Skillset
 
  0019a494: 92450013 lbu r5,0x0013(r18) Load Unit's Secondary Skillset
  0019a498: 0c06697e jal 0x 0019a5f8 Usable Ability Setting
+
  0019a498: 0c06697e jal 0x 0019a5f8 [[Usable_Ability_Setting]]
 
  0019a49c: 02203021 addu r6,r17,r0 r6 = Counter
 
  0019a49c: 02203021 addu r6,r17,r0 r6 = Counter
 
  0019a4a0: 00408821 addu r17,r2,r0 r17 = Counter
 
  0019a4a0: 00408821 addu r17,r2,r0 r17 = Counter

Revision as of 17:12, 1 April 2023

Set AI Flags/Usable Abilities
0019a2f0: 27bdffc0 addiu r29,r29,0xffc0
0019a2f4: afb3002c sw r19,0x002c(r29)
0019a2f8: 00809821 addu r19,r4,r0		r19 = Unit's ID
0019a2fc: afb10024 sw r17,0x0024(r29)
0019a300: 001310c0 sll r2,r19,0x03		ID * 8
0019a304: 00531023 subu r2,r2,r19		ID * 7
0019a308: 00021180 sll r2,r2,0x06		ID * 1c0
0019a30c: 3c038019 lui r3,0x8019
0019a310: 246308cc addiu r3,r3,0x08cc
0019a314: afb20028 sw r18,0x0028(r29)
0019a318: 00439021 addu r18,r2,r3		r18 = Unit's Data Pointer
0019a31c: afb50034 sw r21,0x0034(r29)
0019a320: 3c15801a lui r21,0x801a
0019a324: 26b5f3c4 addiu r21,r21,0xf3c4		r21 = AI Data Pointer
0019a328: afbf003c sw r31,0x003c(r29)
0019a32c: afb60038 sw r22,0x0038(r29)
0019a330: afb40030 sw r20,0x0030(r29)
0019a334: afb00020 sw r16,0x0020(r29)
0019a338: 92420012 lbu r2,0x0012(r18)		Load Unit's Primary Skillset
0019a33c: 3c01801a lui r1,0x801a
0019a340: 00330821 addu r1,r1,r19
0019a344: 90340d50 lbu r20,0x0d50(r1)		Load Unit's Battle ID?
0019a348: 2c4200b0 sltiu r2,r2,0x00b0
0019a34c: 10400047 beq r2,r0,0x 0019a46c		Branch if using a monster skillset
0019a350: 00008821 addu r17,r0,r0		Counter = 0
0019a354: 00141100 sll r2,r20,0x04		ID * 16
0019a358: 00541021 addu r2,r2,r20		ID * 17
0019a35c: 000210c0 sll r2,r2,0x03		ID * 136
0019a360: 00551021 addu r2,r2,r21
0019a364: 34160001 ori r22,r0,0x0001		r22 = 1
0019a368: 00131a80 sll r3,r19,0x0a		ID * 1024
0019a36c: a0560ef2 sb r22,0x0ef2(r2)		Store Skillset = 1 (Attack)
0019a370: a4430ef0 sh r3,0x0ef0(r2)		Store Unit's ID
0019a374: 001410c0 sll r2,r20,0x03		ID * 8
0019a378: 24421778 addiu r2,r2,0x1778
0019a37c: 00558021 addu r16,r2,r21
0019a380: ae000000 sw r0,0x0000(r16)		Store Physcal Attack Data 1 = 0
0019a384: 92020001 lbu r2,0x0001(r16)		Load AI Behavior Flags 1
0019a388: 92030003 lbu r3,0x0003(r16)		Load AI Behavior Flags 3
0019a38c: ae000004 sw r0,0x0004(r16)		Store Physical Attack Data 2 = 0
0019a390: 34420080 ori r2,r2,0x0080		Enable HP Check
0019a394: a2020001 sb r2,0x0001(r16)		Store new AI Behavior Flags 1
0019a398: 92020002 lbu r2,0x0002(r16)		Load AI Behavior Flags 2
0019a39c: 34630001 ori r3,r3,0x0001		Enable Defense UP
0019a3a0: a2030003 sb r3,0x0003(r16)		Store new AI Behavior Flags 3
0019a3a4: 34420002 ori r2,r2,0x0002		Enable Evadeable? Flag
0019a3a8: a2020002 sb r2,0x0002(r16)		Store new AI Behavior Flags 2
0019a3ac: afa00010 sw r0,0x0010(r29)		Store Stack Flags = 0
0019a3b0: 92420006 lbu r2,0x0006(r18)		Load Unit's Gender byte
0019a3b4: 00000000 nop
0019a3b8: 30420020 andi r2,r2,0x0020
0019a3bc: 14400008 bne r2,r0,0x 0019a3e0		Branch if Unit is a monster
0019a3c0: 02002021 addu r4,r16,r0		r4 = Physical Attack AI Data Pointer
0019a3c4: 9245001d lbu r5,0x001d(r18)		Load Unit's RH Weapon
0019a3c8: 0c06694b jal 0x 0019a52c		Store Weapon? Attack Data
0019a3cc: 27a60010 addiu r6,r29,0x0010		r6 = Pointer to stack
0019a3d0: 02002021 addu r4,r16,r0		r4 = ? AI Pointer
0019a3d4: 9245001f lbu r5,0x001f(r18)		Load Unit's LH Weapon
0019a3d8: 0c06694b jal 0x 0019a52c		Store Weapon? Attack Data
0019a3dc: 27a60010 addiu r6,r29,0x0010		r6 = Pointer to stack
0019a3e0: 8fa30010 lw r3,0x0010(r29)		Load Stack Flags
0019a3e4: 34020001 ori r2,r0,0x0001		r2 = 1
0019a3e8: 10620010 beq r3,r2,0x 0019a42c		Branch if using a normal weapon
0019a3ec: 28620002 slti r2,r3,0x0002
0019a3f0: 10400005 beq r2,r0,0x 0019a408		Branch if not unarmed
0019a3f4: 00000000 nop
0019a3f8: 1060000b beq r3,r0,0x 0019a428		Branch if Unarmed
0019a3fc: 00000000 nop
0019a400: 0806691b j 0x 0019a46c			Negative check
0019a404: 26310001 addiu r17,r17,0x0001		Counter ++
0019a408: 34020002 ori r2,r0,0x0002
0019a40c: 1062000c beq r3,r2,0x 0019a440		Branch if using Absorption Weapon
0019a410: 00000000 nop
0019a414: 34020004 ori r2,r0,0x0004
0019a418: 1062000d beq r3,r2,0x 0019a450		Branch if using Healing weapon
0019a41c: 00000000 nop
0019a420: 0806691b j 0x 0019a46c			Dual wielding diff weapon types?
0019a424: 26310001 addiu r17,r17,0x0001		Counter ++
0019a428: a2160000 sb r22,0x0000(r16)		Store Range? = 1
0019a42c: 92020001 lbu r2,0x0001(r16)		Load AI Behavior Flags 1
0019a430: 00000000 nop
0019a434: 34420002 ori r2,r2,0x0002		Enable Target Enemies
0019a438: 0806691a j 0x 0019a468
0019a43c: a2020001 sb r2,0x0001(r16)		Store new AI Behavior Flags 1
0019a440: 92020001 lbu r2,0x0001(r16)		Load AI Behavior Flags 1
0019a444: 92030002 lbu r3,0x0002(r16)		Load AI Behavior Flags 2
0019a448: 08066917 j 0x 0019a45c
0019a44c: 34420002 ori r2,r2,0x0002		Enable Target Enemies
0019a450: 92020001 lbu r2,0x0001(r16)		Load AI Behavior Flags 1
0019a454: 92030002 lbu r3,0x0002(r16)		Load AI Behavior Flags 2
0019a458: 34420001 ori r2,r2,0x0001		Enable Target Allies
0019a45c: 34630020 ori r3,r3,0x0020		Enable Undead Reverse
0019a460: a2020001 sb r2,0x0001(r16)		Store new AI Behavior Flags 1
0019a464: a2030002 sb r3,0x0002(r16)		Store new AI Behavior Flags 2
0019a468: 26310001 addiu r17,r17,0x0001		Counter ++
0019a46c: 02602021 addu r4,r19,r0		r4 = Unit's ID
0019a470: 92450012 lbu r5,0x0012(r18)		Load Unit's Primary Skillset
0019a474: 0c06697e jal 0x 0019a5f8		Usable_Ability_Setting 
0019a478: 02203021 addu r6,r17,r0		r6 = Counter
0019a47c: 92430012 lbu r3,0x0012(r18)		Load Unit's Primary Skillset
0019a480: 00000000 nop
0019a484: 2c6300b0 sltiu r3,r3,0x00b0
0019a488: 10600006 beq r3,r0,0x 0019a4a4		Branch if Unit is a monster
0019a48c: 00408821 addu r17,r2,r0		r17 = Counter
0019a490: 02602021 addu r4,r19,r0		r4 = Unit's ID
0019a494: 92450013 lbu r5,0x0013(r18)		Load Unit's Secondary Skillset
0019a498: 0c06697e jal 0x 0019a5f8		Usable_Ability_Setting
0019a49c: 02203021 addu r6,r17,r0		r6 = Counter
0019a4a0: 00408821 addu r17,r2,r0		r17 = Counter
0019a4a4: 00112080 sll r4,r17,0x02		Counter * 4
0019a4a8: 26310001 addiu r17,r17,0x0001		Counter ++
0019a4ac: 00141100 sll r2,r20,0x04		Battle ID * 16
0019a4b0: 00541021 addu r2,r2,r20		ID * 17
0019a4b4: 000228c0 sll r5,r2,0x03		ID * 136
0019a4b8: 00851821 addu r3,r4,r5
0019a4bc: 02a31821 addu r3,r21,r3
0019a4c0: 340200a9 ori r2,r0,0x00a9		r2 = 0xa9
0019a4c4: a0620ef2 sb r2,0x0ef2(r3)		Store Skillset = Attack?
0019a4c8: 00131280 sll r2,r19,0x0a
0019a4cc: 2442016f addiu r2,r2,0x016f
0019a4d0: a4620ef0 sh r2,0x0ef0(r3)		Store Attack? ID + Unit's ID * 1024
0019a4d4: 00b51021 addu r2,r5,r21
0019a4d8: 00822021 addu r4,r4,r2
0019a4dc: 34020084 ori r2,r0,0x0084		r2 = 0x84
0019a4e0: a0820ef3 sb r2,0x0ef3(r4)		Store Usage Type?
0019a4e4: 2a220022 slti r2,r17,0x0022
0019a4e8: 10400005 beq r2,r0,0x 0019a500		Branch if Pointer >= 34
0019a4ec: 00111080 sll r2,r17,0x02		r2 = Counter * 4
0019a4f0: 00451021 addu r2,r2,r5
0019a4f4: 02a21021 addu r2,r21,r2
0019a4f8: 340300ff ori r3,r0,0x00ff		r3 = FF
0019a4fc: a0430ef2 sb r3,0x0ef2(r2)		Store Skillset = FF (end marker)
0019a500: 8fbf003c lw r31,0x003c(r29)
0019a504: 8fb60038 lw r22,0x0038(r29)
0019a508: 8fb50034 lw r21,0x0034(r29)
0019a50c: 8fb40030 lw r20,0x0030(r29)
0019a510: 8fb3002c lw r19,0x002c(r29)
0019a514: 8fb20028 lw r18,0x0028(r29)
0019a518: 8fb10024 lw r17,0x0024(r29)
0019a51c: 8fb00020 lw r16,0x0020(r29)
0019a520: 27bd0040 addiu r29,r29,0x0040
0019a524: 03e00008 jr r31
0019a528: 00000000 nop