Hi, i have a script where you use a book and recieve a spellbook and with that you can learn a spell,
But i cant seem to find how to make it choose between a certain amount of spells randomly and show description of it for example:
You see a unidentified book. ID 6124
And then you use it and it says
You removed the dust and discovered a spell book!
and i want you too look at the book at it says for example:
You see a spellbook. ID 1982
You can learn ...Spellname.. by reading this book.
Here is the script:
Thanks
- - - Updated - - -
bump
But i cant seem to find how to make it choose between a certain amount of spells randomly and show description of it for example:
You see a unidentified book. ID 6124
And then you use it and it says
You removed the dust and discovered a spell book!
and i want you too look at the book at it says for example:
You see a spellbook. ID 1982
You can learn ...Spellname.. by reading this book.
Here is the script:
LUA:
--[[Created by Ghostx for Lightonia
Torn Book; ID 6124
Purple Tome; ID 1982
Right click on Torn Book retrieve a Purple Tome
Right click it and receive a spell,
]]--
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 6124 then --- The Unidentified Tome id
doPlayerSendTextMessage(cid, 21, "You removed the dust and discovered a spell book!") --- Message you get on use
doTransformItem(item.uid, 1982) --- Transforms into the Spell Book
elseif item.itemid == 1982 then --- Else if the use is on id 1982 then the following happens
if getPlayerLearnedInstantSpell(cid, name) == true then --- Put the spell name where it says name. If player has already got spell, then it will tell them
doPlayerSendTextMessage(cid, 21, "you have already learnt this spell!")
else
doPlayerLearnInstantSpell(cid, name) --- with name, put the spell name the same as the name above. Make sure it is the spell name and not the spell words
doPlayerSendTextMessage(cid, 21, "you have learned a new spell!") --- Message when learnt the new spell.
end
return TRUE
end
end
Thanks
- - - Updated - - -
bump