Document more battle pyramid

This commit is contained in:
Marcus Huderle 2019-02-07 11:37:28 -06:00
parent a1ad1bad3a
commit 3a88ab831d
33 changed files with 406 additions and 390 deletions

View File

@ -7498,7 +7498,7 @@ TrainerHill_1F_Movement_2C83EE:: @ 82C83EE
step_end step_end
EventScript_2C83F0:: @ 82C83F0 EventScript_2C83F0:: @ 82C83F0
trainerbattle TRAINER_BATTLE_12, TRAINER_PHILLIP, 0, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D trainerbattle TRAINER_BATTLE_12, TRAINER_PHILLIP, 0, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText
setvar VAR_0x8004, 11 setvar VAR_0x8004, 11
special CallTrainerHillFunction special CallTrainerHillFunction
waitmessage waitmessage

View File

@ -152,8 +152,8 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252C45:: @ 8252C45
waitstate waitstate
end end
BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F:: @ 8252C4F BattlePyramid_TrainerBattle:: @ 8252C4F
trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, 0, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, 0, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText
setvar VAR_0x8004, 10 setvar VAR_0x8004, 10
special CallBattlePyramidFunction special CallBattlePyramidFunction
waitmessage waitmessage
@ -162,22 +162,22 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F:: @ 8252C4F
releaseall releaseall
end end
BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A:: @ 8252C6A BattlePyramid_FindItemBall:: @ 8252C6A
setvar VAR_0x8004, 7 setvar VAR_0x8004, 7
special CallBattlePyramidFunction special CallBattlePyramidFunction
callstd STD_FIND_ITEM callstd STD_FIND_ITEM
compare VAR_0x8007, 0 compare VAR_0x8007, 0
goto_if_eq BattleFrontier_BattlePyramidEmptySquare_EventScript_252C87 goto_if_eq BattlePyramid_FindItemBall_End
setvar VAR_0x8004, 8 setvar VAR_0x8004, 8
special CallBattlePyramidFunction special CallBattlePyramidFunction
BattleFrontier_BattlePyramidEmptySquare_EventScript_252C87:: @ 8252C87 BattlePyramid_FindItemBall_End:: @ 8252C87
end end
BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88:: @ 8252C88 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88:: @ 8252C88
goto BattleFrontier_BattlePyramidTop_EventScript_252B42 goto BattleFrontier_BattlePyramidTop_EventScript_252B42
BattleFrontier_BattlePyramidEmptySquare_Text_252C8D: @ 8252C8D BattleFacility_TrainerBattle_PlaceholderText: @ 8252C8D
.string "This is a sample message.$" .string "This is a sample message.$"
gText_BattlePyramidConfirmRest:: @ 8252CA7 gText_BattlePyramidConfirmRest:: @ 8252CA7

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 7, "trainer_sight_or_berry_tree_id": 7,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 7, "trainer_sight_or_berry_tree_id": 7,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 7, "trainer_sight_or_berry_tree_id": 7,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 7, "trainer_sight_or_berry_tree_id": 7,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 7, "trainer_sight_or_berry_tree_id": 7,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -24,7 +24,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -37,7 +37,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -50,7 +50,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -63,7 +63,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 6, "trainer_sight_or_berry_tree_id": 6,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F", "script": "BattlePyramid_TrainerBattle",
"flag": "0" "flag": "0"
}, },
{ {
@ -76,7 +76,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -89,7 +89,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
}, },
{ {
@ -102,7 +102,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A", "script": "BattlePyramid_FindItemBall",
"flag": "0" "flag": "0"
} }
], ],

View File

@ -4,20 +4,20 @@
void CallBattlePyramidFunction(void); void CallBattlePyramidFunction(void);
u16 LocalIdToPyramidTrainerId(u8 localId); u16 LocalIdToPyramidTrainerId(u8 localId);
bool8 GetBattlePyramidTrainerFlag(u8 eventId); bool8 GetBattlePyramidTrainerFlag(u8 eventId);
void sub_81A9B04(void); void MarkApproachingPyramidTrainersAsBattled(void);
void GenerateBattlePyramidWildMon(void); void GenerateBattlePyramidWildMon(void);
u8 GetPyramidRunMultiplier(void); u8 GetPyramidRunMultiplier(void);
u8 InBattlePyramid(void); u8 InBattlePyramid(void);
bool8 InBattlePyramid_(void); bool8 InBattlePyramid_(void);
void sub_81A9E90(void); void sub_81A9E90(void);
void sub_81A9EC8(void); void SoftResetInBattlePyramid(void);
void CopyPyramidTrainerSpeechBefore(u16 trainerId); void CopyPyramidTrainerSpeechBefore(u16 trainerId);
void CopyPyramidTrainerWinSpeech(u16 trainerId); void CopyPyramidTrainerWinSpeech(u16 trainerId);
void CopyPyramidTrainerLoseSpeech(u16 trainerId); void CopyPyramidTrainerLoseSpeech(u16 trainerId);
u8 GetTrainerEncounterMusicIdInBattlePyramind(u16 trainerId); u8 GetBattlePyramindTrainerEncounterMusicId(u16 trainerId);
void GenerateBattlePyramidFloorLayout(u16 *mapArg, bool8 setPlayerPosition); void GenerateBattlePyramidFloorLayout(u16 *mapArg, bool8 setPlayerPosition);
void sub_81AA1D8(void); void LoadBattlePyramidEventObjectTemplates(void);
void sub_81AA2F8(void); void LoadBattlePyramidFloorEventObjectScripts(void);
u8 GetNumBattlePyramidEventObjects(void); u8 GetNumBattlePyramidEventObjects(void);
u16 GetBattlePyramidPickupItemId(void); u16 GetBattlePyramidPickupItemId(void);

View File

@ -576,8 +576,8 @@ extern const u8 gUnknown_082A8350[];
// Battle Pyramid. // Battle Pyramid.
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88[]; extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88[];
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F[]; extern const u8 BattlePyramid_TrainerBattle[];
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A[]; extern const u8 BattlePyramid_FindItemBall[];
// fldeff misc // fldeff misc
extern const u8 EventScript_275A86[]; extern const u8 EventScript_275A86[];

View File

@ -316,7 +316,7 @@ struct BattleFrontier
/*0xCAA*/ u16 selectedPartyMons[3]; /*0xCAA*/ u16 selectedPartyMons[3];
/*0xCB0*/ u16 field_CB0; /*0xCB0*/ u16 field_CB0;
/*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor. /*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor.
/*0xCB4*/ u16 field_CB4[20]; /*0xCB4*/ u16 trainerIds[20];
/*0xCDC*/ u32 field_CDC; /*0xCDC*/ u32 field_CDC;
/*0xCE0*/ u16 towerWinStreaks[4][2]; /*0xCE0*/ u16 towerWinStreaks[4][2];
/*0xCF0*/ u16 towerRecordWinStreaks[4][2]; /*0xCF0*/ u16 towerRecordWinStreaks[4][2];

1
porymap.project.cfg Executable file
View File

@ -0,0 +1 @@
base_game_version=pokeemerald

View File

@ -304,14 +304,14 @@ static void sub_81A61B0(void)
trainerId = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum); trainerId = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
gTrainerBattleOpponent_A = trainerId; gTrainerBattleOpponent_A = trainerId;
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId;
i = 0; i = 0;
while (i != 3) while (i != 3)

View File

