Demon Overlord
Yep. Thats me.
I've been trying to make a spell scroll that gives you a spell, depending on the item that's used. So far I'm using Tfs 1.x
as the actions/scripts/Spell Scroll.lua and
for the actions .xml
The error I'm getting in my console is
Is there a different function for players to learn spells in 1.x?
Lua:
local spells = {
[6087] = "Exori Hur",
[6088] = "Exura Sio",
[6089] = "Exori Con",
[6090] = "Exori Flam",
}
function onUse(cid, item, frompos, itemEx, topos)
if(spells[item.itemid]) then
if(not(getPlayerLearnedInstantSpell(cid, spells[item.itemid]))) then
doPlayerLearnInstantSpell(cid, spells[item.itemid])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, 20, "You have successfully learned " .. spells[item.itemid])
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, "You already know this spell.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
return true
end
as the actions/scripts/Spell Scroll.lua and
XML:
<action itemid="6087" script="other/Spell Scrolls.lua" />
for the actions .xml
The error I'm getting in my console is
Is there a different function for players to learn spells in 1.x?
Last edited: