• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

how to detect assists on kills????

Status
Not open for further replies.
Level 15
Joined
Jul 9, 2008
Messages
1,552
what can i do to detect when a play assists another player in killling another player (by player i mean there hero)


e.g red and blue are killing teal teal dies red gets the kill. how do i detect that blue was helping him????
 
Level 9
Joined
Apr 26, 2011
Messages
403
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)
 
Status
Not open for further replies.
Top