• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Learn spell by clicking on a book [Quest]

rilleman

New Member
Joined
Feb 14, 2010
Messages
269
Reaction score
0
I wonder if its possible to make a book/chest and when you click on it you will learn a spell?
 
I put doSetItemSpecialDescription(item, "Your text here.") and now it works. idk maybe i made a mistake before. Seriously you guys helped me insanely.

Im doing this ot and this was one of the things was giving me headaches.
doSetItemSpecialDescription(item, "Your text here.")

thanks I rep+ everyone

- - - Updated - - -

here is my server: http://otland.net/f251/wip-rookgaard-adventures-196409/#post1892053
 
Can you post full script?

I am still doing it, and I created another script just to test. My idea is to make different npcs, each one selling different spells.

function onUse(cid, item, fromPosition, itemEx, toPosition)
local item2 = doPlayerAddItem(cid,5952,1)
doSetItemActionId(item2, 29001)
doSetItemSpecialDescription(item2, "Your text here.")
return true
end

<action uniqueid="30090" script="test.lua"/>

Put the uniqueid on a tree and use it.

Now the spell scroll:

local t = {
[29001] = {"Light Healing"},
[29002] = {"Haste"},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},
[290] = {""},

}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.actionid]
if v then
if getPlayerLearnedInstantSpell(cid, v[1]) then
return doPlayerSendCancel(cid, "You already know this spell."), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
end

doPlayerLearnInstantSpell(cid, v[1])
doSendMagicEffect(getThingPos(cid), CONST_ME_WRAPS)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You learned the spell " .. v[1] ..".")
end
return true
end

<action actionid="29001" script="spell scroll.lua"/>

the 29001 action id I will make like from aid="" to aid="" for all the spells i need

- - - Updated - - -

If anyone wants to make a comment with a suggestion on my server, please do: http://otland.net/f251/wip-rookgaard-adventures-196409/
 
Back
Top