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

Use Scroll Learn Spell.

darkk

New Member
Joined
May 1, 2009
Messages
15
Reaction score
0
Location
Las Vegas, US
Hi, i know maybe some 1 posted about this, but i cant find it,:confused:
so i need help on this...

When you use X scroll you will learn X spell. and the scroll will dissapear.

Thanks. ^_^
Thanks SexyDevil
Thanks Cykotitan. :thumbup:
 
Last edited:
Code:
function onUse(cid, item, frompos, item2, topos)
  if doPlayerRemoveItem(cid, 2311, 1) and getPlayerStorageValue(cid, 5312) == -1 then
     doPlayerLearnInstantSpell(cid, Light Healing)
     setPlayerStorageValue(cid, 5312, 1)
  else
     doPlayerSendCancel(cid, "You have already learned this spell")
  end
end
like this?
 
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
 
Great idea, but... should I put something in spells.xml or? I mean in spells.xml, you need x lvl etc..

Edit: 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 a scroll...
 
Last edited:
[05/05/2010 19:53:50] data/actions/scripts/mountscroll.lua:eek:nUse

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

error :/ did as you said. tfs 0.3.1

Please help :(
 
Is it possible to make it only work for x vocation?

P.S

add
Code:
			doRemoveItem(item.uid, 1)

below

Code:
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)


to make it dissapear after it has been used
 
Last edited:
Is it possible to make it only work for x vocation?



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)
	elseif getPlayerVocation(cid) ~= x then
		doCreatureSay(cid, "Only the x vocation can learn this spell.", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end
 
Back
Top