- 48
- Posts
- 10
- Years
- Seen Nov 1, 2024
UPDATE : 100% working afaik, here is :
Stance Change:
Spoiler:
Emerald :
Spoiler:
The battle scripts come first :
Spoiler:
BladeBS:
Spoiler:
#org 0xSomeLoc
nop3
nop3
setword 0x203E320 0x8PPPPPP
printstring 0x184
waitmessage 0x40
playanimation 0x1 0x20 0x0 //The green bold byte must be an animation similar to transform, see the mega weathers to expand the table
waitanimation
setword 0x203E320 0x8StringBlade
printstring 0x184
waitmessage 0x40
goto 0x8XXXXXX
StringBlade:
Code:FD 0D 00 DD E7 00 E2 E3 EB 00 DD E2 00 DD E8 E7 00 D6 E0 D5 D8 D9 00 DA E3 E6 E1 AB FF FF
ShieldBS:
Spoiler:
#org 0xSomeLoc
nop3
nop3
setword 0x203E320 0x8PPPPPP
printstring 0x184
waitmessage 0x40
playanimation 0x1 0x20 0x0 //The green bold byte must be an animation similar to transform, see the mega weathers to expand the table
waitanimation
setword 0x203E320 0x8StringShield
printstring 0x184
waitmessage 0x40
goto 0x8XXXXXX
StringShield:
Code:FD 0D 00 DD E7 00 E2 E3 EB 00 DD E2 00 DD E8 E7 00 E7 DC DD D9 E0 D8 00 DA E3 E6 E1 AB FF FF
At XX XX XX :
Spoiler:
2E 8B 44 02 02 00 E7 2F 8B 44 02 02 01 2D 8B 44 02 02 6C 40 02 02 01 YY YY YY 08 3C
YY YY YY being the address of the red bold byte.
At PP PP PP :
Spoiler:
FD 0D B4 E7 00 CD E8 D5 E2 D7 D9 00 BD DC D5 E2 DB D9 AB FF
Main routine : (same hook than mold break, we'll see later for compatibility)
Spoiler:
Code:.thumb push {r4-r7} ldr r0, FreeRam ldrb r1, [r0] cmp r1, #0 bne Return ldr r0, Bank ldrb r0, [r0] mov r5, r0 mov r1, #1 and r1, r0 cmp r1, #0 beq Player AI: ldr r6, AIParty mov r1, #3 b CheckAegi Player: ldr r6, PlayerParty mov r1, #0 CheckAegi: ldr r0, MemLoc ldr r0, [r0] add r0, #0x60 ldrb r0, [r0, r1] mov r1, #2 and r1, r5 cmp r1, #0 beq Continue lsl r0, r0, #4 lsr r0, r0, #4 lsl r0, r0, #4 Continue: lsr r0, r0, #0x4 mov r1, r6 mov r2, #0x64 mul r0, r2 add r0, r1 mov r1, #0xB mov r4, r0 ldr r3, getattr bl Jump ldr r1, ABlade cmp r0, r1 beq CheckKing ldr r1, AShield cmp r0, r1 beq CheckMove Return: pop {r4-r7} ldr r3, =0x8041A6C+1 bl Jump lsl r0, r0, #0x18 lsr r2, r0, #0x18 cmp r2, #0 beq ReturnPos ldr r0, =0x8046398+1 mov pc, r0 ReturnPos: ldr r0, =0x8046072+1 mov pc, r0 CheckMove: bl BData ldr r0, CurMove ldrh r0, [r0] ldr r1, KingShield cmp r0, r1 beq Return ldr r1, ABlade strh r1, [r5] ldr r2, var8004 mov r7, r1 b ChangePokeParty CheckKing: bl BData ldr r0, CurMove ldrh r0, [r0] ldr r1, KingShield cmp r0, r1 bne Return ldr r1, AShield strh r1, [r5] ldr r2, var8004 mov r7, r1 ChangePokeParty: strh r1, [r2] mov r0, r4 mov r1, #0xB ldr r3, setattr bl Jump mov r0, r4 ldr r3, calcstats bl Jump ChangeBattleStats: mov r1, #0x54 mov r0, r4 ldr r3, getattr bl Jump strh r0, [r5, #2] mov r1, #0x55 mov r0, r4 ldr r3, getattr bl Jump strh r0, [r5, #4] mov r1, #0x56 mov r0, r4 ldr r3, getattr bl Jump strh r0, [r5, #6] mov r1, #0x57 mov r0, r4 ldr r3, getattr bl Jump strh r0, [r5, #8] mov r1, #0x58 mov r0, r4 ldr r3, getattr bl Jump strh r0, [r5, #0xA] KeepAttackSafe: ldr r3, ScriptPusher bl Jump ldr r1, ABlade cmp r7, r1 bne ShieldScript BladeScript: ldr r2, BladeBS b Store ShieldScript: ldr r2, ShieldBS Store: ldr r1, CurBS str r2, [r1] ldr r0, FreeRam mov r1, #1 strb r1, [r0] pop {r4-r7} ldr r3, Test Jump: mov pc, r3 Jumpr4: mov pc, r4 BData: push {lr} mov r1, #0x58 mul r5, r1 ldr r1, BattleData add r5, r1 pop {pc} .align 2 BladeBS: .word 0x08____ ShieldBS: .word 0x08____ BattleData: .word 0x02024084 KingShield: .word 0x5E /*Move King Shield*/ ABlade: .word 0x__ /*Index number of Aegislash Blade*/ AShield: .word 0x__ /*Aegislash Shield*/ MemLoc: .word 0x0202449C getattr: .word 0x0806A518+1 Bank: .word 0x0202420B PlayerParty: .word 0x020244EC AIParty: .word 0x02024744 calcstats: .word 0x08068D0C+1 setattr: .word 0x0806ACAC+1 var8004: .word 0x020275D8 + (0x8004*2) ScriptPusher: .word 0x0803FAFC+1 CurMove: .word 0x020241EA CurBS: .word 0x02024214 Test: .word 0x08046398+1 FreeRam: .word 0x0203E33C /*00 48 00 47 xx+1 xx xx 08 at 08046064. It should be include in Mold breaker*/
Modification of the "end" command :
Spoiler:
Code:.thumb ldr r0, FreeRam mov r1, #0 strb r1, [r0] ldr r0, End bx r0 .align2 FreeRam: .word 0x0203E33C End: .word 0x8______ /*old location of your "end" command or the second routine of the life orb if you're using it Replace your "end" command with that one
Switch out check :
Spoiler:
This includes the check for the Primal weathersCode:.text .align 2 .thumb .thumb_func .global regenerator AbilityBuffer: add r0, r1, r3 add r0, #0x20 ldrb r0, [r0] RegeneratorCheck: cmp r0, #[B]0x91 [/B] /*Index number of your ability Regenerator*/ beq Regenerator NaturalCureCheck: cmp r0, #0x1E bne CheckDelta NaturalCure: ldr r0, .Return bx r0 CheckAegi: push {r0-r7} ldr r0, Bank ldrb r0, [r0] mov r5, r0 mov r1, #1 and r1, r0 cmp r1, #0 beq Player AI: ldr r7, AIParty mov r1, #3 b CheckAegis Player: ldr r7, PlayerParty mov r1, #0 CheckAegis: ldr r0, MemLoc ldr r0, [r0] add r0, #0x60 ldrb r0, [r0, r1] lsr r0, r0, #0x4 mov r1, r7 mov r2, #0x64 mul r0, r2 add r0, r1 mov r1, #0xB mov r4, r0 ldr r3, getattr bl Jump ldr r1, ABlade cmp r0, r1 beq Revert BackEnd: pop {r0-r7} NoAbility: ldr r0, .Return2 bx r0 Revert: ldr r1, AShield ldr r2, var8004 strh r1, [r2] mov r0, r4 mov r1, #0xB ldr r3, setattr bl Jump mov r0, r4 ldr r3, calcstats bl Jump b BackEnd Regenerator: GetHP: add r3, #0x28 add r3, r1, r3 mov r1, #0x20 mul r0, r1 mov r1, #0x60 push {r3} bl Divide pop {r3} ldrh r1, [r3] add r0, r0, r1 b CheckHP CheckDelta: cmp r0, #[B]0xC0 [/B] /*Index number of your ability Delta Stream*/ beq Delta b CheckDesolate CheckHP: ldrh r2, [r3, #0x4] cmp r0, r2 ble StoreHP MaxHP: mov r0, r2 StoreHP: strh r0, [r3] BufferHealthChange: ldr r2, .CommandTable ldrb r1, [r4] ldr r0, .RamLoc ldr r0, [r0] add r0, r1, r0 add r0, #0x58 ldrb r0, [r0] lsl r0, r0, #0x2 add r0, r0, r2 ldrb r2, [r0] mov r0, r1 mul r0, r6 add r0, r0, r3 str r0, [sp] mov r0, #0x0 HealthChangeIndex: mov r1, #0x2A Success: ldr r3, .Return3 bx r3 Divide: ldr r3, .DivideLoc bx r3 CheckDesolate: cmp r0, #[B]0xBF [/B] /*Index number of yout ability Desolate Land*/ beq Desolate CheckPrimordial: cmp r0, #[B]0xBE[/B] /*Index number of yout ability Primordial Sea*/ beq Primordial b CheckAegi NormalWeather: push {lr} bl ScriptPusher ldr r1, ActiveBS ldr r2, ScriptNormalWeather str r2, [r1] pop {pc} bl ScriptPoper b NoAbility Delta: ldr r2, .FreeRam ldrb r0, [r2] cmp r0, #[B]0xC0 [/B] /*Index number of your ability Delta Stream*/ bne NoAbility b ClearWeather Desolate: ldr r2, .FreeRam ldrb r0, [r2] cmp r0, #[B]0xBF[/B] /*Index number of your ability Desolate Land*/ bne NoAbility b ClearWeather Primordial: ldr r2, .FreeRam ldrb r0, [r2] cmp r0, #[B]0xBE [/B] /*Index number of your ability Primordial Sea*/ bne NoAbility ClearWeather: mov r0, #0x00 strb r0, [r2] ldr r2, .CurrentWeather mov r0, #0x00 strb r0, [r2] b NormalWeather ScriptPusher: ldr r0, ScriptPush bx r0 ScriptPoper: ldr r0, ScriptPop bx r0 Jump: mov pc, r3 .align 2 .CurrentWeather: .word 0x020243CC .FreeRam: .word 0x0203E331 .Return: .word 0x08055A9F .Return2: .word 0x08055AD3 .CommandTable: .word 0x08A20000 .RamLoc: .word 0x0202449C .Return3: .word 0x08055AC7 .DivideLoc: .word 0x082E7541 ActiveBS: .word 0x02024214 ScriptNormalWeather: .word 0x08A1FCF0 ScriptPush: .word 0x0803FAFC+1 ScriptPop: .word 0x0803FB24+1 ABlade: .word 0xFD AShield: .word 0xFE MemLoc: .word 0x0202449C getattr: .word 0x0806A518+1 Bank: .word 0x0202420B PlayerParty: .word 0x020244EC AIParty: .word 0x02024744 calcstats: .word 0x08068D0C+1 setattr: .word 0x0806ACAC+1 var8004: .word 0x020275D8 + (0x8004*2) /*Insert 00 48 00 47 XX XX XX 08 00 00 at 0x55A94*/
Revert in the end of the battle :
Spoiler:
Code:.thumb CheckAegi: push {r0-r7} mov r5, #0 ldr r7, PlayerParty mov r1, #0xB Loop: cmp r5, #5 beq BackEnd mov r4, r5 mov r2, #0x64 mul r4, r2 add r4, r7 mov r1, #0xB mov r0, r4 ldr r3, getattr bl Jump ldr r1, ABlade cmp r0, r1 beq Revert add r5, #1 b Loop BackEnd: pop {r0-r7} b ClearRam Revert: ldr r1, AShield ldr r2, var8004 strh r1, [r2] mov r0, r4 mov r1, #0xB ldr r3, setattr bl Jump mov r0, r4 ldr r3, calcstats bl Jump b BackEnd ClearRam: ldr r0, =0x803DE41 str r0, [r1] ldr r0, FreeRam mov r1, #0 strb r1, [r0] ldr r1, =0x30061E8 ldr r0, =0x8038421 str r0, [r1] ldr r0, =0x803DE2A mov pc, r0 Jump: mov pc, r3 .align 2 FreeRam: .word 0x0203E331 ABlade: .word 0xFD AShield: .word 0xFE MemLoc: .word 0x0202449C getattr: .word 0x0806A518+1 Bank: .word 0x0202420B PlayerParty: .word 0x020244EC AIParty: .word 0x02024744 calcstats: .word 0x08068D0C+1 setattr: .word 0x0806ACAC+1 var8004: .word 0x020275D8 + (0x8004*2) /*00 48 00 47 xx+1 xx xx 08 at 0803DDE4*/
Note:
Spoiler:
-Your Aegislash will be slightly brighter than usual (because I use transform animation).
MrDS, if you read this, I'm sure you can help :p, it's just a matter of doing a better animation, we can alternatively use the 0x1C anim instead of the transform one
-I used a FreeRam location because otherwise aegislash couldn't transform if froze or confused etc. The FreeRam must be the same in both routine (but different than the life orb
if you're using it).
-See my documentation on the battle script commands for the "nop3"
Look great.And i have A problem You use the 1C animation make image change And when i change pokemon Will the image change?And when battle end?