Toggles the player's combat state.
- inCombat
boolean--trueto enter combat,falseto leave - Affects:
InCombatLockdown(),UnitAffectingCombat("player") - Fires:
PLAYER_REGEN_DISABLEDwhen entering combat,PLAYER_REGEN_ENABLEDwhen leaving - Example:
A_Admin.SetInCombat(true)
print(InCombatLockdown()) -- true
A_Admin.SetInCombat(false)
print(InCombatLockdown()) -- falseStarts a simulated cast bar on the player.
- spellId
number-- Spell ID for the cast - spellName
string-- Display name shown in the cast bar - iconPath
string-- Texture path for the cast bar icon - duration
number-- Cast time in seconds - Affects:
UnitCastingInfo("player") - Fires:
UNIT_SPELLCAST_START - Note: The cast does not auto-complete. Call
StopCasting()to cancel, or overwrite with anotherSetCasting. - Example:
A_Admin.SetCasting(19750, "Flash of Light", "Interface\\Icons\\Spell_Holy_FlashHeal", 1.5)
local name, text, texture, startTime, endTime = UnitCastingInfo("player")
-- name="Flash of Light"Cancels the current simulated cast.
- Affects:
UnitCastingInfo("player")returnsnil - Fires:
UNIT_SPELLCAST_STOP - Example:
A_Admin.SetCasting(19750, "Flash of Light", "", 1.5)
A_Admin.StopCasting()
print(UnitCastingInfo("player")) -- nilTriggers the global cooldown.
- duration
number-- GCD duration in seconds (typically 1.5) - Affects:
GetSpellCooldown(61304)-- spell ID 61304 is the GCD sentinel - Example:
A_Admin.SetGCD(1.5)
local start, dur, enabled = GetSpellCooldown(61304)
-- start=current_time, dur=1.5, enabled=1Sets a cooldown on a specific spell.
- spellId
number-- Spell ID to put on cooldown - duration
number-- Cooldown duration in seconds - Affects:
GetSpellCooldown(spellId) - Example:
A_Admin.SetSpellCooldown(31935, 15.0) -- Avenger's Shield on 15s CD
local start, dur, enabled = GetSpellCooldown(31935)
-- dur=15.0