Helper API Docs

Information how to write rotations, how specific functions work
1 post Page 1 of 1
Kaminaris
Site Admin
Posts: 41
Joined: 25 Jun 2017, 03:45


All of those functions can be found in helper.lua inside addon folder.

Legend
Required parameter - normal text
Optional parameter - italic text

General helper functions
local specName = MaxDps:SpecName()
Returns Specialization name
MaxDps:CheckTalents()
Checks player talents and stores them in:
MaxDps.PlayerTalents
Array where key is the Spell ID (not Talent ID) and value equals true. It is always executed at the initialization process so there is no need to check them manually.

local targetPh = MaxDps:TargetPercentHealth()
Target Percent HP
Returns:
  • targetPh - float (from 0 - 1)

local gcd = MaxDps:GlobalCooldown()
Calculate player global cooldown.
Returns:
  • gcd - float

local attackSpeed = MaxDps:AttackHaste()
Calculate player global attack speed
Returns:
  • attackSpeed - float
Aura Helpers
local hasAura, stackCount = MaxDps:PersistentAura(name)
Used to check for player auras that does not expire in time.
Parameters:
  • name - Name or ID of Aura
Returns:
  • hasAura - boolean
  • stackCount - integer

local hasAura, stackCount, timeLeft = MaxDps:Aura(name, timeShift, filter)
Used to check for player auras that does expire in time.
Parameters:
  • name - Name or ID of Aura
  • timeShift - float
  • filter - Custom filter for UnitAura
Returns:
  • hasAura - boolean
  • stackCount - integer
  • timeLeft - float

local hasAura, stackCount = MaxDps:UnitAura(name, timeShift, unit)
Used to check for aura on specific target.
Parameters:
  • name - Name or ID of Aura
  • timeShift - float
  • unit - UnitID
Returns:
  • hasAura - boolean
  • stackCount - integer

local hasAura, stackCount = MaxDps:TargetAura(name, timeShift)
Used to check for aura on player target.
Parameters:
  • name - Name or ID of Aura
  • timeShift - float
Returns:
  • hasAura - boolean
  • timeLeft - float
Casting Info Helpers
local timeShift, spell, gcd = MaxDps:EndCast(target)
Get information about target current casting info.
Parameters:
  • target - Unit ID (player by default)
Returns:
  • timeShift - float (how much time till finish of current cast)
  • spell - string (name of the spell)
  • gcd - float (global cooldown)

local isSame = MaxDps:SameSpell(spell1, spell2)
Compares two spells
Parameters:
  • spell1 - ID or Name of a spell
  • spell2 - ID or Name of a spell
Returns:
  • isSame - boolean
Spell Helpers
local cd, currentCharges, maxCharges = MaxDps:SpellCharges(spell, timeShift)
Get information about specific spell charges and cooldown
Parameters:
  • spell - Spell Name or ID
  • timeShift - float
Returns:
  • cd - float (spell cooldown)
  • currentCharges - float (Current spell changes in fractional form ex. 1.5 for one whole stack and cooldown halfway thru)
  • maxCharges - integer (Maximum charges)

local isAvailable, cd = MaxDps:SpellAvailable(spell, timeShift)
Checks if spell is available to cast.
Parameters:
  • spell - Spell Name or ID
  • timeShift - float
Returns:
  • isAvailable - boolean
  • cd - float (Current spell cooldown)

local cd = MaxDps:Cooldown(spell, timeShift)
Checks spell cooldown
Parameters:
  • spell - Spell Name or ID
  • timeShift - float
Returns:
  • cd - float (Current spell cooldown)

Resources helpers
local manaPercent, mana = MaxDps:Mana(minus, timeShift)
Player mana and percentage mana
Parameters:
  • minus - integer (Amount of mana to subtract)
  • timeShift - float
Returns:
  • manaPercent - float (Mana percentage from 0 to 1)
  • mana - integer (Current Mana)

Range helpers
local inRange = MaxDps:IsSpellInRange(spell, unit)
Checks if spell is in range of unit.
Parameters:
  • spell - Spell Name or ID
  • unit - UnitID (target by default)
Returns:
  • inRange - boolean

local count = MaxDps:TargetsInRange(spell)
Counts the number of targets within specific spell range (AOE detection)
Parameters:
  • spell - Spell Name or ID
Returns:
  • count - integer (how many targets are in range)
To be continued...
1 post Page 1 of 1
drogie łóżka stolik kawowy stół dębowy rozkładany