Skip to content

Commit

Permalink
Some fixes to buff and cached buffs function
Browse files Browse the repository at this point in the history
  • Loading branch information
projecteon committed Sep 16, 2022
1 parent a720d5f commit 1de81bf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
38 changes: 35 additions & 3 deletions datatype/_spawn.lua
Expand Up @@ -14,13 +14,11 @@
--- @field public Binding fun(): boolean Binding wounds?
--- @field public Blind fun(): number Blind? Not sure why this is a number?
--- @field public Body body Body type
--- @field public Buff fun(name: string): spell Buff spell
--- @field public bShowHelm fun(): boolean Showing Helm?
--- @field public bStationary fun(): boolean Stationary spawn? Not to be confused with "Moving"
--- @field public bTempPet fun(): boolean Is the spawn a Temporary Pet?
--- @field public Buyer fun(): boolean Is a buyer? (ie. Buyer in the bazaar)
--- @field public bWaitingForPort fun(): boolean Am I waiting to accept a port?
--- @field public CachedBuff cachedbuff Caches buff information cast on others, refer to [[DataType:CachedBuff for additional information
--- @field public CachedBuffCount fun(): number Number of Buffs cached
--- @field public CanSplashLand fun(): boolean TRUE/FALSE on if a splash spell can land...NOTE! This check is ONLY for line of sight to the targetindicator (red/green circle)
--- @field public Casting spell Spell, if currently casting (only accurate on yourself, not NPCs or other group members)
Expand Down Expand Up @@ -149,4 +147,38 @@
--- @field public S fun(): number Shortcut for -Y (makes Southward positive)
--- @field public D fun(): number Shortcut for -Z (makes Downward positive)
--- @field public FindBuff fun(predicate: string): spell Try find a given buff/debuff given predicate from cachedbuffs
--- @field public Aggresive fun(): boolean Is the spawn agressive towards you
--- @field public Aggresive fun(): boolean Is the spawn agressive towards you
local spawn = {}

---@diagnostic disable: duplicate-set-field
---Returns the cachedbuff given the index or first one found
---Data must be populated first by targeting
---@param index? integer
---@return cachedbuff
function spawn.Buff(index)end

---Returns the cachedbuff given the spell name
---Data must be populated first by targeting
---@param spellName string
---@return cachedbuff
function spawn.Buff(spellName)end
---@diagnostic enable: duplicate-set-field

---@return integer # Returns the number of cached buffs on the spawn. (Same as CachedBuffCount)
function spawn.BuffCount() end

---@diagnostic disable: duplicate-set-field
---Returns the cachedbuff given the spell id
---Data must be populated first by targeting
---Refer to [DataType:CachedBuff](https://docs.macroquest.org/reference/data-types/datatype-cachedbuff/) for additional information
---@param spellId integer
---@return cachedbuff
function spawn.CachedBuff(spellId)end

---Returns the cachedbuff given the predicate (see https://docs.macroquest.org/main/features/cached-buffs/)
---Data must be populated first by targeting
---Refer to [DataType:CachedBuff](https://docs.macroquest.org/reference/data-types/datatype-cachedbuff/) for additional information
---@param predicate string
---@return cachedbuff
function spawn.CachedBuff(predicate)end
---@diagnostic enable: duplicate-set-field
2 changes: 0 additions & 2 deletions datatype/_target.lua
Expand Up @@ -2,8 +2,6 @@
--- @field public Aego cachedbuff|fun(): string Returns the name of the Aego spell if the Target has one
--- @field public AggroHolder spawn|fun(): spawn Returns the target's current target.
--- @field public Beneficial cachedbuff|fun(): string Returns the name of the Beneficial spell if the Target has one. This will skip "player" casted buffs, but will show NPC Casted buffs and some AA buffs.
--- @field public Buff cachedbuff|fun(name?: string|integer): cachedbuff Returns the target's spell by buff index number or the first buff if no Index is provided.
--- @field public BuffCount fun(): integer Returns the number of buffs on the target.
--- @field public BuffDuration timestamp|fun(val:string|integer): timestamp Returns the duration remaining on this target buff by index number or by spell name
--- @field public BuffsPopulated fun(): boolean Returns TRUE when the target's buffs are finished populating.
--- @field public Brells fun(): string Returns the name of the Brells spell if the Target has one
Expand Down

0 comments on commit 1de81bf

Please sign in to comment.