Skip to content

GetObjectDynamicFlags

The GetObjectDynamicFlags function retrieves the dynamic flags of a specified object in the game world. Dynamic flags are properties that can change based on the state of the object, such as whether it is in combat, dead, or otherwise affected by game mechanics. These flags are typically used internally by the game engine to manage object states and behaviors.

Parameters

  • object: The object identifier (GUID) or unit identifier (such as "player", "target", "focus", etc.) for which to retrieve the dynamic flags.

Returns

  • flags: A bitmask representing the dynamic flags of the specified object. The specific meaning of each bit in the bitmask depends on the game's implementation and is usually documented in the game's API reference.

Warning

Dynamic flags are advanced properties. If you are unfamiliar with how dynamic flags work, it is recommended that you do not modify or rely on them without proper understanding.

Example Usage in Lua

Here is an example of how to use the GetObjectDynamicFlags function in Lua:

local api = ...

-- Function to retrieve a lootable node 
function FindLootableNodes()
    local objs = api.GetObjectsByType(8) 
    for index, object in ipairs(objs) do 
      if api.GetObjectDynamicFlags(object) == 32768 then
        return object -- Object is a lootable node (herb / ore) 
      end 
    end 
    return false 
end

-- Call the function
FindLootableNodes()