@ -1393,7 +1393,7 @@ static void PrepareOneTrainer(bool8 difficult)
trainerId = sub_8162548(challengeNum, battleNum); trainerId = sub_8162548(challengeNum, battleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1);
@ -1402,7 +1402,7 @@ static void PrepareOneTrainer(bool8 difficult)
gFacilityTrainers = gBattleFrontierTrainers; gFacilityTrainers = gBattleFrontierTrainers;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A;
} }
static void PrepareTwoTrainers(void) static void PrepareTwoTrainers(void)
@ -1418,7 +1418,7 @@ static void PrepareTwoTrainers(void)
trainerId = sub_8162548(challengeNum, 1); trainerId = sub_8162548(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1);
@ -1426,14 +1426,14 @@ static void PrepareTwoTrainers(void)
gTrainerBattleOpponent_A = trainerId; gTrainerBattleOpponent_A = trainerId;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= 14) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= 14)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A;
do do
{ {
trainerId = sub_8162548(challengeNum, 1); trainerId = sub_8162548(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
@ -1441,7 +1441,7 @@ static void PrepareTwoTrainers(void)
gTrainerBattleOpponent_B = trainerId; gTrainerBattleOpponent_B = trainerId;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1);
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 2] = gTrainerBattleOpponent_B; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 2] = gTrainerBattleOpponent_B;
} }
static void sub_81A84B4(void) static void sub_81A84B4(void)
@ -1449,7 +1449,7 @@ static void sub_81A84B4(void)
u8 i; u8 i;
for (i = 0; i < 14; i++) for (i = 0; i < 14; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF; gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
} }
static void sub_81A84EC(void) static void sub_81A84EC(void)

View File

