zerghel
Tsuni
- Joined
- Jul 1, 2008
- Messages
- 299
- Reaction score
- 9
Hello guys
im trying to use this script for spell learning
i think is kinda messy 'cause somehow it can be used by other vocations
can u throw me some light?
im trying to use this script for spell learning
i think is kinda messy 'cause somehow it can be used by other vocations
Code:
local spell = "sharp light"
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not getPlayerLearnedInstantSpell(cid, spell) then
Item(item.uid):remove(1)
playerLearnInstantSpell(cid, spell)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
elseif getPlayerVocation(cid) ~= 5 then
doCreatureSay(cid, "Only Master sorcerers can learn " .. spell .. " spell.", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "You already know " .. spell .. " spell!", TALKTYPE_ORANGE_1)
end
return true
end