Quantcast
BCC: Any good way to tell if a mount can fly? - WoWInterface
Thread Tools Display Modes
07-29-21, 07:26 PM   #1
fullmoon_sulfuras
A Deviate Faerie Dragon
Join Date: Dec 2019
Posts: 10
BCC: Any good way to tell if a mount can fly?

Hi! I'm trying to figure out if a mount, say, the Great While Kodo (ID 18793), can fly. I know it can't, but is there an API function that could tell me if a mount can fly? The best I could come up with is to exhaustively check for the name of the flying mounts:

string.find(mount.name, "Windrider")

- Griffon
- Windrider
- Cenarion War Hippogryph (33999)
- Netherwing Drake
- Nether Ray
- Ashes of Al'ar (32458)
- Flying Machine

This is for BCC.

Thanks!

Last edited by fullmoon_sulfuras : 07-30-21 at 07:44 AM.
  Reply With Quote
07-29-21, 09:30 PM   #2
Ekaterina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 64
Code:
creatureDisplayInfoID, description, source, isSelfMount, mountTypeID,
uiModelSceneID, animID, spellVisualKitID, disablePlayerMountPreview
   = C_MountJournal.GetMountInfoExtraByID(mountID)
   = C_MountJournal.GetDisplayedMountInfoExtra(index)
https://wowpedia.fandom.com/wiki/API...tInfoExtraByID

One of the returns is the mountTypeId with for flying should be 248 for most flying mounts.
  Reply With Quote
07-30-21, 07:44 AM   #3
fullmoon_sulfuras
A Deviate Faerie Dragon
Join Date: Dec 2019
Posts: 10
Is C_MountJournal available in BCC?
  Reply With Quote
07-30-21, 06:12 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,048
It isn't available in BCC. You'll have to build your own database for item and/or spell IDs depending on if you're checking inventory or buffs.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
07-30-21, 06:41 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,423
It might be better to watch the 2.5.2 PTR and how it progresses.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
07-31-21, 03:31 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,048
Originally Posted by Fizzlemizz View Post
It might be better to watch the 2.5.2 PTR and how it progresses.
They're not going to make major system changes like this to the client in the middle of an expansion.
Especially when there was no precedent for it in the reference content. Mount Journal didn't exist until WoD.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 07-31-21 at 03:33 AM.
  Reply With Quote
07-31-21, 09:09 AM   #7
fullmoon_sulfuras
A Deviate Faerie Dragon
Join Date: Dec 2019
Posts: 10
I came up with the following function:

Lua Code:
  1. function Lunar.Items:BCCIsFlyingMount(mount)
  2.     local items = { "Windrider", "Gryphon", "Cenarion War Hippogryph", "Netherwing Drake", "Nether Ray", "Ashes of Al'ar", "Flying Machine" }
  3.  
  4.     for _,v in pairs(items) do
  5.         if string.find(mount, v) then
  6.             return true
  7.         end
  8.     end
  9.     return false
  10. end

Where mount is the item's name.
  Reply With Quote
08-01-21, 12:55 PM   #8
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 117
tContains do the same thing:

Lua Code:
  1. function Lunar.Items:BCCIsFlyingMount(mount)
  2.     local items = { "Windrider", "Gryphon", "Cenarion War Hippogryph", "Netherwing Drake", "Nether Ray", "Ashes of Al'ar", "Flying Machine" }
  3.         return tContains(items, mount)
  4. end
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-04-21, 12:26 AM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,048
tContains() doesn't run string pattern matching.
Also, it's better to compare by itemID rather than name, otherwise localization will be a problem.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-04-21 at 12:29 AM.
  Reply With Quote
08-04-21, 09:53 AM   #10
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 117
Originally Posted by SDPhantom View Post
tContains() doesn't run string pattern matching.
Unless I missed something, after testing with tContains, Lunar.Items:BCCIsFlyingMount("Gryphon") returns true.
Originally Posted by SDPhantom View Post
Also, it's better to compare by itemID rather than name, otherwise localization will be a problem.
Right.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-04-21, 04:38 PM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,048
There is no mount simply named "Gryphon". For example, if you tried to match with Ebon Gryphon, tContains() will return false while the manual search returns true because tContains() (using tIndexOf()) doesn't do pattern matching. This is what string.find() is doing.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-04-21 at 05:00 PM.
  Reply With Quote
08-04-21, 11:32 PM   #12
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 117
OK, I understand.
Thank you for your explanation SDPhantom.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
08-06-21, 06:01 PM   #13
fullmoon_sulfuras
A Deviate Faerie Dragon
Join Date: Dec 2019
Posts: 10
Originally Posted by SDPhantom View Post
tContains() doesn't run string pattern matching.
Also, it's better to compare by itemID rather than name, otherwise localization will be a problem.
That's a great point, I'll switch to a (longer) list of item IDs.

Thanks!!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » BCC: Any good way to tell if a mount can fly?

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