I’m trying to add @Sme’s Status Expansion to my project (I’m using the latest version of the Skill System), but nothing works as expected.
This is what I’m doing.:
- I added the installer to the project.
#include "StatusExpansion/StatusExpansion.event"
I set a staff to apply the effect:
In the Item Table:
Byte 0x1E: 0x34
Byte 0x22: 0x4E (Duration: 0100b [0x4], Effect: 1110b [0xE], Total: 01001110b. For some reason using 0x5E gives a blank status instead of 5 turns of status 0xE)
In the UseEffectAnimTable:
0x34,0x34,2,0x2d,0x0,0x0,0x89a4ea4,0x0,0x0,0x0,0x0 (Copy Silence Animation)
In the IERevampTable:
0x34,0x8028aec,0x802a100,0x8028fcc,0x802fe74 (Silence's Usability and Targeting)
In the SpellAssociationTable:
0xF6,HexingStaff,0x2,0x26,0x00,0x0,0x89A4EA4,0x0,0x0,WhiteFlash,0x0 (Use Silence's Animation)
With this the staff should apply the Hex status to the target, right?
The target:
The staff does work:
The status gets inflicted… but it does nothing, the target still has all the PV.
And for some reason the detail box says it only lasts for 2 turns:
(Ignore the palette)
Another odddity is that the status changes after 1 turn:
Looking at the memory, the status changed from 0x4E to 0x3E.
In the next turn it goes back to Hexing status with 2 turns remaining.
Additionally, a random thief got poisoned for 10 turns instead of 5.
Ok, so then I go to:
2. I check the files and try to figure out a way to make this work.
In HexingRod\HexingRod.event
:
#define HexingRodStatusID 0xE //first fully unused status ID
SetStatusName(HexingRodStatusID,HexingRodStatusName)
SetStatusDesc(HexingRodStatusID,HexingRodStatusDesc)
SetStatusBlinkyIconFunc(HexingRodStatusID,BlinkyIconFuncNoIcon)
//add this to the max HP getter file
// prHexingRodStatus:
// rIfUnitHasStatus(HexingRodStatusID); rHalved
//and a ptr to prHexingRodStatus to the getter loop itself
//define text IDs for name and desc (only used on stat screen)
So, I’ll go check the Max HP getter and it already has this:
prHexingRodEffect:
#incbin "_asm/HexingRod.bin"
WORD DebuffTable
And I’ll add this as the HexingRod.event suggests:
...
pMaxHPModifiers: // Maximum HP
POIN prAddUnitMaxHP prHexingRodStatus prHexingRodEffect prAddEquipHP prItemPassiveHp
...
prHexingRodEffect:
#incbin "_asm/HexingRod.bin"
WORD DebuffTable
prHexingRodStatus:
rIfUnitHasStatus(HexingRodStatusID)
...
And… still nothing:
At this point I give up with Hexing, so I’ll try with Enfeeble.
- Enfeeble doesn’t have instructions…
#define EnfeebleStatusID 0x1F //last valid status ID
SetStatusName(EnfeebleStatusID,EnfeebleName)
SetStatusDesc(EnfeebleStatusID,EnfeebleDesc)
SetStatusBlinkyIconFunc(EnfeebleStatusID,BlinkyIconFuncNoIcon)
#include "Enfeeble.lyn.event"
ALIGN 4
EnfeebleStatusIDLink:
BYTE EnfeebleStatusID
// Add `` to stat getters for stats you want enfeeble to debuff
// Define EnfeebleName and EnfeebleDesc (only used on stat screen)
Moving on to Regen.
4. …
#define RegenStatusID 0x10
SetStatusName(RegenStatusID,RegenStatusName)
SetStatusDesc(RegenStatusID,RegenStatusDesc)
SetStatusBlinkyIconFunc(RegenStatusID,BlinkyIconFuncDancerRingIcon)
ALIGN 4
RegenStatusIDLink:
BYTE RegenStatusID
//meat of this is in hp restoration skills func
Ok, but the other files have names that might help: RenewalAmaterasu.s
and RenewalAmaterasu.lyn.event
In the current version of Skill System, the HP Restoration skills have been divided in separated files, meaning that I have to create the proper entry for Regen to work.
I copied the ASM code and created this file:
.thumb
.align
.global RegenStatus
.type RegenStatus, %function
RegenStatus:
push {r4-r5,r14}
@check for status
mov r0,r5
add r0,#0x30
ldrb r0,[r0]
mov r1,#0x1F
and r0,r1
ldr r1,=RegenStatusIDLink
ldrb r1,[r1]
cmp r0,r1
bne NoRegenStatus
@add 10% regen
add r4,#25
NoRegenStatus:
mov r0,r5
pop {r4-r5}
pop {r1}
bx r1
.ltorg
.align
I compiled the .elf and .lyn.event files and I add this to the Regen.event:
#include "RegenStatus.lyn.event"
And I added it to the corresponding CalcLoop function:
...
ALIGN 4
HPRestorationLoop: //for each, r0 = unit and r1 = current heal %; return modified heal % in r0
POIN Renewal Relief Imbue Forager Camaraderie Amaterasu
POIN HealTiles
POIN RegenStatus
WORD 0 //terminator
...
And because I’m too lazy to create another Staff to do the job, I’ll just edit the memory:
And just wait for the next turn and…
Did he just… restored his status to normal?
Even without the Regen status injured units go back to normal as if they had a status affecting them (That goes for enemies too, the thief was poisoned and he restored his status to normal)
Then I tried with Haste and Slow, and those didn’t work either.
What am I doing wrong?
How do I fix this?
As a side note, I know this Status Expansion hack is meant to work with 3 bites for duration and 5 for the status ID, however, it doesn’t seem to work like that.
To make the Hex status work for 5 turns, it should be 101b+01110b (0xAE), but that only gives it 10 turns instead of 5.