Help with Chance to Dodge... (Not as easy as it appears)

S

Stratavarius

Guest
I'm currently working on a big project, and it's my first 'real' map so I'm sort of forcing knowledge about map editor down my throat. So forgive me if this is a simple problem.
I'm trying to make a hero ability that increases the hero's chance to dodge as the hero's health decreases. So that if the hero's health were at say, 56%, his chance to dodge would be at 20%.
The problem I've run into is that all abilities that deal with chance to dodge do not allow variables to be used in stead of values. So my question remains, is this ability possible to create? And if so, how is it possible?

If I am being to vague, I'd be happy to give more details.
Any guidance would really be appreciated. :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
Sure, it's possible, but you have to use triggers to do it. Something with a random integer comparison.
 

MaaxeEvid

New Member
Reaction score
8
hard, or no... maybe

if you made some evasion skill with 25 levels you can do it easier

everytime the hero hp belows you add a new level for the skill

eg.

hero full has 700 HP...if the hp below 650, you increase 1 level, if below 600 you increase +1 etc...its my idea
 
S

Stratavarius

Guest
Hmm...
I could do something like that I Maax, it would still be increments though. I guess it would be a good fall back.
How would the random integer comparison method work?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
It's probably more trouble than it's worth, but you would have to detect when a unit was attacked, then if a random integer were higher than a certain value, undo the damage done to the attacked unit.
 
S

Stratavarius

Guest
I guess what I'm stuck on is that I need to know how to change the value of the hero's chance to dodge through triggers. I can set his health to a variable and find a way to connect it to his chance to dodge, but I can't seem to find a command that actually alters the chance to dodge ability itself.
Is there a way to do that?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
Not unless you made the entire dodge ability nothing but a trigger and used a variable for the dodge chance.
 

Kershbob

New Member
Reaction score
30
It's probably more trouble than it's worth, but you would have to detect when a unit was attacked, then if a random integer were higher than a certain value, undo the damage done to the attacked unit.

Not when attacked when damaged; and this method is probably the best.
 
S

Stratavarius

Guest
That could work Ghan... Since it completly by-passes the chance to dodge by creating my own artificial one. Worth a shot I'd say, thanks to both of you!
 

Kershbob

New Member
Reaction score
30
Code:
Dodge Set Up
    Events
        Unit - A unit enters (Entire map)
    Conditions
        (Unit-type of (Entering unit)) Equal to Demon Hunter
    Actions
        Trigger - Add to Dodge <gen> the event (Unit - (Entering unit) Takes damage)

Code:
Dodge
    Events
    Conditions
        (Damage taken) Greater than 0.00
        (Level of Evasion for (Triggering 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) Greater than ((Integer((Percentage life of (Triggering unit)))) + 25)
            Then - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
            Else - Actions

This means the hero can evade damage from any source, including spells.
 

Evoroth

New Member
Reaction score
11
And for levels:

Code:
Dodge
    Events
    Conditions
        (Damage taken) Greater than 0.00
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Greater than ((Integer((Percentage life of (Triggering unit)))) + 5 * Level of Panic Dodge for (Triggering Unit) + 10
            Then - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
            Else - Actions
 

Kershbob

New Member
Reaction score
30
"+ 5 * Level of Panic Dodge for (Triggering Unit)" makes the ability worse per level. You'd want -.
 
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