• 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.

Add money to the enemy when he kills you (not from yourself) ?

Status
Not open for further replies.
Level 5
Joined
May 8, 2020
Messages
87
I have a command to kill my own hero or if they use it to kill their hero.
I use : -kill (to kill my own champion) and they can do the same
So
How to when enemy general (or their mirror iimage) kills me will receive money Or vice versa, so am I ?
I will be deducted about 5000 gold when killed by an enemy.
Or -7000 gold when killed by Neutral Hostile
Allies will get -1000 gold when trying to kill me.
To avoid them using the spam kill command to increase their own money
 
Level 14
Joined
Jan 24, 2017
Messages
280
If you check if the unit was killed by a unit you know it was not done by your command.
After that you can check if the killing unit is an enemy of the dying unit. And give gold according to that. I did not completly understand who should lose how much gold exactly.
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Killing unit) Not equal to No unit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Killing unit)) Equal to Neutral Hostile
        • Then - Actions
          • Player - Add -7000 to (Owner of (Dying unit)).Current gold
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) belongs to an enemy of (Owner of (Dying unit)).) Equal to True
        • Then - Actions
          • Player - Add -5000 to (Owner of (Dying unit)).Current gold
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) belongs to an ally of (Owner of (Dying unit)).) Equal to True
        • Then - Actions
          • Player - Add -1000 to (Owner of (Killing unit)).Current gold
        • Else - Actions
 
Last edited:
Level 29
Joined
Sep 26, 2009
Messages
2,596
I think it could work by adding this to the trigger that fires when you write the '-kill' command:
  • Set VariableSet KilledByCommand = True
  • Unit - Kill <selected_hero>
  • Set VariableSet KilledByCommand = False
and in the second trigger just validate the boolean variable's value:
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • KilledByCommand Equal to False
    • Actions
      • //your actions
 
Status
Not open for further replies.
Top