Skip to content

Commit

Permalink
Merge pull request #86 from jfarr095/pikstuff
Browse files Browse the repository at this point in the history
Equipped Weapon Skills
  • Loading branch information
boviex committed Aug 19, 2019
2 parents 00c81ca + 2a3323f commit 1ad01f2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions Engine Hacks/SkillSystem/Internals/SkillSystem.event
Expand Up @@ -68,6 +68,7 @@ Skill_Getter: // gets a list of skills
SkillTesterOriginal: //does unit have X skill?
#incbin skillTester.dmp
POIN Skill_Getter
POIN ItemTable

SkillTester: //does enemy have Nihil? if so, does Nihil negate X skill?
#incbin nihilTester.dmp
Expand Down
Binary file modified Engine Hacks/SkillSystem/Internals/skillTester.dmp
Binary file not shown.
35 changes: 28 additions & 7 deletions Engine Hacks/SkillSystem/Internals/skillTester.s
Expand Up @@ -4,10 +4,14 @@

@TODO: also check inventory for skill items?

.set GetUnitEquippedItem, 0x8016B28
.set ItemTable, SkillGetter+0x04

.thumb

push {r4,lr}
push {r4-r5,lr}
@r0 has unit data
mov r5, r0
cmp r1, #0
beq True
cmp r1, #0xFF
Expand All @@ -20,20 +24,37 @@ mov lr, r1
@now r0 is the buffer to loop through
Loop:
ldrb r1, [r0]
cmp r1, #0
beq False
cmp r1, #0 @list is over, now test if the equipped item has a skill
beq TestEquippedItem
cmp r1, r4
beq True
add r0, #1
b Loop

True:
mov r0, #1
pop {r4,pc}
TestEquippedItem:
ldrh r0, [r5, #0x1E]
mov r1, #0xFF @get the item id
and r0, r1
cmp r0, #0
beq False
mov r1, #36 @size of the item table
mul r0, r1
ldr r1, ItemTable
add r0, r1
mov r1, #35 @last byte in the item table
ldrb r0, [r0, r1]
cmp r0, r4
beq True

False:
mov r0, #0
pop {r4,pc}
pop {r4-r5, pc}

True:
mov r0, #1
pop {r4-r5, pc}

.pool

SkillGetter:
@POIN SkillGetter
@@ -1,4 +1,4 @@
0x809b10,Item Name,Item Description,Use Item Description,Item Number,Weapon Type,Weapon Ability 1,Weapon Ability 2,Weapon Ability 3,Weapon Ability 4,Stat Bonuses Pointer,Effectiveness Pointer,Durability,Power,Hit%,Weight,Critical%,Minimum - Maximum Range,Cost Per Use (0 = Unsellable),Weapon Rank,Item Icon #,Staff/Use Effect,Weapon Effect,Weapon Experience,DebuffType,***UNKNOWN*** (Zero),***UNKNOWN*** (Zero)
0x809b10,Item Name,Item Description,Use Item Description,Item Number,Weapon Type,Weapon Ability 1,Weapon Ability 2,Weapon Ability 3,Weapon Ability 4,Stat Bonuses Pointer,Effectiveness Pointer,Durability,Power,Hit%,Weight,Critical%,Minimum - Maximum Range,Cost Per Use (0 = Unsellable),Weapon Rank,Item Icon #,Staff/Use Effect,Weapon Effect,Weapon Experience,DebuffType,***UNKNOWN*** (Zero),Item Skill
Nothing,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0,0,0,0,0x0,0,0,0x0,0x0,0,0,0,0,0
Iron Sword,0x354,0x404,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,46,5,90,5,0,0x11,10,1,0x0,0x0,0,2,0,0,0
Slim Sword,0x355,0x405,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0,30,3,100,2,5,0x11,16,1,0x1,0x0,0,2,0,0,0
Expand Down

0 comments on commit 1ad01f2

Please sign in to comment.