Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CommandPetToggleAbility

From RoR Wiki
Revision as of 19:41, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Pet functions
Version: WAR 1.4.8

Sends a "toggle ability" command for one of the pet's abilities to the server.

sent = CommandPetToggleAbility(abilityId)

Arguments

abilityId
number – ID of the pet ability.

Returns

sent
boolean – true if the request was sent to the server, false otherwise.

Details

  • Sends a "toggle ability" pet command together with abilityId.
  • Nothing is sent, and false is returned, if the player has no pet, the player object does not exist yet, or one of the player's state flags blocks pet commands (see CommandPet).
  • The client does not check that the pet has the ability.
  • Exactly one argument must be passed. If the argument is missing or not a number, two errors are raised: the generic Invalid Parameters message and the message below.

Errors

  • LuaCommandPetToggleAbility: Paramater 1 should be ability id to toggle.

Example

Right-clicking a pet ability button, from default/ea_careerresourceswindow/source/petbutton.lua:

function PetButton:OnRButtonDown (flags, x, y)
    local slot, actionType, actionId = self:GetActionData ()

    if ((actionType == GameData.PlayerActions.COMMAND_PET_DO_ABILITY) and (actionId ~= 0))
    then
        CommandPetToggleAbility (actionId)
    end
end

See also