You can try something like this:
- Tr
- Events
- Map Initialization
- Conditions
- Actions
- Set Regions[1] = Region 000 <gen>
- Set Regions[2] = Region 001 <gen>
- Set Regions[3] = Region 002 <gen>
- Set ExpRate[1] = 30
- Set ExpRate[2] = 70
- Set ExpRate[3] = 190
- Trigger
- Events
- Unit - A unit dies
- Conditions
- Actions
- Set Point1 = (Position of (Triggering unit))
- For each (IntegerA) from 1 to 3, do (Actions)
- Loop - Actions
- If (All conditions are true) then do (Actions) else do (Actions)
- If - Conditions
- (Regions[(IntegerA)] contains Point1) Equal to True
- Then - Actions
- Set TempGroup = (Units within 900.00 of Point1 matching ((Matching unit) is a Hero) Equal to True) and ((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) Equal to True) and ((Matching unit) is alive) Equal to True)
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Hero - Add ExpRate[(IntegerA)] to (Picked unit), Show level-up graphics
- Custom script: call DestoryGroup (udg_TempGroup)
- Else - Actions
- Custom script: call RemoveLocation (udg_Point1)