@ -57,6 +57,21 @@ enum
HINT_EXIT_FAR_REMAINING_ITEMS, HINT_EXIT_FAR_REMAINING_ITEMS,
}; };
enum
{
OBJ_TRAINERS,
OBJ_ITEMS,
};
enum
{
OBJ_POSITIONS_UNIFORM,
OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE,
OBJ_POSITIONS_IN_AND_NEAR_EXIT,
OBJ_POSITIONS_NEAR_NEAR_ENTRANCE,
OBJ_POSITIONS_NEAR_NEAR_EXIT,
};
struct PyramidWildMon struct PyramidWildMon
{ {
u16 species; u16 species;
@ -69,8 +84,8 @@ struct PyramidFloorTemplate
{ {
u8 numItems; u8 numItems;
u8 numTrainers; u8 numTrainers;
u8 unk2; u8 itemPositions;
u8 unk3; u8 trainerPositions;
u8 runMultiplier; u8 runMultiplier;
u8 layoutOffsets[8]; u8 layoutOffsets[8];
}; };
@ -99,19 +114,19 @@ static void UpdatePyramidLightRadius(void);
static void ClearPyramidPartyHeldItems(void); static void ClearPyramidPartyHeldItems(void);
static void SetPyramidFloorPalette(void); static void SetPyramidFloorPalette(void);
static void sub_81A9828(void); static void sub_81A9828(void);
static void RestorePlayerPartyAfterPyramid(void); static void RestorePyramidPlayerParty(void);
static void InitPyramidBagItems(u8 lvlMode); static void InitPyramidBagItems(u8 lvlMode);
static u8 GetPyramidFloorTemplateId(void); static u8 GetPyramidFloorTemplateId(void);
static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8); static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8);
static void Task_SetPyramidFloorPalette(u8 taskId); static void Task_SetPyramidFloorPalette(u8 taskId);
static void sub_81A9B44(u16 trainerId); static void MarkPyramidTrainerAsBattled(u16 trainerId);
static void SetPyramidFloorLayoutOffsets(u8 *layoutOffsets); static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets);
static void SetPyramidEntranceAndExitSquareIds(u8 *, u8 *); static void GetPyramidEntranceAndExitSquareIds(u8 *, u8 *);
static void sub_81AA398(u8); static void SetPyramidObjectPositionsUniformly(u8);
static bool8 sub_81AA4D8(u8, u8); static bool8 SetPyramidObjectPositionsInAndNearSquare(u8, u8);
static bool8 sub_81AA648(u8, u8); static bool8 SetPyramidObjectPositionsNearSquare(u8, u8);
static bool8 sub_81AA760(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId); static bool8 TrySetPyramidEventObjectPositionInSquare(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId);
static bool8 sub_81AA810(u8 arg0, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId); static bool8 TrySetPyramidEventObjectPositionAtCoords(bool8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId);
// Const rom data. // Const rom data.
#include "data/battle_frontier/battle_pyramid_level_50_wild_mons.h" #include "data/battle_frontier/battle_pyramid_level_50_wild_mons.h"
@ -122,129 +137,129 @@ static const struct PyramidFloorTemplate sPyramidFloorTemplates[] =
{ {
.numItems = 7, .numItems = 7,
.numTrainers = 3, .numTrainers = 3,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x80, .runMultiplier = 128,
.layoutOffsets = {0, 0, 1, 1, 2, 2, 3, 3}, .layoutOffsets = {0, 0, 1, 1, 2, 2, 3, 3},
}, },
{ {
.numItems = 6, .numItems = 6,
.numTrainers = 3, .numTrainers = 3,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x80, .runMultiplier = 128,
.layoutOffsets = {1, 1, 2, 2, 3, 3, 4, 4}, .layoutOffsets = {1, 1, 2, 2, 3, 3, 4, 4},
}, },
{ {
.numItems = 5, .numItems = 5,
.numTrainers = 3, .numTrainers = 3,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x78, .runMultiplier = 120,
.layoutOffsets = {2, 2, 3, 3, 4, 4, 5, 5}, .layoutOffsets = {2, 2, 3, 3, 4, 4, 5, 5},
}, },
{ {
.numItems = 4, .numItems = 4,
.numTrainers = 4, .numTrainers = 4,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x78, .runMultiplier = 120,
.layoutOffsets = {3, 3, 4, 4, 5, 5, 6, 6}, .layoutOffsets = {3, 3, 4, 4, 5, 5, 6, 6},
}, },
{ {
.numItems = 4, .numItems = 4,
.numTrainers = 4, .numTrainers = 4,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x01, .trainerPositions = OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE,
.runMultiplier = 0x70, .runMultiplier = 112,
.layoutOffsets = {4, 4, 5, 5, 6, 6, 7, 7}, .layoutOffsets = {4, 4, 5, 5, 6, 6, 7, 7},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 5, .numTrainers = 5,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x02, .trainerPositions = OBJ_POSITIONS_IN_AND_NEAR_EXIT,
.runMultiplier = 0x70, .runMultiplier = 112,
.layoutOffsets = {5, 6, 7, 8, 9, 10, 11, 12}, .layoutOffsets = {5, 6, 7, 8, 9, 10, 11, 12},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 5, .numTrainers = 5,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x68, .runMultiplier = 104,
.layoutOffsets = {6, 7, 8, 9, 10, 11, 12, 13}, .layoutOffsets = {6, 7, 8, 9, 10, 11, 12, 13},
}, },
{ {
.numItems = 2, .numItems = 2,
.numTrainers = 4, .numTrainers = 4,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x01, .trainerPositions = OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE,
.runMultiplier = 0x68, .runMultiplier = 104,
.layoutOffsets = {7, 8, 9, 10, 11, 12, 13, 14}, .layoutOffsets = {7, 8, 9, 10, 11, 12, 13, 14},
}, },
{ {
.numItems = 4, .numItems = 4,
.numTrainers = 5, .numTrainers = 5,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x02, .trainerPositions = OBJ_POSITIONS_IN_AND_NEAR_EXIT,
.runMultiplier = 0x60, .runMultiplier = 96,
.layoutOffsets = {8, 9, 10, 11, 12, 13, 14, 15}, .layoutOffsets = {8, 9, 10, 11, 12, 13, 14, 15},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 6, .numTrainers = 6,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x04, .trainerPositions = OBJ_POSITIONS_NEAR_NEAR_EXIT,
.runMultiplier = 0x60, .runMultiplier = 96,
.layoutOffsets = {8, 9, 10, 11, 12, 13, 14, 15}, .layoutOffsets = {8, 9, 10, 11, 12, 13, 14, 15},
}, },
{ {
.numItems = 2, .numItems = 2,
.numTrainers = 3, .numTrainers = 3,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x58, .runMultiplier = 88,
.layoutOffsets = {12, 13, 14, 12, 13, 14, 12, 13}, .layoutOffsets = {12, 13, 14, 12, 13, 14, 12, 13},
}, },
{ {
.numItems = 4, .numItems = 4,
.numTrainers = 5, .numTrainers = 5,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x58, .runMultiplier = 88,
.layoutOffsets = {11, 11, 11, 11, 11, 11, 11, 11}, .layoutOffsets = {11, 11, 11, 11, 11, 11, 11, 11},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 7, .numTrainers = 7,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x50, .runMultiplier = 80,
.layoutOffsets = {12, 12, 12, 12, 12, 12, 12, 12}, .layoutOffsets = {12, 12, 12, 12, 12, 12, 12, 12},
}, },
{ {
.numItems = 2, .numItems = 2,
.numTrainers = 4, .numTrainers = 4,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x50, .runMultiplier = 80,
.layoutOffsets = {13, 13, 13, 13, 13, 13, 13, 13}, .layoutOffsets = {13, 13, 13, 13, 13, 13, 13, 13},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 6, .numTrainers = 6,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x50, .runMultiplier = 80,
.layoutOffsets = {14, 14, 14, 14, 14, 14, 14, 14}, .layoutOffsets = {14, 14, 14, 14, 14, 14, 14, 14},
}, },
{ {
.numItems = 3, .numItems = 3,
.numTrainers = 8, .numTrainers = 8,
.unk2 = 0x00, .itemPositions = OBJ_POSITIONS_UNIFORM,
.unk3 = 0x00, .trainerPositions = OBJ_POSITIONS_UNIFORM,
.runMultiplier = 0x50, .runMultiplier = 80,
.layoutOffsets = {15, 15, 15, 15, 15, 15, 15, 15}, .layoutOffsets = {15, 15, 15, 15, 15, 15, 15, 15},
} }
}; };
@ -816,7 +831,7 @@ static void (* const sBattlePyramidFunctions[])(void) =
ClearPyramidPartyHeldItems, ClearPyramidPartyHeldItems,
SetPyramidFloorPalette, SetPyramidFloorPalette,
sub_81A9828, sub_81A9828,
RestorePlayerPartyAfterPyramid, RestorePyramidPlayerParty,
}; };
static const u16 sShortStreakRewardItems[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC}; static const u16 sShortStreakRewardItems[] = {ITEM_HP_UP, ITEM_PROTEIN, ITEM_IRON, ITEM_CALCIUM, ITEM_CARBOS, ITEM_ZINC};
@ -1209,7 +1224,7 @@ static void sub_81A9828(void)
sub_809FDD4(); sub_809FDD4();
} }
static void RestorePlayerPartyAfterPyramid(void) static void RestorePyramidPlayerParty(void)
{ {
int i, j, k, l; int i, j, k, l;
@ -1317,7 +1332,7 @@ static u8 GetPostBattleDirectionHintTextIndex(int *hintType, u8 minDistanceForEx
u16 LocalIdToPyramidTrainerId(u8 localId) u16 LocalIdToPyramidTrainerId(u8 localId)
{ {
return gSaveBlock2Ptr->frontier.field_CB4[localId - 1]; return gSaveBlock2Ptr->frontier.trainerIds[localId - 1];
} }
bool8 GetBattlePyramidTrainerFlag(u8 eventId) bool8 GetBattlePyramidTrainerFlag(u8 eventId)
@ -1325,23 +1340,23 @@ bool8 GetBattlePyramidTrainerFlag(u8 eventId)
return gSaveBlock2Ptr->frontier.pyramidTrainerFlags & gBitTable[gEventObjects[eventId].localId - 1]; return gSaveBlock2Ptr->frontier.pyramidTrainerFlags & gBitTable[gEventObjects[eventId].localId - 1];
} }
void sub_81A9B04(void) void MarkApproachingPyramidTrainersAsBattled(void)
{ {
sub_81A9B44(gTrainerBattleOpponent_A); MarkPyramidTrainerAsBattled(gTrainerBattleOpponent_A);
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
{ {
gSelectedEventObject = GetChosenApproachingTrainerEventObjectId(1); gSelectedEventObject = GetChosenApproachingTrainerEventObjectId(1);
sub_81A9B44(gTrainerBattleOpponent_B); MarkPyramidTrainerAsBattled(gTrainerBattleOpponent_B);
} }
} }
static void sub_81A9B44(u16 trainerId) static void MarkPyramidTrainerAsBattled(u16 trainerId)
{ {
s32 i; int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
gSaveBlock2Ptr->frontier.pyramidTrainerFlags |= gBitTable[i]; gSaveBlock2Ptr->frontier.pyramidTrainerFlags |= gBitTable[i];
} }
@ -1354,7 +1369,7 @@ static void sub_81A9B44(u16 trainerId)
void GenerateBattlePyramidWildMon(void) void GenerateBattlePyramidWildMon(void)
{ {
u8 name[POKEMON_NAME_LENGTH + 1]; u8 name[POKEMON_NAME_LENGTH + 1];
s32 i; int i;
const struct PyramidWildMon *wildMons; const struct PyramidWildMon *wildMons;
u32 id; u32 id;
u32 lvl = gSaveBlock2Ptr->frontier.lvlMode; u32 lvl = gSaveBlock2Ptr->frontier.lvlMode;
@ -1410,7 +1425,8 @@ void GenerateBattlePyramidWildMon(void)
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(&gEnemyParty[0], wildMons[id].moves[i], i); SetMonMoveSlot(&gEnemyParty[0], wildMons[id].moves[i], i);
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] >= 140) // BUG: Reading outside the array as lvl was used for mon level instead of frontier lvl mode. // BUG: Reading outside the array as lvl was used for mon level instead of frontier lvl mode.
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] >= 140)
{ {
id = (Random() % 17) + 15; id = (Random() % 17) + 15;
for (i = 0; i < NUM_STATS; i++) for (i = 0; i < NUM_STATS; i++)
@ -1445,14 +1461,14 @@ void sub_81A9E90(void)
{ {
if (InBattlePyramid()) if (InBattlePyramid())
{ {
RestorePlayerPartyAfterPyramid(); RestorePyramidPlayerParty();
gSaveBlock2Ptr->frontier.field_CA8 = 2; gSaveBlock2Ptr->frontier.field_CA8 = 2;
VarSet(VAR_TEMP_E, 0); VarSet(VAR_TEMP_E, 0);
LoadPlayerParty(); LoadPlayerParty();
} }
} }
void sub_81A9EC8(void) void SoftResetInBattlePyramid(void)
{ {
if (InBattlePyramid()) if (InBattlePyramid())
DoSoftReset(); DoSoftReset();
@ -1473,7 +1489,7 @@ void CopyPyramidTrainerLoseSpeech(u16 trainerId)
FrontierSpeechToString(gFacilityTrainers[trainerId].speechLose); FrontierSpeechToString(gFacilityTrainers[trainerId].speechLose);
} }
u8 GetTrainerEncounterMusicIdInBattlePyramind(u16 trainerId) u8 GetBattlePyramindTrainerEncounterMusicId(u16 trainerId)
{ {
int i; int i;
@ -1485,12 +1501,12 @@ u8 GetTrainerEncounterMusicIdInBattlePyramind(u16 trainerId)
return TRAINER_ENCOUNTER_MUSIC_MALE; return TRAINER_ENCOUNTER_MUSIC_MALE;
} }
static void sub_81A9F80(void) void sub_81A9F80(void)
{ {
ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88); ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88);
} }
static u16 sub_81A9F90(u8 count) static u16 GetUniqueTrainerId(u8 eventObjectId)
{ {
int i; int i;
u16 trainerId; u16 trainerId;
@ -1502,24 +1518,24 @@ static u16 sub_81A9F90(u8 count)
do do
{ {
trainerId = sub_8162548(challengeNum + 1, battleNum); trainerId = sub_8162548(challengeNum + 1, battleNum);
for (i = 0; i < count; i++) for (i = 0; i < eventObjectId; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != count); } while (i != eventObjectId);
} }
else else
{ {
do do
{ {
trainerId = sub_8162548(challengeNum, battleNum); trainerId = sub_8162548(challengeNum, battleNum);
for (i = 0; i < count; i++) for (i = 0; i < eventObjectId; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != count); } while (i != eventObjectId);
} }
return trainerId; return trainerId;
@ -1532,8 +1548,8 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
u8 entranceSquareId, exitSquareId; u8 entranceSquareId, exitSquareId;
u8 *floorLayoutOffsets = AllocZeroed(16); u8 *floorLayoutOffsets = AllocZeroed(16);
SetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
SetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId); GetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId);
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {
u16 *map; u16 *map;
@ -1578,67 +1594,67 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
free(floorLayoutOffsets); free(floorLayoutOffsets);
} }
void sub_81AA1D8(void) void LoadBattlePyramidEventObjectTemplates(void)
{ {
int i; int i;
u8 id; u8 id;
u8 entranceSquareId, exitSquareId; u8 entranceSquareId, exitSquareId;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF; gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
id = GetPyramidFloorTemplateId(); id = GetPyramidFloorTemplateId();
SetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId); GetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId);
CpuFill32(0, gSaveBlock1Ptr->eventObjectTemplates, sizeof(gSaveBlock1Ptr->eventObjectTemplates)); CpuFill32(0, gSaveBlock1Ptr->eventObjectTemplates, sizeof(gSaveBlock1Ptr->eventObjectTemplates));
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
u8 value; u8 objectPositionsType;
if (i == 0) if (i == OBJ_TRAINERS)
value = sPyramidFloorTemplates[id].unk3; objectPositionsType = sPyramidFloorTemplates[id].trainerPositions;
else else // OBJ_ITEMS
value = sPyramidFloorTemplates[id].unk2; objectPositionsType = sPyramidFloorTemplates[id].itemPositions;
switch (value) switch (objectPositionsType)
{ {
case 0: case OBJ_POSITIONS_UNIFORM:
sub_81AA398(i); SetPyramidObjectPositionsUniformly(i);
break; break;
case 1: case OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE:
if (sub_81AA4D8(i, entranceSquareId)) if (SetPyramidObjectPositionsInAndNearSquare(i, entranceSquareId))
sub_81AA398(i); SetPyramidObjectPositionsUniformly(i);
break; break;
case 2: case OBJ_POSITIONS_IN_AND_NEAR_EXIT:
if (sub_81AA4D8(i, exitSquareId)) if (SetPyramidObjectPositionsInAndNearSquare(i, exitSquareId))
sub_81AA398(i); SetPyramidObjectPositionsUniformly(i);
break; break;
case 3: case OBJ_POSITIONS_NEAR_NEAR_ENTRANCE:
if (sub_81AA648(i, entranceSquareId)) if (SetPyramidObjectPositionsNearSquare(i, entranceSquareId))
sub_81AA398(i); SetPyramidObjectPositionsUniformly(i);
break; break;
case 4: case OBJ_POSITIONS_NEAR_NEAR_EXIT:
if (sub_81AA648(i, exitSquareId)) if (SetPyramidObjectPositionsNearSquare(i, exitSquareId))
sub_81AA398(i); SetPyramidObjectPositionsUniformly(i);
break; break;
} }
} }
} }
void sub_81AA2F8(void) void LoadBattlePyramidFloorEventObjectScripts(void)
{ {
s32 i; int i;
struct EventObjectTemplate *events = gSaveBlock1Ptr->eventObjectTemplates; struct EventObjectTemplate *events = gSaveBlock1Ptr->eventObjectTemplates;
for (i = 0; i < EVENT_OBJECT_TEMPLATES_COUNT; i++) for (i = 0; i < EVENT_OBJECT_TEMPLATES_COUNT; i++)
{ {
if (events[i].graphicsId != EVENT_OBJ_GFX_ITEM_BALL) if (events[i].graphicsId != EVENT_OBJ_GFX_ITEM_BALL)
events[i].script = BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F; events[i].script = BattlePyramid_TrainerBattle;
else else
events[i].script = BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A; events[i].script = BattlePyramid_FindItemBall;
} }
} }
static void SetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSquareId) static void GetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSquareId)
{ {
*entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % 16; *entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % 16;
*exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % 16; *exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % 16;
@ -1650,30 +1666,30 @@ static void SetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSqu
} }
} }
static void sub_81AA398(u8 arg0) static void SetPyramidObjectPositionsUniformly(u8 objType)
{ {
int i; int i;
int count; int numObjects;
int var_28; int objectStartIndex;
int squareId; int squareId;
u32 bits = 0; u32 bits = 0;
u8 id = GetPyramidFloorTemplateId(); u8 id = GetPyramidFloorTemplateId();
u8 *floorLayoutOffsets = AllocZeroed(16); u8 *floorLayoutOffsets = AllocZeroed(16);
SetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16; squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16;
if (arg0 == 0) if (objType == OBJ_TRAINERS)
{ {
count = sPyramidFloorTemplates[id].numTrainers; numObjects = sPyramidFloorTemplates[id].numTrainers;
var_28 = 0; objectStartIndex = 0;
} }
else else // OBJ_ITEMS
{ {
count = sPyramidFloorTemplates[id].numItems; numObjects = sPyramidFloorTemplates[id].numItems;
var_28 = sPyramidFloorTemplates[id].numTrainers; objectStartIndex = sPyramidFloorTemplates[id].numTrainers;
} }
for (i = 0; i < count; i++) for (i = 0; i < numObjects; i++)
{ {
do do
{ {
@ -1701,47 +1717,47 @@ static void sub_81AA398(u8 arg0)
} }
} while (!(bits & 2)); } while (!(bits & 2));
} while (!(bits & 4) && sub_81AA760(arg0, floorLayoutOffsets, squareId, var_28 + i)); } while (!(bits & 4) && TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, squareId, objectStartIndex + i));
bits &= 1; bits &= 1;
} }
free(floorLayoutOffsets); free(floorLayoutOffsets);
} }
static bool8 sub_81AA4D8(u8 arg0, u8 squareId) static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId)
{ {
int i; int i;
int var_28; int objectStartIndex;
int borderedIndex = 0; int borderedIndex = 0;
int r7 = 0; int r7 = 0;
int var_34 = 0; int numPlacedObjects = 0;
int count; int numObjects;
u8 id = GetPyramidFloorTemplateId(); u8 id = GetPyramidFloorTemplateId();
u8 *floorLayoutOffsets = AllocZeroed(16); u8 *floorLayoutOffsets = AllocZeroed(16);
SetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
if (arg0 == 0) if (objType == OBJ_TRAINERS)
{ {
count = sPyramidFloorTemplates[id].numTrainers; numObjects = sPyramidFloorTemplates[id].numTrainers;
var_28 = 0; objectStartIndex = 0;
} }
else else // OBJ_ITEMS
{ {
count = sPyramidFloorTemplates[id].numItems; numObjects = sPyramidFloorTemplates[id].numItems;
var_28 = sPyramidFloorTemplates[id].numTrainers; objectStartIndex = sPyramidFloorTemplates[id].numTrainers;
} }
for (i = 0; i < count; i++) for (i = 0; i < numObjects; i++)
{ {
if (r7 == 0) if (r7 == 0)
{ {
if (sub_81AA760(arg0, floorLayoutOffsets, squareId, var_28 + i)) if (TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, squareId, objectStartIndex + i))
r7 = 1; r7 = 1;
else else
var_34++; numPlacedObjects++;
} }
if (r7 & 1) if (r7 & 1)
{ {
if (sub_81AA760(arg0, floorLayoutOffsets, sBorderedSquareIds[squareId][borderedIndex], var_28 + i)) if (TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, sBorderedSquareIds[squareId][borderedIndex], objectStartIndex + i))
{ {
do do
{ {
@ -1749,15 +1765,15 @@ static bool8 sub_81AA4D8(u8 arg0, u8 squareId)
if (sBorderedSquareIds[squareId][borderedIndex] == 0xFF || borderedIndex >= 4) if (sBorderedSquareIds[squareId][borderedIndex] == 0xFF || borderedIndex >= 4)
borderedIndex = 0; borderedIndex = 0;
r7 += 2; r7 += 2;
} while (r7 >> 1 != 4 && sub_81AA760(arg0, floorLayoutOffsets, sBorderedSquareIds[squareId][borderedIndex], var_28 + i)); } while (r7 >> 1 != 4 && TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, sBorderedSquareIds[squareId][borderedIndex], objectStartIndex + i));
var_34++; numPlacedObjects++;
} }
else else
{ {
borderedIndex++; borderedIndex++;
if (sBorderedSquareIds[squareId][borderedIndex] == 0xFF || borderedIndex >= 4) if (sBorderedSquareIds[squareId][borderedIndex] == 0xFF || borderedIndex >= 4)
borderedIndex = 0; borderedIndex = 0;
var_34++; numPlacedObjects++;
} }
} }
@ -1768,51 +1784,51 @@ static bool8 sub_81AA4D8(u8 arg0, u8 squareId)
} }
// free(floorLayoutOffsets); BUG: floorLayoutOffsets memory not freed // free(floorLayoutOffsets); BUG: floorLayoutOffsets memory not freed
return (count / 2 > var_34); return (numObjects / 2) > numPlacedObjects;
} }
static bool8 sub_81AA648(u8 arg0, u8 squareId) static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId)
{ {
int i; int i;
int var_28; int objectStartIndex;
int r4 = 0; int borderOffset = 0;
int r7 = 0; int numPlacedObjects = 0;
int r8 = 0; int r8 = 0;
int count; int numObjects;
u8 id = GetPyramidFloorTemplateId(); u8 id = GetPyramidFloorTemplateId();
u8 *floorLayoutOffsets = AllocZeroed(16); u8 *floorLayoutOffsets = AllocZeroed(16);
SetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
if (arg0 == 0) if (objType == OBJ_TRAINERS)
{ {
count = sPyramidFloorTemplates[id].numTrainers; numObjects = sPyramidFloorTemplates[id].numTrainers;
var_28 = 0; objectStartIndex = 0;
} }
else else // OBJ_ITEMS
{ {
count = sPyramidFloorTemplates[id].numItems; numObjects = sPyramidFloorTemplates[id].numItems;
var_28 = sPyramidFloorTemplates[id].numTrainers; objectStartIndex = sPyramidFloorTemplates[id].numTrainers;
} }
for (i = 0; i < count; i++) for (i = 0; i < numObjects; i++)
{ {
if (sub_81AA760(arg0, floorLayoutOffsets, sBorderedSquareIds[squareId][r4], var_28 + i)) if (TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, sBorderedSquareIds[squareId][borderOffset], objectStartIndex + i))
{ {
do do
{ {
r4++; borderOffset++;
if (sBorderedSquareIds[squareId][r4] == 0xFF || r4 >= 4) if (sBorderedSquareIds[squareId][borderOffset] == 0xFF || borderOffset >= 4)
r4 = 0; borderOffset = 0;
r8++; r8++;
} while (r8 != 4 && sub_81AA760(arg0, floorLayoutOffsets, sBorderedSquareIds[squareId][r4], var_28 + i)); } while (r8 != 4 && TrySetPyramidEventObjectPositionInSquare(objType, floorLayoutOffsets, sBorderedSquareIds[squareId][borderOffset], objectStartIndex + i));
r7++; numPlacedObjects++;
} }
else else
{ {
r4++; borderOffset++;
if (sBorderedSquareIds[squareId][r4] == 0xFF || r4 >= 4) if (sBorderedSquareIds[squareId][borderOffset] == 0xFF || borderOffset >= 4)
r4 = 0; borderOffset = 0;
r7++; numPlacedObjects++;
} }
if (r8 == 4) if (r8 == 4)
@ -1820,32 +1836,31 @@ static bool8 sub_81AA648(u8 arg0, u8 squareId)
} }
// free(floorLayoutOffsets); BUG: floorLayoutOffsets memory not freed // free(floorLayoutOffsets); BUG: floorLayoutOffsets memory not freed
return (count / 2 > r7); return (numObjects / 2) > numPlacedObjects;
} }
static bool8 sub_81AA760(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId) static bool8 TrySetPyramidEventObjectPositionInSquare(u8 objType, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId)
{ {
int i, j; int x, y;
if (gSaveBlock2Ptr->frontier.pyramidRandoms[0] & 1) if (gSaveBlock2Ptr->frontier.pyramidRandoms[0] & 1)
{ {
int minus1 = -1; for (y = 7; y > -1; y--)
for (i = 7; i > minus1; i--)
{ {
for (j = 7; j >= 0; j--) for (x = 7; x > -1; x--)
{ {
if (!sub_81AA810(arg0, j, i, floorLayoutOffsets, squareId, eventObjectId)) if (!TrySetPyramidEventObjectPositionAtCoords(objType, x, y, floorLayoutOffsets, squareId, eventObjectId))
return FALSE; return FALSE;
} }
} }
} }
else else
{ {
for (i = 0; i < 8; i++) for (y = 0; y < 8; y++)
{ {
for (j = 0; j < 8; j++) for (x = 0; x < 8; x++)
{ {
if (!sub_81AA810(arg0, j, i, floorLayoutOffsets, squareId, eventObjectId)) if (!TrySetPyramidEventObjectPositionAtCoords(objType, x, y, floorLayoutOffsets, squareId, eventObjectId))
return FALSE; return FALSE;
} }
} }
@ -1854,11 +1869,11 @@ static bool8 sub_81AA760(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 eventO
return TRUE; return TRUE;
} }
static bool8 sub_81AA810(u8 arg0, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId) static bool8 TrySetPyramidEventObjectPositionAtCoords(u8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 eventObjectId)
{ {
int i, j; int i, j;
const struct MapHeader *mapHeader; const struct MapHeader *mapHeader;
struct EventObjectTemplate *events = gSaveBlock1Ptr->eventObjectTemplates; struct EventObjectTemplate *floorEvents = gSaveBlock1Ptr->eventObjectTemplates;
mapHeader = Overworld_GetMapHeaderByGroupAndId(MAP_GROUP(BATTLE_PYRAMID_SQUARE01), floorLayoutOffsets[squareId] + MAP_NUM(BATTLE_PYRAMID_SQUARE01)); mapHeader = Overworld_GetMapHeaderByGroupAndId(MAP_GROUP(BATTLE_PYRAMID_SQUARE01), floorLayoutOffsets[squareId] + MAP_NUM(BATTLE_PYRAMID_SQUARE01));
for (i = 0; i < mapHeader->events->eventObjectCount; i++) for (i = 0; i < mapHeader->events->eventObjectCount; i++)
@ -1866,37 +1881,39 @@ static bool8 sub_81AA810(u8 arg0, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareI
if (mapHeader->events->eventObjects[i].x != x || mapHeader->events->eventObjects[i].y != y) if (mapHeader->events->eventObjects[i].x != x || mapHeader->events->eventObjects[i].y != y)
continue; continue;
if (arg0 != 0 || mapHeader->events->eventObjects[i].graphicsId == EVENT_OBJ_GFX_ITEM_BALL) if (objType != OBJ_TRAINERS || mapHeader->events->eventObjects[i].graphicsId == EVENT_OBJ_GFX_ITEM_BALL)
{ {
if (arg0 != 1 || mapHeader->events->eventObjects[i].graphicsId != EVENT_OBJ_GFX_ITEM_BALL) if (objType != OBJ_ITEMS || mapHeader->events->eventObjects[i].graphicsId != EVENT_OBJ_GFX_ITEM_BALL)
continue; continue;
} }
// Ensure an object wasn't previously placed in the exact same position.
for (j = 0; j < eventObjectId; j++) for (j = 0; j < eventObjectId; j++)
{ {
if (events[j].x == x + ((squareId % 4) * 8) && events[j].y == y + ((squareId / 4) * 8)) if (floorEvents[j].x == x + ((squareId % 4) * 8) && floorEvents[j].y == y + ((squareId / 4) * 8))
break; break;
} }
if (j != eventObjectId)
continue;
events[eventObjectId] = mapHeader->events->eventObjects[i]; if (j == eventObjectId)
events[eventObjectId].x += ((squareId % 4) * 8);
events[eventObjectId].y += ((squareId / 4) * 8);
events[eventObjectId].localId = eventObjectId + 1;
if (events[eventObjectId].graphicsId != EVENT_OBJ_GFX_ITEM_BALL)
{ {
i = sub_81A9F90(eventObjectId); floorEvents[eventObjectId] = mapHeader->events->eventObjects[i];
events[eventObjectId].graphicsId = GetBattleFacilityTrainerGfxId(i); floorEvents[eventObjectId].x += (squareId % 4) * 8;
gSaveBlock2Ptr->frontier.field_CB4[eventObjectId] = i; floorEvents[eventObjectId].y += (squareId / 4) * 8;
floorEvents[eventObjectId].localId = eventObjectId + 1;
if (floorEvents[eventObjectId].graphicsId != EVENT_OBJ_GFX_ITEM_BALL)
{
i = GetUniqueTrainerId(eventObjectId);
floorEvents[eventObjectId].graphicsId = GetBattleFacilityTrainerGfxId(i);
gSaveBlock2Ptr->frontier.trainerIds[eventObjectId] = i;
} }
return FALSE; return FALSE;
} }
}
return TRUE; return TRUE;
} }
static void SetPyramidFloorLayoutOffsets(u8 *layoutOffsets) static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets)
{ {
int i; int i;
int rand = (gSaveBlock2Ptr->frontier.pyramidRandoms[0]) | (gSaveBlock2Ptr->frontier.pyramidRandoms[1] << 16); int rand = (gSaveBlock2Ptr->frontier.pyramidRandoms[0]) | (gSaveBlock2Ptr->frontier.pyramidRandoms[1] << 16);
@ -1944,7 +1961,7 @@ u8 GetNumBattlePyramidEventObjects(void)
static void InitPyramidBagItems(u8 lvlMode) static void InitPyramidBagItems(u8 lvlMode)
{ {
s32 i; int i;
for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++) for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++)
{ {

View File

@ -874,8 +874,8 @@ u8 sub_80B100C(s32 arg0)
return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)]; return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)];
} }
var = gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 0] var = gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 0]
+ gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 1]; + gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum * 2 + 1];
return sUnknown_0854FE98[var % ARRAY_COUNT(sUnknown_0854FE98)]; return sUnknown_0854FE98[var % ARRAY_COUNT(sUnknown_0854FE98)];
} }
@ -1266,7 +1266,7 @@ void BattleSetup_StartTrainerBattle(void)
ZeroMonData(&gEnemyParty[2]); ZeroMonData(&gEnemyParty[2]);
} }
sub_81A9B04(); MarkApproachingPyramidTrainersAsBattled();
} }
else if (sub_81D5C18()) else if (sub_81D5C18())
{ {

View File

@ -356,7 +356,7 @@ static void sub_81BA040(void)
trainerId = Random() % 30; trainerId = Random() % 30;
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
@ -370,7 +370,7 @@ static void sub_81BA040(void)
} }
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
monSets = gFacilityTrainers[gTrainerBattleOpponent_A].monSets; monSets = gFacilityTrainers[gTrainerBattleOpponent_A].monSets;
i = 0; i = 0;

