• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Set Disobedience

metapod23

Hardened Trainer
673
Posts
15
Years
    • Seen Aug 18, 2016
    I'm just reviving this thread to post that I figured out how to combine JPAN's routine of having a Pokemon obey once in a while and Jambo51's routine of having it only do so when a certain variable is or isn't set. Again, I want to thank colcolstyles, Jambo51, and JPAN for working on this for me! Thanks! :)

    So here's the routine:

    First place 00 49 08 47 at 0x0801D3F4, and the reversed pointer to the code below at 0x0801D3F8 (per JPAN's routine).

    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global obedience
     
    main:
        cmp r0, #0x97    [b]@Mew's number, if you want it to disobey still[/b]
        beq disobey
        cmp r0, #0x05    [b]@Pokemon you want to disobey only sometimes [/b]
        beq disobey        [b](Charmeleon)[/b]
        cmp r0, #0x06    [b]@Pokemon you want to disobey only sometimes[/b]         
        beq disobey        [b](Charizard)[/b]
        ldr r1, mew_check
        bx r1
    
    mew_check:
       .word 0x0801D403
     
    disobey:
        ldr r0, =0x00006199    [b]@Variable you want to use[/b]
        push {lr}
        bl vardecrypt
        pop {r1}
        mov lr, r1
        ldrh r0, [r0]
        cmp r0, #0x00    [b]@the value of the variable you want to cause the[/b]
        beq disobey2       [b]Pokemon to sometimes disobey[/b]
         mov r0, #0x01
        ldr r1, .RESUME
        bx r1
    
    disobey2:
        ldr r1, random_addr 
        ldrb r1, [r1]
        mov r0, #0xcd    [b]the number, divided by 256, that will be the[/b]
        cmp r1, r0          [b]percentage of how often the Pokemon disobeys[/b]
        bgt is_obedient    [b](in this case, cd (205)/256 = 80% disobey)[/b]
        ldr r0, disobedient_ret_addr
        bx r0
     
    resume:
        ldr r1, .RESUME
        bx r1
     
    vardecrypt:
        ldr r1, .VARDEC
        bx r1
    
    is_obedient:   mov r0, #0x1
        pop {r4-r7,pc}
    .hword 0x0000
    
    .align 2
    .RESUME:
        .word    0x0801D42B
    .DISOBEY:
        .word    0x0801D415
    .VARDEC:
        .word    0x0806E455
    random_addr:
    	.word 0x03005000
    
    disobedient_ret_addr:
    	.word 0x0801d415
     

    Wynchester

    Legendary Trainer
    24
    Posts
    11
    Years
  • My question is this... Does this then affect every Poke of a species (i.e. all Charmeleon and Charizard) or only one specific pokemon you have? My instinct says all of the Species, but if that's the case, I need help making it so it only affects a very specific Poke.
     

    tinix

    PearlShipper & C Programmer
    86
    Posts
    14
    Years
  • It affects all of species. I think you could make a specific poke disobey by storing its personality value(it is unique as it is randomly generated) from its data in some variable and then comparing the variable to the personality value of active pokemon. If I am wrong feel free to correct me.
     
    Back
    Top