builtin spell - boyism80/fb GitHub Wiki

Built-in Functions Documentation (Spell)

This document describes functions available to spell type objects.


model

model()

  • Description:
    Returns the spell model (fb.model.spell) object that this spell references.
  • Parameters:
    • None
  • Return Value:
    • fb.model.spell: Spell model object
  • Example:
    -- This is a real usage example from game scripts
    local spell = me:spell('비영사천문')
    if spell then
        local model = spell:model()
        me:message("Spell: " .. model:name())
    end
    

delay

Provides two functionalities to get or set the spell's delay.

delay()

  • Description:
    Returns the current delay value of the spell.
  • Parameters:
    • None
  • Return Value:
    • number: Current delay value
  • Example:
    -- This is a real usage example from game scripts
    local spell = me:spell('비영사천문')
    if spell then
        local current_delay = spell:delay()
        me:message("Spell delay: " .. current_delay)
    end
    

delay(value:number)

  • Description:
    Sets the spell's delay to the specified value.
  • Parameters:
    • value:number: Delay value to set
  • Return Value:
    • None
  • Example:
    -- This is a real usage example from game scripts
    local spell = me:spell('비영사천문')
    if spell then
        spell:delay(1000)
        me:message("Spell delay set to 1000")
    end
    

delay2

delay2(delay:number)

  • Description:
    Sends a spell delay protocol message to the spell owner (the life object who owns this spell). This appears to be used for client-server communication to update spell delay information.
  • Parameters:
    • delay:number: Delay value to send in the protocol message
  • Return Value:
    • None
  • Example:
    -- This is a real usage example from game scripts
    local spell = me:spell('비영사천문')
    if spell then
        spell:delay2(500)  -- Send delay info to client
    end