• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Attack Speed math problem

Status
Not open for further replies.
I got Archer with "Attack Cooldown Time" in OE set to 1.500 sec
Allied unit has UnholyFrezny (+75% AS) and BloodLust (+40% AS)

BloodLust is casted. Archer's AS=1.070 sec
IAS (increased attack speed) = 40%, counted this way:
Base attack (1.500) * 100 - current attack speed (1.070) / current attack speed (1.070)
so IAS = ((1.500*100) - (1.070*100)) / 1.070 = 40

next step:
UnholyFrenzy is casted, Archer's AS = 0.695 sec
IAS = 115% (40%+75%)
IAS = ((1.500*100) - (0.695*100)) / 0.695 = 115

diffrence between AS=1.070 and AS=0.695 is 54%
I count it like before:
IAS_2 = ((1.070*100) - (0.695*100)) / 0.695 = 54%


I got a copy of Archer, and want to that copy has the same AS as original unit.
I have BonusMod that allows to aplly AS bonus. I can track original unit for AS changes.
now question
Without knowing "Base Attack Speed" (in OE) is it possible to count how much shoud I apply Bonus AS for a copy unit to be the same attack speed as original unit?
 
Level 3
Joined
Mar 5, 2016
Messages
25
Make a trigger to save as variable that unit's stats so you dont have to count every time

for example make an event about it

Event if someone casts (bloodlust unfrezy [there is countable spells so you can write them one by one])

actions: set variable (current attack speed) = current attack speed [ that variable counts attack speed with buffs)


so when you need to know whats the last attack speed the "current attack speed" will show you
 
well..
maybe I didnt described well enough
let's say:

we know that Archer's last AS was 1.070 sec
next time when Archer attacks, she's AS is 0.695 sec
if we do not know "Attack Cooldown Time" in OE (basic AS) is there a way to calculate Gloves of Haste ability (how much %) for copied Archer so that copied unit will have the same AS as original Archer.

storing all abilities/buffs with their percent changes AS is not an option.
 
Level 3
Joined
Mar 5, 2016
Messages
25
Is this what you mean ? :

How can i calculate item bonus if we dont know units attack speed?

and that unit is a hero right ?

if it is you can calculate it from Agility


in other ways you can "variable" that attack speed on per unit-class cause world edit doenst give you much option as hero stat calculating

or else you need to write custom script
 
eh..
I'll try last time, please remember this is just an example, its about math.

1. there's custom ability based on "Gloves of Haste"
to do : calculate percent of this ability

2. there is regular unit: archer with attack speed: 1.070 sec
(we do not know if it is base AS, or if unit is under effect of any aura or it has any buffs..)

3. I want to add ability based on "Gloves" so Archer's new Attack speed should be 0.695 sec. Is possibe to calculate "Gloves" ability percent?
 
Level 13
Joined
Jan 2, 2016
Messages
973
Why don't you try to find the formula yourself?
Make a an ability, based on gloves of haste, give it many levels, each giving more attack speed than the previous.
Make a trigger, that can level/de-level that ability, so you can test different bonuses.
Make a trigger, that's telling you the time between attacks.

And then just get the formula by doing multiple tests, with different bonuses :p

I could help you with analizing the results if you still can't figure out the formula :)
 
Thanks for your answer WereElf,
I'm afraid the answer for my question is: it's not possible..

*The formula is in 1st post.

*I got BonusMod, so no need to create ability based on Gloves: it was just an example to ask as easy as possible;]

*There is a triger that prints time between 2 uninterrupted attacks already

I belive calculate this is not possible without knowing Base Attack Speed from OE.
Thanks anyway;]
 
Level 13
Joined
Jan 2, 2016
Messages
973
When I tried to use the Object Data Extractor - it destroyed my map xP

It's possible that this happened, cuz I'm unable to use LUA for some reason, but make sure to back up your map before opening it with ODE instealled :p

EDIT: By the way, I checked the initial post, and I think it's possible to caluclate it, if you check the unit's attack speed, give it some bonus attack speed, check it again, and then you'll be able to do what you want.
However, that's not very practical, since you wouldn't be able to initially set its attack speed.. you'd need to make it attack few times before that xP
 
Status
Not open for further replies.
Top