View File

@ -1311,15 +1311,15 @@ static void ChooseNextBattleTowerTrainer(void)
if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS) if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS)
{ {
id = gSaveBlock2Ptr->frontier.curChallengeBattleNum; id = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
gTrainerBattleOpponent_A = gSaveBlock2Ptr->frontier.field_CB4[id * 2]; gTrainerBattleOpponent_A = gSaveBlock2Ptr->frontier.trainerIds[id * 2];
gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.field_CB4[id * 2 + 1]; gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.trainerIds[id * 2 + 1];
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1);
} }
else if (ChooseSpecialBattleTowerTrainer()) else if (ChooseSpecialBattleTowerTrainer())
{ {
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
} }
else else
{ {
@ -1331,7 +1331,7 @@ static void ChooseNextBattleTowerTrainer(void)
// Ensure trainer wasn't previously fought in this challenge. // Ensure trainer wasn't previously fought in this challenge.
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == id) if (gSaveBlock2Ptr->frontier.trainerIds[i] == id)
break; break;
} }
if (i == gSaveBlock2Ptr->frontier.curChallengeBattleNum) if (i == gSaveBlock2Ptr->frontier.curChallengeBattleNum)
@ -1341,7 +1341,7 @@ static void ChooseNextBattleTowerTrainer(void)
gTrainerBattleOpponent_A = id; gTrainerBattleOpponent_A = id;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 7) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 7)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
} }
} }
} }
@ -2250,7 +2250,7 @@ void DoSpecialTrainerBattle(void)
break; break;
case FRONTIER_MODE_MULTIS: case FRONTIER_MODE_MULTIS:
FillFrontierTrainersParties(2); FillFrontierTrainersParties(2);
gPartnerTrainerId = gSaveBlock2Ptr->frontier.field_CB4[17]; gPartnerTrainerId = gSaveBlock2Ptr->frontier.trainerIds[17];
FillPartnerParty(gPartnerTrainerId); FillPartnerParty(gPartnerTrainerId);
gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS; gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS;
break; break;
@ -2524,32 +2524,32 @@ static void sub_81642A0(void)
trainerId = sub_8162548(challengeNum, 0); trainerId = sub_8162548(challengeNum, 0);
for (i = 0; i < j; i++) for (i = 0; i < j; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
if (gFacilityTrainers[gSaveBlock2Ptr->frontier.field_CB4[i]].facilityClass == gFacilityTrainers[trainerId].facilityClass) if (gFacilityTrainers[gSaveBlock2Ptr->frontier.trainerIds[i]].facilityClass == gFacilityTrainers[trainerId].facilityClass)
break; break;
} }
} while (i != j); } while (i != j);
gSaveBlock2Ptr->frontier.field_CB4[j] = trainerId; gSaveBlock2Ptr->frontier.trainerIds[j] = trainerId;
j++; j++;
} while (j < 6); } while (j < 6);
r10 = 8; r10 = 8;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
trainerId = gSaveBlock2Ptr->frontier.field_CB4[i]; trainerId = gSaveBlock2Ptr->frontier.trainerIds[i];
eventObjTemplates[i + 1].graphicsId = GetBattleFacilityTrainerGfxId(trainerId); eventObjTemplates[i + 1].graphicsId = GetBattleFacilityTrainerGfxId(trainerId);
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
while (1) while (1)
{ {
monSetId = RandomizeFacilityTrainerMonSet(trainerId); monSetId = RandomizeFacilityTrainerMonSet(trainerId);
if (j % 2 != 0 && gFacilityTrainerMons[gSaveBlock2Ptr->frontier.field_CB4[r10 - 1]].itemTableId == gFacilityTrainerMons[monSetId].itemTableId) if (j % 2 != 0 && gFacilityTrainerMons[gSaveBlock2Ptr->frontier.trainerIds[r10 - 1]].itemTableId == gFacilityTrainerMons[monSetId].itemTableId)
continue; continue;
for (k = 8; k < r10; k++) for (k = 8; k < r10; k++)
{ {
if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.field_CB4[k]].species == gFacilityTrainerMons[monSetId].species) if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.trainerIds[k]].species == gFacilityTrainerMons[monSetId].species)
break; break;
if (species1 == gFacilityTrainerMons[monSetId].species) if (species1 == gFacilityTrainerMons[monSetId].species)
break; break;
@ -2560,7 +2560,7 @@ static void sub_81642A0(void)
break; break;
} }
gSaveBlock2Ptr->frontier.field_CB4[r10] = monSetId; gSaveBlock2Ptr->frontier.trainerIds[r10] = monSetId;
r10++; r10++;
} }
} }
@ -2591,10 +2591,10 @@ static void sub_81642A0(void)
} }
if (r10 != 0) if (r10 != 0)
{ {
gSaveBlock2Ptr->frontier.field_CB4[6] = spArray[Random() % r10]; gSaveBlock2Ptr->frontier.trainerIds[6] = spArray[Random() % r10];
eventObjTemplates[7].graphicsId = GetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.field_CB4[6]); eventObjTemplates[7].graphicsId = GetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.trainerIds[6]);
FlagClear(FLAG_HIDE_BATTLE_TOWER_MULTI_BATTLE_PARTNER_ALT_1); FlagClear(FLAG_HIDE_BATTLE_TOWER_MULTI_BATTLE_PARTNER_ALT_1);
sub_81640E0(gSaveBlock2Ptr->frontier.field_CB4[6]); sub_81640E0(gSaveBlock2Ptr->frontier.trainerIds[6]);
} }
r10 = 0; r10 = 0;
@ -2634,10 +2634,10 @@ static void sub_81642A0(void)
} }
if (r10 != 0) if (r10 != 0)
{ {
gSaveBlock2Ptr->frontier.field_CB4[7] = spArray[Random() % r10]; gSaveBlock2Ptr->frontier.trainerIds[7] = spArray[Random() % r10];
eventObjTemplates[8].graphicsId = GetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.field_CB4[7]); eventObjTemplates[8].graphicsId = GetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.trainerIds[7]);
FlagClear(FLAG_HIDE_BATTLE_TOWER_MULTI_BATTLE_PARTNER_ALT_2); FlagClear(FLAG_HIDE_BATTLE_TOWER_MULTI_BATTLE_PARTNER_ALT_2);
sub_8164188(gSaveBlock2Ptr->frontier.field_CB4[7]); sub_8164188(gSaveBlock2Ptr->frontier.trainerIds[7]);
} }
} }
@ -2684,7 +2684,7 @@ static void sub_8164828(void)
u16 winStreak = GetCurrentFacilityWinStreak(); u16 winStreak = GetCurrentFacilityWinStreak();
s32 challengeNum = winStreak / 7; s32 challengeNum = winStreak / 7;
s32 k = gSpecialVar_LastTalked - 2; s32 k = gSpecialVar_LastTalked - 2;
s32 trainerId = gSaveBlock2Ptr->frontier.field_CB4[k]; s32 trainerId = gSaveBlock2Ptr->frontier.trainerIds[k];
for (arrId = 0; arrId < ARRAY_COUNT(gUnknown_085DD500); arrId++) for (arrId = 0; arrId < ARRAY_COUNT(gUnknown_085DD500); arrId++)
{ {
@ -2717,29 +2717,29 @@ static void sub_8164828(void)
} }
break; break;
case 1: case 1:
monSetId = gSaveBlock2Ptr->frontier.field_CB4[8 + k * 2]; monSetId = gSaveBlock2Ptr->frontier.trainerIds[8 + k * 2];
sub_81646BC(trainerId, monSetId); sub_81646BC(trainerId, monSetId);
break; break;
case 2: case 2:
monSetId = gSaveBlock2Ptr->frontier.field_CB4[9 + k * 2]; monSetId = gSaveBlock2Ptr->frontier.trainerIds[9 + k * 2];
sub_81646BC(trainerId, monSetId); sub_81646BC(trainerId, monSetId);
break; break;
case 3: case 3:
gPartnerTrainerId = trainerId; gPartnerTrainerId = trainerId;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND) if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
{ {
gSaveBlock2Ptr->frontier.field_CB4[18] = gSaveBlock2Ptr->frontier.field_CB4[8 + k * 2]; gSaveBlock2Ptr->frontier.trainerIds[18] = gSaveBlock2Ptr->frontier.trainerIds[8 + k * 2];
gSaveBlock2Ptr->frontier.field_CB4[19] = gSaveBlock2Ptr->frontier.field_CB4[9 + k * 2]; gSaveBlock2Ptr->frontier.trainerIds[19] = gSaveBlock2Ptr->frontier.trainerIds[9 + k * 2];
} }
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE) else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
{ {
gSaveBlock2Ptr->frontier.field_CB4[18] = gUnknown_03006298[2]; gSaveBlock2Ptr->frontier.trainerIds[18] = gUnknown_03006298[2];
gSaveBlock2Ptr->frontier.field_CB4[19] = gUnknown_03006298[3]; gSaveBlock2Ptr->frontier.trainerIds[19] = gUnknown_03006298[3];
} }
else else
{ {
gSaveBlock2Ptr->frontier.field_CB4[18] = gUnknown_03006298[0]; gSaveBlock2Ptr->frontier.trainerIds[18] = gUnknown_03006298[0];
gSaveBlock2Ptr->frontier.field_CB4[19] = gUnknown_03006298[1]; gSaveBlock2Ptr->frontier.trainerIds[19] = gUnknown_03006298[1];
} }
for (k = 0; k < 14; k++) for (k = 0; k < 14; k++)
{ {
@ -2751,15 +2751,15 @@ static void sub_8164828(void)
for (j = 0; j < k; j++) for (j = 0; j < k; j++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[j] == i) if (gSaveBlock2Ptr->frontier.trainerIds[j] == i)
break; break;
} }
if (j == k) if (j == k)
break; break;
} }
gSaveBlock2Ptr->frontier.field_CB4[k] = i; gSaveBlock2Ptr->frontier.trainerIds[k] = i;
} }
gSaveBlock2Ptr->frontier.field_CB4[17] = trainerId; gSaveBlock2Ptr->frontier.trainerIds[17] = trainerId;
break; break;
case 4: case 4:
break; break;
@ -2825,12 +2825,12 @@ static void sub_8164B74(void)
trainerId = sub_8162548(challengeNum, i / 2); trainerId = sub_8162548(challengeNum, i / 2);
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[j] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[j] == trainerId)
break; break;
} }
} while (i != j); } while (i != j);
if (i == j) // This condition is always true, because of the loop above. if (i == j) // This condition is always true, because of the loop above.
gSaveBlock2Ptr->frontier.field_CB4[i] = trainerId; gSaveBlock2Ptr->frontier.trainerIds[i] = trainerId;
} }
gSpecialVar_Result = 2; gSpecialVar_Result = 2;
} }
@ -2838,7 +2838,7 @@ static void sub_8164B74(void)
case 2: case 2:
if (IsLinkTaskFinished()) if (IsLinkTaskFinished())
{ {
SendBlock(bitmask_all_link_players_but_self(), &gSaveBlock2Ptr->frontier.field_CB4, sizeof(gSaveBlock2Ptr->frontier.field_CB4)); SendBlock(bitmask_all_link_players_but_self(), &gSaveBlock2Ptr->frontier.trainerIds, sizeof(gSaveBlock2Ptr->frontier.trainerIds));
gSpecialVar_Result = 3; gSpecialVar_Result = 3;
} }
break; break;
@ -2846,9 +2846,9 @@ static void sub_8164B74(void)
if ((GetBlockReceivedStatus() & 3) == 3) if ((GetBlockReceivedStatus() & 3) == 3)
{ {
ResetBlockReceivedFlags(); ResetBlockReceivedFlags();
memcpy(&gSaveBlock2Ptr->frontier.field_CB4, gBlockRecvBuffer, sizeof(gSaveBlock2Ptr->frontier.field_CB4)); memcpy(&gSaveBlock2Ptr->frontier.trainerIds, gBlockRecvBuffer, sizeof(gSaveBlock2Ptr->frontier.trainerIds));
gTrainerBattleOpponent_A = gSaveBlock2Ptr->frontier.field_CB4[battleNum * 2]; gTrainerBattleOpponent_A = gSaveBlock2Ptr->frontier.trainerIds[battleNum * 2];
gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.field_CB4[battleNum * 2 + 1]; gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.trainerIds[battleNum * 2 + 1];
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1);
if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType == 0) if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType == 0)
@ -2880,7 +2880,7 @@ static void sub_8164DCC(void)
static void sub_8164DE4(void) static void sub_8164DE4(void)
{ {
SetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.field_CB4[17], 0xF); SetBattleFacilityTrainerGfxId(gSaveBlock2Ptr->frontier.trainerIds[17], 0xF);
} }
static void sub_8164E04(void) static void sub_8164E04(void)
@ -3213,7 +3213,7 @@ static void FillPartnerParty(u16 trainerId)
otID = Random32(); otID = Random32();
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
monSetId = gSaveBlock2Ptr->frontier.field_CB4[i + 18]; monSetId = gSaveBlock2Ptr->frontier.trainerIds[i + 18];
CreateMonWithEVSpreadNatureOTID(&gPlayerParty[3 + i], CreateMonWithEVSpreadNatureOTID(&gPlayerParty[3 + i],
gFacilityTrainerMons[monSetId].species, gFacilityTrainerMons[monSetId].species,
level, level,
@ -3243,7 +3243,7 @@ static void FillPartnerParty(u16 trainerId)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
struct EmeraldBattleTowerRecord *record = &gSaveBlock2Ptr->frontier.towerRecords[trainerId]; struct EmeraldBattleTowerRecord *record = &gSaveBlock2Ptr->frontier.towerRecords[trainerId];
struct BattleTowerPokemon monData = record->party[gSaveBlock2Ptr->frontier.field_CB4[18 + i]]; struct BattleTowerPokemon monData = record->party[gSaveBlock2Ptr->frontier.trainerIds[18 + i]];
StringCopy(trainerName, record->name); StringCopy(trainerName, record->name);
if (record->language == LANGUAGE_JAPANESE) if (record->language == LANGUAGE_JAPANESE)
{ {
@ -3269,7 +3269,7 @@ static void FillPartnerParty(u16 trainerId)
trainerId -= TRAINER_RECORD_MIXING_APPRENTICE; trainerId -= TRAINER_RECORD_MIXING_APPRENTICE;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
CreateApprenticeMon(&gPlayerParty[3 + i], &gSaveBlock2Ptr->apprentices[trainerId], gSaveBlock2Ptr->frontier.field_CB4[18 + i]); CreateApprenticeMon(&gPlayerParty[3 + i], &gSaveBlock2Ptr->apprentices[trainerId], gSaveBlock2Ptr->frontier.trainerIds[18 + i]);
j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_APPRENTICE); j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_APPRENTICE);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j); SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
} }
@ -3564,7 +3564,7 @@ static void sub_8165E18(void)
trainerId = sub_8165D40(); trainerId = sub_8165D40();
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == trainerId) if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
break; break;
} }
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
@ -3572,7 +3572,7 @@ static void sub_8165E18(void)
gTrainerBattleOpponent_A = trainerId; gTrainerBattleOpponent_A = trainerId;
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 3) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 3)
gSaveBlock2Ptr->frontier.field_CB4[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
} }
static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount) static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)

