Plot:Spells learnt
From OHRRPGCE-Wiki
spells learnt (hero,number)
Used to return the id numbers of spells the hero learnt from the last battle or give experience or set hero level command. (Returns only the spells learnt from the very last battle or give experience/set hero level command). If the second argument is get count then the number of spells that the hero learnt is returned. Pass 0 for number to get the first spell learnt, 1 the second, etc. You can use a loop and strings to list to the player all the spells a hero learnt:
[edit] Examples
# the following script uses strings 0, 1, 2 for its use (will be overwritten)
script, print learnt spells, who=0, begin
variable(i)
get hero name (1, who) # construct the static part of the text in string 1
$1+" learnt spell "
for (i, 0, spells learnt (who, get count) -- 1) do (
get attack name (2, spells learnt (who, i)) # get the i-th spell learnt
0 $= 1 # copy the static part to the displayed string
0 $+ 2 # combine with the spell name
show string at (0, 160, 100)
wait for keypress (anykey)
)
hide string (0)
end
