Thread Tools Display Modes
06-28-21, 10:52 AM   #1
Wojakpink
A Kobold Labourer
Join Date: Jun 2021
Posts: 1
Looking for a lua command to get spell damage

Hi everyone,

I'm new to developping AddOns and just got into the lua language recently. I want to extract the amount of damage that a spell deals with a lua command. I've been scrolling through
"https://wowwiki-archive.fandom.com/wiki/World_of_Warcraft_API#Unit"
but I didin't find such a command (I can only get infos like casttime, ID, name etc. but not the range of damage that a spell deals !)
I want this for tbc classic.
Any suggestion on how I could get the range of damage for each spell ?

(for example, as a mage, my scorch deals "265 to 312" raw damage. All i want is creating 2 variables :
ScorchDmg1 = 265
ScorchDmg2 = 312)

I appreciate any kind of help !

PS : i've tried to extract those numbers from the description of the spell with GetSpellDescription, then find and sub the chain with patterns etc. to extract the numbers but it is SO complicated and not flexible.

Wojakpink
  Reply With Quote
06-28-21, 11:00 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Originally Posted by Wojakpink View Post
PS : i've tried to extract those numbers from the description of the spell with GetSpellDescription, then find and sub the chain with patterns etc. to extract the numbers but it is SO complicated and not flexible.
Unfortunately, that is one of only two ways to get those values. The other is creating a scan tooltip and extracting the values from that.
  Reply With Quote

WoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » Looking for a lua command to get spell damage

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