HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Evade: Event / Action?

12-21-2006, 01:32 PM#1
Avanger
Hi guys!

I have a (i fear) simple Problem:

There are 2 Skills in my map witch uses Evade:

First 1:
A Skill (with autocast) that gives the Hero the chance of X% to evade. The evade costs 25 Mana. The Hero should be able to cast a channel-spell and evade in one time. therefor it must be the "real" evade.

Problem:
If i use an permanent evade skill (-mana blub) the hero evades without having mana.
if i use "unit takes dammage" (+addlife...) the hero could be dead befor the trigger starts.
if i use "unit gets attacked" and check for Mana. i need the event "evade". or a good workaround.


second skill:
A skill witch gives the Hero a chance [HLvL + (INT / 2)]% to evade.
My way: create a skill with 100 levels...
Problem: fucking loading time and lagg when learning the Skill.
so i need the action "evade"...
12-21-2006, 01:41 PM#2
Rising_Dusk
There is no event or action for Evasion.
You can trigger the effect with the "EVENT_UNIT_DAMAGED" event and then nullify the damage done and create your own floating text, however.
The issue there is that a general EVENT_UNIT_DAMAGED trigger cannot differentiate between attacks and spells.
This can of course be adjusted for if you use some damage detection system with orb abilities. (Like Slow Poison)
Granted, at the end of the day it's slightly complicated for people not willing to spend a good chunk of time on it.

Quote:
if i use "unit takes dammage" (+addlife...) the hero could be dead befor the trigger starts.
Wrong.
The damage event triggers before the unit actually is damaged.
Trust me, I abused that to hell in AotZ.

For your first skill, why not use Phase Shift?
That Faerie Dragon skill works pretty well for what you're looking for.
(Even though it isn't a % chance, it's probably the simplest way to achieve the general effect you want)

Quote:
lagg when learning the Skill.
You can preload the ability by putting it on a preplaced unit and then removing the unit.
That eliminates that lag.

Quote:
A skill witch gives the Hero a chance [HLvL + (INT / 2)]% to evade.
You could run a timer that updates the skill level of the evasion ability if that's what you want.
Or you could trigger it with the EVENT_UNIT_DAMAGED trigger as above and just use your formula in the condition.
I think the trigger choice is probably easier in that case.

Anyways, hope I've helped.
12-21-2006, 01:57 PM#3
Avanger
hey thank u for the fast answer.

Question:
how is the exact fuction called to nullify the damage?
When i nullify the damage will the hero be afected by a frost orb or s.t. else?

to phase shift: i whant that % and the main reason for me ist that I don't whant that the hero evades multiple Attaks at once. otherwise i would tried s.t. like this or a short inuverabilty.

can you say short how u mean this with the damage detection system? don't have to be much. i think i'm able to make this.
12-21-2006, 02:16 PM#4
wyrmlord
You would probably just add life to the unit being attacked which would be equal to the damage the unit is about to take. I'd assume the unit would be affected by buffs still. As for the fade shift, just get some random integer/real and check it, and when the unit is supposed to evade, just 'nullify' the damage using whatever method. Perhaps also create some kind of floating text showing "miss" or a special effect.
12-21-2006, 02:44 PM#5
Avanger
Hey! i have an idea witch is the best for me. therefor another question:

when i use the "takes dammage" event. and i add an ability to the dammage source witch gives 100% miss will this work? so it wont be affected by orbs but is affected by spells!

problem witch spells make this effect? cause casting "curse" won't be fast enough i think.
12-21-2006, 03:00 PM#6
Rising_Dusk
The EVENT_UNIT_DAMAGE trigger fires when the damage is taken, not when an attack is made.
Therefore curse will not work, neither will evasion do I think.

Quote:
You would probably just add life to the unit being attacked which would be equal to the damage the unit is about to take.
That's exactly how you would nullify the damage.
Be forewarned that it doesn't work under two conditions.
A) When the damage taken is greater than a unit's maximum life.
B) When the heal would put a unit over its max life (And therefore cannot fully negate the damage)

There is another way you can do it, but it causes some targeting issues.
You can make the unit invulnerable for .01 seconds, which would negate the damage being taken guaranteed, no matter what damage it was.
Issue with that being it causes units targeting you to untarget you, which can be annoying.

Quote:
When i nullify the damage will the hero be afected by a frost orb or s.t. else?
Yes, all effects are properly retained.
You can code to remove any additional buffs that may be there if you so desire.

