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

Need a learn spell action

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
hello guys
im looking for a learn spell action(scroll) im using this script from Anteyz
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local spell = dark star wave
if getPlayerLearnedInstantSpell(cid, spell) == FALSE then
playerLearnInstantSpell(cid,"spell")
doCreatureSay(cid, "You Just learned dark star wave spell", TALKTYPE_ORANGE_1)
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid,"You've already learned that spell!")
end
return TRUE
end
but wrong vocations can use the spell after using the scroll, even though
Code:
	<instant name="Dark Star Wave" words="Stella Caligatum" lvl="1" manapercent="20" exhaustion="3000" needlearn="1" script="dark wave.lua">
		[COLOR="#FF0000"]<vocation name="elder druid"/>
		<vocation name="master sorcerer"/>[/COLOR]
	</instant>
in spells.xml
so i need u to add a vocation request
this is used on Mystic spirit 0.2.11
=3
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local spell = dark star wave
local druid, sorcerer = isSorcerer(cid), isDruid(cid)
local knight, paladin = isKnight(cid), isPaladin(cid)
		
if druid or sorcerer then		
if getPlayerLearnedInstantSpell(cid, spell) == FALSE then
playerLearnInstantSpell(cid,"spell")
doCreatureSay(cid, "You Just learned dark star wave spell", TALKTYPE_ORANGE_1)
doRemoveItem(cid, item.uid, 1)
elseif knight or paladin then
doPlayerSendCancel(cid,"You must be a sorcerer or druid to use this lever!")
elseif getPlayerLearnedInstantSpell(cid, spell) == TRUE then
doPlayerSendCancel(cid,"You have learnt this spell already!")
end
return TRUE
end
 
Last edited:
[01/09/2011 12:58:02] Warning: [Event::checkScript] Can not load script. /scripts/spellslearn/dark star wave.lua
[01/09/2011 12:58:02] data/actions/scripts/spellslearn/dark star wave.lua:2: '=' expected near 'wave'
 
Code:
local spell = "dark star wave"
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isSorcerer(cid) or isDruid(cid) then
		if not getPlayerLearnedInstantSpell(cid, spell) then
			doPlayerLearnInstantSpell(cid, spell)
			doCreatureSay(cid, "You Just learned " .. spell .. " !!", TALKTYPE_ORANGE_1)
			doRemoveItem(item.uid, 1) 
	else
			doPlayerSendCancel(cid,"You've already learned that spell!")
		end
	else
			doPlayerSendCancel(cid,"Only mages can learn this " .. spell .. " spell")
		end
	return TRUE
end
 
My bad try this, it should work.
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local spell = "Dark Star Wave"
local druid, sorcerer = isDruid(cid), isSorcerer(cid)
local knight, paladin = isKnight(cid), isPaladin(cid)
		
if druid or sorcerer then		
if getPlayerLearnedInstantSpell(cid, spell) == FALSE then
playerLearnInstantSpell(cid, spell)
doCreatureSay(cid, "You Just learned dark star wave spell", TALKTYPE_ORANGE_1)
doRemoveItem(cid, item.uid, 1)
end
elseif knight or paladin then
doPlayerSendCancel(cid,"You must be a sorcerer or druid to use this lever!")
elseif getPlayerLearnedInstantSpell(cid, spell) == TRUE then
doPlayerSendCancel(cid,"You have learnt this spell already!")
end
return TRUE
end
 
i need help with learn spell


<instant name="Admin" words="admin spell" lvl="10000" mana="3000" selftarget="1" prem="0" exhaustion="2000" needlearn="1" event="script" value="attack/admin.lua">
<vocation id="4"/>
<vocation id="8"/>
<vocation name="Sorcerer"/>
<vocation name="Druid"/>
<vocation name="Paladin"/>
<vocation name="Knight"/>
</instant>

help plzzz :D :D rep+ if you help me
 
Back
Top