Returns the number of ability requirements for purchasing a trainer service. Ability requirements are often used for ranked class spells purchased from the trainer: e.g. learning Blood Strike (Rank 3) requires having learned Blood Strike (Rank 2). See GetTrainerServiceAbilityReq()
for information about specific ability requirements.
See also Trainer functions.
Signature:
numRequirements
=
GetTrainerServiceNumAbilityReq(index)
Arguments:
index
- Index of an entry in the trainer service listing (between 1 andGetNumTrainerServices()
) (number
)
Returns:
numRequirements
- Number of different ability requirements for the trainer service (number
)
Examples:
-- prints a list of trainer services with their ability requirements for index = 1, GetNumTrainerServices() do local name, rank, serviceType = GetTrainerServiceInfo(index) if serviceType ~= "header" then local numRequirements = GetTrainerServiceNumAbilityReq(index) if numRequirements > 0 then print("Ability requirements for " .. name .. " (" .. rank .. "):") for i=1,numRequirements do local ability, hasReq = GetTrainerServiceAbilityReq(index, i) if hasReq then print(" + " .. ability) else print(" - " .. ability) end end end end end