• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Setting unit to not die

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,373
Hello. I tried to make a little arena fight, however I am having problems setting it correctly.

I wanted a friendly arena match - there are 2 opponents that wouldn't die, but instead they would be teleported out of the arena once they have very low hp (10 or less).
The problem is that the trigger I set for that doesn't really work. Sometimes both opponents die and nothing happens; sometimes only one dies and the other is teleported away; sometimes killing one acts as if I defeated both and I win the arena. I often saw, that even though one of the opponents took damage and had less than 10 hp left, only the next blow to the opponent triggered the effect. Also, it happened to me that the opponent died and his corpse was teleported out of the arena.

I use the trigger below, one per opponent.
  • Swordsmen Duo 094
    • Events
      • Unit - Swordsman 0094 <gen> Takes damage
    • Conditions
      • (Life of Swordsman 0094 <gen>) Less than or equal to 10.00
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Set life of Swordsman 0094 <gen> to 10.00
      • Unit - Make Swordsman 0094 <gen> Invulnerable
      • Unit - Pause Swordsman 0094 <gen>
      • Set ArenaVariable[1] = (ArenaVariable[1] + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArenaVariable[1] Equal to 2.00
        • Then - Actions
          • -------- //////////////////////////////////////////////// --------
          • -------- If the var = 2, both enemies are defeated and the match is won --------
          • -------- //////////////////////////////////////////////// --------
          • Cinematic - Disable user control for (All players)
          • Unit - Order <Hero> to Stop
          • Player - Make Player 1 (Red) treat Player 3 (Teal) as an Neutral
          • Player - Make Player 3 (Teal) treat Player 1 (Red) as an Neutral
          • Set ArenaEndPoint[1] = (Position of <Arena Warden> <gen>)
          • Set ArenaEndPoint[2] = (ArenaEndPoint[1] offset by 100.00 towards 225.00 degrees)
          • Cinematic - Fade out over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Wait 2.00 seconds
          • Unit - Move <Hero> instantly to ArenaEndPoint[2], facing 45.00 degrees
          • Unit - Remove Swordsman 0094 <gen> from the game
          • Unit - Remove Swordsman 0095 <gen> from the game
          • Trigger - Run Arena No Fight <gen> (checking conditions)
          • Camera - Pan camera for Player 1 (Red) to (Position of <Hero>) over 0.00 seconds
          • Cinematic - Fade in over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Wait 2.00 seconds
          • Unit - Make <Arena Warden> <gen> face <Hero> over 0.20 seconds
          • Cinematic - Send transmission to (All players) from <Arena Warden> <gen> named <Arena Warden>: Play No sound and display You've got some goo.... Modify duration: Set to 9.00 seconds and Wait
          • Cinematic - Enable user control for (All players)
        • Else - Actions
          • -------- //////////////////////////////////////////////// --------
          • -------- Only 1 enemy is down, item is dropped and the enemy is teleported away --------
          • -------- //////////////////////////////////////////////// --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArenaVariable[2] Equal to 1.00
            • Then - Actions
              • Set ArenaVariable[2] = 0.00
              • Set ArenaItemPoint[1] = (Position of Swordsman 0094 <gen>)
              • Set ArenaItemPoint[2] = (ArenaItemPoint[1] offset by 60.00 towards 270.00 degrees)
              • Item - Create Potion of Healing at ArenaItemPoint[2]
            • Else - Actions
          • Animation - Play <Arena Warden> <gen>'s spell animation
          • Wait 0.30 seconds
          • Special Effect - Create a special effect at (Position of Swordsman 0094 <gen>) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Wait 0.20 seconds
          • Unit - Unpause Swordsman 0094 <gen>
          • Unit - Move Swordsman 0094 <gen> instantly to (Center of Safe Area 04 <gen>), facing 340.00 degrees
          • Unit - Pause Swordsman 0094 <gen>
          • Wait 0.50 seconds
          • Animation - Play <Arena Warden> <gen>'s stand animation
To explain a few things:
  • Set ArenaVariable[1] - This is set to 0 and detects how many opponents were defeated (to check if the player won the arena, or still has to fight)
  • Set ArenaVariable[2] - This is set to 1 and for every defeated opponent (except the last one), an item will be created (in this case where there are 2 opponents, only 1 will drop an item).
  • Unit - <Arena Warden> - This unit only plays spell animation when defeated opponent is teleported away and serves as the one who let's the player in the arena
  • Trigger - Run Arena No Fight <gen> (checking conditions) - this trigger has nothing to do with the fight itself, it only spawns a couple of units into the arena, when the player himself is not participating in any match
Could anyone help me solve this problem, please?
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
use weep's damage detection system >>> http://www.hiveworkshop.com/forums/...8/?prev=search=damage%20detection&d=list&r=20

and do this...
  • Untitled Trigger 002
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of GDD_DamagedUnit) Less than or equal to 10.00
        • Then - Actions
          • -------- teleportation here --------
        • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It's even better to use Night Elf Giant's passive for damage blocking. Set max amount to 99999 and set the Minimum damage field.

Combine with,

You are right, I forgot about magic source. There is item ability which can reduce Magic damage by 100% ^^

Is it possible to achieve "the unit doesn't takes any damage although 10000000 damage of both, magic and physical source hits upon that unit" ?
(Too lazy to experiment...)
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Item's magic damage reduction negates any magic dmg (no mater how much), although giant's ability is limited to 99999. So it sucks if your units deal 1mln++ damage.
If you would ask about Pharaoh_'s suggestion: no, if unit has less life than amount of damage that it is going to take and delay is less than 0.00 it still dies (delay means the minimum time unit requires to regenerate).
 
Status
Not open for further replies.
Top