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

Lua Use Scroll and learn Spell

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello!

Script by Cykotitan:

Code:
local spell = "Light Healing"
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not getPlayerLearnedInstantSpell(cid, spell) then
		doPlayerLearnInstantSpell(cid, spell)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end

Ok.. should I put something in spells.xml or? I mean in spells.xml, you need x lvl etc..

To make myself clearer, should I remove the spell line from spells.xml? Because I want people to learn, i.e light healing, only by using the scroll...


Thanks in advance!
 
Last edited:
Junior Member

Join Date: Dec 2008
Posts: 8
Reputation: Johanz is on a distinguished road

Add to Johanz's Reputation


[05/05/2010 19:53:50] data/actions/scripts/mountscroll.luanUse

[05/05/2010 19:53:50] luaDoCreatureSay(). Creature not found

error :/ did as you said. tfs 0.3.1

Please help
 
Lua:
local spell = "SPELLNAME"
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not player:hasLearnedSpell(spell) then
        player:getPosition():sendMagicEffect(50)
        player:learnSpell(spell)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Congratz!!! You learned "SPELLNAME".')
        else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy learned the spell!.')
        player:getPosition():sendMagicEffect(3)
    end
    return true
end

for tfs 1.3 if someone needs it :)
 
Back
Top