Help with an arena

BiGyElLoWhAt

New Member
Reaction score
1
I have what will be a battle arena, but I don't want the defender to actually die.
I've tried
Long live rexxar
Events
Unit - Rexxar 0054 <gen>'s life becomes Equal to 1.00
Conditions
Actions
Unit - Make (Triggering unit) Invulnerable
Game - Display to (All players) the text: You are strong, gre...
Wait 2.00 seconds
Unit - Set life of (Triggering unit) to 100.00%
Unit - Order Rexxar 0054 <gen> to Move To (Center of Rexx Home <gen>)
Player - Add 2000 to Player 1 (Red) Current gold

but he still dies. I'm assuming it's never equal to 1, and the only thing I can think of is tracking the damage that the main char can do, and using that as a reference and a variable in the unit event.
Thanks
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You are correct, its very very very unlikely that the units HP are ever exactly equal to 1.00. Especially because HP are floating point numbers. It could be 1.00001 or 0.999999. To be exactly at 1.00 is highly unlikely.

You could:
1) Change the event to "unit dies" and simply revive the hero (if it is a hero)
2) Change the event to "unit takes damage", then check if (current life - damage taken <= 0)
3) Give your hero the reincarnation ability from the tauren chieftain

By the way, ordering a unit to move somewhere is not the same as teleporting the unit. The player can still give orders to the unit and make it keep attacking. If you want to teleport a unit you have to use "move unit to location".
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Change the event to be Less than 1.00, that ought to work. I do that in my map and turn the unit Invulnerable at that point; it stays alive instead of dying when it takes fatal damage.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top