-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathhooks
492 lines (403 loc) · 13.8 KB
/
hooks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
#include "include/config.h"
#include "include/debug.h"
#overlay 1 is loaded in at 021E5900
#overlay 2 is loaded in at 02245B80
#overlay 12 is loaded in at 022378C0
#mega
0012 LoadMegaOam 0226715C 1
0012 MegaButtonCheck 02267F04 2
0012 load_mega_button 0802FBFC 1
0012 Sub_PokeIconResourceLoad 080308D4 1
0012 Sub_PokeIconResourceFree 08030954 1
0012 ServerBeforeAct 08011A4C 2
0012 ServerWazaBefore 08014ACC 2
#0012 set_proper_mega_status 0802E868 4
0012 set_proper_mega_status 0802E8C4 0
# 0226762C
0012 shift_cancel_over 0802FD6C 0
#0224C690
0012 ServerHPCalc 08014DD0 2
arm9 PokePicLoad 080701EC 1
arm9 PokeOtherFormMonsNoGet 08072634 2
arm9 PokeIconIndexGetByMonsNumber 080741BC 3
arm9 PokeIconCgxPatternGet 080742CC 1
arm9 IconPalGet 08074364 2
arm9 ItemDataTableLoad 08078138 1
#0206DED0+4
arm9 CreateBoxMonData_hook 0806DED4 5
arm9 LoadEggMoves 0806C488 2
#arm9 InheritMoves 0206C510 3 # come back later for egg move expansion
#02070E34+4
arm9 GetMonEvolution_hook 08070E38 5
0007 hook_7_spriteOffsetSpecies 08018A48 3
0012 hook_12_spriteOffsetSpecies 08022154 2
0012 hook_12_spriteOffsetSpecies_escapeFromBall 02259DBC 2
0012 fix_double_spriteOffsetSpecies 02259C0C 2
0012 Battle_End 08000B90 1
0012 TryRevertFormChange_hook 080069AC 2
0012 CheckCanTakeItem 02241334 0
#expand items
arm9 GetItemIndex 08077C18 2
arm9 GetItemArcData 08077CE8 3
#mon expansion
arm9 GetPokemonOwNum 0206A304 1
arm9 GetMonIconPalette 02074364 3
# wild mon hidden ability/form stuff
#02247910
0002 get_form_out_of_encounter_species_rare 02247910 4
#02247A00
0002 modify_species_encounter_data_rare 02247A00 1
#02247A1C
0002 get_form_out_of_encounter_species 02247A1C 4
#02247B42
0002 modify_species_encounter_data 02247B42 3
# starter hidden ability stuff
arm9 set_starter_hidden_ability_hook 02096158 5
#battle hooks
#02256FF8+4
0012 calc_base_damage_hook 02256FFC 5
0012 CalcDamageOverall 0223DCE0 2
0012 AdjustDamageForRoll 02257C30 3
#02252EC8
0012 MoveCheckDamageNegatingAbilities 0801B608 3
#02253194
0012 SwitchInAbilityCheck 0801B8D4 2
## this is no longer needed--handled in
##02253068
#0012 TurnEndAbilityCheck 0801B7A8 3
#02253E04
0012 MoveHitDefenderAbilityCheck 0801C544 3
#0224BCC4+4
0012 CalcAccuracy_hook 08014408 5
#0224FC48+4
0012 CalcSpeed_hook 0801838C 5
#02257C5C+4
0012 CalcCritical_hook 080203A0 5
#022555EC
0012 GetBattleMonItem 0801DD2C 2
#02252834
0012 MoldBreakerAbilityCheck_hook 0801AF78 5
#02254580
0012 SynchroniseAbilityCheck 02254580 3
#02256914
0012 BattleFormChangeCheck 0801F054 3
#0224CAA4
0012 ServerWazaOutAfterMessage 080151E4 3
#0224E078
0012 ServerFlinchCheck 080167B8 3
#0224C218
0012 ServerWazaKoyuuCheck 08014944 2
#battle script command hooks
#0223E568
0012 btl_scr_cmd_24_jumptocurmoveeffectscript 08006CA8 3
#0223ED78
0012 btl_scr_cmd_33_statbuffchange 080074B8 3
#022404e0
0012 btl_scr_cmd_54_ohko_move_handle 08008C20 3
0012 CheckMoveIsChargeMove 022525AC 2
0012 btl_scr_cmd_5f_trysleeptalk 02240F7C 3
#02241F10
0012 btl_scr_cmd_6f_fury_cutter_damage_calc 02241F10 3
#02242710
0012 btl_scr_cmd_7c_beat_up_damage_calc 0800AE50 3
#0224324C
0012 btl_scr_cmd_8c_lowkickdamagecalc 0800B98C 3
#02245008
0012 btl_scr_cmd_d0_checkshouldleavewith1hp 0800D748 3
#022450B0
0012 btl_scr_cmd_d1_trynaturalcure 0800D7F0 3
#0223E004
0012 btl_scr_cmd_17_playanimation 08006744 3
#0223E080
0012 btl_scr_cmd_18_playanimation2 080067C0 3
#0223E6A0
0012 btl_scr_cmd_27_shouldgetexp 08006DE0 3
0012 btl_scr_cmd_0E_waitmessage 0223DCAC 3
0012 Link_QueueIsEmpty 0224ED48 1
0012 btl_scr_cmd_87_tryknockoff 02242EB4 3
0012 BtlCmd_GoToMoveScript 0223E594 3
0012 BtlCmd_WeatherHPRecovery 02242380 3
0012 BtlCmd_CalcWeatherBallParams 022432AC 3
0012 BtlCmd_EndOfTurnWeatherEffect 02241B30 3
0012 BtlCmd_TrySubstitute 022414F0 3
0012 BtlCmd_RapidSpin 02242238 3
0012 BtlCmd_CheckSubstitute 0224514C 3
0012 BtlCmd_TryWish 02242B58 3
0012 BtlCmd_TryFutureSight 02242570 3
0012 BtlCmd_SetMultiHit 0223EC10 3
0012 BtlCmd_GenerateEndOfBattleItem 022440A0 3
#trainer data expansion
arm9 MakeTrainerPokemonParty 08073604 3
arm9 TT_TrainerTypeSexGet 020735F8 1
#fix money calculation -
0012 fix_money_calc 0800829E 0
#illusion hooks
#02258EE0
0012 ClientPokemonEncount 08021620 2
#02258EF4
0012 ClientPokemonEncountAppear 08021634 2
#02258F08
0012 ClientPokemonAppear 08021648 2
#022480C0
0012 MessageParam_GetNickname 08010800 3
#02261464+4
0012 CT_SwitchInMessageParamMake_hook 08029BA8 5
#022615F0+4
0012 CT_EncountSendOutMessageParamMake_hook 08029D34 5
#move expansion
#0225839A - edits to ST_ServerAddStatusParamSet to be better
0012 remap_move_effect_to_subscript_table 08020ADA 0
#battle script command expansion
#0223CF68 - edits to the battle script command handler
0012 BattleScriptCommandHandler 080056A8 2
#reset battlemon switch in flags (now really really do it)
# smack in the middle of BattleSystem_GetBattleMon
0012 ClearBattleMonFlags_hook 0224E998 3
# need to do it in the middle of InitFaintedWork too
0012 ClearBattleMonFlags_hook2 0225155C 0
#hidden ability
arm9 SetBoxMonAbility 080722DC 1
arm9 GiveMon_hook 080541E0 5
#0224855C
#need to use this to UpdatePassiveForms, reinitialize the moveset, set the hidden ability, recalc stats
0002 AddWildPartyPokemon_hook 080029E0 5
arm9 ScrCmd_GiveEgg 0204D248 1
0001 ScrCmd_GiveTogepiEgg 022020CC 1
arm9 sub_0206D328 0206D328 2
#hof/pokeathlon/pokewalker fix
0063 grab_overworld_a081_index 080025E4 3
0096 grab_overworld_a081_index 080038B8 3
0112 grab_overworld_a081_index 021F0E14 3
arm9 get_mon_ow_tag 08069D70 3
#genesect formes
arm9 ArceusBoxPokemonFormeChange 08071BD0 3
#pc screen forme change
0014 HandleBoxPokemonFormeChanges 08000BD0 3
#use item attribute change
arm9 UseItemMonAttrChangeCheck_hook 0807C29C 0
0094 UseItemMonAttrLoadDiffMessage_hook 021E5A6A 1
#ifdef ALLOW_SAVE_CHANGES
arm9 Sav2_Misc_sizeof 0802A8B4 0
arm9 Sav2_Misc_init_new_fields_hook 0802A8CC 0
#ifdef ITEM_POCKET_EXPANSION
arm9 Sav2_Bag_sizeof 08078180 0
arm9 Sav2_Bag_new 08078188 1
arm9 Sav2_Bag_init 080781A0 1
arm9 Sav2_Bag_copy 080781B4 2
arm9 Bag_GetRegisteredItemSlot1 080781C4 1
arm9 Bag_GetRegisteredItemSlot2 080781D0 1
arm9 Bag_TryRegisterItem 080781DC 2
arm9 Bag_UnregisterItem 08078208 2
# needs an extended hook +4
arm9 Bag_GetItemPocket_hook 08078244 5
arm9 Pocket_GetItemSlotForAdd_hook 080782E0 5
arm9 Bag_GetItemSlotForAdd_hook 08078344 5
arm9 Bag_HasSpaceForItem_hook 08078388 5
arm9 Bag_AddItem_hook 0807839C 5
arm9 Pocket_GetItemSlotForRemove_hook 080783E4 5
arm9 Bag_GetItemSlotForRemove_hook 08078414 5
arm9 Bag_TakeItem_hook 08078438 5
arm9 Pocket_TakeItem_hook 08078484 5
arm9 Bag_HasItem_hook 080784B4 5
# no more extended hook
arm9 Bag_PocketNotEmpty 080784C4 2
arm9 Bag_GetQuantity 08078550 3
arm9 Pocket_GetQuantity 08078568 3
arm9 SwapItemSlots 0807857C 2
arm9 PocketCompaction 080785A0 2
arm9 SortPocket 080785EC 2
arm9 CreateBagView 08078644 3
arm9 Bag_GetPocketSlotN 08078724 3
#endif
#endif
#deerling forms
arm9 Party_TryResetShaymin 08071E78 3
#significant gender differences forms
arm9 GetBoxMonSex 0806FF90 1
arm9 grab_sex_for_GetBoxMonData 0806EA1A 1
#item time baby - 02257FA0
0012 MoveHitUTurnHeldItemEffectCheck 080206E0 3
#0224E1BC - after move hit effects
0012 ServerWazaHitAfterCheckAct 080168FC 2
# post-move effects, not necessarily on hit
0012 ServerDoPostMoveEffects 0224CC88 2
#02255634
0012 CheckDefenderItemEffectOnHit 02255634 3
arm9 GetMoveDataTable 02073300 1
# add linked overlay support
arm9 HandleLoadOverlay 02006FF8 2
arm9 UnloadOverlayByID 02006F7C 1
arm9 GF_Snd_LoadSeq 02004764 1
arm9 GF_Snd_LoadSeqEx 02004784 2
arm9 StoreFieldSysPtr 0203E028 1
#ifdef IMPLEMENT_BDHCAM_ROUTINE
# bdhcam
arm9 FUN_GDMI 02023174 3
0001 FUN_RHDtaArc 021FB04C 3
0001 FUN_ReadEntryDataArc 021FB164 3
arm9 IsPlayerOnIce 0205B828 1
#endif
#ifdef IMPLEMENT_TRANSPARENT_TEXTBOXES
#transparent textbox
arm9 Tr_TextBox 0205B564 2
arm9 FieldMsgPrintInit 0205B4EC 2
arm9 WindowClose 02041190 0
#endif
arm9 GrabCryNumSpeciesForm 02006A0C 2
#ifdef IMPLEMENT_WILD_DOUBLE_BATTLES
# r0 isn't used, can be burned
0002 WildEncSingle 02247424 0
0002 WildWaterEncSingle_hook 022474E4 5
# can't modify SetFieldBattleParam since it is used for sweet scent and fishing and such
#0002 TryTriggerWildDoubleBattle 02248284 0
0002 TryTriggerWildDoubleBattle 02246E0E 0
0012 KeepPlayerPaletteIntact 022607BC 1
0012 MakeSureDoublesBitIsSet 0226328E 0
0008 ReleaseDoubleBattleWhenOnlyOneMon 02222CBC 1
#endif
#ifdef IMPLEMENT_CAPTURE_EXPERIENCE
0012 Task_DistributeExp_capture_experience_hook 0224688A 0
0012 DontFreeMemoryIfCatchExp 022463A0 0
#endif
# used to implement new balls + critical capture
0012 CalculateBallShakes 02247228 2
#ifdef IMPLEMENT_CRITICAL_CAPTURE
0012 DealWithCriticalCaptureShakes_hook 02246758 1
0007 LoadCaptureSuccessSPA 0223261C 1
0007 LoadCaptureSuccessSPAStarEmitter 02232644 1
0007 LoadCaptureSuccessSPANumEmitters 02232630 1
#endif
0001 SpeciesAndFormeToWazaOshieIndex 02202C7C 2
# need another hook for this one yeah yeah
0012 ServerDoTypeCalcMod_hook 02251D2C 5
0012 AITypeCalc_hook 02252058 5
0012 GrabMoveTypeForConversion2 0224DD7C 2
# pokewalker grab sprite
0112 GrabPokewalkerMonSpriteIndex 021E9480 3
#ifdef IMPLEMENT_NEW_EV_IV_VIEWER
# code from LheaRachel on github based on code from Bubble791 now on heartgold
arm9 Summary_IVEV 02088B60 1
arm9 Summary_Entry_Hook 0208D2C4 1
#endif
arm9 CanUseItemOnMonInParty_hook 020902BC 5
#ifdef IMPLEMENT_LEVEL_CAP
0012 ImplementLevelCap_hook 02245A28 3
arm9 Pokemon_TryLevelUp 02070DB4 1
arm9 CapRareCandies 0208FEEA 1
#endif
# rewrite tailwind counter decrement to use our new counter
0012 ServerFieldConditionCheck 022494DC 2
# dex digits
0018 FormatDexNumberAnimationDigits 021E6A98 3
# allow for grabbing ally and such in battle script parameters
0012 GrabClientFromBattleScriptParam 0224768C 3
0012 read_battle_script_param 022454E8 1
0012 LoadBattleSubSeqScript 0224EB9C 3
0012 PushAndLoadBattleScript 0224EBDC 3
0012 ServerInit 02248660 1
0012 CantEscape_hook 02252984 5
0012 BattlerCantSwitch 02255920 3
0012 BattleTryRun 02252B68 3
arm9 ModifyStatByNature 0206FE3C 3
# when a specific mon is in illusion, the target icon brought up needs to be in the illusioned state
0012 target_select_inject_illusion_icon 02267CDC 0
#ifdef ALLOW_SAVE_CHANGES
#ifdef EXPAND_PC_BOXES
# save expansion
arm9 SaveData_New 020271B0 0
arm9 SaveArray_Get 020272C8 2
arm9 Save_DeleteAllData 020272F4 1
arm9 SaveGameNormal 020273F0 1
arm9 Save_NowWriteFile_AfterMGInit 0202746C 2
arm9 Save_InitDynamicRegion 020274A8 1
arm9 Save_PrepareForAsyncWrite 02027550 2
arm9 Save_WriteFileAsync 02027564 1
arm9 Save_Cancel 020275A4 1
arm9 GetSaveSectorFooterPtr 020275F4 3
arm9 ValidateSaveSectorFooter 0202761C 3
arm9 SaveSlot_BuildFooter 020276C0 3
arm9 Save_RecordWhichLatestGoodSector_hook 020277C0 5
arm9 Save_LoadDynamicRegion 02027AD4 1
arm9 Save_WriteSlotAsync 02027B74 3
arm9 Save_WriteChunkFooterAsync 02027BAC 3
arm9 Save_WriteManInit 02027BDC 3
arm9 Save_WriteManFinish 02027CEC 3
arm9 SaveData_InitSlotSpecs 02027EFC 2
arm9 HandleWriteSaveAsync_PCBoxes 02028968 2
arm9 Save_WritePCBoxes 02028AB4 2
arm9 Save_WriteNextPCBox 02028BA8 3
arm9 Save_WritePCFooter 02028BF8 3
arm9 Save_CalcPCBoxModifiedFlags 02028C70 1
arm9 PCModifiedFlags_CountModifiedBoxes 02028C9C 1
arm9 PCModifiedFlags_GetIndexOfNthModifiedBox 02028CD4 2
#pc box expansion
arm9 PCStorage_sizeof 02073B20 0
arm9 PCStorage_InitializeBoxes 02073B28 1
arm9 PCStorage_PlaceMonInFirstEmptySlotInAnyBox 02073BB8 2
arm9 PCStorage_PlaceMonInBoxFirstEmptySlot 02073BFC 3
arm9 PCStorage_PlaceMonInBoxByIndexPair_hook 02073C70 5
arm9 PCStorage_SwapMonsInBoxByIndexPair_hook 02073CC4 5
arm9 PCStorage_DeleteBoxMonByIndexPair 02073D10 3
arm9 PCStorage_GetActiveBox 02073D4C 1
arm9 PCStorage_FindFirstBoxWithEmptySlot 02073D54 1
arm9 PCStorage_FindFirstEmptySlot 02073D9C 3
arm9 PCStorage_CountEmptySpotsInAllBoxes 02073DFC 1
arm9 PCStorage_CountEmptySpotsInBox 02073E40 2
arm9 PCStorage_SetActiveBox 02073E84 2
arm9 PCStorage_GetBoxWallpaper 02073E98 2
arm9 PCStorage_IsValidWallpaperId 02073EB4 1
arm9 PCStorage_SetBoxWallpaper 02073EC8 3
arm9 PCStorage_GetBoxName 02073F00 3
arm9 PCStorage_SetBoxName 02073F34 3
arm9 PCStorage_CountMonsAndEggsInBox 02073F64 2
arm9 PCStorage_CountMonsInBox 02073FA8 2
arm9 PCStorage_CountMonsInAllBoxes 02073FF8 1
arm9 PCStorage_GetMonDataByIndexPair_hook 02074018 5
arm9 PCStorage_GetMonByIndexPair 02074058 3
arm9 PCStorage_UnlockBonusWallpaper 02074094 2
arm9 PCStorage_IsBonusWallpaperUnlocked 020740B4 2
arm9 PCStorage_SetBoxModified 020740D8 2
arm9 PCStorage_SetAllBoxesModified 020740F8 1
arm9 PCStorage_ResetBoxModifiedFlags 02074108 1
arm9 PCStorage_GetBoxModifiedFlags 02074114 1
arm9 sub_02074128 02074128 1
#endif
# EXPAND_PC_BOXES
#endif
# ALLOW_SAVE_CHANGES
0002 SetFixedWildEncounter_hook 022480C4 5
# allow for crazy shiny odds calcs
arm9 CalcShininessByOtIdAndPersonality 02070068 2
# expand animation command indices
0007 GrabAnimScriptCommand 0221F8B0 1
# evolution level up moves
arm9 MonTryLearnMoveOnLevelUp 02071534 3
# edit the playcry command to potentially take form into account
0007 AnimCmd_PlayCryEdit_hook 0221F854 0
arm9 ScrCmd_DaycareSanitizeMon 0204CFB8 1
# 0224C018 + 4 = 224C01C
0012 BattleSystem_CheckMoveEffect_hook 224C01C 5
# 0012 BattleControllerPlayer_UpdateMonCondition 02249CC4 2
#ifdef DEBUG_PRINT_HEAP_OVERFLOW_MESSAGES
arm9 AllocFail_hook 0201AA7C 0
#endif
# DEBUG_PRINT_HEAP_OVERFLOW_MESSAGES
arm9 GF_AssertFail 0202551C 0
0012 ov12_0224D368 0224D368 3
0012 ov12_0224C4D8 0224C4D8 3
# fix trainer ai being able to switch illegally when binded
0010 ai_switch_ban_for_bind_hook 022203B4 2
0012 GetDynamicMoveType 02258688 4
# 022517EC + 4 = 22517F0
0012 StruggleCheck_hook 22517F0 5
# 02251A28 + 4 = 2251A2C
0012 ov12_02251A28_hook 2251A2C 5
# evolutions with forms, this time bugless
# used for queuing up sprites
arm9 form_evo_hook_1 02077224 1
# actually setting the new mon's form
arm9 form_evo_hook_2 0207641C 0
#ifdef IMPLEMENT_REUSABLE_REPELS
0002 PlayerStepEvent_RepelCounterDecrement 0224BAE4 2
0015 BagApp_GetRepelStepCountAddr 021F993C 3
#endif