Thread: Development: Trainers with EVs
View Single Post
  #4    
Old August 21st, 2013 (10:43 AM). Edited August 22nd, 2013 by Aruaruu.
Aruaruu Aruaruu is offline
     
    Join Date: Sep 2011
    Gender: Male
    Posts: 199
    Quote:
    Originally Posted by DoesntKnowHowToPlay View Post
    That is correct for a 31 IV mon with 1530 EVs in a Master Ball. If that's the first entry in the EV table, you would make a pokemon use that spread by setting its IV value (AI Value in A-Trainer) to 0.
    Ah. So it was simple. Thank you.

    EDIT:
    Another problem. I assembled it and changed the things you said to change for Emerald and this was the result when I was going to insert it.

    Spoiler:


    ^ Do I just copy the highlighted part or have I done something wrong that caused all those 0s

    and this is what it looked like before assembling it. Not sure if I messed something up or what.

    Spoiler:
    Quote:
    #EV spread table format
    #Each spread is 16 bytes
    #first four bytes are filler
    #0x4 = IVs (from 0-31, not 0-255, used for all IVs)
    # (if you want hidden powers, recall the ai can't handle -- bp moves)
    #0x5 = HP EVs
    #0x6 = Atk EVs
    #0x7 = Def EVs
    #0x8 = Speed EVs
    #0x9 = SAtk EVs
    #0xA = SDef EVs
    #0xB = Pokeball
    #last four bytes are filler

    .align 2
    .thumb
    .thumb_func

    .org 0x38936
    mov r0, r1
    lsl r1, r1, #0x0
    lsl r1, r1, #0x0
    lsl r1, r1, #0x0
    lsl r1, r1, #0x0

    .org 0x67d68
    lsl r1, r1, #0x0
    lsl r1, r1, #0x0
    ldr r1, .Method_Addr
    bx r1

    .Method_Addr: .word 0x081E9F69

    .org 0x1E9F68

    LoadHPEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0x5
    mov r1, #0x1A
    mov r0, r7
    bl Insert_Element

    LoadAtkEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0x6
    mov r1, #0x1B
    mov r0, r7
    bl Insert_Element

    LoadDefEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0x7
    mov r1, #0x1C
    mov r0, r7
    bl Insert_Element

    LoadSpeedEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0x8
    mov r1, #0x1D
    mov r0, r7
    bl Insert_Element

    LoadSAtkEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0x9
    mov r1, #0x1E
    mov r0, r7
    bl Insert_Element

    LoadSDefEV:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0xA
    mov r1, #0x1F
    mov r0, r7
    bl Insert_Element

    LoadBall:
    mov r0, sp
    ldrb r0, [r0, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    add r2, #0xB
    mov r1, #0x26
    mov r0, r7
    bl Insert_Element

    LoadIVs:
    mov r1, sp
    ldrb r0, [r1, #0x11]
    lsl r0, r0, #0x4
    ldr r2, .EV_Table
    add r2, r0
    ldrb r2, [r2, #0x4]
    strb r2, [r1, #0x11]

    HPIV:
    add r0, r7, #0x0
    mov r1, #0x27
    mov r2, sp
    add r2, #0x11
    bl Insert_Element

    AtkIV:
    add r0, r7, #0x0
    mov r1, #0x28
    mov r2, sp
    add r2, #0x11
    bl Insert_Element

    End:
    ldr r1, .Return_Addr
    bx r1

    Insert_Element:
    ldr r3, .Insert_Addr
    bx r3


    .align 2
    .Return_Addr: .word 0x08067d83
    .EV_Table: .word 0x08e42710
    .Insert_Addr: .word 0x0806ad9c


    I ask this because I went ahead and tried it out on the first rematch for roxanne, it didn't seem to work. I set the AI value to 0 since it was the very first spread as well.
    Reply With Quote