• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

get Damage, the trigger will not work

Status
Not open for further replies.
Level 5
Joined
May 8, 2020
Messages
87
when using command -die1 that user's hero will die but when taking damage will not die.
But when not taking damage within 5 seconds of the countdown, it can be used again
how can i do that
 

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,951
I don't really understand what you want so I'll just show you different examples:

Track each Player's hero:
  • Set Player Hero
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Set VariableSet PlayerHero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Prevent heroes from dying from damage (version 1.31+ required):
  • Damage Cant Kill
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • PlayerHero[(Player number of (Owner of (Damage Target)))] Equal to (Damage Target)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Damage Target)) - (Damage taken)) Less than or equal to 0.45
        • Then - Actions
          • Event Response - Set Damage of Unit Damaged Event to 0.00
          • Unit - Set life of (Damage Target) to 0.45
        • Else - Actions
This isn't ideal and I can't guarantee that it will work 100% of the time.

Damage command which can only be used if the CanUseDieCommand boolean is false:
  • Damage Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -die1 as An exact match
      • Player - Player 2 (Blue) types a chat message containing -die1 as An exact match
      • Player - Player 3 (Teal) types a chat message containing -die1 as An exact match
    • Conditions
      • CanUseDieCommand[(Player number of (Triggering player))] Equal to True
    • Actions
      • Unit - Kill PlayerHero[(Player number of (Triggering player))]
You can set CanUseDieCommand[player number] to False whenever you want to disable it for a given player.
 
Last edited:
Level 5
Joined
May 8, 2020
Messages
87
I mean when that player use command : -die1 will kill his hero .
but when attacked by other players ( hit or use spell ) will be disabled.
If in 5 seconds no longer take damage from the player (attack or magic) will be able to use the command -die1 again
 

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,951
Okay, whenever the Hero takes damage Set it's CanUseDieCommand boolean to False. Then start a Timer for that Player which lasts 5 seconds. When that Timer expires Set CanUseDieCommand back to True.

The above triggers should give you a good idea of how to do this.
 
Last edited:
Status
Not open for further replies.
Top