World of Warcraft Forever API · Unit.md, for your AI
Unit (global functions)
218 functions, 142 events, 8 tables, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
CanEjectPassengerFromSeat
result = CanEjectPassengerFromSeat(virtualSeatIndex)
Arguments
virtualSeatIndex | luaIndex |
|---|
Returns
result | bool |
|---|
CanSwitchVehicleSeat
result = CanSwitchVehicleSeat()
Returns
result | bool |
|---|
ClosestGameObjectPosition
xPos, yPos, distance = ClosestGameObjectPosition(gameObjectID)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
gameObjectID | number |
|---|
Returns
xPos | number | |
|---|---|---|
yPos | number | |
distance | number |
ClosestUnitPosition
xPos, yPos, distance = ClosestUnitPosition(creatureID)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
creatureID | number |
|---|
Returns
xPos | number | |
|---|---|---|
yPos | number | |
distance | number |
CreateUnitHealPredictionCalculator
healPredictionCalculator = CreateUnitHealPredictionCalculator()
Returns
healPredictionCalculator | UnitHealPredictionCalculator |
|---|
EjectPassengerFromSeat
EjectPassengerFromSeat(virtualSeatIndex)
Arguments
virtualSeatIndex | luaIndex |
|---|
GetComboPoints
result = GetComboPoints(unit, target)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
target | UnitTokenPvPRestrictedForAddOns |
Returns
result | number |
|---|
GetNegativeCorruptionEffectInfo
corruptionEffects = GetNegativeCorruptionEffectInfo()
Returns
corruptionEffects | CorruptionEffectInfo[] |
|---|
GetUnitChargedPowerPoints
pointIndices = GetUnitChargedPowerPoints(unit)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
pointIndices | number[] |
|---|
GetUnitEmpowerHoldAtMaxTime
holdAtMaxTime = GetUnitEmpowerHoldAtMaxTime(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
holdAtMaxTime | number |
|---|
GetUnitEmpowerMinHoldTime
minHoldTime = GetUnitEmpowerMinHoldTime(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
minHoldTime | number |
|---|
GetUnitEmpowerStageDuration
duration = GetUnitEmpowerStageDuration(unit, index)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
index | number |
Returns
duration | number |
|---|
GetUnitHealthModifier
result = GetUnitHealthModifier(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
GetUnitMaxHealthModifier
result = GetUnitMaxHealthModifier(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
GetUnitPowerBarInfo
info = GetUnitPowerBarInfo(unitToken)
May return nothing.
Arguments
unitToken | UnitToken |
|---|
Returns
info | UnitPowerBarInfo |
|---|
GetUnitPowerBarInfoByID
info = GetUnitPowerBarInfoByID(barID)
May return nothing.
Arguments
barID | number |
|---|
Returns
info | UnitPowerBarInfo |
|---|
GetUnitPowerBarStrings
name, tooltip, cost = GetUnitPowerBarStrings(unitToken)
Arguments
unitToken | UnitToken |
|---|
Returns
name | cstring may be nil | |
|---|---|---|
tooltip | cstring may be nil | |
cost | cstring may be nil |
GetUnitPowerBarStringsByID
name, tooltip, cost = GetUnitPowerBarStringsByID(barID)
Arguments
barID | number |
|---|
Returns
name | cstring may be nil | |
|---|---|---|
tooltip | cstring may be nil | |
cost | cstring may be nil |
GetUnitPowerBarTextureInfo
texture, colorR, colorG, colorB, colorA = GetUnitPowerBarTextureInfo(unitToken, textureIndex, [timerIndex])
Arguments
unitToken | UnitToken | |
|---|---|---|
textureIndex | luaIndex | |
timerIndex | luaIndex may be nil |
Returns
texture | fileID | |
|---|---|---|
colorR | number | |
colorG | number | |
colorB | number | |
colorA | number |
GetUnitPowerBarTextureInfoByID
texture, colorR, colorG, colorB, colorA = GetUnitPowerBarTextureInfoByID(barID, textureIndex)
Arguments
barID | number | |
|---|---|---|
textureIndex | luaIndex |
Returns
texture | fileID | |
|---|---|---|
colorR | number | |
colorG | number | |
colorB | number | |
colorA | number |
GetUnitPowerModifier
result = GetUnitPowerModifier(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
GetUnitSpeed
currentSpeed, runSpeed, flightSpeed, swimSpeed = GetUnitSpeed(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
currentSpeed | number | |
|---|---|---|
runSpeed | number | |
flightSpeed | number | |
swimSpeed | number |
GetUnitTotalModifiedMaxHealthPercent
result = GetUnitTotalModifiedMaxHealthPercent(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
GetVehicleUIIndicator
backgroundTextureID, numSeatIndicators = GetVehicleUIIndicator(vehicleIndicatorID)
May return nothing.
Arguments
vehicleIndicatorID | number |
|---|
Returns
backgroundTextureID | fileID | |
|---|---|---|
numSeatIndicators | number |
GetVehicleUIIndicatorSeat
virtualSeatIndex, xPos, yPos = GetVehicleUIIndicatorSeat(vehicleIndicatorID, indicatorSeatIndex)
May return nothing.
Arguments
vehicleIndicatorID | number | |
|---|---|---|
indicatorSeatIndex | luaIndex |
Returns
virtualSeatIndex | number | |
|---|---|---|
xPos | number | |
yPos | number |
IsFalling
result = IsFalling([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
IsFlying
result = IsFlying([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
IsPlayerInGuildFromGUID
IsInGuild = IsPlayerInGuildFromGUID(playerGUID)
Arguments
playerGUID | WOWGUID |
|---|
Returns
IsInGuild | bool |
|---|
IsSubmerged
result = IsSubmerged([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
IsSwimming
result = IsSwimming([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
IsUnitModelReadyForUI
isReady = IsUnitModelReadyForUI(unitToken)
Arguments
unitToken | UnitToken |
|---|
Returns
isReady | bool |
|---|
PlayerIsPVPInactive
result = PlayerIsPVPInactive(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
PlayerIsSpellTarget
result = PlayerIsSpellTarget(unit)
If the unit is currently casting a spell, returns whether spell's target unit is the player. Returns false if the unit is not casting a spell or the spell has no target.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
PlayerVehicleHasComboPoints
vehicleHasComboPoints = PlayerVehicleHasComboPoints()
Returns
vehicleHasComboPoints | bool |
|---|
RegionalUniqueNamesEnabled
result = RegionalUniqueNamesEnabled()
Returns
result | bool |
|---|
ReportPlayerIsPVPAFK
ReportPlayerIsPVPAFK(unit)
Arguments
unit | UnitToken |
|---|
ResistancePercent
result = ResistancePercent(resistance, casterLevel)
Arguments
resistance | number | |
|---|---|---|
casterLevel | number |
Returns
result | number |
|---|
SetPortraitTexture
SetPortraitTexture(textureObject, unitToken, [disableMasking])
Arguments
textureObject | SimpleTexture | |
|---|---|---|
unitToken | UnitToken | |
disableMasking | bool default false |
SetPortraitTextureFromCreatureDisplayID
SetPortraitTextureFromCreatureDisplayID(textureObject, creatureDisplayID)
Arguments
textureObject | SimpleTexture | |
|---|---|---|
creatureDisplayID | number |
SetUnitCursorTexture
hasCursor = SetUnitCursorTexture(textureObject, unit, [style], [includeLowPriority], [preferGamepadIcon])
Arguments
textureObject | SimpleTexture | |
|---|---|---|
unit | UnitToken | |
style | CursorStyle may be nil | |
includeLowPriority | bool may be nil | |
preferGamepadIcon | bool may be nil |
Returns
hasCursor | bool |
|---|
UnitAffectingCombat
result = UnitAffectingCombat(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitAlliedRaceInfo
isAlliedRace, hasHeritageArmorUnlocked = UnitAlliedRaceInfo(unit)
Arguments
unit | UnitToken |
|---|
Returns
isAlliedRace | bool | |
|---|---|---|
hasHeritageArmorUnlocked | bool |
UnitArmor
base, effective, real, bonus = UnitArmor(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
base | number | |
|---|---|---|
effective | number | |
real | number | |
bonus | number |
UnitAttackPower
attackPower, posBuff, negBuff = UnitAttackPower(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
attackPower | number | |
|---|---|---|
posBuff | number | |
negBuff | number |
UnitAttackSpeed
attackSpeed, offhandAttackSpeed, rangedAttackSpeed = UnitAttackSpeed(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
attackSpeed | number | |
|---|---|---|
offhandAttackSpeed | number may be nil | |
rangedAttackSpeed | number may be nil |
UnitBattlePetLevel
result = UnitBattlePetLevel(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number may be nil |
|---|
UnitBattlePetSpeciesID
result = UnitBattlePetSpeciesID(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number may be nil |
|---|
UnitBattlePetType
result = UnitBattlePetType(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number may be nil |
|---|
UnitCanAssist
result = UnitCanAssist(unit, target, [canAssistImmunePC], [canAssistUninteractable])
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken | |
canAssistImmunePC | bool default false | |
canAssistUninteractable | bool default false |
Returns
result | bool |
|---|
UnitCanAttack
result = UnitCanAttack(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | bool |
|---|
UnitCanCooperate
result = UnitCanCooperate(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | bool |
|---|
UnitCanPetBattle
result = UnitCanPetBattle(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | bool |
|---|
UnitCastingDuration
duration = UnitCastingDuration(unit)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
duration | LuaDurationObject |
|---|
UnitCastingInfo
name, displayName, textureID, startTimeMs, endTimeMs, isTradeskill, castID, notInterruptible, castingSpellID, castBarID, delayTimeMs = UnitCastingInfo(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
name | cstring | |
|---|---|---|
displayName | string | |
textureID | fileID | |
startTimeMs | number | |
endTimeMs | number | |
isTradeskill | bool | |
castID | WOWGUID | |
notInterruptible | bool may be nil | |
castingSpellID | number | |
castBarID | UnitCastBarID may be nil | |
delayTimeMs | number |
UnitChannelDuration
duration = UnitChannelDuration(unit)
May return nothing.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
duration | LuaDurationObject |
|---|
UnitChannelInfo
name, displayName, textureID, startTimeMs, endTimeMs, isTradeskill, notInterruptible, spellID, isEmpowered, numEmpowerStages, castBarID = UnitChannelInfo(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
name | cstring | |
|---|---|---|
displayName | cstring | |
textureID | fileID | |
startTimeMs | number | |
endTimeMs | number | |
isTradeskill | bool | |
notInterruptible | bool may be nil | |
spellID | number | |
isEmpowered | bool | |
numEmpowerStages | number | |
castBarID | UnitCastBarID may be nil |
UnitChromieTimeID
ID = UnitChromieTimeID(unit)
Arguments
unit | UnitToken |
|---|
Returns
ID | number |
|---|
UnitClass
className, classFilename, classID = UnitClass(unit)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
className | cstring | |
|---|---|---|
classFilename | cstring | |
classID | number |
UnitClassBase
classFilename, classID = UnitClassBase(unit)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
classFilename | cstring | |
|---|---|---|
classID | number |
UnitClassFromGUID
className, classFilename, classID = UnitClassFromGUID(unitGUID)
May return nothing.
Arguments
unitGUID | WOWGUID |
|---|
Returns
className | cstring | |
|---|---|---|
classFilename | cstring | |
classID | number |
UnitClassification
result = UnitClassification(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | cstring |
|---|
UnitControllingVehicle
result = UnitControllingVehicle(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitCreatureFamily
name, id = UnitCreatureFamily(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
name | cstring | |
|---|---|---|
id | number |
UnitCreatureID
creatureID = UnitCreatureID(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
creatureID | number may be nil |
|---|
UnitCreatureType
name, id = UnitCreatureType(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
name | cstring | |
|---|---|---|
id | number |
UnitDamage
minDamage, maxDamage, offhandMinDamage, offhandMaxDamage, posBuff, negBuff, percent = UnitDamage(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
minDamage | number | |
|---|---|---|
maxDamage | number | |
offhandMinDamage | number | |
offhandMaxDamage | number | |
posBuff | number | |
negBuff | number | |
percent | number |
UnitDefenseSkill
base, modifier = UnitDefenseSkill(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
base | number | |
|---|---|---|
modifier | number |
UnitDetailedThreatSituation
isTanking, status, scaledPercentage, rawPercentage, rawThreat = UnitDetailedThreatSituation(unit, mobGUID)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
mobGUID | UnitToken |
Returns
isTanking | bool | |
|---|---|---|
status | number | |
scaledPercentage | number | |
rawPercentage | number | |
rawThreat | number |
UnitDistanceSquared
distance, checkedDistance = UnitDistanceSquared(unit)
Arguments
unit | UnitToken |
|---|
Returns
distance | number | |
|---|---|---|
checkedDistance | bool |
UnitEffectiveLevel
result = UnitEffectiveLevel(name)
Arguments
name | cstring |
|---|
Returns
result | number |
|---|
UnitEmpoweredChannelDuration
duration = UnitEmpoweredChannelDuration(unit, [includeHoldAtMaxTime])
Returns a duration object that includes the duration of an empowered cast channel.
May return nothing.
Arguments
unit | UnitToken | |
|---|---|---|
includeHoldAtMaxTime | bool default true | If true, include the hold-at-max time of the empowered channel in the total duration. |
Returns
duration | LuaDurationObject |
|---|
UnitEmpoweredStageDurations
duration = UnitEmpoweredStageDurations(unit)
Returns a vector of duration objects that measure the time spans for each individual stage in an empowered channel, with hold-at-max time included as the last element.
May return nothing.
Arguments
unit | UnitToken |
|---|
Returns
duration | LuaDurationObject[] |
|---|
UnitEmpoweredStagePercentages
percentages = UnitEmpoweredStagePercentages(unit, [includeHoldAtMaxTime])
Returns a vector of percentages that describe how much of the total duration of an empowered channel is occupied by a stage.
May return nothing.
Arguments
unit | UnitToken | |
|---|---|---|
includeHoldAtMaxTime | bool default true | If true, include the hold-at-max time of the empowered channel in the total duration and add a percentage value for it. |
Returns
percentages | number[] |
|---|
UnitExists
result = UnitExists([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitFactionGroup
factionGroupTag, localized = UnitFactionGroup(unitName, [checkDisplayRace])
Arguments
unitName | cstring | |
|---|---|---|
checkDisplayRace | bool default false |
Returns
factionGroupTag | cstring | |
|---|---|---|
localized | cstring |
UnitFullName
unitName, unitServer = UnitFullName(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
unitName | cstring | |
|---|---|---|
unitServer | cstring |
UnitGUID
result = UnitGUID(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
result | WOWGUID may be nil |
|---|
UnitGetDetailedHealPrediction
UnitGetDetailedHealPrediction(unit, [healerUnit], healPredictionCalculator)
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
healerUnit | UnitTokenPvPRestrictedForAddOns may be nil | If specified, a unit to evaluate as the 'healer' for incoming heal values. If nil, healer values will be zero. |
healPredictionCalculator | UnitHealPredictionCalculator |
UnitGetIncomingHeals
result = UnitGetIncomingHeals(unit, [healerGUID])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
healerGUID | UnitTokenPvPRestrictedForAddOns may be nil |
Returns
result | number may be nil |
|---|
UnitGetTotalAbsorbs
result = UnitGetTotalAbsorbs(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
result | number |
|---|
UnitGetTotalHealAbsorbs
result = UnitGetTotalHealAbsorbs(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
result | number |
|---|
UnitGroupRolesAssigned
result = UnitGroupRolesAssigned([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | cstring |
|---|
UnitGroupRolesAssignedEnum
result = UnitGroupRolesAssignedEnum([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | number |
|---|
UnitHPPerStamina
result = UnitHPPerStamina(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitHasEffectivelyTankAura
result = UnitHasEffectivelyTankAura([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitHasLootInteraction
result = UnitHasLootInteraction(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitHasMouseoverHighlight
result = UnitHasMouseoverHighlight(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitHasPowerType
hasPower = UnitHasPowerType(unitToken, powerType)
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType |
Returns
hasPower | bool |
|---|
UnitHasRelicSlot
result = UnitHasRelicSlot(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitHasVehiclePlayerFrameUI
result = UnitHasVehiclePlayerFrameUI([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitHasVehicleUI
result = UnitHasVehicleUI([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitHealthMax
result = UnitHealthMax(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
result | number |
|---|
UnitHealthMissing
result = UnitHealthMissing(unit, [usePredicted])
Result of UnitHealthMax() - UnitHealth()
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
usePredicted | bool default true |
Returns
result | number |
|---|
UnitHealthPercent
result = UnitHealthPercent(unit, [usePredicted], [curve])
Returns percent of health remaining - can be scaled via a curve for display purposes
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
usePredicted | bool default true | |
curve | LuaCurveObjectBase may be nil |
Returns
result | LuaCurveEvaluatedResult | If no curve is specified, a floating point percentage value. Else, the result of evaluating the curve with the percentage as the input. |
|---|
UnitHealth
result = UnitHealth(unit, [usePredicted])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
usePredicted | bool default true |
Returns
result | number |
|---|
UnitHonor
result = UnitHonor(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitHonorLevel
result = UnitHonorLevel(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitHonorMax
result = UnitHonorMax(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitInAnyGroup
result = UnitInAnyGroup([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitInBattleground
result = UnitInBattleground([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | luaIndex may be nil |
|---|
UnitInOtherParty
inOtherParty = UnitInOtherParty(unit)
Checks whether this unit cannot see your party chat because it is in an instance group
Arguments
unit | UnitToken |
|---|
Returns
inOtherParty | bool |
|---|
UnitInParty
result = UnitInParty([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitInPartyIsAI
result = UnitInPartyIsAI([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitInPartyShard
inPartyShard = UnitInPartyShard(unit)
Arguments
unit | UnitToken |
|---|
Returns
inPartyShard | bool |
|---|
UnitInRaid
result = UnitInRaid([unit], [partyIndex])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | luaIndex may be nil |
|---|
UnitInRange
inRange, checkedRange = UnitInRange(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
inRange | bool | |
|---|---|---|
checkedRange | bool |
UnitInSubgroup
result = UnitInSubgroup([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitInVehicle
result = UnitInVehicle(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitInVehicleControlSeat
result = UnitInVehicleControlSeat([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitInVehicleHidesPetFrame
result = UnitInVehicleHidesPetFrame([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsAFK
result = UnitIsAFK(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsBattlePet
result = UnitIsBattlePet(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool may be nil |
|---|
UnitIsBattlePetCompanion
result = UnitIsBattlePetCompanion(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsBossMob
result = UnitIsBossMob(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsCharmed
result = UnitIsCharmed([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsConnected
isConnected = UnitIsConnected(unit)
Arguments
unit | UnitToken |
|---|
Returns
isConnected | bool |
|---|
UnitIsControlling
result = UnitIsControlling(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsCorpse
result = UnitIsCorpse([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsDND
result = UnitIsDND(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsDead
result = UnitIsDead(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsDeadOrGhost
result = UnitIsDeadOrGhost(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsEnemy
result = UnitIsEnemy(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | bool |
|---|
UnitIsFeignDeath
result = UnitIsFeignDeath(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsFriend
result = UnitIsFriend(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | bool |
|---|
UnitIsGameObject
result = UnitIsGameObject([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsGhost
result = UnitIsGhost(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsGroupAssistant
isAssistant = UnitIsGroupAssistant(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
isAssistant | bool |
|---|
UnitIsGroupLeader
isLeader = UnitIsGroupLeader(unit, [partyCategory])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
partyCategory | luaIndex may be nil |
Returns
isLeader | bool |
|---|
UnitIsHumanPlayer
result = UnitIsHumanPlayer([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitIsInInteractRange
result = UnitIsInInteractRange(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsInMyGuild
result = UnitIsInMyGuild(unit)
Arguments
unit | cstring |
|---|
Returns
result | bool |
|---|
UnitIsInteractable
result = UnitIsInteractable([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsLieutenant
result = UnitIsLieutenant(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsMercenary
result = UnitIsMercenary(name)
Arguments
name | cstring |
|---|
Returns
result | bool |
|---|
UnitIsMinion
result = UnitIsMinion(unit)
Returns whether the unit is considered a minion of a player, such as a pet, totem, or guardian.
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsNPCAsPlayer
result = UnitIsNPCAsPlayer([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsOtherPlayersBattlePet
result = UnitIsOtherPlayersBattlePet([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsOtherPlayersPet
result = UnitIsOtherPlayersPet([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsOwnerOrControllerOfUnit
unitIsOwnerOrControllerOfUnit = UnitIsOwnerOrControllerOfUnit(controllingUnit, controlledUnit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
controllingUnit | UnitToken | |
|---|---|---|
controlledUnit | UnitToken |
Returns
unitIsOwnerOrControllerOfUnit | bool |
|---|
UnitIsPVP
result = UnitIsPVP(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsPVPFreeForAll
result = UnitIsPVPFreeForAll(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsPVPSanctuary
result = UnitIsPVPSanctuary([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsPlayer
result = UnitIsPlayer([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitIsPlayerControlledOrGroupMember
result = UnitIsPlayerControlledOrGroupMember(unit)
Returns true for 'player', 'pet', 'vehicle', or any of 'partyn', 'partypetn', 'raidn', 'raidpetn'
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsPossessed
result = UnitIsPossessed([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsQuestBoss
result = UnitIsQuestBoss(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsRaidOfficer
result = UnitIsRaidOfficer([unit])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsSameServer
result = UnitIsSameServer(unitName)
Arguments
unitName | cstring |
|---|
Returns
result | bool |
|---|
UnitIsTapDenied
result = UnitIsTapDenied(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsTrivial
result = UnitIsTrivial(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsUnconscious
result = UnitIsUnconscious(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitIsUnit
result = UnitIsUnit(unit1, unit2)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit1 | UnitToken | |
|---|---|---|
unit2 | UnitToken |
Returns
result | bool |
|---|
UnitIsVisible
result = UnitIsVisible([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitIsWildBattlePet
result = UnitIsWildBattlePet(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitLeadsAnyGroup
isLeader = UnitLeadsAnyGroup(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
isLeader | bool |
|---|
UnitLevel
result = UnitLevel(name)
Arguments
name | cstring |
|---|
Returns
result | number |
|---|
UnitName
unitName, unitServer = UnitName(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
unitName | cstring | |
|---|---|---|
unitServer | cstring |
UnitNameFromGUID
unitName, unitServer = UnitNameFromGUID(unitGUID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitGUID | WOWGUID |
|---|
Returns
unitName | cstring | |
|---|---|---|
unitServer | cstring |
UnitNameUnmodified
unitName, unitServer = UnitNameUnmodified(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
unitName | cstring | |
|---|---|---|
unitServer | cstring |
UnitNameplateShowsWidgetsOnly
nameplateShowsWidgetsOnly = UnitNameplateShowsWidgetsOnly(unit)
Arguments
unit | UnitToken |
|---|
Returns
nameplateShowsWidgetsOnly | bool |
|---|
UnitNumPowerBarTimers
result = UnitNumPowerBarTimers(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitOnTaxi
result = UnitOnTaxi(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitOwnerGUID
ownerGUID = UnitOwnerGUID(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
ownerGUID | WOWGUID |
|---|
UnitPVPName
result = UnitPVPName(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
result | string |
|---|
UnitPartialPower
partialPower = UnitPartialPower(unitToken, [powerType], [unmodified])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType may be nil | |
unmodified | bool default false |
Returns
partialPower | number |
|---|
UnitPercentHealthFromGUID
percentHealth = UnitPercentHealthFromGUID(unitGUID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitGUID | WOWGUID |
|---|
Returns
percentHealth | number may be nil |
|---|
UnitPhaseReason
reason = UnitPhaseReason(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
reason | PhaseReason may be nil |
|---|
UnitPlayerControlled
result = UnitPlayerControlled([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitPlayerOrPetInParty
result = UnitPlayerOrPetInParty([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitPlayerOrPetInRaid
result = UnitPlayerOrPetInRaid([unit], [partyIndex])
Arguments
unit | UnitToken may be nil | |
|---|---|---|
partyIndex | luaIndex may be nil |
Returns
result | bool |
|---|
UnitPosition
positionX, positionY, positionZ, mapID = UnitPosition(unit)
Arguments
unit | UnitToken |
|---|
Returns
positionX | number | |
|---|---|---|
positionY | number | |
positionZ | number | |
mapID | number |
UnitPower
power = UnitPower(unitToken, [powerType], [unmodified])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType may be nil | |
unmodified | bool default false |
Returns
power | number |
|---|
UnitPowerBarID
barID = UnitPowerBarID(unitToken)
Arguments
unitToken | UnitToken |
|---|
Returns
barID | number |
|---|
UnitPowerBarTimerInfo
duration, expiration, barID, auraID = UnitPowerBarTimerInfo(unit, [index])
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
index | luaIndex default 0 |
Returns
duration | number | |
|---|---|---|
expiration | number | |
barID | number | |
auraID | number |
UnitPowerDisplayMod
displayMod = UnitPowerDisplayMod(powerType)
Arguments
powerType | PowerType |
|---|
Returns
displayMod | number |
|---|
UnitPowerMax
maxPower = UnitPowerMax(unitToken, [powerType], [unmodified])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType may be nil | |
unmodified | bool default false |
Returns
maxPower | number |
|---|
UnitPowerMissing
result = UnitPowerMissing(unitToken, [powerType], [unmodified])
Result of UnitPowerMax() - UnitPower()
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType may be nil | |
unmodified | bool default false |
Returns
result | number |
|---|
UnitPowerPercent
result = UnitPowerPercent(unitToken, [powerType], [unmodified], [curve])
Queries the percent of power remaining, optionally evaluating it against a supplied curve.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitToken | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
powerType | PowerType may be nil | |
unmodified | bool default false | |
curve | LuaCurveObjectBase may be nil |
Returns
result | LuaCurveEvaluatedResult | If no curve is specified, a floating point percentage value. Else, the result of evaluating the curve with the percentage as the input. |
|---|
UnitPowerType
powerType, powerTypeToken, rgbX, rgbY, rgbZ = UnitPowerType(unit, [index])
May return nothing.
Arguments
unit | UnitTokenPvPRestrictedForAddOns | |
|---|---|---|
index | number default 0 |
Returns
powerType | PowerType | |
|---|---|---|
powerTypeToken | string | |
rgbX | number | |
rgbY | number | |
rgbZ | number |
UnitPvpClassification
classification = UnitPvpClassification(unit)
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
classification | PvPUnitClassification may be nil |
|---|
UnitQuestTrivialLevelRange
levelRange = UnitQuestTrivialLevelRange(unit)
Arguments
unit | UnitToken |
|---|
Returns
levelRange | number |
|---|
UnitQuestTrivialLevelRangeScaling
levelRange = UnitQuestTrivialLevelRangeScaling(unit)
Arguments
unit | UnitToken |
|---|
Returns
levelRange | number |
|---|
UnitRace
localizedRaceName, englishRaceName, raceID = UnitRace(unit)
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
localizedRaceName | cstring | |
|---|---|---|
englishRaceName | cstring | |
raceID | number |
UnitRangedAttackPower
attackPower, posBuff, negBuff = UnitRangedAttackPower(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
attackPower | number | |
|---|---|---|
posBuff | number | |
negBuff | number |
UnitRangedDamage
speed, minDamage, maxDamage, posBuff, negBuff, percent = UnitRangedDamage(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
speed | number | |
|---|---|---|
minDamage | number | |
maxDamage | number | |
posBuff | number | |
negBuff | number | |
percent | number |
UnitReaction
result = UnitReaction(unit, target)
Arguments
unit | UnitToken | |
|---|---|---|
target | UnitToken |
Returns
result | luaIndex may be nil |
|---|
UnitRealmRelationship
realmRelationship = UnitRealmRelationship(unit)
Arguments
unit | UnitToken |
|---|
Returns
realmRelationship | luaIndex may be nil |
|---|
UnitResistance
baseResistance, realResistance, effectiveResistance, bonusResistance = UnitResistance(unit, damageClass)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
damageClass | Damageclass |
Returns
baseResistance | number | |
|---|---|---|
realResistance | number | |
effectiveResistance | number | |
bonusResistance | number |
UnitSelectionColor
resultR, resultG, resultB, resultA = UnitSelectionColor(unit, [useExtendedColors])
Arguments
unit | UnitToken | |
|---|---|---|
useExtendedColors | bool default false |
Returns
resultR | number | |
|---|---|---|
resultG | number | |
resultB | number | |
resultA | number |
UnitSelectionType
result = UnitSelectionType(unit, [useExtendedColors])
Arguments
unit | UnitToken | |
|---|---|---|
useExtendedColors | bool default false |
Returns
result | number |
|---|
UnitSex
sex = UnitSex(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
sex | number may be nil |
|---|
UnitSexBase
sex = UnitSexBase(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
sex | UnitSex may be nil |
|---|
UnitShouldDisplayName
result = UnitShouldDisplayName(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitShouldDisplaySpellTargetName
result = UnitShouldDisplaySpellTargetName(unit)
If the unit is currently casting a spell, returns whether the target's name should be displayed. Returns false if the unit is not casting a spell or the spell has no target.
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitSpellHaste
result = UnitSpellHaste(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitSpellTargetClass
classFilename = UnitSpellTargetClass(unit)
If the unit is currently casting a spell, returns the class of the spell's target unit. Returns nil if the unit is not casting a spell or the spell has no target.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
classFilename | cstring |
|---|
UnitSpellTargetName
targetName = UnitSpellTargetName(unit)
If the unit is currently casting a spell, returns the name of the spell's target unit. Returns nil if the unit is not casting a spell or the spell has no target.
May return nothing.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
targetName | string |
|---|
UnitStagger
result = UnitStagger(unit)
Arguments
unit | UnitTokenPvPRestrictedForAddOns |
|---|
Returns
result | number |
|---|
UnitStat
currentStat, effectiveStat, statPositiveBuff, statNegativeBuff = UnitStat(unit, index)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
index | luaIndex |
Returns
currentStat | number | |
|---|---|---|
effectiveStat | number | |
statPositiveBuff | number | |
statNegativeBuff | number |
UnitSwitchToVehicleSeat
UnitSwitchToVehicleSeat(unit, virtualSeatIndex)
Arguments
unit | UnitToken | |
|---|---|---|
virtualSeatIndex | luaIndex |
UnitTargetsVehicleInRaidUI
result = UnitTargetsVehicleInRaidUI([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
UnitThreatLeadSituation
result = UnitThreatLeadSituation(unit, mobGUID)
Returns a threat state (0-3; representing none, yellow, orange, red) that indicates how far the provided unit is above the secondmost threat on the provided mob. If the unit is not first on threat, will always return red. Can return nil if the provided mob does not exist.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
mobGUID | UnitToken |
Returns
result | number may be nil |
|---|
UnitThreatPercentageOfLead
result = UnitThreatPercentageOfLead(unit, mobGUID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
mobGUID | UnitToken |
Returns
result | number may be nil |
|---|
UnitThreatSituation
result = UnitThreatSituation(unit, [mobGUID])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken | |
|---|---|---|
mobGUID | UnitToken may be nil |
Returns
result | number may be nil |
|---|
UnitTokenFromGUID
unitToken = UnitTokenFromGUID(unitGUID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unitGUID | WOWGUID |
|---|
Returns
unitToken | string may be nil |
|---|
UnitTreatAsPlayerForDisplay
treatAsPlayer = UnitTreatAsPlayerForDisplay(unit)
Arguments
unit | UnitToken |
|---|
Returns
treatAsPlayer | bool |
|---|
UnitTrialBankedLevels
bankedLevels, xpIntoCurrentLevel, xpForNextLevel = UnitTrialBankedLevels(unit)
Arguments
unit | UnitToken |
|---|
Returns
bankedLevels | number | |
|---|---|---|
xpIntoCurrentLevel | number | |
xpForNextLevel | number |
UnitTrialXP
result = UnitTrialXP(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitUsesAmmo
result = UnitUsesAmmo(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitUsingVehicle
result = UnitUsingVehicle(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | bool |
|---|
UnitVehicleSeatCount
result = UnitVehicleSeatCount(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitVehicleSeatInfo
controlType, occupantName, serverName, ejectable, canSwitchSeats = UnitVehicleSeatInfo(unit, virtualSeatIndex)
May return nothing.
Arguments
unit | UnitToken | |
|---|---|---|
virtualSeatIndex | luaIndex |
Returns
controlType | cstring | |
|---|---|---|
occupantName | cstring | |
serverName | cstring | |
ejectable | bool | |
canSwitchSeats | bool |
UnitVehicleSkin
result = UnitVehicleSkin([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | fileID |
|---|
UnitWeaponAttackPower
mainHandWeaponAttackPower, offHandWeaponAttackPower, rangedWeaponAttackPower = UnitWeaponAttackPower(unit)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitToken |
|---|
Returns
mainHandWeaponAttackPower | number | |
|---|---|---|
offHandWeaponAttackPower | number | |
rangedWeaponAttackPower | number |
UnitWidgetSet
uiWidgetSet = UnitWidgetSet(unit)
May return nothing.
Arguments
unit | UnitToken |
|---|
Returns
uiWidgetSet | number |
|---|
UnitXP
result = UnitXP(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
UnitXPMax
result = UnitXPMax(unit)
Arguments
unit | UnitToken |
|---|
Returns
result | number |
|---|
WorldLootObjectExists
result = WorldLootObjectExists([unit])
Arguments
unit | UnitToken may be nil |
|---|
Returns
result | bool |
|---|
Events
ACTIVE_PLAYER_SPECIALIZATION_CHANGED
No payload.
ARENA_COOLDOWNS_UPDATE
No payload.
ARENA_CROWD_CONTROL_SPELL_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
spellID | number |
AUTOFOLLOW_BEGIN
name | cstring |
|---|
AUTOFOLLOW_END
No payload.
CANCEL_SUMMON
No payload.
COMBO_TARGET_CHANGED
No payload.
CONFIRM_BINDER
areaName | cstring |
|---|
CONFIRM_SUMMON
summonReason | number | |
|---|---|---|
skippingStartExperience | bool |
ECLIPSE_DIRECTION_CHANGE
direction | cstring |
|---|
HEARTHSTONE_BOUND
No payload.
HONOR_XP_UPDATE
unitTarget | UnitTokenVariant |
|---|
INCOMING_RESURRECT_CHANGED
unitTarget | UnitTokenVariant |
|---|
INCOMING_SUMMON_CHANGED
unitTarget | UnitTokenVariant |
|---|
KNOWN_TITLES_UPDATE
unitTarget | UnitTokenVariant |
|---|
LOCALPLAYER_PET_RENAMED
No payload.
MIRROR_TIMER_PAUSE
timerName | cstring | |
|---|---|---|
paused | number |
MIRROR_TIMER_START
timerName | cstring | |
|---|---|---|
value | number | |
maxValue | number | |
scale | number | |
paused | number | |
timerLabel | cstring |
MIRROR_TIMER_STOP
timerName | cstring |
|---|
NEUTRAL_FACTION_SELECT_RESULT
success | bool |
|---|
OBJECT_ENTERED_AOI
guid | WOWGUID |
|---|
OBJECT_LEFT_AOI
guid | WOWGUID |
|---|
PARTY_KILL
attackerGUID | WOWGUID | |
|---|---|---|
targetGUID | WOWGUID |
PET_BAR_UPDATE_USABLE
No payload.
PET_UI_UPDATE
No payload.
PLAYER_CAN_GLIDE_CHANGED
canGlide | bool |
|---|
PLAYER_DAMAGE_DONE_MODS
unitTarget | UnitTokenVariant |
|---|
PLAYER_ENTER_COMBAT
No payload.
PLAYER_FARSIGHT_FOCUS_CHANGED
No payload.
PLAYER_FLAGS_CHANGED
unitTarget | UnitTokenVariant |
|---|
PLAYER_FOCUS_CHANGED
No payload.
PLAYER_IMPULSE_APPLIED
No payload.
PLAYER_IS_GLIDING_CHANGED
isGliding | bool |
|---|
PLAYER_LEAVE_COMBAT
No payload.
PLAYER_LEVEL_CHANGED
oldLevel | number | |
|---|---|---|
newLevel | number | |
real | bool |
PLAYER_LEVEL_UP
level | number | |
|---|---|---|
healthDelta | number | |
powerDelta | number | |
numNewTalents | number | |
numNewPvpTalentSlots | number | |
strengthDelta | number | |
agilityDelta | number | |
staminaDelta | number | |
intellectDelta | number | |
spiritDelta | number |
PLAYER_MAX_LEVEL_UPDATE
unitTarget | UnitTokenVariant |
|---|
PLAYER_MOUNT_DISPLAY_CHANGED
No payload.
PLAYER_PVP_KILLS_CHANGED
unitTarget | UnitTokenVariant |
|---|
PLAYER_PVP_RANK_CHANGED
unitTarget | UnitTokenVariant |
|---|
PLAYER_REGEN_DISABLED
No payload.
PLAYER_REGEN_ENABLED
No payload.
PLAYER_SOFT_ENEMY_CHANGED
No payload.
PLAYER_SOFT_FRIEND_CHANGED
No payload.
PLAYER_SOFT_INTERACT_CHANGED
oldTarget | WOWGUID | |
|---|---|---|
newTarget | WOWGUID |
PLAYER_SOFT_TARGET_INTERACTION
No payload.
PLAYER_SPECIALIZATION_CHANGED
unitTarget | UnitTokenVariant |
|---|
PLAYER_STARTED_LOOKING
No payload.
PLAYER_STARTED_MOVING
No payload.
PLAYER_STARTED_TURNING
No payload.
PLAYER_STOPPED_LOOKING
No payload.
PLAYER_STOPPED_MOVING
No payload.
PLAYER_STOPPED_TURNING
No payload.
PLAYER_TARGET_CHANGED
No payload.
PLAYER_TRIAL_XP_UPDATE
unitTarget | UnitTokenVariant |
|---|
PLAYER_UPDATE_RESTING
No payload.
PLAYER_XP_UPDATE
unitTarget | UnitTokenVariant |
|---|
PORTRAITS_UPDATED
No payload.
PROVING_GROUNDS_SCORE_UPDATE
points | number |
|---|
PVP_TIMER_UPDATE
unitTarget | UnitTokenVariant |
|---|
RUNE_POWER_UPDATE
runeIndex | number | |
|---|---|---|
added | bool may be nil |
RUNE_TYPE_UPDATE
runeIndex | number |
|---|
SHOW_FACTION_SELECT_UI
No payload.
SPELL_CONFIRMATION_PROMPT
spellID | number | |
|---|---|---|
effectValue | number | |
message | cstring | |
duration | number | |
currencyTypesID | number | |
currencyCost | number | |
currentDifficulty | number | |
displayItemID | number | |
itemContext | number | |
treasureContextLevel | number |
SPELL_CONFIRMATION_TIMEOUT
spellID | number | |
|---|---|---|
effectValue | number |
UNIT_ABSORB_AMOUNT_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_AREA_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_ARENA_COOLDOWNS_UPDATE
Only signaled when the active player is a commentator or spectator.
unitTarget | UnitTokenVariant |
|---|
UNIT_ATTACK
unitTarget | UnitTokenVariant |
|---|
UNIT_ATTACK_POWER
unitTarget | UnitTokenVariant |
|---|
UNIT_ATTACK_SPEED
unitTarget | UnitTokenVariant |
|---|
UNIT_CHEAT_TOGGLE_EVENT
No payload.
UNIT_CLASSIFICATION_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_COMBAT
unitTarget | UnitTokenVariant | |
|---|---|---|
event | cstring | |
flagText | cstring | |
amount | number | |
schoolMask | number |
UNIT_CONNECTION
unitTarget | UnitTokenVariant | |
|---|---|---|
isConnected | bool |
UNIT_CTR_OPTIONS
unitTarget | UnitTokenVariant |
|---|
UNIT_DAMAGE
unitTarget | UnitTokenVariant |
|---|
UNIT_DEFENSE
unitTarget | UnitTokenVariant |
|---|
UNIT_DIED
unitGUID | WOWGUID |
|---|
UNIT_DISPLAYPOWER
unitTarget | UnitTokenVariant |
|---|
UNIT_DISTANCE_CHECK_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
isInDistance | bool |
UNIT_FACTION
unitTarget | UnitTokenVariant |
|---|
UNIT_FLAGS
unitTarget | UnitTokenVariant |
|---|
UNIT_FORM_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_HAPPINESS
unitTarget | UnitTokenVariant |
|---|
UNIT_HEAL_ABSORB_AMOUNT_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_HEAL_PREDICTION
unitTarget | UnitTokenVariant |
|---|
UNIT_HEALTH
unitTarget | UnitTokenVariant |
|---|
UNIT_IN_RANGE_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
isInRange | bool |
UNIT_INVENTORY_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_LEVEL
unitTarget | UnitTokenVariant |
|---|
UNIT_LOOT
unitGUID | WOWGUID | |
|---|---|---|
hasLoot | bool |
UNIT_MANA
unitTarget | UnitTokenVariant |
|---|
UNIT_MAX_HEALTH_MODIFIERS_CHANGED
unitTarget | UnitTokenVariant | |
|---|---|---|
percentMaxHealthAdjusted | number |
UNIT_MAXHEALTH
unitTarget | UnitTokenVariant |
|---|
UNIT_MAXPOWER
unitTarget | UnitTokenVariant | |
|---|---|---|
powerType | cstring |
UNIT_MODEL_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_NAME_UPDATE
unitTarget | UnitTokenVariant |
|---|
UNIT_OTHER_PARTY_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_PET
unitTarget | UnitTokenVariant |
|---|
UNIT_PET_EXPERIENCE
unitTarget | UnitTokenVariant |
|---|
UNIT_PET_TRAINING_POINTS
unitTarget | UnitTokenVariant |
|---|
UNIT_PHASE
unitTarget | UnitTokenVariant |
|---|
UNIT_PORTRAIT_UPDATE
unitTarget | UnitTokenVariant |
|---|
UNIT_POWER_BAR_HIDE
unitTarget | UnitTokenVariant |
|---|
UNIT_POWER_BAR_SHOW
unitTarget | UnitTokenVariant |
|---|
UNIT_POWER_BAR_TIMER_UPDATE
unitTarget | UnitTokenVariant |
|---|
UNIT_POWER_FREQUENT
unitTarget | UnitTokenVariant | |
|---|---|---|
powerType | cstring |
UNIT_POWER_POINT_CHARGE
unitTarget | UnitTokenVariant |
|---|
UNIT_POWER_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
powerType | cstring |
UNIT_QUEST_LOG_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_RANGED_ATTACK_POWER
unitTarget | UnitTokenVariant |
|---|
UNIT_RANGEDDAMAGE
unitTarget | UnitTokenVariant |
|---|
UNIT_RESISTANCES
unitTarget | UnitTokenVariant |
|---|
UNIT_SPELL_HASTE
unitTarget | UnitTokenVariant |
|---|
UNIT_SPELLCAST_CHANNEL_START
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_CHANNEL_STOP
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
interruptedBy | WOWGUID | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_CHANNEL_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_DELAYED
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_EMPOWER_START
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_EMPOWER_STOP
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
complete | bool | |
interruptedBy | WOWGUID | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_EMPOWER_UPDATE
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_FAILED
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_FAILED_QUIET
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_INTERRUPTED
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
interruptedBy | WOWGUID | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_INTERRUPTIBLE
unitTarget | UnitTokenVariant |
|---|
UNIT_SPELLCAST_NOT_INTERRUPTIBLE
unitTarget | UnitTokenVariant |
|---|
UNIT_SPELLCAST_RETICLE_CLEAR
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number |
UNIT_SPELLCAST_RETICLE_TARGET
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number |
UNIT_SPELLCAST_SENT
unitTarget | UnitTokenVariant | |
|---|---|---|
target | cstring | |
castGUID | WOWGUID | |
spellID | number |
UNIT_SPELLCAST_START
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_STOP
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_SPELLCAST_SUCCEEDED
unitTarget | UnitTokenVariant | |
|---|---|---|
castGUID | WOWGUID | |
spellID | number | |
castBarID | UnitCastBarID may be nil |
UNIT_STATS
unitTarget | UnitTokenVariant |
|---|
UNIT_TARGET
unitTarget | UnitTokenVariant |
|---|
UNIT_TARGETABLE_CHANGED
unitTarget | UnitTokenVariant |
|---|
UNIT_THREAT_LIST_UPDATE
unitTarget | UnitTokenVariant |
|---|
UNIT_THREAT_SITUATION_UPDATE
unitTarget | UnitTokenVariant |
|---|
UPDATE_EXHAUSTION
No payload.
UPDATE_MOUSEOVER_UNIT
No payload.
UPDATE_STEALTH
No payload.
VEHICLE_ANGLE_UPDATE
normalizedPitch | number | |
|---|---|---|
radians | number |
Tables
Enum.PhaseReason enumeration
Phasing | 0 |
|---|---|
Sharding | 1 |
WarMode | 2 |
ChromieTime | 3 |
TimerunningHwt | 4 |
RuleSet | 5 |
Enum.PvPUnitClassification enumeration
FlagCarrierHorde | 0 |
|---|---|
FlagCarrierAlliance | 1 |
FlagCarrierNeutral | 2 |
CartRunnerHorde | 3 |
CartRunnerAlliance | 4 |
AssassinHorde | 5 |
AssassinAlliance | 6 |
OrbCarrierBlue | 7 |
OrbCarrierGreen | 8 |
OrbCarrierOrange | 9 |
OrbCarrierPurple | 10 |
CorruptionEffectInfo structure
name | string | |
|---|---|---|
description | string | |
minCorruption | number |
UnitCastingInfoResult structure
name | cstring | |
|---|---|---|
displayName | string | |
textureID | fileID | |
startTimeMs | number | |
endTimeMs | number | |
isTradeskill | bool | |
castID | WOWGUID | |
notInterruptible | bool may be nil | |
castingSpellID | number | |
castBarID | UnitCastBarID may be nil | |
delayTimeMs | number |
UnitChannelInfoResult structure
name | cstring | |
|---|---|---|
displayName | cstring | |
textureID | fileID | |
startTimeMs | number | |
endTimeMs | number | |
isTradeskill | bool | |
notInterruptible | bool may be nil | |
spellID | number | |
isEmpowered | bool | |
numEmpowerStages | number | |
castBarID | UnitCastBarID may be nil |
UnitCreatureFamilyResult structure
name | cstring | |
|---|---|---|
id | number |
UnitCreatureTypeResult structure
name | cstring | |
|---|---|---|
id | number |
UnitPowerBarInfo structure
ID | number | |
|---|---|---|
barType | number | |
minPower | number | |
startInset | number | |
endInset | number | |
smooth | bool | |
hideFromOthers | bool | |
showOnRaid | bool | |
opaqueSpark | bool | |
opaqueFlash | bool | |
anchorTop | bool | |
forcePercentage | bool | |
sparkUnderFrame | bool | |
flashAtMinPower | bool | |
fractionalCounter | bool | |
animateNumbers | bool | |
attachTooltipToBar | bool |