• 🏆 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!

[Trigger] Triggered evasion

Status
Not open for further replies.
Level 6
Joined
Nov 3, 2008
Messages
117
Just get the attacked unit and the attacking unit. create a trigger with the unittakesdamage event and increase the attacked units current life by the amount of damage taken.
Well im not that expierienced in gui but in jass its rlly easy to create^^
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
Just get the attacked unit and the attacking unit. create a trigger with the unittakesdamage event and increase the attacked units current life by the amount of damage taken.
Well im not that expierienced in gui but in jass its rlly easy to create^^
yeah but then it wouldnt work against attack that could kill

like if you have 10 hp, evasion wont work then


and I know evasion ability, thx for reading the first post. "crit" was typo D:
 
Level 7
Joined
Jul 20, 2008
Messages
377
Crit that does 0x? Alternatively, place a curse debuff on the attacking unit.
 
Level 3
Joined
Aug 1, 2007
Messages
27
Hey,
Maybe I did something wrong, but i created footmen with 99% evasion, 1 hp
and units with 500000 dmg.
They weren't able to kill them.
Did you change some gameplay constants?
Otherwise I can't think of a reason for your ones to be killed.

~I3obo~
 
Level 3
Joined
Aug 1, 2007
Messages
27
Well, I think you should be more precise.
Up to now it seemed that u were able to use evasion to reach your goal:

So I want to have % chance that attack will deal 0 damage. How?

Or do I just HAVE TO use evasion ability?

Well, and maybe I'm not advanced enough for this, but I think you have to use JASS for this.

~I3obo~

Edit: Wow! Nice idea by Element of Water! But then, you could also use the stop oder, don't you?
Edit2: I think he just wants a spell like "Backtrack" of Void from DotA.
 
It is impossible to do exactly as you request, without the unit dying already if the attack is due to be missed yet it is enough to kill the opponent. Either use mine, which isn't perfect but stops units being killed (You could play the attack animation too to make it look better), or use Inferior's which is perfect apart from the dying part. Jass, in this case, cannot do any more than GUI can.
 
Level 13
Joined
May 11, 2008
Messages
1,198
if you have a trigger that does damage to a unit and you want a chance to miss then run an algorhythm whereby you get a random number and if it's less than or greater than a certain number then the damage part of the trigger happens or is skipped. if you need it to apply to a certain unit for spells in general i suggest using a global variable integer and use that for the number that the random number needs to be higher or lower than. also you'd need to use this for all your spells. maybe you can trigger all your spells and then you could add in the random thing that way. from there on, it's all just math.

sorry i don't have an example, i'm too lazy to type and test all that out right now. maybe i'll try to do it a bit later on.
 
Level 7
Joined
Oct 14, 2008
Messages
340
Backtrack is an insanely high chance to "go back in time" when he takes ANY damage, pretty much nullifying it. i think its like 25%, so overpowered :p

Err void's backtrack uses the whole takes damage then reverts back to the hp before the damage thing.

I'm pretty sure if you do that, like, add hp == damage taken, your unit won't die. For example:

My hero has 20 hp, I'm hit by an archer that deals 30 damage, but my trigger goes off, i take the damage bringing my hp down, but the trigger takes action faster than my death will go off, saving my ass.
 
Level 3
Joined
Jul 6, 2008
Messages
42
Well , I got a example solution for your question .
But , the problem is , If the damages taken higher than your maximum life , it doesn't work (You will dead)

Another problem is , when you are at full hp , you can't dodge the attack ~

But , if the damages lower than your maximum hp , you wont die if u dodge the attack , even through u only 1hp left.

You can try on the example I gave you
type "-hp 1" (without "") in the game to set the hero's hp to 1.

Edit : I pretty sure death come before take damages. Else , the 1st problem in my example won't occur . And I pretty sure take damage event does actions before the unit reduce the hp . Therefore , in my example , I set the life of the unit that dodge attack to his (current life + damages) . So , when it take damages , it come back to its original life . The 2nd problem occur because I can't set life higher than maximum life.
 

Attachments

  • trigger evade.w3x
    20.2 KB · Views: 42
Level 2
Joined
Jan 10, 2009
Messages
30
Ok, ill make you an tutorial for this.

How to setup an Evasion Trigger without using the Evasion spell.

If you still have questions about this after this TUT, post it.
Ok, create an Trigger like this:

  • Events
    • Unit - A unit Is issued an order targeting an object
  • Conditions
    • ((Targeted unit of issued order) is A Hero) Equal to True
  • Actions
    • // This REAL numbers are the chance that the unit blocks the attack (by Evasion)
    • Set NUM_EvasionChance = (Random real number between 1.00 and 1.000)
    • Set UNIT_Target = (Targeted unit of issued order)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • NUM_EvasionChance Equal to 1.00
    • Then - Actions
      • Unit - Add Evasion to UNIT_Target
      • Unit - Add a 0.10 second Generic expiration timer to UNIT_Target
      • Unit - Remove Evasion from UNIT_Target
      • Set UNIT_Target = No Unit
    • Else - Actions
I have not yet tryed this my self and don't have time for it atm, but if it dont work, please tell. If it did work, then enjoy! :thumbs_up:
 
Status
Not open for further replies.
Top