Skill that temporary enables 100% critical for a limited of attacks.

BoterhaM

New Member
Reaction score
2
As the title sais, I want to make a skill that enables the hero to deal a number of critical strikes and evade a numer of attacks.

Like; once activated (spell): your next 5 attacks will deal 2.2 critical damage, and, the next 5 attacks made to you will be evaded no matter what.

Is it possible and if so, does anyone know how to do this?

I've tried stuff like

Unit casts ability
Ability beeing cast equal to Cunning Time
Unit add ability: Evasion (which is 100%)
Unit add ability: Critical strike (which is 100% and 2.2)

However, this does not work AND its based on the duration of the spell, not real attacks!
 

thewrongvine

The Evolved Panda Commandant
Reaction score
506
The ability doesn't add? Are the evasion and crit abilities the type of the unit (hero)? It should at least add, even if the timing and extra data you want doesn't work.

First off, make a variable for the caster. Say Caster is the variable for the triggering unti. For the attacks/attacked, you could make this trigger activate another trigger that has an event that when a unit attacks/unit is attacked, and the triggering unit is Caster, another Variable is a... don't exactly know what type it would be, but it's a number. And it first sets it at 0, then every attack/attacked, it adds to the counter, and have a If,Then,Else for those actions, that if it is more than 5, it turns off the trigger.

Ok, that's confusing...
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
for your critical strike, add the critical strike ability by a trigger like you did, but change the event to 'Unit - a unit starts the effect of an ability'
Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to 'Your Skill'
    Actions
        Unit - Add Critical Strike (100%) to (Triggering unit)
now a second trigger got to be used:
Code:
Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Critical Strike (100%) for (Attacking unit)) Not equal to 0
    Actions
        Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Custom value of (Attacking unit)) mod 5) Equal to 0
            Then - Actions
                Unit - Remove Critical Strike (100%) from (Attacking unit)
            Else - Actions

This should help out...
Edit: well for evasion it should work same way too, just change attacking to attacked unit and critical strike to evasion ^^
 

cleeezzz

The Undead Ranger.
Reaction score
268
did you guys know Critical strike has an evasion field? so you could do it all in one ability.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
but he wants evasion to be removed after 5 evaded attacks and critical strike after 5 critical hits, if you do both into the same ability both will be removed after on of the conditions.
 

Tyman2007

Ya Rly >.
Reaction score
74
Set the custom values of the units to like 5 then use when a unit is attacked then set the custom value of the attacking unit -= 1 then if its 0 then remove the ability from attacked unit..

Simple im guessing.. i don't like explaining thouroughly if i dont need to.
 

BoterhaM

New Member
Reaction score
2
hey thanks for the help but it doesnt work!

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ultimate 
    Actions
        Unit - Add Critical Strike to (Triggering unit)

Code:
Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Critical Strike for (Attacking unit)) Not equal to 0
    Actions
        Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Abs((Custom value of (Attacking unit)))) - 5) Equal to 0
            Then - Actions
                Unit - Remove Critical Strike from (Attacking unit)
            Else - Actions

It works the first time you cast it, however if you cast it a second time the critical strike ability will not be removed.

Ive based the spell on Avatar. BTW: once you activated the Avatar spell, the hero (Mountain king) will always attack with a bash-animation (blue stuff out of his axe).
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
yes because you havent copied it exact, the condition you re using in the if/then/else action is wrong, you got to use '((Custom value of (Attacking unit)) mod 5) Equal to 0' not like you did '((Abs((Custom value of (Attacking unit)))) - 5) Equal to 0'
 

BoterhaM

New Member
Reaction score
2
yes because you havent copied it exact, the condition you re using in the if/then/else action is wrong, you got to use '((Custom value of (Attacking unit)) mod 5) Equal to 0' not like you did '((Abs((Custom value of (Attacking unit)))) - 5) Equal to 0'

Yes i know that, but i cant see where "mod" is...

I use normal world editor? Do you know which buttons i need to choose?
 

Dr.Jack

That's Cap'n to you!
Reaction score
109
Or just do...

Code:
Untitled Trigger 002
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Critical Strike for (Attacking unit)) Not equal to 0
    Actions
        Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Abs((Custom value of (Attacking unit)))) - 5) Equal to 0
            Then - Actions
                Unit - Remove Critical Strike from (Attacking unit)
                Unit - Set the custom value of (Attacking unit) to 0
            Else - Actions

:)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top