MZ Enemies leaving spoils on the map when defeated which are reset when the player leaves the map

Hi, so this is an idea I had when I was trying to brainstorm my game in VXA https://forums.rpgmakerweb.com/index.php?threads/solved-enemies-drop-reward-on-the-map-that-disappear-if-left-area.157982/. For convenience I copy paste what I was/am looking for:

Enemy monster event on the map starts a battle when the player touch it. If they defeat it, instead of getting gold by default the enemy event switches to the next page with self-switch, changes graphic to sparkles, and becomes an action-button event. The player can step on the sparkles and press X to collect “the gold dropped by the enemy”. Then the enemy event deletes itself and the next time the player re-enters this map this enemy event start all over. This at least I can do.

The problem is I have another desired outcome, if the player saw the sparkles (the gold dropped) and decided to leave the current map, I don’t want the enemy event to be stuck on that gold/sparkle page. Instead it will just return back to the first page (walking enemy event). Basically if they don’t pick up the gold, the next time they re-enter this map the gold reward won’t be there; it resets.
Thanks to kyonides there is a working script for this particular desired outcome, but after searching here I didn’t see a plug-in for this on MV/MZ.

I got MZ just yesterday and was going to give it a try with the same idea. Is this doable in MZ without a plug-in now? If not, is there any existing one?
There was always a way to do this by eventing alone, without any script or plugin.
But that method is a bit more work.

Basically you need to implement a map reset switch, and give all those enemy events an additional reset page.

On the reset page (which needs to be the highest page number), a parallel process should switch off all self-switches or any other condition, resulting in the event going back to page 1.
This page needs to be conditioned to a global reset switch for the map.

then, either on entering or leaving the map, you'll need a sequence that switches on the reset switch, waits 3-4 frames (to allow each event to reset) and then switch off the reset switch again (allowing all events to resume normal operation)
You can do it with VisuStella Events and Movement Core, using this note tag:
Code:
<Exit Reset Self Data>

- Used for: Event Notetags ONLY
- When the player leaves the current map, all Self Switches and Self
  Variables related to this event will be reset.
You can do it with VisuStella Events and Movement Core, using this note tag:
Code:
<Exit Reset Self Data>

- Used for: Event Notetags ONLY
- When the player leaves the current map, all Self Switches and Self
  Variables related to this event will be reset.
Thanks!

There was always a way to do this by eventing alone, without any script or plugin.
But that method is a bit more work.

Basically you need to implement a map reset switch, and give all those enemy events an additional reset page.

On the reset page (which needs to be the highest page number), a parallel process should switch off all self-switches or any other condition, resulting in the event going back to page 1.
This page needs to be conditioned to a global reset switch for the map.

then, either on entering or leaving the map, you'll need a sequence that switches on the reset switch, waits 3-4 frames (to allow each event to reset) and then switch off the reset switch again (allowing all events to resume normal operation)
I do have your idea in mind from my previous post, but since it uses a PP for every enemy event's reset page I was hesitant since I know it's not good to use too many PP; the less I can use the better which is why I lean toward scripts/plug-ins. But I do keep the idea in mind and will credit you if I do use it!
but since it uses a PP for every enemy event's reset page I was hesitant since I know it's not good to use too many PP;
that doesn't matter in this case as long as you switch off the reset like I described.
A PP running only a few frames never matters, it's the continuous PPs that create problems.

Original thread: https://forums.rpgmakerweb.com/threads/enemies-leaving-spoils-on-the-map-when-defeated-which-are-reset-when-the-player-leaves-the-map.158327/