Quantcast Getting item weapon speed - WoWInterface
Thread Tools Display Modes
08-15-19, 09:52 AM   #1
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
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.

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

Last edited by MinguasBeef : 08-15-19 at 01:17 PM.
  Reply With Quote
08-17-19, 10:37 PM   #2
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
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?
  Reply With Quote
08-18-19, 02:47 AM   #3
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 753
Cant remember but if its in the tooltip you could read it from there?
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
08-18-19, 05:07 PM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,071
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
  Reply With Quote
08-18-19, 05:11 PM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,071
Check out DejaClassicStats to see how Deja extracts the numbers from the API.
  Reply With Quote
08-23-19, 02:01 PM   #6
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
Originally Posted by myrroddin View Post
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!
  Reply With Quote
08-26-19, 05:26 PM   #7
MinguasBeef
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 17
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?
  Reply With Quote

WoWInterface » Classic - AddOns, Compliations, Macros » Classic - AddOn Help/Support » Getting item weapon speed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off