So an update on my progress I found an hma script that is applicable for hex maniac advanced. It is originally made by Doesntknowhowtoplay and has edits by AGSMGMaster64. The only problem is when the script is loaded when challenging the first gym in firered the game is resetting. Does anyone know how to fix this.
HMA Script:
# Trainers with EVs, Natures, and Indiviual IVs
# Original ASM by Doesntknowhowtoplay. IV edits and HMA script by AGSMGMaster64.
# This adds a table with 80 entries for EV spreads that includes the following at order:
# Natures, Each individual IV, each individual EV, Poke Ball, ability (out of first or second)
# This table can be safely expanded up to 256 entries if you wish
# For trainers to have any of these spreads, they must have custom items and movesets enabled
# You also need to edit your toml and make 'ShowRawIVByteForTrainer' be TRUE to allow putting the EV spreads for your trainers using the "IVs" for each Pokemon
# ---------------- FR, Emerald: Add in the EV Spread table ----------------
@!game(BPRE0_BPEE0)
# Fills in about 80 default entries for the EV table
@data.pokemon.evSpread(500)
@!00(1280)
@data.pokemon.evSpread ^data.pokemon.evSpread[nature.data.pokemon.natures.names hpIV. atkIV. defIV. speedIV. spAtkIV. spDefIV. hpEV. atkEV. defEV. speedEV. spAtkEV. spDefEV. ball.data.items.stats ability. unused.]80
# ---------------- FR, Emerald: Add in the code to read the EV Spread table ----------------
@thumb.trainer.EvSpread(15C) .thumb
LoadItem:
add r5, r5, #6
mov r0, r4
mov r1, #12
mov r2, r5
bl Insert_Element
LoadHPIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #1
mov r1, #39
mov r0, r4
bl Insert_Element
LoadAtkIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #2
mov r1, #40
mov r0, r4
bl Insert_Element
LoadDefIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #3
mov r1, #41
mov r0, r4
bl Insert_Element
LoadSpeedIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #4
mov r1, #42
mov r0, r4
bl Insert_Element
LoadSpAtkIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #5
mov r1, #43
mov r0, r4
bl Insert_Element
LoadSpDefIV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #6
mov r1, #44
mov r0, r4
bl Insert_Element
LoadHPEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #7
mov r1, #26
mov r0, r4
bl Insert_Element
LoadAtkEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #8
mov r1, #27
mov r0, r4
bl Insert_Element
LoadDefEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #9
mov r1, #28
mov r0, r4
bl Insert_Element
LoadSpeedEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #10
mov r1, #29
mov r0, r4
bl Insert_Element
LoadSpAtkEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #11
mov r1, #30
mov r0, r4
bl Insert_Element
LoadSpDefEV:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #12
mov r1, #31
mov r0, r4
bl Insert_Element
LoadBall:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #13
mov r1, #38
mov r0, r4
cmp r0, #13
bcs ValidBall
bl Insert_Element
b LoadAbility
ValidBall:
mov r0, #4
bl Insert_Element
LoadAbility:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
add r2, r2, #14
mov r1, #46
mov r0, r4
cmp r0, #2
bcs ValidAbility
bl Insert_Element
b StartNatureLoop
ValidAbility:
mov r0, #1
bl Insert_Element
StartNatureLoop:
lsl r0, r6, #4
ldr r2, EV_Table
add r2, r2, r0
ldrb r5, [r2, #0]
cmp r5, #25
bcs End
ldr r0, [r4, #0]
ldr r1, [r4, #4]
eor r1, r0
str r1, [r4, #4]
NatureLoop:
ldr r0, [r4, #0]
add r0, r0, #24
str r0, [r4, #0]
mov r1, #25
bl Mod
cmp r0, r5
bne NatureLoop
EndNatureLoop:
ldr r0, [r4, #0]
ldr r1, [r4, #4]
eor r1, r0
str r1, [r4, #4]
End:
bl RecalcStats
ldr r1, ReturnOffset
bx r1
Insert_Element:
ldr r3, SetMonData
bx r3
RecalcStats:
mov r0, r4
ldr r1, CalculateMonStats
bx r1
Mod:
ldr r3, Umodsi3
bx r3
ReturnOffset:
.word 0x08038979 @ FR: 0x08011639
EV_Table:
.word <data.pokemon.evSpread>
SetMonData:
.word 0x0806ACAD @ FR: 0x0804037D SetMonData
CalculateMonStats:
.word 0x08068D0D @ FR: 0x0803E47D CalculateMonStats
Umodsi3:
.word 0x082E7BE1 @ FR: 0x081E4685 __umodsi3
.end
# Addresses differ in Fire Red
# @!game(BPRE0)
# @thumb.trainer.EvSpread+148 <011639>
# @thumb.trainer.EvSpread+150 <04037D> <03E47D> <1E4685>
# ---------------- FR, Emerald: Hook in the code to read the EV spread ----------------
@!game(BPRE0)
@115F6 .thumb
mov r0, r1
mov r6, r0
b <011604>
.end
@1162C .thumb
ldr r0, =0
bx r0
.end
@11630 <thumb.trainer.EvSpread+1>
@3DC70 .thumb
b <03DCD0>
.end
@!game(BPEE0)
@38936 .thumb
mov r0, r1
mov r6, r0
b <038944>
.end
@3896C .thumb
ldr r0, =0
bx r0
.end
@38970 <thumb.trainer.EvSpread+1>
@67D68 .thumb
b <067DC8>
.end
# goto the table so the user can edit it
@data.pokemon.evSpread