WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Checking for "Ground mounts are not allowed here"? (https://www.wowinterface.com/forums/showthread.php?t=56903)

LudiusMaximus 12-16-18 12:55 PM

Checking for "Ground mounts are not allowed here"?
 
I just realised that when moving close to "Great-father Winter" you get dismounted automatically and trying to mount again brings up "Ground mounts are not allowed here".

Is there any way of checking if the player is in such an area? I mean like IsIndoors() but for these kinds of other areas in which you cannot be mounted?

Thanks!

JDoubleU00 12-16-18 04:17 PM

I'm not sure how to check, but I remember several expansions ago Blizz implemented an area around quest givers that dismounts you. This was to prevent griefers from sitting on their large mounts and making it difficult for you to see the mob. Maybe the NPC has a buff?

LudiusMaximus 12-16-18 04:39 PM

Hm, isn't there any way of knowing if mounting is possible in an area?

I guess it must be possible somehow, because the mount icons in the action bars become inactive whenever in such an area.

Any idea how the action bar UI is doing this trick?

LudiusMaximus 12-16-18 05:37 PM

I am now doing it with this workaround of storing the last active mount id of each character in a variable lastActiveMount:

Code:

local _, _, _, _, lastActiveMountUsable = C_MountJournal.GetMountInfoByID(self.db.char.lastActiveMount)
if (not lastActiveMountUsable) then
  print("You cannot mount here!")
end

This works for me, as my code is only invoked by PLAYER_MOUNT_DISPLAY_CHANGED with IsMounted()==false.

Nightness 12-29-18 11:31 AM

Zone
 
Keep using isUsable from C_MountJournal.GetMountInfoByID, and create a pseudo-event that triggers off of the "ZONE_CHANGED", "ZONE_CHANGED_NEW_AREA", and the "ZONE_CHANGED_INDOORS" events; trigger when isUsable has changed values.


All times are GMT -6. The time now is 10:22 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI