It seems you're familiar with scripts, so I'll just provide a general list of actions:
- Create script tables with guards and rewards (organize them in a way that's convenient for you)
- At the start of the map, iterate through all buildings of that type using GetObjectNamesByType("BUILDING_BLOOD_TEMPLE") and attach touch triggers
- Alternatively, you can create a building-bank class with corresponding initializers...
- Touching the bank emulates a battle using StartCombat, and in the callback after the hero wins, they receive a random reward (or a reward tied to the strength of the guard)
- In the callback, also reset the touch trigger (or, for a better visual, display a message like "The treasure has already been looted" + MarkObjectAsVisited())
Well, within a single scenario, there are no questions. But where and how do I save the script so that it applies to all maps, including RMG?