Пользовательские дополнения

На главную


spellLib.GetRequirements( id )

Возвращает информацию о требованиях к использованию заклинания.

-- библиотека
spellLib

-- объявление:
function GetRequirements( id )

-- параметры
id: SpellId - Id умения

-- возвращаемые значения
table or nil, если заклинание есть, таблица с полями:
  casterConditions: RequirementsTable - список условий на кастующем
  casterResources: RequirementsTable - список ресурсов (условий присутствия ресурса) на кастующем
  targetConditions: RequirementsTable - список условий на цели

Описание требований: RequirementsTable.

-- пример использования
local spellbook = avatar.GetSpellBook()
local reqs = spellLib.GetRequirements( spellbook[0] )

local firstRequirement = nil

if reqs then
  local req = reqs.casterConditions[0]
  if req then

    if req.type then

      req = req.childs[ 0 ]
      if req then
        firstRequirement = req.sysCause
      end

    else
      firstRequirement = req.sysCause
    end
  end
end

Связанные страницы: "CategoryLuaApi" "CategorySpellLib"

CategorySpellLib
EnumSpellbookPage
FunctionAvatarGetBuildSwitchSpell
FunctionGuildHallLibGetTeleportSpell
FunctionHangarGetLendShipSpellId
FunctionHangarGetReturnLendedShipSpellId
FunctionSpellLibBuffsCanDispel
FunctionSpellLibCanRunAvatar
FunctionSpellLibCanRunAvatarEx
FunctionSpellLibGetActionGroups
FunctionSpellLibGetAESectorProps
FunctionSpellLibGetCooldown
FunctionSpellLibGetCurrentValues
FunctionSpellLibGetDescription
FunctionSpellLibGetDurationBuff
FunctionSpellLibGetGroups
FunctionSpellLibGetGroupsDescriptions
FunctionSpellLibGetIcon
FunctionSpellLibGetObjectSpell
FunctionSpellLibGetProperties
FunctionSpellLibGetRequiredBuffs
FunctionSpellLibGetRequiredResources
FunctionSpellLibGetRequirements
FunctionSpellLibGetState
FunctionSpellLibGetValuedObject
FunctionSpellLibHasDurationBuff


CategoryLuaApi CategoryFunction CategorySpellbook CategorySpellLib

На главную