Quote:
I don't whant that the hero evades multiple Attaks at once
Adding a cooldown to Phase Shift does just that.
It also saves you unnecessary code.
12-21-2006, 03:09 PM#7
wyrmlord
If you're going to raise the unit's life to negate damage, but yet the unit won't have enough total life to do so, you might want to mess around with this: http://www.wc3campaigns.net/showthread.php?t=80490 Which is just a sample on how to adjust the maximum life/mana of a unit.
12-21-2006, 07:22 PM#8
Avanger
kk thanks a lot. that's enough for me. I'll add life and try to kill the added buff's in some way. if i can't i'll crie
12-21-2006, 07:47 PM#9
masda70
I've recently tried to make a custom evasion system without using damage events (and effectively working like the original evasion) but I quit when I realized that changing the attacking unit's order as soon as a UNIT IS ATTACKED event was triggered came with very troublesome side effects I couldn't manage to overcome after all.

EDIT: using damage events has the disadvantage of triggering weapon sounds and displaying weapon missiles, keep in mind that the original 'Miss' is always displayed as soon as the attacker shoots and not as soon as the attack was supposed to hit (it should have missed after all).
12-21-2006, 10:21 PM#10
UnMi
Quote:
ut I quit when I realized that changing the attacking unit's order as soon as a UNIT IS ATTACKED event was triggered came with very troublesome side effects I couldn't manage to overcome after all.
This is because the UNIT_IS_ATTACKED event triggers when a unit starts attacking. Whether it finishes the attack or not does not matter, so if a unit has some kind of Animation Damage Point, it would still triggers if that unit begins its attacking animation and stops immediately after. A fix would be to set the Animation Damage Point to 0, but that looks really weird on some units.
Quote:
using damage events has the disadvantage of triggering weapon sounds
No, WEAPON_TYPE_UNKNOWN does not have a weapon sound.
Quote:
and displaying weapon missiles
Er...? What? If someone misses the attack, the missles don't show up? I am not sure what you mean.
Quote:
keep in mind that the original 'Miss' is always displayed as soon as the attacker shoots and not as soon as the attack was supposed to hit
EVENT_UNIT_DAMAGED is triggered in the momoent when someone shoots, not when the missle lands.
12-22-2006, 12:37 AM#11
masda70
First off, I was mistaken about the weapon missile, I wanted to actually point out that when you miss an attack involving a missile, the missile actually targets the floor right under the target unit's feet and doesn't follow the unit if it's a homing missile.

Then when I was talking about damage events not catching weapon sounds, I'm not talking about the UnitDamageTarget function but about the EVENT_UNIT_DAMAGED event.

That event triggers when the missile lands, since that's when it does damage, not otherwise. Since the missile will have landed at the moment you catch the damage event, proper weapon sound should have triggered by then.

So the thing is, simulating Miss through damage negation (That is catch the DAMAGE event and heal the unit) doesn't take into consideration: the sound played when a weapon hits, not played if it misses and the fact missiles hit the floor when they miss.
Additionally that method must feature a fancy buff removal method to take care of orb effects.


My system was supposed to catch the attacking unit at the moment it ATTACKED a unit (that means at the moment it starts the attack animation and missile shooting) then immediately switch its target if missing conditions were met with an unselectable model-less dummy unit and 100% evasion, which basically acted as the floor target featured in the original Miss.
The problem was that attack animations weren't properly displayed this way, and pausing the unit in order to switch targets would involve a modification of the unit's attack speed. Then the problem was that the next attack I had to catch if the unit had missed was issued to the dummy unit, and that caused some troubles.

If I actually set the damage point to 0 then maybe the target would have been hit even before I could catch the ATTACKED event and effectively switch targets... so I don't think that will fix it at all.
12-22-2006, 01:38 AM#12
Pheonix-IV
Hey Dusk, with the triggered damage, instead of making the unit invulnerable for 0.01 seconds, give it a modded hardened skin with 10000 damage reduction and 0 minimum damage for 0.01 seconds, if you want it to work for spells too, give it spell immunity and resistant skin for 0.01 seconds as well.
12-22-2006, 02:38 AM#13
xombie
Yea thats the DotA-way! Avernus's ultimate.
12-22-2006, 03:45 AM#14
masda70
I have taken a look at the system I had started earlier and spent some time to improve it, results look quite good... thus I will probably post it later.