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

Mana rune problem

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
i tryed all kinds of manarune script when i use action script i get this error(warning load scrip-event onuse not found)
when i use spells script i getr this(on castspell not found) any one can help ??:(
that is the script i use :

local config = {
funnyEffect = "YES", -- Effect (YES/NO)
minimumLevel = 20,
maximumLevel = math.huge, -- for infinite type math.huge
}
local addMana = {
[{config.minimumLevel, 40}] = 500,
[{40, 80}] = 500,
[{80, 90}] = 500,
[{90, 100}] = 600,
[{100, 120}] = 700,
[{120, 199}] = 800,
[{200, config.maximumLevel}] = 1000,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local effect = CONST_ME_MAGIC_GREEN

if level < config.minimumLevel then
doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a manarune.")
return FALSE
end

if level >= config.maximumLevel then
doPlayerSendCancel(cid, "Your way to high level for this rune.")
return FALSE
end

for k, v in pairs(addMana) do
if level >= k[1] and level < k[2] then
doPlayerAddMana(cid, v)
doRemoveItem(item.uid, 0)
break
end
end

if config.funnyEffect == "YES" then
local pos = getPlayerPosition(cid)
local positions = {
{x=pos.x,y=pos.y,z=pos.z},
}

for i = 1, table.getn(positions) do
doSendMagicEffect(positions,effect)
end
end
return TRUE
end



server 8.50 TFS
 
Last edited:
Please take your time to write your posts, because as it is now, hardly any one will know what problem you have. Provide more informations like otserv distribution, script you were trying to use, what files did you edit etc..
 
Script for manarune "manarune.lua" in "spells\support or \healing"

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, 500) 
return doCombat(cid, combat, var)
end

Add in spells.xml ->
PHP:
<rune name="manarune" id="RUNEITEMID HERE" charges="XX" maglv="X" exhaustion="XX" blocktype="solid" allowfaruse="1" aggressive="0" script="healing/manarune.lua"/>

Where: RUNEITEMID = the ItemID of the rune. Charges="XX" = Nº of charges of the rune. Maglv="x" = magic level needed, and Exhaustion="XX" = delay when using it. Use a normal delay like 700-800

Hope it works
 
Back
Top