• 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 scroll request rep+

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello, i using 0.4 dev, and i was searching for a spell scroll, noone work.. so i start this thread.. i want to make peoples need to use scroll for learn exura ( light healing ), rep ++ for help :)
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Mooosie
local spell = "Light Healing" -- The spell name you want to learn
	if getPlayerLearnedInstantSpell(cid, spell) == false then
		doSendMagicEffect(getCreaturePosition(cid), 12)
		doPlayerSendTextMessage(cid, 22, "You just learned a new spell ".. spell .."!")
		doPlayerLearnInstantSpell(cid, spell)
	else
		doPlayerSendCancel(cid, "You already know the ".. spell .." spell.")
		doSendMagicEffect(getCreaturePosition(cid),2)
	end
return true
end

Remember next time post your requests at the Requesting Board.
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Mooosie
local spell = Light Healing -- The spell name you want to learn
	if getPlayerLearnedInstantSpell(cid, spell) == false then
		doPlayerLearnInstantSpell(cid, spell)
	else
		doPlayerSendCancel(cid, "You already know the ".. spell .." spell.")
		doSendMagicEffect(getCreaturePosition(cid),2)
	end
return true
end

Remember next time post your requests at the Requesting Board.

i cant use the obeject? ;s, '' sorry not possbile ''
 
What does it say in your actions.xml? Example:
XML:
<action itemid="6119" event="script" value="spell_scroll.lua" />
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Mooosie
local spell = "Light Healing" -- The spell name you want to learn
	if getPlayerLearnedInstantSpell(cid, spell) == false then
		doPlayerLearnInstantSpell(cid, spell)
	else
		doPlayerSendCancel(cid, "You already know the ".. spell .." spell.")
		doSendMagicEffect(getCreaturePosition(cid),2)
	end
return true
end

fixed mooosie's script :) so its still his rep :)
 
What was wrong with the script? It is just a xml part that is not woriking correctly. Thats becouse it says "can't use this object." it don't have any function. Thats why I ask him to show me his action.xml line that is linked to the script.

EDIT: Just saw the foult. Updated the script:

make a new .lua file and place it in ../data/actions/scripts/spell_scroll.lua
inside the spell_scroll.lua paste in:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Mooosie
local spell = "Light Healing" -- The spell name you want to learn
	if getPlayerLearnedInstantSpell(cid, spell) == false then
		doSendMagicEffect(getCreaturePosition(cid), 12)
		doPlayerSendTextMessage(cid, 22, "You just learned a new spell ".. spell .."!")
		doPlayerLearnInstantSpell(cid, spell)
	else
		doPlayerSendCancel(cid, "You already know the ".. spell .." spell.")
		doSendMagicEffect(getCreaturePosition(cid),2)
	end
return true
end

In actions.xml (actions/actions.xml) add this:

XML:
<action itemid="SPELLSCROLLITEMID" event="script" value="spell_scroll.lua"/>

After
XML:
<?xml version="1.0" encoding="UTF-8"?>
<actions>

If you did'nt understand
XML:
<?xml version="1.0" encoding="UTF-8"?>
<actions> 
<action itemid="SPELLSCROLLITEMID" event="script" value="spell_scroll.lua"/>

Then you are done! You just need to use on the item and you will get the spell.

If you want to remove the item when you use it then:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Mooosie
local spell = "Light Healing" -- The spell name you want to learn
	if getPlayerLearnedInstantSpell(cid, spell) == false then
		doSendMagicEffect(getCreaturePosition(cid), 12)
		doPlayerSendTextMessage(cid, 22, "You just learned a new spell ".. spell .."!")
		doPlayerLearnInstantSpell(cid, spell)
                doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, "You already know the ".. spell .." spell.")
		doSendMagicEffect(getCreaturePosition(cid),2)
	end
return true
end
 
Last edited:
The thing wrong with the script was only that he had it
LUA:
local spell = Light Healing

so i changed it to
LUA:
local spell = "Light Healing"
 
Back
Top