Helper API Docs - 8.0.10 updated

Information how to write rotations, how specific functions work
1 post Page 1 of 1
Kaminaris
Site Admin
Posts: 322
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

Functions here returns a table with following format:
aura = {
			name           = '', -- Aura name
			up             = true, -- Is active
			count          = 0, -- stack count
			expirationTime = 0, -- expiration time in seconds
			remains        = 0, -- how many seconds remains
			refreshable    = remains < 0.3 * duration, -- is refreshable returns true if aura can be safely reapplied to not loose dps (pandemic 30% of original duration)
		}

local aura = MaxDps:IntUnitAura(unit, nameOrId, filter, timeShift)
Used to check for auras on specific target, any valid target works ex boss1, player, pet, target etc.
Parameters:
  • unit - Unit to check for
  • name - Name or ID of Aura
  • filter - Custom filter for UnitAura
  • timeShift - float
Returns:
  • aura - table (AURA type)
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)
Spell Helpers

Cooldowns are now consolidated and returns following format (COOLDOWN type)
{
	ready           = remains <= 0,
	remains         = remains,
	fullRecharge    = fullRecharge,
	partialRecharge = partialRecharge,
	charges         = charges,
	maxCharges      = maxCharges
}

local cooldown = MaxDps:CooldownConsolidated(spellId, timeShift)
Checks if spell is available to cast and returns more information about it.
Parameters:
  • spell - Spell Name or ID
  • timeShift - float
Returns:
  • cooldown - table (COOLDOWN type)
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 targets = MaxDps:SmartAoe(itemId)
This function checks number of targets according to instance type you are in.
Parameters:
  • itemId - Optional item Id
Returns:
  • count - number of targets in range

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