Core Concepts

Player Attributes

Player-specific attributes and functions for character state and capabilities

These are attributes and functions only available to the player object. They provide essential information about your character's current state, capabilities, and enhancements that are crucial for building intelligent, context-aware routines.

Core Player Information

specialization

Your specialization index (number value).

player.specialization : specID
player.spec : specID

Example:

print("Player specialization: " .. player.spec)
-- res: 1 (for Beast Mastery Hunter)

This is useful for validating that you're using the correct rotation for your spec, or for creating multi-spec routines that adapt based on your current specialization.

Player State

falling

Returns true if the player is in the air.

player.falling : falling | false

Example:

-- Prevent casting while falling in your BM Hunter routine
if player.falling then
    return -- Skip rotation while falling
end

Useful for preventing actions that shouldn't be performed while falling, or for triggering fall-specific logic like using Disengage to break a fall.

mounted

Checks if the player is mounted.

player.mounted : true | false

Example:

-- Only execute BM Hunter rotation when not mounted
if not player.mounted then
    bm:Init(function()
        -- Your rotation logic here
    end)
end

timeStandingStill

Returns the amount of time the player has been standing still.

player.timeStandingStill : tss | 0

Example:

if player.timeStandingStill > 3 then
    print("Player has been standing still for more than 3 seconds!")
end

This can be useful for movement-based optimizations or detecting when the player is stationary.

Player Abilities & Enhancements

hasTalent

Checks if the player is spec'd into the given talent or PvP talent.

player.hasTalent(talent) : true | false

Note: Accepts talent name (non-case-sensitive string) or SpellID. This also works with members of your group.

Example:

-- Check for BM Hunter talents using spell ID
if player.hasTalent(321530) then -- Bloodshed talent
    -- Use Bloodshed in rotation
end

-- Or check by talent name (case-insensitive)
if player.hasTalent("bloodshed") then
    -- Use Bloodshed in rotation
end

-- Check for Aspect of the Beast talent
if player.hasTalent("Aspect of the Beast") then
    -- Adjust rotation for Aspect of the Beast
end

This function is essential for creating talent-based rotation logic. Your BM Hunter routine can adapt based on which talents you've selected, using different ability priorities or conditions.

Weapon Enchants

mainHandEnchant

Checks if the player has enchant on mainhand (hello enhance players).

player.mainHandEnchant : true | false

Similar: mainHandEnchantRemains - returns remaining duration of mh enchant

Example:

if player.mainHandEnchant and player.mainHandEnchantRemains < 30 then
    flametongueWeapon:Cast()
end

offHandEnchant

Checks if the player has enchant on offhand.

player.offHandEnchant : true | false

Similar: offHandEnchantRemains - returns remaining duration of oh enchant

Example:

if not player.offHandEnchant then
    windfuryWeapon:Cast()
end

Usage Examples

Check Player State Before Engaging (BM Hunter)

local Unlocker, synq, example = ...
local bm = example.hunter.bm

bm:Init(function()
    -- Only execute rotation when player is ready
    if not player.mounted and not player.falling then
        if target.enemy then
            -- Your BM Hunter rotation logic here
            killCommand()
            barbedShot()
        end
    end
end)

Talent-Based Rotation Logic (BM Hunter)

-- Adapt BM Hunter rotation based on talents
if player.hasTalent("Bloodshed") then
    -- Use Bloodshed in rotation when talented
    bloodshed:Callback(function(spell)
        if bestialWrath.active then
            spell:Cast(target)
        end
    end)
end

-- Check for Aspect of the Beast talent
if player.hasTalent("Aspect of the Beast") then
    -- Adjust pet management logic
    -- Aspect of the Beast changes how you manage pet abilities
end

Specialization Validation (Multi-Spec Hunter)

-- Validate you're using the correct rotation
if player.spec == 1 then
    -- Beast Mastery Hunter rotation
    bm:Init(function()
        -- BM rotation logic
    end)
elseif player.spec == 2 then
    -- Marksmanship Hunter rotation
    mm:Init(function()
        -- MM rotation logic
    end)
elseif player.spec == 3 then
    -- Survival Hunter rotation
    sv:Init(function()
        -- SV rotation logic
    end)
end

Movement Tracking for Ranged Positioning

-- Track standing still time for optimal ranged positioning
if player.timeStandingStill > 3 then
    -- Player has been stationary - good for casting longer abilities
    -- Use this to prioritize abilities that benefit from standing still
end

Summary

Player-specific attributes provide essential information for creating intelligent, context-aware routines that adapt to your character's current state and capabilities.

Key Takeaways:

  • Specialization tracking – Adapt your routine based on your current spec
  • State awareness – Check if mounted, falling, or stationary
  • Talent detection – Build talent-based conditional logic
  • Enchant management – Track and maintain weapon enchants automatically

These attributes work exclusively with the player object and are essential for building routines that understand your character's current situation and adapt accordingly.


Next: Learn about General Tools for timing, events, visuals, and configuration.