|
|
|
@ -232,6 +232,12 @@ function Unit:IsHostile() |
|
|
|
|
return UnitCanAttack(self:GetOMToken(), "player") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
---@param unit Unit |
|
|
|
|
---@return number |
|
|
|
|
function Unit:GetReaction(unit) |
|
|
|
|
return UnitReaction(unit:GetOMToken(), self:GetOMToken()) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- Is the unit a boss |
|
|
|
|
---@return boolean |
|
|
|
|
function Unit:IsBoss() |
|
|
|
@ -338,6 +344,18 @@ local isClassicWow = select(4, GetBuildInfo()) < 40000 |
|
|
|
|
-- return UnitInMelee(self:GetOMToken(), unit:GetOMToken()) |
|
|
|
|
-- end |
|
|
|
|
|
|
|
|
|
--[[ |
|
|
|
|
M2Collision = 0x1 |
|
|
|
|
M2Render = 0x2 |
|
|
|
|
WMOCollision = 0x10 |
|
|
|
|
WMORender = 0x20 |
|
|
|
|
Terrain = 0x100 |
|
|
|
|
WaterWalkableLiquid = 0x10000 |
|
|
|
|
Liquid = 0x20000 |
|
|
|
|
EntityCollision = 0x100000 |
|
|
|
|
Unknown = 0x200000 |
|
|
|
|
]] |
|
|
|
|
|
|
|
|
|
local losFlag = bit.bor(0x1, 0x10, 0x100000) |
|
|
|
|
|
|
|
|
|
-- Check if the unit can see another unit |
|
|
|
@ -1029,7 +1047,12 @@ end |
|
|
|
|
-- ismounted |
|
|
|
|
---@return boolean |
|
|
|
|
function Unit:IsMounted() |
|
|
|
|
return UnitIsMounted(self.unit) |
|
|
|
|
local mountedFormId = { |
|
|
|
|
[3] = true, -- Mount / Travel Form |
|
|
|
|
[27] = true, -- Swift Flight Form |
|
|
|
|
[29] = true, -- Flight Form |
|
|
|
|
} |
|
|
|
|
return UnitIsMounted(self.unit) or (GetShapeshiftFormID() and mountedFormId[GetShapeshiftFormID()]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- isindoors |
|
|
|
|