WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   UnitRace("player") while in Dazar'alor or Mercenary PvP Mode (https://www.wowinterface.com/forums/showthread.php?t=56990)

LudiusMaximus 01-21-19 05:42 PM

UnitRace("player") while in Dazar'alor or Mercenary PvP Mode
 
I don't have a character to try this myself, so maybe somebody can help me out?

While in the respective parts of the Dazar'alor raid or while in Mercenary PvP Mode, is UnitRace("player") returning the swapped race or your original race?


I already found out that when your race gets swapped in the Caverns of Time by "Temporal Illusion", UnitRace("player") still returns your original race and not the one you have been swapped into.
Any ideas how to determine the race otherwise? I am already experimenting with

Code:

local modelFrame = CreateFrame("PlayerModel")
modelFrame:SetUnit("player")
local modelId = modelFrame:GetModelFileID()

But this is not reliable when Druid or Shaman shapeshifting is involved...

Thanks!

Kanegasi 01-21-19 06:59 PM

The new raid swaps racials as well, you can use IsSpellKnown() with an array of racial spell IDs.

myrroddin 01-22-19 02:54 AM

Wouldn't checking the player's buffs inform you which race you've been given? UnitRace() will always return the unit's actual race; that's the point. However, temporary race changes are cosmetic, and usually have an associated buff or debuff.

LudiusMaximus 01-22-19 05:23 AM

All right. Thanks for the replies!

Checking for IsSpellKnown() with racial spell IDs is a good idea, regarding the not just cosmetic racial changes. Do you know if these have only been introduced with Dazar'alor or are the racial spells also changing in mercenary PvP mode?

Regarding the merely cosmetic model changes (like in the Caverns of Time), I do get the "Temporal Illusion" buff, but this does not tell me *what* random Alliance race a Horde character has been changed into...


All times are GMT -6. The time now is 01:58 PM.

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