counter strike ability trigger blah

SouL-Laka

New Member
Reaction score
2
hello
i want a trigger so that when my demon hunter uses evasion or when like it dodges the attack that a dummy is made and shoots out a fire bolt
i got it right
except im having troble getting the dummy to be made and shoot when the demon hunter dodges not just every single time he gets hit
anyways can some1 show me how its done
if it even can :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
You cannot detect when a unit evades an attack or not.
 

Sevion

The DIY Ninja
Reaction score
413
You can trigger the Evasion ability. Then it would work. Something like

Code:
Events:
Unit - A unit is attacked
Conditions:
(Attacked Unit) has Evasion
Actions:
[Give attacked unit Evasion (100%)]
Floating text - Blah Blah.
[Remove Evasion]
[Dummy Stuff]

I don't have WE open right now but something like that :p
 

Sevion

The DIY Ninja
Reaction score
413
Well it's something like that. Just check if he has a dummy spell called Evasion. Yes the spell you upgrade will be a dummy spell. The real spell is given when he's attacked. But you'll need to do a random integer thingy. Forgot to put that in -_-
 

Sevion

The DIY Ninja
Reaction score
413
Alright, I haven't tested so you'll have to test it.


Variables:
EvasionPercent, Integer, Array

Spells:
Evasion: Dummy spell. Does nothing only has text.
EvasionReal: Does something. You may want to put it into a spell book and disable the spell book so you don't see the flash of the Evasion icon when this trigger fires.

Code:
EvasionInit
    Events
        Map initialization
    Conditions
    Actions
        Set EvasionPercent[1] = 25
        Set EvasionPercent[2] = 50
        Set EvasionPercent[3] = 75

Code:
Evasion
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Evasion for (Attacked unit)) Greater than 0
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Less than or equal to EvasionPercent[(Level of Evasion for (Attacked unit))]
            Then - Actions
                Hero - Modify unspent skill points of (Attacked unit): Add (Level of Evasion for (Attacked unit)) points
                Hero - Learn skill for (Attacked unit): EvasionReal
                Unit - Set level of EvasionReal for (Attacked unit) to (Level of Evasion for (Attacked unit))
                Wait 0.25 seconds
                For each (Integer A) from 1 to (Level of EvasionReal for (Attacked unit)), do (Actions)
                    Loop - Actions
                        Unit - Decrease level of EvasionReal for (Attacked unit)
            Else - Actions

This won't work if the attacking unit is colded or poisoned because his attack speed is way slowed. You'll have to do an If/Then/Else to figure how long the wait is. Not 100% sure if it will work
though.

Edit: Oh kewl. I'm a veteran member now!
 

Weyrling

New Member
Reaction score
25
It isn't actually easier in JASS, you still have to do the same/similar things, JASS may be more efficient, but you also have to learn JASS first.
 

SouL-Laka

New Member
Reaction score
2
btw im basing my ability on evasion
so
do i gota edit the evasion ability
like change the stuff to zero since theres a trigger?
 

Hero

─║╣ero─
Reaction score
250
btw im basing my ability on evasion
so
do i gota edit the evasion ability
like change the stuff to zero since theres a trigger?

Yeah

It isn't actually easier in JASS, you still have to do the same/similar things, JASS may be more efficient, but you also have to learn JASS first.
Well apparently I know jass :p so it is easier for me...
 

Sevion

The DIY Ninja
Reaction score
413
Yea I know. You can change the % chance for it to happen. :p I thought at first it wouldn't work :D Also. I forgot to change the arrays for the EvasionPercent. I fixed it so you might want to check it on your trigger :p Also the EvasionReal spell should have 100% chance evade because there's already a %chance check in the Random Integer part. GTG do HW. GL in whatever you're doing.
 

SouL-Laka

New Member
Reaction score
2
evadepercent integer array

evade
Events
Map initialization
Conditions
Actions
Set evadepercent[1] = 25
Set evadepercent[2] = 50
Set evadepercent[3] = 75

Evade- 100% dodge
Evade(dummy)- does nothing, 0% dodge (hero ability)

evade2
Events
Unit - A unit Is attacked
Conditions
(Level of Evade for (Attacked unit)) Greater than 0
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to evadepercent[(Level of Evade for (Attacked unit))]
Then - Actions
Hero - Modify unspent skill points of (Attacked unit): Add (Level of Evade(dummy) for (Attacked unit)) points
Hero - Learn skill for (Attacked unit): Evade
Unit - Set level of Evade for (Attacked unit) to (Level of Evade(dummy) for (Attacked unit))
Wait 0.25 seconds
For each (Integer A) from 1 to (Level of Evade for (Attacked unit)), do (Actions)
Loop - Actions
Unit - Decrease level of Evade for (Attacked unit)
Else - Actions
Unit - Create 1 Priest for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing 0.00 degrees
Unit - Add Abolish Magic to (Last created unit)
Unit - Order (Last created unit) to Night Elf Dryad - Abolish Magic (Attacking unit)
Unit - Remove (Last created unit) from the game


ya so this is supposed to abolish magic to the attacking unit when the demon hunter does evade
but it dont work =/
 

Sevion

The DIY Ninja
Reaction score
413
It takes longer than 0.0000000000000000001 seconds to cast abolish magic. Add an expiration timer to the priest. Make sure the priest is invisible else you got a unit appearing then disappearing and everyone will be like WTH!?!?! HAX!

Code:
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
 
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