• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved item gives you a spell help

lego

New Member
Joined
Mar 11, 2013
Messages
86
Reaction score
2
Location
Stockholm
hello.. :rolleyes:

I wanted a book by id: 1985 on my 8.6 serv to become an item so a spell only works when you wear the book.
I copyed this codes from another forum because its kinda what i want for spell for my server.
but i also need the value code "ek1.lua" which i dont have.. :(

If this doesn't help please tell me how i can create spells like my description by my own.
Thanks !!

Code:
<action itemid="1985" event="script" value="ek1.lua"/>

local spell = "Super Exori"
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)
                doPlayerRemoveItem(cid, 1985, 1) 
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end
 
hello.. :rolleyes:

I wanted a book by id: 1985 on my 8.6 serv to become an item so a spell only works when you wear the book.
I copyed this codes from another forum because its kinda what i want for spell for my server.
but i also need the value code "ek1.lua" which i dont have.. :(

If this doesn't help please tell me how i can create spells like my description by my own.
Thanks !!

Code:
<action itemid="1985" event="script" value="ek1.lua"/>

local spell = "Super Exori"
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)
                doPlayerRemoveItem(cid, 1985, 1) 
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end

in actions.xml, paste

Code:
<action itemid="1985" script="others/ek1.lua"/>

now, go into actions/scripts/others and make a new .lua file named ek1. Then paste the code:

Code:
local spell = "Super Exori"
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)
                doPlayerRemoveItem(cid, 1985, 1) 
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
 
Back
Top