use trigger, group array.
1, create variable
hero_units[1-8] : player's hero 1-8
HeroAssistGroups[1-8] : keep a list of assisted for every hero (1-8)
2, add assisted player to group:
Trigger - add attacking hero to assisted group
Trigger: Unit type of Hero_type is attacked
Condition: Attacked unit is Hero[1]
Action: add attacking unit to HeroAssistGroups[1]
3, hero die
Trigger - hero die
Trigger : unit type of Hero_type die
condition : none
action:
give xxx gold to player(owner of killing unit)
set temp_integer = player number of dieing unit
for every player in HeroAssistGroups[temp-integer]
give yyy gold to picked player
empty HeroAssistGroups[temp-integer]
- do assist ever expired ? then you need to update assist group
Trigger : every 1 second
for every integer 1 to 8 do
do something with HeroAssistGroups[1-8]
(work out your rules for expired)