# attack speed system

#### gorillabull

Level 17
im making a system which is able to modify the attack speed of a unit with a smallest possible variation of only 1% so you can have 2% increased attack speed, 3%,.. 55%,56%,57% etc.. however i ran into a problem: i thought that the gloves of haste attack speed ability stacks but it appears that only works when a hero aquires multiple gloves of haste items and the effect does not work if you add multiple gloves of haste abilities.. so the only solution that i have so far is to make 100 attack speed abilities and just remove the old and add a new ability so if i wanted to make a hero gain 22% attack speed i would add ability# 22 assuming ability 1 gives 1% attack speed and ability 100 gives 100%
so is there another way to modify the attack speed maybe with upgrades or some other ability >.>

#### Doomlord

Level 16
I thought bonus mod works that way. Is my whole life a lie? >_<

#### Spartipilo

Level 20
This is why we need more Math and Logic Classes in School.

You have to do something like Roman Numeric System

Have 1 ability with 5 levels: 0, 1, 2, 3, and 4% increase
Have 1 ability with 5 levels: 0, 5, 10, 15, and 20% increase
Have 1 ability with 5 levels: 0, 10, 20, 30, 40% increase.
Have 1 ability with 5 levels: 0, 20, 40, 60, 80% increase.

Add all the abilities to the unit and set them to lvl 1 (where they give no bonus)

Lets assume your unit starts increasing speed
- 1%, 2%, 3%, 4% (untill now it's just the 1% Ability level increase)
- Increases another to 5%, now you set 1%Abil to 0, and set 5%Abil to level 1. Then start with the 1%Abil again.
- Increases up to 10%, now set 1%Abil and 5%Abil to 0, and set 10%Abil to lvl 1, then start with the 1% abil again, and with the 5% abil again.
- Increases up to 20%, now set 1%Abil, 5%Abil, and 10%Abil to 0, and set 20%Abil to 1, then start with the others just as before.

I don't know the exact math in all this, but I know there is a formula that allows you to do this without having to use hundreds of ITE's statements, and without having to use a 100 levels ability.

With this system you can increase speed from 1% to 144% one by one with just those 4 abilities and some math formula (and an Ability array). In fact, this could work for critical strike and evasion as well, is not so heavy, seems pretty efficient, abilities can be hidden in a spellbook and many people could take advantage of this by simply using
• t
• Custom script: call SetSpeedBonus(someunit, 20) to Set Speed bonus to 20%
• Custom script: call SetCriticalChance(someunit, 22) to set Critical Strike to 22%
• Custom script: call SetEvasionChance(someunit, 68) to set Evasion to 68%

#### Doomlord

Level 16
Something is wrong here it seems. I just tested with my system. The attack speed change is quite difficult to notice but it is still there. Maybe your Gameplay Constant has a weird spot?

Level 17

#### Doomlord

Level 16
What is the test value? I think 30% and lower may be unnoticable. I tested with 100 and -75, as well as some other high values.

Oh and since my system uses the same method as Bonus Mod, does that mean Bonus Mod is flawed too?

#### gorillabull

Level 17
it works fine as long as the abilities you add are uniqie (2,4,8,16..) if you add the same ability twice then nothing will happen, i thought the same ability can be added multiple times to the same hero but i was wrong

#### Doomlord

Level 16
Ah yes I see. Thanks for clearing that out I was misunderstanding the whole time x)

Replies
0
Views
601
Replies
5
Views
842
Replies
16
Views
1K
Replies
3
Views
601
Replies
3
Views
491