Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Reply
 
Thread Tools
  #101    
Old July 4th, 2015 (5:11 AM).
kleenexfeu kleenexfeu is offline
     
    Join Date: Aug 2013
    Gender: Male
    Posts: 216
    Quote:
    Originally Posted by FamiliaWerneck View Post
    Is it possible to make an ability where physical normal attacks are changed to the Pokémon's type (or for a specific type, like Rock)?
    My reasons: If an Onix or a Golem tackles, they throw their bodies against the enemy. But since their bodies are made of rock, it would be like a Rock Throw, making the normal attack be exactly like a rock-type attack.
    Well, possible?
    Basically everything is possible, we even have a working Mega-Evolution now. But MrDollSteak already mentioned : this thread is meant to port existing abilities up to gen 6, not to create new one.

    Creating new abilities would be cool, and even interests me, but this is not the purpose of that thread.

    If you want to continue that conversation, PM or VM or post in a more appropriated thread
    Reply With Quote
      #102    
    Old July 6th, 2015 (5:24 AM).
    FamiliaWerneck's Avatar
    FamiliaWerneck FamiliaWerneck is offline
       
      Join Date: May 2015
      Location: São Paulo, Brasil
      Gender: Male
      Posts: 274
      Sorry, didn't realize MrDS already said that this is for already existing abilities, not for new.
      Really sorry, won't post here again. :(
      __________________
      My Main Team:


      Reply With Quote
        #103    
      Old July 12th, 2015 (4:25 AM). Edited July 14th, 2015 by MrDollSteak.
      MrDollSteak's Avatar
      MrDollSteak MrDollSteak is online now
      Formerly known as 11bayerf1
         
        Join Date: Dec 2008
        Location: Hong Kong
        Age: 23
        Gender: Male
        Posts: 844
        Quote:
        Originally Posted by FamiliaWerneck View Post
        Sorry, didn't realize MrDS already said that this is for already existing abilities, not for new.
        Really sorry, won't post here again. :(
        Kleenex is right, I've said it a few different times here, but no worries.

        I've got some more easy abilities here, Super Luck and Scrappy!

        Super Luck

        Spoiler:
        Fire Red
        Spoiler:
        Code:
        .text
        .text
        .align 2
        .thumb
        .thumb_func
        .global superluck
        
        BufferAbility:
        	push {r0}
        	ldr r1, .UserBank
        	ldrb r1, [r1]
        	mov r0, #0x58
        	mul r0, r1
        	ldr r1, .BattleData
        	add r0, r0, r1
        	ldrb r0, [r0]
        SuperLuckCheck:
        	cmp r0, #0x6A
        	bne Return
        SuperLuck:
        	add r5, #0x2
        Return:
        	pop {r0}
        	lsl r1, r5, #0x1
        	add r1, r1, r2
        	lsl r0, r0, #0x10
        	lsr r0, r0, #0x10
        	ldr r2, .Return
        	bx r2
        
        .align 2
        
        .UserBank: .word 0x02023D6B
        .BattleData: .word 0x2023C04	
        .Return: .word 0x0801E539
        
        #Insert 00 49 08 47 xx xx xx 08 at 0801E530

        Emerald
        Spoiler:
        Code:
        .text
        .text
        .align 2
        .thumb
        .thumb_func
        .global superluck
        
        BufferAbility:
        	push {r0}
        	ldr r1, .UserBank
        	ldrb r1, [r1]
        	mov r0, #0x58
        	mul r0, r1
        	ldr r1, .BattleData
        	add r0, r0, r1
        	ldrb r0, [r0]
        SuperLuckCheck:
        	cmp r0, #0x6A
        	bne Return
        SuperLuck:
        	add r5, #0x2
        Return:
        	pop {r0}
        	lsl r1, r5, #0x1
        	add r1, r1, r2
        	lsl r0, r0, #0x10
        	lsr r0, r0, #0x10
        	ldr r2, .Return
        	bx r2
        
        .align 2
        
        .UserBank: .word 0x0202420B
        .BattleData: .word 0x20240A4	
        .Return: .word 0x08046D49
        
        #Insert 00 49 08 47 xx xx xx 08 at 08046D40

        Scrappy

        Spoiler:
        Fire Red
        Spoiler:
        Code:
        .text
        .text
        .align 2
        .thumb
        .thumb_func
        .global scrappy
        
        BufferAbility:
        	ldr r1, .UserBank
        	ldrb r1, [r1]
        	mov r0, #0x58
        	mul r0, r1
        	mov r1, r5
        	add r1, #0x20
        	add r0, r0, r1
        	ldrb r0, [r0]
        ScrappyCheck:
        	cmp r0, #0x72
        	bne ForeSightCheck
        Scrappy:
        	ldr r1, .Return
        	bx r1
        ForeSightCheck:
        BufferSecondaryStatus:
        	mov r0, #0x58
        	ldrb r1, [r4]
        	mul r0, r1
        	mov r1, r5
        	add r1, #0x50
        	add r0, r0, r1
        Return:
        	ldr r1, .Return2
        	bx r1
        	
        
        .align 2
        
        .UserBank: .word 0x02023D6B
        .Return: .word 0x0801E9D5	
        .Return2: .word 0x0801E9C9
        
        #Insert 00 48 00 47 xx xx xx 08 at 0801E9BC

        Emerald
        Spoiler:
        Code:
        .text
        .text
        .align 2
        .thumb
        .thumb_func
        .global scrappy
        
        BufferAbility:
        	ldr r1, .UserBank
        	ldrb r1, [r1]
        	mov r0, #0x58
        	mul r0, r1
        	mov r1, r5
        	add r1, #0x20
        	add r0, r0, r1
        	ldrb r0, [r0]
        ScrappyCheck:
        	cmp r0, #0x72
        	bne ForeSightCheck
        Scrappy:
        	ldr r1, .Return
        	bx r1
        ForeSightCheck:
        BufferSecondaryStatus:
        	mov r0, #0x58
        	ldrb r1, [r4]
        	mul r0, r1
        	mov r1, r5
        	add r1, #0x50
        	add r0, r0, r1
        Return:
        	ldr r1, .Return2
        	bx r1
        	
        
        .align 2
        
        .UserBank: .word 0x0202420B
        .Return: .word 0x080471C5	
        .Return2: .word 0x080471B9
        
        #Insert 00 48 00 47 xx xx xx 08 at 080471AC
        __________________
        Reply With Quote
          #104    
        Old July 12th, 2015 (7:01 AM).
        Chacha Dinosaur's Avatar
        Chacha Dinosaur Chacha Dinosaur is offline
        Adamant and adaptive dinosaur.
           
          Join Date: Jul 2013
          Age: 24
          Gender: Male
          Posts: 453
          Quote:
          Originally Posted by MrDollSteak View Post
          Scrappy
          There is an AI check for foresight at x1ecac in FR. You can expand there to include Scrappy as well.
          Reply With Quote
            #105    
          Old July 12th, 2015 (7:41 AM). Edited July 13th, 2015 by Xencleamas.
          Xencleamas's Avatar
          Xencleamas Xencleamas is offline
          Suddenly lurking in the shadows...
             
            Join Date: Feb 2014
            Location: Asgard
            Gender: Male
            Nature: Adamant
            Posts: 458
            Quote:
            Originally Posted by KDS View Post
            There is an AI check for foresight at x1ecac in FR. You can expand there to include Scrappy as well.
            And 0804749C in Emerald. :P

            I've also got a few problems with some abilities:

            In Heatproof second routine, an error in line 9.

            In Snow Cloak, the offset for .TargetBank isn't in the list.

            In Super Luck, the game freezes when the Pokemon is going to use a move (before the move animation).

            I was testing these on Emerald by the way.
            __________________

            Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
            Reply With Quote
              #106    
            Old July 13th, 2015 (7:10 AM). Edited July 13th, 2015 by kleenexfeu.
            kleenexfeu kleenexfeu is offline
               
              Join Date: Aug 2013
              Gender: Male
              Posts: 216
              Quote:
              Originally Posted by Sky High View Post
              And 0804749C in Emerald. :P

              I've also got a few problems with some abilities:

              In Heatproof second routine, an error in line 9.

              In Snow Cloak, the offset for .TargetBank isn't in the list.

              In Super Luck, the game freezes when the Pokemon is going to use a move (before the move animation).

              I was testing these on Emerald by the way.
              Super Luck : .Return: .word 0x08046D48 should be +1

              HeatProof : I'm not sure the command is appropriated. Try :
              add r0, r1
              add r0, #0x20

              Snow Cloak:
              The target bank in Emerald is 0x0202420C

              Second routine btw, MrDollSteak has it but if you want it now :
              Spoiler:

              Code:
              .text
              .align 2
              .thumb
              .thumb_func
              .global preventfromhail
              
              Start:
              mov r0, r2
              add r0, #0x20
              ldrb r1, [r0]
              cmp r1, #0x52	/*Index number of your ability Snow Cloak*/
              bne Return
              
              Untouched:
              ldr r1, UntouchedBack
              bx r1
              
              Return:
              add r0, #1
              ldrb r0, [r0]
              cmp r0, #0xF
              beq Untouched
              ldr r1, Back
              bx r1
              
              .align 2
              Back: .word 0x08051BFA+1
              UntouchedBack: .word 0x08051C3C+1
              
              /* 00 48 00 47 xx+1 xx xx 08 at 08051BF0*/
              Reply With Quote
                #107    
              Old July 13th, 2015 (7:44 AM). Edited January 27th, 2016 by MrDollSteak.
              MrDollSteak's Avatar
              MrDollSteak MrDollSteak is online now
              Formerly known as 11bayerf1
                 
                Join Date: Dec 2008
                Location: Hong Kong
                Age: 23
                Gender: Male
                Posts: 844
                Quote:
                Originally Posted by Sky High View Post
                And 0804749C in Emerald. :P

                I've also got a few problems with some abilities:

                In Heatproof second routine, an error in line 9.

                In Snow Cloak, the offset for .TargetBank isn't in the list.

                In Super Luck, the game freezes when the Pokemon is going to use a move (before the move animation).

                I was testing these on Emerald by the way.
                All fixed! Just try the routines now and they'll work. Kleenex was right with all of them except Heatproof.

                I'm reserving this spot for Magic Guard. Although there are already a few Magic Guard routines I'll try and link them all in this post. This is where things start getting annoying as more and more abilities need to be hooked in multiple places with multiple other routines.

                Magic Guard

                Spoiler:
                Fire Red

                Emerald
                Spoiler:
                Routines
                Spoiler:
                Routine I: Prevent Sandstorm Damage (Also contains Overcoat, Sand Rush and Sand Force)
                Spoiler:
                Code:
                .text
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventsandstormdamage
                
                BufferAbility:
                	mov r0, r3
                	add r0, #0x20
                	ldrb r0, [r0]
                SandVeilCheck:
                	cmp r0, #0x8
                	beq NoDamage
                MagicGuardCheck:
                	cmp r0, #0x63
                	beq NoDamage
                OvercoatCheck:
                	cmp r0, #0x8F
                	beq NoDamage
                SandRushCheck:
                	cmp r0, #0x93
                	beq NoDamage
                SandForceCheck:
                	cmp r0, #0xA0
                	beq NoDamage
                Return:
                	ldr r0, .Return
                	bx r0
                NoDamage:
                	ldr r1, .Return2
                	bx r1
                
                .align 2
                
                .Return: .word 0x08051B95
                .Return2: .word 0x08051BD5
                
                Insert 01 48 00 47 00 00xx xx xx 08 at 08051B8A

                Routine II: Prevent Hail Damage

                Routine III: Prevent Leech Seed Damage
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventleechseeddamage
                
                BufferAbility:
                	ldrb r0, [r6]
                	mul r0, r1
                	add r0, r0, r3
                	push {r0}
                	add r0, #0x20
                	ldrb r0, [r0]
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne LeechSeedDamage
                MagicGuard:
                	pop {r0}
                	mov r0, #0x0
                	b StoreDamage
                LeechSeedDamage:
                	pop {r0}
                	ldrh r0, [r0, #0x2C]
                	lsr r0, r0, #0x3
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	ldr r1, .Return
                	bx r1
                
                .align 2
                
                .Return: .word 0x08040B1D
                
                Insert 01 48 00 47 00 00 xx xx xx 08 at 08040B0A

                Routine IV: Prevent Poison Damage (also contains Poison Heal)
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventpoisondamage
                
                BufferAbility:
                	mov r0, r1
                	add r0, #0x20
                	ldrb r0, [r0]
                PoisonHealCheck:
                	cmp r0, #0x5B
                	beq NoDamage
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne PoisonDamage
                NoDamage:
                	mov r0, #0x0
                	b StoreDamage
                PoisonDamage:
                	ldrh r0, [r0, #0x2C]
                	lsr r0, r0, #0x3
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	ldr r1, .Return
                	bx r1
                
                .align 2
                
                .Return: .word 0x08040B79
                
                Insert 00 48 00 47 xx xx xx 08 at 08040B6C

                Routine V: Prevent Toxic Damage (also contains Poison Heal)
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventtoxicdamage
                
                BufferAbility:
                	mov r0, r1
                	add r0, #0x20
                	ldrb r0, [r0]
                PoisonHealCheck:
                	cmp r0, #0x5B
                	beq NoDamage
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne PoisonDamage
                NoDamage:
                	mov r0, #0x0
                	b StoreDamage
                PoisonDamage:
                	ldrh r0, [r0, #0x2C]
                	lsr r0, r0, #0x4
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	ldr r1, .Return
                	bx r1
                
                .align 2
                
                .Return: .word 0x08040BC3
                
                Insert 01 48 00 47 00 00 xx xx xx 08 at 08040BB6

                Routine VI: Prevent Burn Damage

                Routine VII: Prevent Nightmare Damage
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventnightmaredamage
                
                BufferAbility:
                	mov r0, r3
                	add r0, #0x20
                	ldrb r0, [r0]
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne NightmareDamage
                MagicGuard:
                	mov r0, #0x0
                	b StoreDamage
                NightmareDamage:
                	ldrh r0, [r3, #0x2C]
                	lsr r0, r0, #0x2
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	ldr r2, .Return
                	bx r2
                
                .align 2
                
                .Return: .word 0x08040C99
                
                Insert 00 48 00 47 xx xx xx 08 at 08040C8C

                Routine VIII: Prevent Curse Damage
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global preventcursedamage
                
                BufferAbility:
                	mov r0, r1
                	add r0, #0x20
                	ldrb r0, [r0]
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne CurseDamage
                MagicGuard:
                	mov r0, #0x0
                	b StoreDamage
                CurseDamage:
                	ldrh r0, [r1, #0x2C]
                	lsr r0, r0, #0x2
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	ldr r1, .Return
                	bx r1
                
                .align 2
                
                .Return: .word 0x08040CEF
                
                Insert 01 48 00 47 00 00 xx xx xx 08 at 08040CE2

                Routine IX: Prevent Trap Damage (also contains Binding Band)
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global bindingband
                 
                BufferTarget:
                	ldrb r0, [r6]
                	mul r0, r3
                	add r0, r8
                BufferAbility:
                	push {r0}
                	add r0, #0x20
                	ldrb r0, [r0]
                MagicGuardCheck:
                	cmp r0, #0x63
                	bne BufferUser
                MagicGuard:
                	pop {r0}
                	mov r0, #0x0
                	b StoreDamage
                BufferUser:
                	pop {r0}
                	push {r0-r7}
                	ldrb r0, [r6]
                	mov r1, #0x1
                	and r0, r1
                	cmp r0, #0x0
                	beq CheckFoe
                CheckUser:
                	mov r0, #0x0
                	mov r6, #0x0
                CheckUserLoop:
                	mul r0, r3
                	add r0, r8
                CheckUserBindingBand:
                	ldrh r0, [r0, #0x2E]
                	bl GetItemByte
                	cmp r0, #0x4C
                	beq BindingBand
                EndUserLoop:
                	ldr r0, .BattleType
                	ldrb r0, [r0]
                	cmp r0, #0x0
                	beq BufferHP
                	cmp r6, #0x1
                	beq BufferHP
                	mov r0, #0x2
                	add r6, #0x1
                	b CheckUserLoop
                CheckFoe:
                	mov r0, #0x1
                	mov r6, #0x0
                CheckFoeLoop:
                	mul r0, r3
                	add r0, r8
                CheckFoeBindingBand:
                	ldrh r0, [r0, #0x2E]
                	bl GetItemByte
                	cmp r0, #0x4C
                	beq BindingBand
                EndFoeLoop:
                	ldr r0, .BattleType
                	ldrb r0, [r0]
                	cmp r0, #0x0
                	beq BufferHP
                	cmp r6, #0x1
                	beq BufferHP
                	mov r0, #0x3
                	add r6, #0x1
                	b CheckFoeLoop
                BindingBand:
                	pop {r0-r7}
                	ldrh r0, [r0, #0x2C]
                	push {r1-r4}
                	mov r1, #0x6
                	bl DivMod
                	pop {r1-r4}
                	b CheckIfZero
                BufferHP:
                	pop {r0-r7}
                	ldrh r0, [r0, #0x2C]
                NormalDamage:
                	lsr r0, r0, #0x3
                CheckIfZero:
                	cmp r0, #0x0
                	bne StoreDamage
                SetDamage:
                	mov r0, #0x1
                StoreDamage:
                	str r0, [r2]
                Return:
                	ldr r0, .Return
                	bx r0
                GetItemByte:
                	ldr r1, .GetItemByteBL
                	bx r1
                DivMod:
                	ldr r2, .DivideBL
                	bx r2
                
                .align 2
                .BattleType: .word 0x2022FEC
                .Return: .word 0x08040DED
                .GetItemByteBL: .word 0x080D74DD
                .DivideBL: .word 0x082E7541
                
                #insert 00 48 00 47 xx xx xx 08 at 040D88
                4C refers to the effect index of the Binding Band. Change that depending on where you choose to put it.

                Battle Scripts
                Spoiler:
                Battle Script I: Prevent Recoil Damage
                Spoiler:
                Code:
                #include moves.bsh
                #include abilities.bsh
                
                #org @Main
                jumpifhalfword B_= 0x20241EA MOVE_STRUGGLE 0x082DB407
                jumpifability BANK_USER ABILITY_ROCKHEAD 0x82DB421
                jumpifability BANK_USER 0x63 0x82DB421
                Insert this battle script into free space, and replace the pointers at 31C25C and 31C2BC to point to this battle script.

                There are still a few extra checks I need to add within some Battle Scripts. Namely; Crash Damage and Entry Hazard Damage. This post will link to the respective Battle Scripts in the Move Resource Thread once they're completed.


                Overcoat and Bulletproof

                Spoiler:
                Fire Red
                Spoiler:
                Prerequisites
                Spoiler:
                Overcoat Table
                Spoiler:
                Insert this table into Free Space and take note of its location. It contains the indexes of Powder moves.
                Code:
                4D 00 4E 00 4F 00 93 00 B2 00 58 02 FF FF 00 00
                58 02 refers to Powder's Gen 6 move index as taken from Bulbapedia. If you have inserted Powder elsewhere change that.

                Bulletproof Table
                Spoiler:
                Insert this table into Free Space and take note of its location. It contains the indexes of Ball and Bomb moves.
                Code:
                79 00 8C 00 BC 00 BE 00 C0 00 F7 00 28 01 2D 01
                37 01 4B 01 68 01 8C 01 92 01 9B 01 9C 01 AA 01
                B7 01 BB 01 E6 01 EB 01 FF FF 00 00
                The move indexes from 68 01 onwards refer to all Ball and Bomb moves added after Gen 3. Replace them with whatever indexes you have used.

                Routines
                Spoiler:
                Routine I: Prevent Powder moves and Bulletproof
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global overcoatbulletproof
                
                BufferAbility:
                	mov r1, r8
                	ldrb r0, [r1]
                SoundproofCheck:
                	cmp r0, #0x2B
                	bne OvercoatCheck
                Soundproof:
                	ldr r0, .Return
                	bx r0
                OvercoatCheck:
                	cmp r0, #0x8F
                	bne BulletproofCheck
                Overcoat:
                	ldr r0, .OvercoatTable
                	b StartLoop
                BulletproofCheck:
                	cmp r0, #0xAC
                	bne Return
                Bulletproof:
                	ldr r0, .BulletproofTable
                StartLoop:
                	mov r5, #0x0
                	ldr r2, .Return2
                	bx r2
                Return:
                	ldr r4, .Return3
                	bx r4
                	
                Loop:
                
                .align 2
                .Return: .word 0x0801A60D
                .OvercoatTable: .word 0x08AAAAAA
                .BulletproofTable: .word 0x08BBBBBB
                .Return2: .word 0x0801A611
                .Return3: .word 0x0801A609
                
                #insert 00 48 00 47 xx xx xx 08 at 01A600
                AAAAAA refers to the offset of the table that contains Powder moves.
                BBBBBB refers to the offset of the table that contains Bomb and Ball moves.

                Routine II: Prevent Effect Spore from Activating
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global overcoat
                
                BufferHealth:
                	mov r0, #0x58
                	mul r0, r2
                	add r1, r0, r1
                	ldrh r0, [r1, #0x28]
                	cmp r0, #0x0
                	beq NoEffectSpore
                OvercoatCheck:
                	add r1, #0x20
                	ldrb r0, [r1]
                	cmp r0, #0x8F
                	beq NoEffectSpore
                BufferPrimaryType:
                	add r1, #0x1
                	ldrb r0, [r1]
                CheckPrimaryTypeGrass:
                	cmp r0, #0xC
                	beq NoEffectSpore
                BufferSecondaryType:
                	add r1, #0x1
                	ldrb r0, [r1]
                CheckSecondaryTypeGrass:
                	cmp r0, #0xC
                	bne Return
                NoEffectSpore:
                	ldr r4, .Return
                	bx r4
                Return:
                	ldr r0, .Return2
                	bx r0
                
                .align 2
                .Return: .word 0x0801AB3F
                .Return2: .word 0x0801AB43
                
                #insert 01 48 00 47 00 00 xx xx xx 08 at 01AB32

                To prevent weather damage from affecting Pokemon with Overcoat, look at Magic Guard's prevent Sandstorm and prevent Hail damage routines just above.

                Emerald
                Spoiler:
                Prerequisites
                Spoiler:
                Overcoat Table
                Spoiler:
                Insert this table into Free Space and take note of its location. It contains the indexes of Powder moves.
                Code:
                4D 00 4E 00 4F 00 93 00 B2 00 58 02 FF FF 00 00
                58 02 refers to Powder's Gen 6 move index as taken from Bulbapedia. If you have inserted Powder elsewhere change that.

                Bulletproof Table
                Spoiler:
                Insert this table into Free Space and take note of its location. It contains the indexes of Ball and Bomb moves.
                Code:
                79 00 8C 00 BC 00 BE 00 C0 00 F7 00 28 01 2D 01
                37 01 4B 01 68 01 8C 01 92 01 9B 01 9C 01 AA 01
                B7 01 BB 01 E6 01 EB 01 FF FF 00 00
                The move indexes from 68 01 onwards refer to all Ball and Bomb moves added after Gen 3. Replace them with whatever indexes you have used.

                Routines
                Spoiler:
                Routine I: Prevent Powder moves and Bulletproof
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global overcoatbulletproof
                
                BufferAbility:
                	ldrb r0, [r7]
                SoundproofCheck:
                	cmp r0, #0x2B
                	bne OvercoatCheck
                Soundproof:
                	ldr r0, .Return
                	bx r0
                OvercoatCheck:
                	cmp r0, #0x8F
                	bne BulletproofCheck
                Overcoat:
                	ldr r0, .OvercoatTable
                	b StartLoop
                BulletproofCheck:
                	cmp r0, #0xAC
                	bne Return
                Bulletproof:
                	ldr r0, .BulletproofTable
                StartLoop:
                	mov r4, #0x0
                	ldr r2, .Return2
                	bx r2
                Return:
                	ldr r1, .Return3
                	bx r1
                	
                Loop:
                
                .align 2
                .Return: .word 0x08042F03
                .OvercoatTable: .word 0x08AAAAAA
                .BulletproofTable: .word 0x08BBBBBB
                .Return2: .word 0x08042F07
                .Return3: .word 0x08042F11
                
                #insert 00 48 00 47 xx xx xx 08 at 042EF8
                AAAAAA refers to the offset of the table that contains Powder moves.
                BBBBBB refers to the offset of the table that contains Bomb and Ball moves.

                Routine II: Prevent Effect Spore from Activating
                Spoiler:
                Code:
                .text
                .align 2
                .thumb
                .thumb_func
                .global overcoat
                
                BufferHealth:
                	mov r0, #0x58
                	mul r0, r2
                	add r1, r0, r1
                	ldrh r0, [r1, #0x28]
                	cmp r0, #0x0
                	beq NoEffectSpore
                OvercoatCheck:
                	add r1, #0x20
                	ldrb r0, [r1]
                	cmp r0, #0x8F
                	beq NoEffectSpore
                BufferPrimaryType:
                	add r1, #0x1
                	ldrb r0, [r1]
                CheckPrimaryTypeGrass:
                	cmp r0, #0xC
                	beq NoEffectSpore
                BufferSecondaryType:
                	add r1, #0x1
                	ldrb r0, [r1]
                CheckSecondaryTypeGrass:
                	cmp r0, #0xC
                	bne Return
                NoEffectSpore:
                	ldr r1, .Return
                	bx r1
                Return:
                	ldr r0, .Return2
                	bx r0
                
                .align 2
                .Return: .word 0x08043433
                .Return2: .word 0x08043437
                
                #insert 01 48 00 47 00 00 xx xx xx 08 at 043426

                To prevent weather damage from affecting Pokemon with Overcoat, look at Magic Guard's prevent Sandstorm and prevent Hail damage routines just above.

                __________________
                Reply With Quote
                  #108    
                Old July 13th, 2015 (8:33 AM). Edited July 13th, 2015 by Xencleamas.
                Xencleamas's Avatar
                Xencleamas Xencleamas is offline
                Suddenly lurking in the shadows...
                   
                  Join Date: Feb 2014
                  Location: Asgard
                  Gender: Male
                  Nature: Adamant
                  Posts: 458
                  Quote:
                  Originally Posted by MrDollSteak View Post
                  All fixed! Just try the routines now and they'll work. Kleenex was right with all of them except Heatproof.

                  I'm reserving this spot for Magic Guard. Although there are already a few Magic Guard routines I'll try and link them all in this post. This is where things start getting annoying as more and more abilities need to be hooked in multiple places with multiple other routines.
                  Thanks to the two of you. They are working now. :)

                  Another big problem with Super Luck: I have spammed attacks hundred times but I don't get any chance of critical hit. With this routine, either if someone has it is active or not, even Focus Energy is set, spammed moves like Slash, still nothing. I dunno for Frost Breath yet but I bet it will not go critical hit.
                  __________________

                  Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
                  Reply With Quote
                    #109    
                  Old July 13th, 2015 (8:54 AM).
                  MrDollSteak's Avatar
                  MrDollSteak MrDollSteak is online now
                  Formerly known as 11bayerf1
                     
                    Join Date: Dec 2008
                    Location: Hong Kong
                    Age: 23
                    Gender: Male
                    Posts: 844
                    Quote:
                    Originally Posted by Sky High View Post
                    Thanks to the two of you. They are working now. :)

                    Another big problem with Super Luck: I have spammed attacks hundred times but I don't get any chance of critical hit. With this routine, either if someone has it is active or not, even Focus Energy is set, spammed moves like Slash, still nothing. I dunno for Frost Breath yet but I bet it will not go critical hit.
                    Yeah oops I did the branch using r0 instead of r1 like its supposed to be. Just change 00 48 00 47 to 08 49 00 47 at the branch location and you're set. I fixed it in the post too.
                    __________________
                    Reply With Quote
                      #110    
                    Old July 13th, 2015 (3:38 PM). Edited July 13th, 2015 by Germaniac.
                    Germaniac's Avatar
                    Germaniac Germaniac is offline
                    Victoria Concordia Crescit
                       
                      Join Date: May 2009
                      Location: Jakarta, Indonesia
                      Age: 20
                      Gender: Male
                      Nature: Relaxed
                      Posts: 567
                      MRDS, I just wanna tell that 2nd line in the "CheckVariableTypeMoves" of Protean routine should be ldr r4, [r4] not ldrb r4, [r4]. Thank you :)
                      Reply With Quote
                        #111    
                      Old July 14th, 2015 (9:15 AM). Edited July 17th, 2015 by MrDollSteak.
                      MrDollSteak's Avatar
                      MrDollSteak MrDollSteak is online now
                      Formerly known as 11bayerf1
                         
                        Join Date: Dec 2008
                        Location: Hong Kong
                        Age: 23
                        Gender: Male
                        Posts: 844
                        Quote:
                        Originally Posted by Germaniac View Post
                        MRDS, I just wanna tell that 2nd line in the "CheckVariableTypeMoves" of Protean routine should be ldr r4, [r4] not ldrb r4, [r4]. Thank you :)
                        Thank you! Also fixed.

                        S-Bird requested I finally get around to doing the Type Absorb abilities, and so I have!
                        I'll update this post once everything is done.

                        Lightningrod, Motor Drive, Dry Skin, Storm Drain and Sap Sipper

                        Spoiler:
                        Fire Red
                        Spoiler:
                        Currently they're just for Emerald and require a few pre-requisites. But I'll port them to Fire Red soon after.
                        Doesnt has informed me that there is probably going to be a bug with Discharge, Lava Plume, Surf and Petal Blizzard as they target all Pokemon on the field. If this is indeed the case I'll move them around.

                        Emerald
                        Spoiler:
                        Pre Requisites
                        Spoiler:
                        First of all, make sure you have the Battle String message loader hack enabled, and the Set word battle scripting command.
                        These are used in the various battle scripts to display custom messages.

                        Byte Changes
                        Spoiler:
                        042FBF - Change D1 to DA
                        This enables Volt Absorb to absorb Thunder Wave

                        043019 - Change D1 to DA
                        This enables Water Absorb and Dry Skin to absorb Soak

                        043076 - Change 56 D1 to 00 00
                        This enables Flash Fire to activate even if Frozen

                        Type Absorb Ability Table
                        Spoiler:
                        Insert this table into free space
                        Code:
                        0A 00 00 00 AA 2F 04 08
                        0B 00 00 00 04 30 04 08
                        12 00 00 00 5C 30 04 08
                        1F 00 00 00 44 44 44 08
                        4F 00 00 00 55 55 55 08
                        58 00 00 00 04 30 04 08
                        73 00 00 00 66 66 66 08
                        9E 00 00 00 77 77 77 08
                        FF 00 00 00 FF FF FF FF
                        Where 44 44 44 08 refers to the location of the Lightningrod ASM (do not add +1)
                        Where 55 55 55 08 refers to the location of the Motor Drive ASM (do not add +1)
                        Where 66 66 66 08 refers to the location of the first Storm Drain ASM (do not add +1)
                        Where 77 77 77 08 refers to the location of the Sap Sipper ASM (do not add +1)

                        Type Absorb Loader
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global typeabsorbloader
                        
                        GetAbilityByte:
                        	ldrb r0, [r7]
                        LoadTable:
                        	push {r1-r6}
                        	ldr r5, .TableLoc
                        	mov r3, #0x0
                        Loop:
                        	lsl r2, r3, #0x3
                        	add r2, r2, r5
                        	ldrb r1, [r2]
                        	cmp r1, #0xFF
                        	beq End
                        	cmp r0, r1
                        	beq Success
                        	add r3, #0x1
                        	b Loop
                        Success:
                        	ldr r0, [r2, #0x4]
                        	pop {r1-r6}
                        	mov r15, r0
                        End:
                        	pop {r1-r6}
                        	ldr r2, .Return
                        	bx r2
                        
                        .align 2
                        
                        .TableLoc: .word 0x08CCCCCC
                        .Return: .word 0x08043127
                        
                        #Insert 00 48 00 47 XX+1 XX XX 08 at 08042F94
                        #Doesnt has informed me that there is probably going to be a bug with Discharge, Lava Plume, Surf and Petal Blizzard as they target all Pokemon on the field. If this is indeed the case I'll move them around.
                        CCCCCC refers to the location of the Type Absorb Ability Table.

                        Routines
                        Spoiler:
                        Lightningrod
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global lightningrod
                        
                        CheckElectricType:
                        	cmp r3, #0xD
                        	bne Return
                        CheckIfSpreadMove:
                        	ldr r1, .SpreadLoc
                        	ldr r0, .UserBank
                        	ldrb r0, [r0]
                        	lsl r0, r0, #0x4
                        	add r0, r0, r1
                        	ldrb r0, [r0, #0x2]
                        	ldr r1, .ScriptLoc
                        	lsl r0, r0, #0x1C
                        	cmp r0, #0x0
                        	bge RemovePP
                        SkipPP:
                        	ldr r0, .RaiseSpAtkBS
                        	add r0, #0x1
                        	b RunScript
                        RemovePP:
                        	ldr r0, .RaiseSpAtkBS
                        RunScript:
                        	str r0, [r1]
                        	mov r2, #0x2
                        	mov r9, r2
                        Return:
                        	ldr r2, .Return
                        	bx r2
                        
                        .align 2
                        
                        .SpreadLoc: .word 0x0202433C
                        .UserBank: .word 0x0202420B
                        .ScriptLoc: .word 0x02024214
                        .RaiseSpAtkBS: .word 0x08CCCCCC
                        .Return: .word 0x08043127
                        CCCCCC refers to the following battle script that is also used in Storm Drain. It raises the Pokemon's Special Attack.

                        Code:
                        #dynamic 0xCCCCCC
                        #freespacebyte 0xFF
                        
                        #org @Main
                        ppreduce
                        attackstring
                        pause DELAY_HALFSECOND
                        jumpifstat BANK_TARGET B_= 0x4 0xC 0x082DB596
                        setbyte 0x202448F 0x0
                        playstatchangeanimation BANK_TARGET 0x10 0x0
                        setbyte 0x202448E 0x14
                        statbuffchange 0x80 false 0x00000000
                        setword 0x203E320 0x8DDDDDD
                        printstring 0x184
                        pause DELAY_1SECOND
                        waitmessage DELAY_1SECOND
                        orbyte 0x202427C 0x8
                        goto 0x82D8A4E
                        DDDDDD refers to the following string that is used in a variety of abilities.

                        Code:
                        FD 13 B4 E7 00 FD 1B FE E6 D5 DD E7 D9 D8 00 DD
                        E8 E7 00 CD E4 AD 00 BB E8 DF AB
                        It says "User's Ability raised it's Sp. Atk!"

                        Motor Drive
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global motordrive
                        
                        CheckElectricType:
                        	cmp r3, #0xD
                        	bne Return
                        CheckIfSpreadMove:
                        	ldr r1, .SpreadLoc
                        	ldr r0, .UserBank
                        	ldrb r0, [r0]
                        	lsl r0, r0, #0x4
                        	add r0, r0, r1
                        	ldrb r0, [r0, #0x2]
                        	ldr r1, .ScriptLoc
                        	lsl r0, r0, #0x1C
                        	cmp r0, #0x0
                        	bge RemovePP
                        SkipPP:
                        	ldr r0, .RaiseSpeedBS
                        	add r0, #0x1
                        	b RunScript
                        RemovePP:
                        	ldr r0, .RaiseSpeedBS
                        RunScript:
                        	str r0, [r1]
                        	mov r2, #0x2
                        	mov r9, r2
                        Return:
                        	ldr r2, .Return
                        	bx r2
                        
                        .align 2
                        
                        .SpreadLoc: .word 0x0202433C
                        .UserBank: .word 0x0202420B
                        .ScriptLoc: .word 0x02024214
                        .RaiseSpeedBS: .word 0x08AAAAAA
                        .Return: .word 0x08043127
                        AAAAAA refers to the following battle script. It raises the Pokemon's Speed.

                        Code:
                        #dynamic 0xAAAAAA
                        #freespacebyte 0xFF
                        
                        #org @Main
                        ppreduce
                        attackstring
                        pause DELAY_HALFSECOND
                        jumpifstat BANK_TARGET B_= 0x3 0xC 0x082DB596
                        setbyte 0x202448F 0x0
                        playstatchangeanimation BANK_TARGET 0x8 0x0
                        setbyte 0x202448E 0x13
                        statbuffchange 0x80 false 0x00000000
                        setword 0x203E320 0x8BBBBBB
                        printstring 0x184
                        pause DELAY_1SECOND
                        waitmessage DELAY_1SECOND
                        orbyte 0x202427C 0x8
                        goto 0x82D8A4E
                        BBBBBB refers to the following string that is used in a variety of abilities.

                        Code:
                        FD 13 B4 E7 00 FD 1B FE E6 D5 DD E7 D9 D8 00 DD
                        E8 E7 00 CD E4 D9 D9 D8 AB
                        It says "User's Ability raised it's Speed!"

                        Dry Skin
                        Spoiler:
                        Routine I: Restore HP in Rain

                        Routine II: Take Damage in Sun

                        Routine III: Increased Fire Damage


                        Storm Drain
                        Spoiler:
                        Routine I: Increase Sp. Atk
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global stormdrain
                        
                        CheckWaterType:
                        	cmp r3, #0xB
                        	bne Return
                        CheckIfSpreadMove:
                        	ldr r1, .SpreadLoc
                        	ldr r0, .UserBank
                        	ldrb r0, [r0]
                        	lsl r0, r0, #0x4
                        	add r0, r0, r1
                        	ldrb r0, [r0, #0x2]
                        	ldr r1, .ScriptLoc
                        	lsl r0, r0, #0x1C
                        	cmp r0, #0x0
                        	bge RemovePP
                        SkipPP:
                        	ldr r0, .RaiseSpAtkBS
                        	add r0, #0x1
                        	b RunScript
                        RemovePP:
                        	ldr r0, .RaiseSpAtkBS
                        RunScript:
                        	str r0, [r1]
                        	mov r2, #0x2
                        	mov r9, r2
                        Return:
                        	ldr r2, .Return
                        	bx r2
                        
                        .align 2
                        
                        .SpreadLoc: .word 0x0202433C
                        .UserBank: .word 0x0202420B
                        .ScriptLoc: .word 0x02024214
                        .RaiseSpAtkBS: .word 0x08CCCCCC
                        .Return: .word 0x08043127
                        CCCCCC refers to the following battle script that is also used in Lightningrod. It raises the Pokemon's Special Attack. If you have already inserted this for Lightning Rod, you don't need to do it again.

                        Code:
                        #dynamic 0xCCCCCC
                        #freespacebyte 0xFF
                        
                        #org @Main
                        ppreduce
                        attackstring
                        pause DELAY_HALFSECOND
                        jumpifstat BANK_TARGET B_= 0x4 0xC 0x082DB596
                        setbyte 0x202448F 0x0
                        playstatchangeanimation BANK_TARGET 0x10 0x0
                        setbyte 0x202448E 0x14
                        statbuffchange 0x80 false 0x00000000
                        setword 0x203E320 0x8DDDDDD
                        printstring 0x184
                        pause DELAY_1SECOND
                        waitmessage DELAY_1SECOND
                        orbyte 0x202427C 0x8
                        goto 0x82D8A4E
                        DDDDDD refers to the following string that is used in a variety of abilities.

                        Code:
                        FD 13 B4 E7 00 FD 1B FE E6 D5 DD E7 D9 D8 00 DD
                        E8 E7 00 CD E4 AD 00 BB E8 DF AB
                        It says "User's Ability raised it's Sp. Atk!"

                        Routine II: Check conditions for Redirection
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global stormdrain
                        
                        BufferAbility:
                        	ldrb r1, [r0, #0xC]
                        	mov r0, #0x58
                        	mul r0, r1
                        	add r0, r0, r3
                        	add r0, #0x20
                        	ldrb r0, [r0]
                        	mov r8, r2
                        	push {r0}
                        MoveType:
                        	ldrb r0, [r4, #0x2]
                        	cmp r0, #0xB
                        	beq StormDrainCheck
                        	cmp r0, #0xD
                        	bne Return
                        LightningRodCheck:
                        	pop {r0}
                        	cmp r0, #0x1F
                        	beq Return
                        LightningRod:
                        	b StormDrain
                        StormDrainCheck:
                        	pop {r0}
                        	cmp r0, #0x73
                        	beq Return
                        StormDrain:
                        	ldr r0, .Return
                        	bx r0
                        Return:
                        	ldr r2, .Return2
                        	bx r2
                        
                        .align 2
                        
                        .Return: .word 0x0803E469
                        .Return2: .word 0x0803E631
                        
                        #Insert 00 49 08 47 xx xx xx 08 at 0803E44C

                        Routine III: Redirect Move
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global stormdrain
                        
                        BufferAbility:
                        	mov r0, #0x58
                        	mul r0, r2
                        	add r0, r0, r1
                        	add r0, #0x20
                        	ldrb r0, [r0]
                        	push {r0-r4}
                        BufferMoveType:
                        	ldr r2, .MoveData
                        	ldr r0, .MoveIndex
                        	ldrh r1, [r0]
                        	lsl r0, r1, #0x1
                        	add r0, r0, r1
                        	lsl r0, r0, #0x2
                        	add r4, r0, r2
                        MoveType:
                        	ldrb r0, [r4, #0x2]
                        	cmp r0, #0xB
                        	beq StormDrainCheck
                        	cmp r0, #0xD
                        	bne Return
                        LightningRodCheck:
                        	pop {r0-r4}
                        	cmp r0, #0x1F
                        	bne Return
                        LightningRod:
                        	b StormDrain
                        StormDrainCheck:
                        	pop {r0-r4}
                        	cmp r0, #0x73
                        	bne Return
                        StormDrain:
                        	ldr r0, .Return
                        	bx r0
                        Return:
                        	ldr r2, .Return2
                        	bx r2
                        
                        .align 2
                        
                        .MoveData: .word 0x0831C898
                        .MoveIndex: .word 0x020241EA
                        .Return: .word 0x0803E4B3
                        .Return2: .word 0x0803E4CF
                        
                        #Insert 00 48 00 47 xx xx xx 08 at 0803E4A4
                        Replace 31C898 with the offset for your move table if you have expanded and repointed it.

                        Sap Sipper
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global sapsipper
                        
                        CheckGrassType:
                        	cmp r3, #0xC
                        	bne Return
                        CheckIfSpreadMove:
                        	ldr r1, .SpreadLoc
                        	ldr r0, .UserBank
                        	ldrb r0, [r0]
                        	lsl r0, r0, #0x4
                        	add r0, r0, r1
                        	ldrb r0, [r0, #0x2]
                        	ldr r1, .ScriptLoc
                        	lsl r0, r0, #0x1C
                        	cmp r0, #0x0
                        	bge RemovePP
                        SkipPP:
                        	ldr r0, .RaiseAttackBS
                        	add r0, #0x1
                        	b RunScript
                        RemovePP:
                        	ldr r0, .RaiseAttackBS
                        RunScript:
                        	str r0, [r1]
                        	mov r2, #0x2
                        	mov r9, r2
                        Return:
                        	ldr r2, .Return
                        	bx r2
                        
                        .align 2
                        
                        .SpreadLoc: .word 0x0202433C
                        .UserBank: .word 0x0202420B
                        .ScriptLoc: .word 0x02024214
                        .RaiseAttackBS: .word 0x08888888
                        .Return: .word 0x08043127
                        AAAAAA refers to the following battle script. It raises the Pokemon's Attack.

                        Code:
                        #dynamic 0x888888
                        #freespacebyte 0xFF
                        
                        #org @Main
                        ppreduce
                        attackstring
                        pause DELAY_HALFSECOND
                        jumpifstat BANK_TARGET B_= 0x1 0xC 0x082DB596
                        setbyte 0x202448F 0x0
                        playstatchangeanimation BANK_TARGET 0x2 0x0
                        setbyte 0x202448E 0x11
                        statbuffchange 0x80 false 0x08000000
                        setword 0x203E320 0x8999999
                        printstring 0x184
                        pause DELAY_1SECOND
                        waitmessage DELAY_1SECOND
                        orbyte 0x202427C 0x8
                        goto 0x82D8A4E
                        999999 refers to the following string that is used in a variety of abilities.

                        Code:
                        FD 13 B4 E7 00 FD 1B FE E6 D5 DD E7 D9 D8 00 DD
                        E8 E7 00 BB E8 E8 D5 D7 DF AB
                        It says "User's Ability raised it's Attack!"
                        __________________
                        Reply With Quote
                          #112    
                        Old July 14th, 2015 (10:02 PM). Edited July 14th, 2015 by Chacha Dinosaur.
                        Chacha Dinosaur's Avatar
                        Chacha Dinosaur Chacha Dinosaur is offline
                        Adamant and adaptive dinosaur.
                           
                          Join Date: Jul 2013
                          Age: 24
                          Gender: Male
                          Posts: 453
                          Quote:
                          Originally Posted by MrDollSteak View Post
                          Lightningrod, Motor Drive, Dry Skin, Storm Drain and Sap Sipper
                          I was also eagerly waiting to see these abilities. :D

                          Quote:
                          Doesnt has informed me that there is probably going to be a bug with Discharge, Lava Plume, Surf and Petal Blizzard as they target all Pokemon on the field. If this is indeed the case I'll move them around.
                          The routines are at perfect location. No need to worry about that.
                          The problem lies within the Vanilla implementation of Water Absorb, Soundproof (causes Problems with Boomburst) and Flash Fire etc. In Gen III, they are not coded to handle moves that target all Pokemon on the field.
                          The Attachment (please bear with my poor handwriting) illustrates the Flow of Events that happen in the Battle Script of Earthquake.

                          Brief explanation of the Diagram:
                          Spoiler:

                          As most Battle Scripts will know, in normal execution, the BS selects the selects the first target, damages it and plays the move animation if applicable, and then selects the next valid target. If no targets are left, the move terminates the execution.

                          You will notice in the Flow Diagram that the Type Absorb abilities are checked in the Accuracy Checker (4th entry of the Ability BL is called) while the checks for Levitate and Wonder Guard are in the Damage Calculator (type-effectiveness section).

                          Now, I'll explain the reason of the bug and its remedy in the form Q & A:

                          Q: What happens if the Earthquake was set to Water Type and a target has Water Absorb in a Double Battle?
                          A: If the target having Water Absorb having is selected first, the accuracy checker will detect Water Absorb and branch out to a Battle Script dedicated for Water Absorb. This Battle Script is terminated by branching to the End Battle Script (at 0x1d694e for Fire Red) by using goto statement.
                          Since the Battle Script is terminated, the next two targets aren't checked at all. The Battle Script branches out of the target iterating loop.
                          If the only Water Absorb target is the last one to be selected, you will experience the correct behavior.

                          Q: Why don't Levitate or Wonder Guard experience this type of Bug?
                          A: Because their execution is handled in such a way that they do not branch out of the loop as seen in the Flow Diagram.

                          Q: Why don't moves like Bubble (target both foes) experience this type of Bug?
                          A: Because they are looped back by cmd49 which the part of End Battle Script and Water Absorb's Battle Script is also terminated by the same.

                          Q: What needs to be done to fix Water Absorb for Surf?
                          A: It is quite simple. You just need to add conditional branch statements to the Water Absorb Battle Scripts (preferably every branch) as denoted by the Flow Diagram i.e branching back to ending section of the loop if move ID is that of Surf.

                          Also, a few more things:
                          - Make Storm Drain to not draw Surf and Lightning Rod to not draw Discharge, they should just Absorb.
                          - Drawing abilities should now draw variable type moves like Hidden Power.
                          - Lightning Rod should not raise Sp. Attack of ground types.
                          - Explicit checks for Mold Breaker (if you are using it) in the Absorb routines of Storm Drain and Lightning Rod but not the in drawing routines.
                          Attached Images
                          File Type: jpg IMG_1738.JPG‎ (542.7 KB, 17 views) (Save to Dropbox)
                          Reply With Quote
                            #113    
                          Old July 14th, 2015 (10:13 PM). Edited July 14th, 2015 by Xencleamas.
                          Xencleamas's Avatar
                          Xencleamas Xencleamas is offline
                          Suddenly lurking in the shadows...
                             
                            Join Date: Feb 2014
                            Location: Asgard
                            Gender: Male
                            Nature: Adamant
                            Posts: 458
                            Quote:
                            Originally Posted by MrDollSteak View Post
                            Lightningrod, Motor Drive, Dry Skin, Storm Drain and Sap Sipper
                            I cannot get the stat change. I am Lightningrod and I'm hit by Thunderbolt. I only get the immunity but not the stat change.

                            And also .Raise<stat>BS errors on Motor Drive and the rest.
                            __________________

                            Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
                            Reply With Quote
                              #114    
                            Old July 14th, 2015 (11:05 PM).
                            MrDollSteak's Avatar
                            MrDollSteak MrDollSteak is online now
                            Formerly known as 11bayerf1
                               
                              Join Date: Dec 2008
                              Location: Hong Kong
                              Age: 23
                              Gender: Male
                              Posts: 844
                              Quote:
                              Originally Posted by KDS View Post
                              I was also eagerly waiting to see these abilities. :D
                              The routines are at perfect location. No need to worry about that.
                              The problem lies within the Vanilla implementation of Water Absorb, Soundproof (causes Problems with Boomburst) and Flash Fire etc. In Gen III, they are not coded to handle moves that target all Pokemon on the field.
                              The Attachment (please bear with my poor handwriting) illustrates the Flow of Events that happen in the Battle Script of Earthquake.
                              Yeah, I know what the issue was, so I was actually considering moving the abilities to where Levitate and Wonder Guard are handled.

                              Quote:
                              Originally Posted by Sky High View Post
                              I cannot get the stat change. I am Lightningrod and I'm hit by Thunderbolt. I only get the immunity but not the stat change.

                              And also .Raise<stat>BS errors on Motor Drive and the rest.
                              Can you explain this more?
                              __________________
                              Reply With Quote
                                #115    
                              Old July 14th, 2015 (11:59 PM).
                              Xencleamas's Avatar
                              Xencleamas Xencleamas is offline
                              Suddenly lurking in the shadows...
                                 
                                Join Date: Feb 2014
                                Location: Asgard
                                Gender: Male
                                Nature: Adamant
                                Posts: 458
                                Quote:
                                Originally Posted by MrDollSteak View Post
                                Can you explain this more?
                                I dunno what else I have encountered more problems but I can clear this out.

                                In a battle, I used Thunderbolt on Electivire which has Motor Drive. The Thunderbolt did not have any damage on Electivire. The immunity occurs. It supposed to have its Speed raised but with the routine, it didn't. Only appeared the immunity and the battle message "Motor Drive made Thunderbolt useless."

                                There is no problem with the battle scripts. When I removed the script, the battle goes fine and still giving the immunity and that message. I guess it is something have to do with the routines per ability.
                                __________________

                                Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
                                Reply With Quote
                                  #116    
                                Old July 15th, 2015 (9:33 AM).
                                AkimotoBubble AkimotoBubble is offline
                                   
                                  Join Date: Aug 2014
                                  Gender: Male
                                  Posts: 48
                                  Quote:
                                  Originally Posted by KDS View Post
                                  I was also eagerly waiting to see these abilities. :D



                                  The routines are at perfect location. No need to worry about that.
                                  The problem lies within the Vanilla implementation of Water Absorb, Soundproof (causes Problems with Boomburst) and Flash Fire etc. In Gen III, they are not coded to handle moves that target all Pokemon on the field.
                                  The Attachment (please bear with my poor handwriting) illustrates the Flow of Events that happen in the Battle Script of Earthquake.

                                  Brief explanation of the Diagram:
                                  Spoiler:

                                  As most Battle Scripts will know, in normal execution, the BS selects the selects the first target, damages it and plays the move animation if applicable, and then selects the next valid target. If no targets are left, the move terminates the execution.

                                  You will notice in the Flow Diagram that the Type Absorb abilities are checked in the Accuracy Checker (4th entry of the Ability BL is called) while the checks for Levitate and Wonder Guard are in the Damage Calculator (type-effectiveness section).

                                  Now, I'll explain the reason of the bug and its remedy in the form Q & A:

                                  Q: What happens if the Earthquake was set to Water Type and a target has Water Absorb in a Double Battle?
                                  A: If the target having Water Absorb having is selected first, the accuracy checker will detect Water Absorb and branch out to a Battle Script dedicated for Water Absorb. This Battle Script is terminated by branching to the End Battle Script (at 0x1d694e for Fire Red) by using goto statement.
                                  Since the Battle Script is terminated, the next two targets aren't checked at all. The Battle Script branches out of the target iterating loop.
                                  If the only Water Absorb target is the last one to be selected, you will experience the correct behavior.

                                  Q: Why don't Levitate or Wonder Guard experience this type of Bug?
                                  A: Because their execution is handled in such a way that they do not branch out of the loop as seen in the Flow Diagram.

                                  Q: Why don't moves like Bubble (target both foes) experience this type of Bug?
                                  A: Because they are looped back by cmd49 which the part of End Battle Script and Water Absorb's Battle Script is also terminated by the same.

                                  Q: What needs to be done to fix Water Absorb for Surf?
                                  A: It is quite simple. You just need to add conditional branch statements to the Water Absorb Battle Scripts (preferably every branch) as denoted by the Flow Diagram i.e branching back to ending section of the loop if move ID is that of Surf.

                                  Also, a few more things:
                                  - Make Storm Drain to not draw Surf and Lightning Rod to not draw Discharge, they should just Absorb.
                                  - Drawing abilities should now draw variable type moves like Hidden Power.
                                  - Lightning Rod should not raise Sp. Attack of ground types.
                                  - Explicit checks for Mold Breaker (if you are using it) in the Absorb routines of Storm Drain and Lightning Rod but not the in drawing routines.
                                  Hi :D I have a problem: could you tell me the EM' DamageAdders,I need it to do the new ORAS'Ability.
                                  __________________
                                  i am bubble,and sorry my english is not good ......
                                  Reply With Quote
                                    #117    
                                  Old July 15th, 2015 (9:54 AM).
                                  Chacha Dinosaur's Avatar
                                  Chacha Dinosaur Chacha Dinosaur is offline
                                  Adamant and adaptive dinosaur.
                                     
                                    Join Date: Jul 2013
                                    Age: 24
                                    Gender: Male
                                    Posts: 453
                                    Quote:
                                    Originally Posted by AkimotoBubble View Post
                                    Hi :D I have a problem: could you tell me the EM' DamageAdders,I need it to do the new ORAS'Ability.
                                    Could you rephrase your question? I did not get what you asked.
                                    Reply With Quote
                                      #118    
                                    Old July 15th, 2015 (10:05 AM).
                                    AkimotoBubble AkimotoBubble is offline
                                       
                                      Join Date: Aug 2014
                                      Gender: Male
                                      Posts: 48
                                      Quote:
                                      Originally Posted by KDS View Post
                                      Could you rephrase your question? I did not get what you asked.
                                      yah....
                                      In FR :02023D50 is DamageAddr
                                      I want know what is this in EM rom
                                      __________________
                                      i am bubble,and sorry my english is not good ......
                                      Reply With Quote
                                        #119    
                                      Old July 15th, 2015 (10:31 AM).
                                      kleenexfeu kleenexfeu is offline
                                         
                                        Join Date: Aug 2013
                                        Gender: Male
                                        Posts: 216
                                        Quote:
                                        Originally Posted by AkimotoBubble View Post
                                        yah....
                                        In FR :02023D50 is DamageAddr
                                        I want know what is this in EM rom
                                        0x020241f0 for Em. But for that kind or question mp or look inside some routine before asking as it's very specific
                                        Reply With Quote
                                          #120    
                                        Old July 15th, 2015 (10:40 AM).
                                        AkimotoBubble AkimotoBubble is offline
                                           
                                          Join Date: Aug 2014
                                          Gender: Male
                                          Posts: 48
                                          Quote:
                                          Originally Posted by KDS View Post
                                          Could you rephrase your question? I did not get what you asked.
                                          Thank you.I find it.
                                          Now I have another problem.

                                          No1:About Prankster ability
                                          This link is about Prankster
                                          http://m.ign.com/wikis/pokemon-x-y/Prankster
                                          And I do not know how to make the move quick guard.Could you write a ASM code for EM

                                          And No2:How to change the weather ability round to 5 (like gen6)

                                          Lost problem:About the weather can not change when i need.

                                          When i need :D I can make some weather change move or ability failure.

                                          soory my English not good.:(
                                          __________________
                                          i am bubble,and sorry my english is not good ......
                                          Reply With Quote
                                            #121    
                                          Old July 15th, 2015 (7:32 PM).
                                          Chacha Dinosaur's Avatar
                                          Chacha Dinosaur Chacha Dinosaur is offline
                                          Adamant and adaptive dinosaur.
                                             
                                            Join Date: Jul 2013
                                            Age: 24
                                            Gender: Male
                                            Posts: 453
                                            Quote:
                                            Originally Posted by AkimotoBubble View Post
                                            Thank you.I find it.
                                            Now I have another problem.

                                            No1:About Prankster ability
                                            This link is about Prankster
                                            http://m.ign.com/wikis/pokemon-x-y/Prankster
                                            And I do not know how to make the move quick guard.Could you write a ASM code for EM

                                            And No2:How to change the weather ability round to 5 (like gen6)

                                            Lost problem:About the weather can not change when i need.

                                            When i need :D I can make some weather change move or ability failure.

                                            soory my English not good.:(
                                            Prankster is already done by MrDS (though it is not the thread yet).
                                            Regarding Quick Guard, this is an Ability Resource thread not a Move Resource Thread. Also, I'm not hacking actively now for some time since I'm busy. But I may consider doing Quick Guard later.

                                            I haven't researched weather abilities yet.
                                            Reply With Quote
                                              #122    
                                            Old July 15th, 2015 (8:28 PM).
                                            MrDollSteak's Avatar
                                            MrDollSteak MrDollSteak is online now
                                            Formerly known as 11bayerf1
                                               
                                              Join Date: Dec 2008
                                              Location: Hong Kong
                                              Age: 23
                                              Gender: Male
                                              Posts: 844
                                              Quote:
                                              Originally Posted by AkimotoBubble View Post
                                              Thank you.I find it.
                                              Now I have another problem.

                                              No1:About Prankster ability
                                              This link is about Prankster
                                              http://m.ign.com/wikis/pokemon-x-y/Prankster
                                              And I do not know how to make the move quick guard.Could you write a ASM code for EM

                                              And No2:How to change the weather ability round to 5 (like gen6)

                                              Lost problem:About the weather can not change when i need.

                                              When i need :D I can make some weather change move or ability failure.

                                              soory my English not good.:(
                                              As KDS said I'll be uploading Prankster shortly. I've sort of redone the Priority System to use a BL that is called for every Banked Pokemon (same as the Speed Calc).

                                              Again as KDS said, ask about Quick Guard in the Move Resource Thread.

                                              Weather Abilities are called at about 42A18 in Emerald, though I'm rewriting the check for Snow Warning, and Kleenexfeu'ss abilities. I believe the actual endless weather effect is done by the battle script, so it could just be a matter of editing it there to set only five turns.
                                              __________________
                                              Reply With Quote
                                                #123    
                                              Old July 15th, 2015 (9:44 PM). Edited July 15th, 2015 by Chacha Dinosaur.
                                              Chacha Dinosaur's Avatar
                                              Chacha Dinosaur Chacha Dinosaur is offline
                                              Adamant and adaptive dinosaur.
                                                 
                                                Join Date: Jul 2013
                                                Age: 24
                                                Gender: Male
                                                Posts: 453
                                                I found the reason of the bug in the Damage Absorbing abilities.
                                                If your HP is full, you will not get the boosts. It is the HP check which is causing the problem.

                                                To disable HP check for non-HP restoring abilities, move #0x2 into r9 instead of #0x1 in their respective routines.
                                                Reply With Quote
                                                  #124    
                                                Old July 16th, 2015 (3:43 PM).
                                                AkimotoBubble AkimotoBubble is offline
                                                   
                                                  Join Date: Aug 2014
                                                  Gender: Male
                                                  Posts: 48
                                                  Quote:
                                                  Originally Posted by MrDollSteak View Post
                                                  As KDS said I'll be uploading Prankster shortly. I've sort of redone the Priority System to use a BL that is called for every Banked Pokemon (same as the Speed Calc).

                                                  Again as KDS said, ask about Quick Guard in the Move Resource Thread.

                                                  Weather Abilities are called at about 42A18 in Emerald, though I'm rewriting the check for Snow Warning, and Kleenexfeu'ss abilities. I believe the actual endless weather effect is done by the battle script, so it could just be a matter of editing it there to set only five turns.
                                                  It so nice:D I am waiting you are ASM code I need it
                                                  __________________
                                                  i am bubble,and sorry my english is not good ......
                                                  Reply With Quote
                                                    #125    
                                                  Old July 16th, 2015 (4:50 PM). Edited July 16th, 2015 by Xencleamas.
                                                  Xencleamas's Avatar
                                                  Xencleamas Xencleamas is offline
                                                  Suddenly lurking in the shadows...
                                                     
                                                    Join Date: Feb 2014
                                                    Location: Asgard
                                                    Gender: Male
                                                    Nature: Adamant
                                                    Posts: 458
                                                    Quote:
                                                    Originally Posted by KDS View Post
                                                    I found the reason of the bug in the Damage Absorbing abilities.
                                                    If your HP is full, you will not get the boosts. It is the HP check which is causing the problem.

                                                    To disable HP check for non-HP restoring abilities, move #0x2 into r9 instead of #0x1 in their respective routines.
                                                    Thanks! Lightningrod and the works fine now and I get the stat boosts, as well as the AI does. But another thing I've found out:

                                                    If the combatants keep attacking that causes the ability to activate and when a certain stat maxed out, should it be sent to where the script where the and displaying the "User's Ability made Move's useless!" instead of "User's restored HP using its Ability!"? This also causes the AI to suddenly faint.

                                                    And also string problems when I'm facing a wild one having these abilities. Sometimes when the AI gains stat due to these, the message error occurs sometimes the player's "User"'s name is displayed. When the wild's message, the name's blank.

                                                    Also in Mold Breaker, when the Mold Breaker user is going to attack the opponent which has any of those Type Absorb Abilities, the game freezes after selecting a move.
                                                    __________________

                                                    Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
                                                    Reply With Quote
                                                    Reply

                                                    Quick Reply

                                                    Join the conversation!

                                                    Create an account to post a reply in this thread, participate in other discussions, and more!

                                                    Create a PokéCommunity Account
                                                    Thread Tools

                                                    Posting Rules
                                                    You may not post new threads
                                                    You may not post replies
                                                    You may not post attachments
                                                    You may not edit your posts

                                                    BB code is On
                                                    Smilies are On
                                                    [IMG] code is On
                                                    HTML code is Off

                                                    Forum Jump


                                                    All times are GMT -8. The time now is 12:43 AM.