rank

Returns the spell ID for a spell at the desired rank (if known).

rank(spellId, rank) : spellId ? boolean

Example

if castable(rank(635, 2)) then
return print('you can cast 639 (Holy Light (Rank 2))')
end