Skip to content

builtin buff

boyism80 edited this page Jun 19, 2025 · 3 revisions

Built-in Functions Documentation (Buff)

This document describes functions available to buff type objects.


model

model()

  • Description:
    Returns the spell model (fb.model.spell) object that this buff object references.
  • Parameters:
    • None
  • Return Value:
    • fb.model.spell: Spell model object
  • Example:
    -- This is a real usage example from game scripts
    for _, buff in pairs(you:buffs()) do
        local spell_model = buff:model()
        me:message("Removing buff: " .. spell_model:name())
        you:unbuff(buff)
    end

time

Provides two functionalities to get or set the remaining duration of the buff.

time()

  • Description:
    Returns the remaining duration of the buff in seconds.
  • Parameters:
    • None
  • Return Value:
    • number: Remaining duration in seconds
  • Example:
    -- This is a real usage example from game scripts
    local remaining = buff:time()
    me:message("Buff remaining: " .. remaining .. " seconds")

time(value:number)

  • Description:
    Sets the buff's remaining duration to the specified number of seconds.
  • Parameters:
    • value:number: Duration in seconds to set
  • Return Value:
    • None
  • Example:
    -- This is a real usage example from game scripts
    buff:time(300)  -- Set to 5 minutes
    me:message("Buff duration extended")

Clone this wiki locally