• 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!

spell from quest chest

LUA:
 local spell = 'xxx' -- Set the spell name here.
local storage = 9999 -- set any storage value u want to use here.
 
function onUse(cid, item, frompos, item2, topos)
            if getPlayerStorageValue(cid, storage) <= 0 then
        	doPlayerLearnInstantSpell(cid, spell)
        	setPlayerStorageValue(cid, storage, 1)
        	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have learned the spell "..spell..".")
         else
            doPlayerSendCancel(cid, "You have already done this quest and aquired the reward.")
        	end
end

should work. you know how to configure in the actions.xml right?
 
Last edited:
save the script i just posted as spellreward.lua then

XML:
 	<action uniqueid="5555" event="script" value="spellreward.lua"/>
put ^ in ur actions.xml and then in mapeditor set the chests unique id as 5555 or w.e u change it to.
 
[20/05/2011 17:55:54] [Error - Action Interface]
[20/05/2011 17:55:54] data/actions/scripts/spellreward.lua:onUse
[20/05/2011 17:55:54] Description:
[20/05/2011 17:55:54] (luaDoPlayerSendTextMessage) Player not found
 
why ? doPlayerSendCancel(cid, "You have already done this quest and aquired the reward.")
and you are gonna make chest in it the reward , the spell will be like a scroll ? ;d
 
LUA:
 doPlayerSendCancel(cid, "You have already done this quest and aquired the reward.")
that is if you have already done the quest.
and what do u mean? do you want it to give an item instead of the spell?
 
Nono....
He doesnt have lua knowledge and he tought it was a chest that gives scroll and the scroll give spell looolll xDDDDDDD

@Thread: no, you change the red parts to show messages.... It was only an example.....
Mmm..... Try it with normal player, dont forget ;)
 
Back
Top