WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Classic - AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=179)
-   -   Getting item weapon speed (https://www.wowinterface.com/forums/showthread.php?t=57354)

MinguasBeef 08-15-19 09:52 AM

Getting item weapon speed
 
Note: This is for Classic

Blizzard made a bunch of changes over the course of beta that slowly broke one of my addons.

I'm trying to fix an addon, but one issue i'm running into is I need to find a way to determine my current equipped range weapon's speed for a hunter.

I know I can get my weapon speed (with haste applied) by using UnitRangedDamage.

I need to find a way to get the base speed.

I tried by getting the item link and finding the item mod for weapon speed via the following:
Code:

bowlink = GetInventoryItemLink("player", 18)
stats = GetItemStats(bowlink)
print(bowlink)
print(tostring(stats["ITEM_MOD_SPEED_SHORT"]))

However i'm getting back nil for the ITEM_MOD_SPEED_SHORT stat. I also tried the item mod
ITEM_MOD_CR_UNUSED_3_SHORT which I found on https://www.townlong-yak.com/framexm...balStrings.lua but it seems like that is not used or is nil as well.

Any ideas would be really appreciated.

Edit: Just an update...
I found I can print out the stats that the item has by using the following..
Code:

for stat, value in pairs(stats) do
  print(stat)
end

It looks like there is not a weapon speed stat. :mad:

Any alternative routes to get my base ranged weapon speed would be amazing.

MinguasBeef 08-17-19 10:37 PM

My real issue is determining ranged haste for aimed shot.

The actual aimed shot cost time is 3.5 seconds and is effected by haste.

I was going to determine the ranged haste by looking at the ranged attack speed, the weapon speed, and calculating it based off that, but as I cannot get the weapon's speed this will not be possible.

Any ideas for alternatives for determining the ranged haste?

Rilgamon 08-18-19 02:47 AM

Cant remember but if its in the tooltip you could read it from there?

myrroddin 08-18-19 05:07 PM

You could do it in steps, unless there is a better way.
Get the percent that Haste gives you for ranged attacks: https://wow.gamepedia.com/API_GetCombatRatingBonus
Code:

local hastePercent = GetCombatRatingBonus(CR_HASTE_RANGED)
Then multiply the weapon's base attack speed by the above, and subtract that amount from the base.

GetRangedHaste() might also work, but the API isn't documented on Wowpedia; you'll have to check the API docs.

https://wow.gamepedia.com/World_of_W...API#Paper_Doll

myrroddin 08-18-19 05:11 PM

Check out DejaClassicStats to see how Deja extracts the numbers from the API.

MinguasBeef 08-23-19 02:01 PM

Quote:

Originally Posted by myrroddin (Post 333271)
Check out DejaClassicStats to see how Deja extracts the numbers from the API.

It looks like that addon is just using the ranged speed value from UnitRangedDamage which wont help me for this since what I really need to determine is the ranged haste.

I'm going to try the other methods suggested once classic goes live though and hopefully i'll have some type of success with those.

Thanks for the input!

MinguasBeef 08-26-19 05:26 PM

So just an update...

Neither of these work for getting the ranged weapon speed. Any other ideas on how to calculate either my ranged haste or my ranged weapon speed (unhasted) for a hunter?


All times are GMT -6. The time now is 10:59 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI