diff --git a/asm/macros/event.inc b/asm/macros/event.inc index d85cfb975..58e37d0a6 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1931,3 +1931,11 @@ waitbuttonpress closebraillemessage .endm + + @ Creates an "event legal" Pokémon for an encounter + .macro seteventmon species:req, level:req, item=ITEM_NONE + setvar VAR_0x8004, \species + setvar VAR_0x8005, \level + setvar VAR_0x8006, \item + special CreateEventLegalEnemyMon + .endm diff --git a/data/maps/BirthIsland_Exterior/scripts.inc b/data/maps/BirthIsland_Exterior/scripts.inc index 57d54d6fd..68d3124d9 100644 --- a/data/maps/BirthIsland_Exterior/scripts.inc +++ b/data/maps/BirthIsland_Exterior/scripts.inc @@ -82,10 +82,7 @@ BirthIsland_Exterior_EventScript_Deoxys:: delay 40 waitmoncry setvar VAR_LAST_TALKED, LOCALID_DEOXYS - setvar VAR_0x8004, SPECIES_DEOXYS - setvar VAR_0x8005, 30 @ level - setvar VAR_0x8006, ITEM_NONE - special CreateEventLegalEnemyMon + seteventmon SPECIES_DEOXYS, 30 setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle waitstate diff --git a/data/maps/FarawayIsland_Interior/scripts.inc b/data/maps/FarawayIsland_Interior/scripts.inc index 983b4709a..d3d519ed1 100644 --- a/data/maps/FarawayIsland_Interior/scripts.inc +++ b/data/maps/FarawayIsland_Interior/scripts.inc @@ -129,10 +129,7 @@ FarawayIsland_Interior_EventScript_Mew:: special DestroyMewEmergingGrassSprite delay 40 waitmoncry - setvar VAR_0x8004, SPECIES_MEW - setvar VAR_0x8005, 30 @ level - setvar VAR_0x8006, ITEM_NONE - special CreateEventLegalEnemyMon + seteventmon SPECIES_MEW, 30 setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle waitstate diff --git a/data/maps/NavelRock_Bottom/scripts.inc b/data/maps/NavelRock_Bottom/scripts.inc index f6687a36f..90cc22989 100644 --- a/data/maps/NavelRock_Bottom/scripts.inc +++ b/data/maps/NavelRock_Bottom/scripts.inc @@ -53,10 +53,7 @@ NavelRock_Bottom_EventScript_Lugia:: playmoncry SPECIES_LUGIA, CRY_MODE_ENCOUNTER waitmoncry delay 20 - setvar VAR_0x8004, SPECIES_LUGIA - setvar VAR_0x8005, 70 @ level - setvar VAR_0x8006, ITEM_NONE - special CreateEventLegalEnemyMon + seteventmon SPECIES_LUGIA, 70 setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle waitstate diff --git a/data/maps/NavelRock_Top/scripts.inc b/data/maps/NavelRock_Top/scripts.inc index 2805f5677..10969367a 100644 --- a/data/maps/NavelRock_Top/scripts.inc +++ b/data/maps/NavelRock_Top/scripts.inc @@ -57,10 +57,7 @@ NavelRock_Top_EventScript_HoOh:: applymovement LOCALID_HO_OH, NavelRock_Top_Movement_HoOhApproach waitmovement 0 special RemoveCameraObject - setvar VAR_0x8004, SPECIES_HO_OH - setvar VAR_0x8005, 70 @ level - setvar VAR_0x8006, ITEM_NONE - special CreateEventLegalEnemyMon + seteventmon SPECIES_HO_OH, 70 setflag FLAG_SYS_CTRL_OBJ_DELETE special BattleSetup_StartLegendaryBattle waitstate diff --git a/data/maps/SouthernIsland_Interior/scripts.inc b/data/maps/SouthernIsland_Interior/scripts.inc index c46cefefc..7bd16b523 100644 --- a/data/maps/SouthernIsland_Interior/scripts.inc +++ b/data/maps/SouthernIsland_Interior/scripts.inc @@ -105,17 +105,11 @@ SouthernIsland_Interior_EventScript_Sign:: end SouthernIsland_Interior_EventScript_SetLatiosBattleVars:: - setvar VAR_0x8004, SPECIES_LATIOS - setvar VAR_0x8005, 50 @ level - setvar VAR_0x8006, ITEM_SOUL_DEW - special CreateEventLegalEnemyMon + seteventmon SPECIES_LATIOS, 50, ITEM_SOUL_DEW return SouthernIsland_Interior_EventScript_SetLatiasBattleVars:: - setvar VAR_0x8004, SPECIES_LATIAS - setvar VAR_0x8005, 50 @ level - setvar VAR_0x8006, ITEM_SOUL_DEW - special CreateEventLegalEnemyMon + seteventmon SPECIES_LATIAS, 50, ITEM_SOUL_DEW return SouthernIsland_Interior_Movement_CameraPanUp: