Registrarse

[RH - ASM] Comprobar felicidad en ruby

Estado
Cerrado para nuevas respuestas.

K3ZZ0

Usuario de platino
Es posible comprobar, aumentar y disminuir la felicidad en Pokémon Ruby (U) en RH binario ? Se que se puede en Fire Red con el engine de JPAN.
 

Andrea

Usuario mítico
Unfortunately i don't test the routine, because i don't have time...
A possible solution could be the following:

.THUMB
.ALIGN 2

PUSH {R0-R3, LR}
LDR R2, = 0x0202E8C4 @ VAR_8000, POINTER TO VALUE
LDRH R0, [R2, # 4] @ VAR_8002, SLOT_INDEX
MOV R1, # 0x64
MUL R0, R1
LDR R1, = 0x03004360
ADD R0, R1
LDRH R1, [R2, # 2] @ VAR_8001, ATTR_INDEX
LDR R3, = 0x0803D2EC @SET_BOX_MON_DATA
BL BX_R3
POP {R0-R3, PC}

BX_R3:
BX R3
The script you will need to use will look something like this:

#dyamic 0x800000
#org @start
lock
setvar 0x8000 0xValue_of_happiness
setvar 0x8001 0xIndex_of_attribute
setvar 0x8002 0xIndex_of_party_slot
callasm 0xOffset_routine+1
release
end
More explicitly, the variable 0x8000 must contain the value that will be set to your team's pokémon (happiness, but with this routine you can also modify other attributes).
The index of the attribute to be modified must be contained in the variable 0x8001 (in your case happines corresponds to 0x20).
The list of the attribute index is shown below:
#definisce ATTR_PID 0x0
#define ATTR_TID 0x1
#define ATTR_NAME 0x2
#define ATTR_FONT_LANG 0x3
#define ATTR_SANITY 0x4
#define ATTR_OT_NAME 0x7
#define ATTR_MARKS 0x8
#define ATTR_CHECKSUM 0x9
#define ATTR_SPECIES 0xB
#define ATTR_HELD_ITEM 0xC
#define ATTR_ATTACK_1 0xD
#define ATTR_ATTACK_2 0xE
#define ATTR_ATTACK_3 0xF
#define ATTR_ATTACK_4 0x10
#define ATTR_PP_1 0x11
#define ATTR_PP_2 0x12
#define ATTR_PP_3 0x13
#define ATTR_PP_4 0x14
#define ATTR_PP_BONUS 0x15
#define ATTR_COOLNESS 0x16
#define ATTR_BEAUTY 0x17
#define ATTR_CUTENESS 0x18
#define ATTR_EXP 0x19
#define ATTR_HP_EV 0x1A
#define ATTR_ATTACK_EV 0x1B
#define ATTR_DEFENCE_EV 0x1C
#define ATTR_SPEED_EV 0x1D
#define ATTR_SP_ATTACK_EV 0x1E
#define ATTR_SP_DEFENCE_EV 0x1F
#define ATTR_HAPPINESS 0x20
#define ATTR_SMARTNESS 0x21
#define ATTR_POKERUS 0x22
#define ATTR_CATCH_LOCATION 0x23
#define ATTR_CATCH_LVL 0x24
#define ATTR_HP_IV 0x27
#define ATTR_ATTACK_IV 0x28
#define ATTR_DEFENCE_IV 0x29
#define ATTR_SPEED_IV 0x2A
#define ATTR_SPECIAL_ATTACK_IV 0x2B
#define ATTR_SPECIAL_DEFENCE_IV 0x2C
#define ATTR_IS_EGG 0x2D
#define ATTR_ABILITY_BIT 0x2E
#define ATTR_TOUGHNESS 0x2F
#define ATTR_SHEEN 0x30
#define ATTR_STATUS_AILMENT 0x37
#define ATTR_LEVEL 0x38
#define ATTR_CURRENT_HP 0x39
#define ATTR_TOTAL_HP 0x3A
#define ATTR_ATTACK 0x3B
#define ATTR_DEFENCE 0x3C
#define ATTR_SPEED 0x3D
#define ATTR_SPECIAL_ATTACK 0x3E
#define ATTR_SPECIAL_DEFENCE 0x3F
#define ATTR_SPECIES_2 0x41
Finally, the variable 8002 must contain the index of the slot of the pokémon on which you want to act (values from 0 to 5).
 
Estado
Cerrado para nuevas respuestas.
Arriba