View File

@ -1827,7 +1827,7 @@ void sub_81A3ACC(void)
s32 i; s32 i;
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF; gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
} }
static void sub_81A3B00(void) static void sub_81A3B00(void)

View File

@ -124,7 +124,6 @@ extern void sub_80AF3C8(void);
extern void ExecuteTruckSequence(void); extern void ExecuteTruckSequence(void);
extern void sub_80A0A38(void); extern void sub_80A0A38(void);
extern void WriteFlashScanlineEffectBuffer(u8); extern void WriteFlashScanlineEffectBuffer(u8);
extern void sub_81AA2F8(void);
extern void InitMatchCallCounters(void); extern void InitMatchCallCounters(void);
extern void sub_80EDB44(void); extern void sub_80EDB44(void);
extern void InitFieldMessageBox(void); extern void InitFieldMessageBox(void);
@ -886,7 +885,7 @@ static void mli0_load_map(u32 a1)
if (!(sUnknown_020322D8 & 1)) if (!(sUnknown_020322D8 & 1))
{ {
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
sub_81AA1D8(); LoadBattlePyramidEventObjectTemplates();
else if (InTrainerHill()) else if (InTrainerHill())
sub_81D5DF8(); sub_81D5DF8();
else else
@ -1753,7 +1752,7 @@ void CB2_ContinueSavedGame(void)
ClearDiveAndHoleWarps(); ClearDiveAndHoleWarps();
trainerHillMapId = GetCurrentTrainerHillMapId(); trainerHillMapId = GetCurrentTrainerHillMapId();
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
sub_81AA2F8(); LoadBattlePyramidFloorEventObjectScripts();
else if (trainerHillMapId != 0 && trainerHillMapId != 6) else if (trainerHillMapId != 0 && trainerHillMapId != 6)
sub_81D5F48(); sub_81D5F48();
else else

View File

@ -6081,7 +6081,7 @@ s32 GetBattlerMultiplayerId(u16 a1)
u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) u8 GetTrainerEncounterMusicId(u16 trainerOpponentId)
{ {
if (InBattlePyramid()) if (InBattlePyramid())
return GetTrainerEncounterMusicIdInBattlePyramind(trainerOpponentId); return GetBattlePyramindTrainerEncounterMusicId(trainerOpponentId);
else if (sub_81D5C18()) else if (sub_81D5C18())
return GetTrainerEncounterMusicIdInTrainerHill(trainerOpponentId); return GetTrainerEncounterMusicIdInTrainerHill(trainerOpponentId);
else else

View File

@ -36,6 +36,7 @@
#include "international_string_util.h" #include "international_string_util.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "field_player_avatar.h" #include "field_player_avatar.h"
#include "battle_pyramid.h"
#include "battle_pyramid_bag.h" #include "battle_pyramid_bag.h"
#include "battle_pike.h" #include "battle_pike.h"
#include "new_game.h" #include "new_game.h"
@ -94,9 +95,7 @@ extern void CB2_Pokedex(void);
extern void PlayRainSoundEffect(void); extern void PlayRainSoundEffect(void);
extern void CB2_PokeNav(void); extern void CB2_PokeNav(void);
extern void ScriptUnfreezeEventObjects(void); extern void ScriptUnfreezeEventObjects(void);
extern void sub_81A9EC8(void);
extern void save_serialize_map(void); extern void save_serialize_map(void);
extern void sub_81A9E90(void);
// Menu action callbacks // Menu action callbacks
static bool8 StartMenuPokedexCallback(void); static bool8 StartMenuPokedexCallback(void);
@ -798,7 +797,7 @@ static bool8 SaveCallback(void)
sub_8197DF8(0, TRUE); sub_8197DF8(0, TRUE);
ScriptUnfreezeEventObjects(); ScriptUnfreezeEventObjects();
ScriptContext2_Disable(); ScriptContext2_Disable();
sub_81A9EC8(); SoftResetInBattlePyramid();
return TRUE; return TRUE;
} }

View File

@ -660,7 +660,7 @@ void sub_81D5DF8(void)
SetUpDataStruct(); SetUpDataStruct();
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF; gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
CpuFill32(0, gSaveBlock1Ptr->eventObjectTemplates, sizeof(gSaveBlock1Ptr->eventObjectTemplates)); CpuFill32(0, gSaveBlock1Ptr->eventObjectTemplates, sizeof(gSaveBlock1Ptr->eventObjectTemplates));
floorId = GetFloorId(); floorId = GetFloorId();
@ -677,7 +677,7 @@ void sub_81D5DF8(void)
eventTemplates[i].movementType = ((sHillData->tag.floors[floorId].direction >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; eventTemplates[i].movementType = ((sHillData->tag.floors[floorId].direction >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP;
eventTemplates[i].trainerRange_berryTreeId = (sHillData->tag.floors[floorId].range >> bits) & 0xF; eventTemplates[i].trainerRange_berryTreeId = (sHillData->tag.floors[floorId].range >> bits) & 0xF;
eventTemplates[i].script = EventScript_2C83F0; eventTemplates[i].script = EventScript_2C83F0;
gSaveBlock2Ptr->frontier.field_CB4[i] = i + 1; gSaveBlock2Ptr->frontier.trainerIds[i] = i + 1;
} }
FreeDataStruct(); FreeDataStruct();
@ -874,7 +874,7 @@ const struct WarpEvent* sub_81D6134(u8 warpEventId)
u16 LocalIdToHillTrainerId(u8 localId) u16 LocalIdToHillTrainerId(u8 localId)
{ {
return gSaveBlock2Ptr->frontier.field_CB4[localId - 1]; return gSaveBlock2Ptr->frontier.trainerIds[localId - 1];
} }
bool8 GetHillTrainerFlag(u8 eventObjectId) bool8 GetHillTrainerFlag(u8 eventObjectId)
@ -892,7 +892,7 @@ void SetHillTrainerFlag(void)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == gTrainerBattleOpponent_A) if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_A)
{ {
gSaveBlock2Ptr->frontier.field_EE0 |= gBitTable[floorId + i]; gSaveBlock2Ptr->frontier.field_EE0 |= gBitTable[floorId + i];
break; break;
@ -903,7 +903,7 @@ void SetHillTrainerFlag(void)
{ {
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (gSaveBlock2Ptr->frontier.field_CB4[i] == gTrainerBattleOpponent_B) if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_B)
{ {
gSaveBlock2Ptr->frontier.field_EE0 |= gBitTable[floorId + i]; gSaveBlock2Ptr->frontier.field_EE0 |= gBitTable[floorId + i];
break; break;