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

Need help with mana rune for pally

I tried making it but haven't tested it... anyways here it is:

LUA:
local runes = {
	[2298] = { -- Put your rune/potion ID here
		voc = {3, 7, 11}, -- Put your vocation(s) here
		min = '(level * 1 + maglv * 5) * 5.90 - 500',
		max = '(level * 1 + maglv * 5) * 5.90',
		min2 = '(level * 5) + (maglv * 3) - 55',
		max2 = '(level * 6) + (maglv * 8)'		
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if min < 2500 then
		min = 2500
	end	

	if isInArray(i.voc, getPlayerVocation(cid)) then
		if isPlayer(itemEx.uid) then
			level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
			doCreatureAddHealth(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
			doPlayerAddMana(cid, math.random(loadstring('return '..i.min2)(), loadstring('return '..i.max2)()))			
			doSendMagicEffect(getThingPos(itemEx.uid), 49)
			doCreatureSay(itemEx.uid, "~Donor~", TALKTYPE_ORANGE_1) -- Change this to have it say something else in-game
			doRemoveItem(item.uid, 1)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)			
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
		end
	else
		doCreatureSay(itemEx.uid, "Only ~~~ can use this Rune!", TALKTYPE_ORANGE_1) -- Put error message for what vocations can use this rune...
	end
	return true
end
 
Don't Work :(

I Put it In Action and give this eror

PHP:
[19/08/2013 19:36:45] [Error - Action Interface] 
[19/08/2013 19:36:45] data/actions/scripts/rune.lua:onUse
[19/08/2013 19:36:45] Description: 
[19/08/2013 19:36:45] data/actions/scripts/rune.lua:12: attempt to compare nil with number
[19/08/2013 19:36:45] stack traceback:
[19/08/2013 19:36:45] 	data/actions/scripts/rune.lua:12: in function <data/actions/scripts/rune.lua:10>

On Spells

PHP:
[19/08/2013 19:34:48] [Error - Action Interface] 
[19/08/2013 19:34:48] data/actions/scripts/rune.lua:onUse
[19/08/2013 19:34:48] Description: 
[19/08/2013 19:34:48] data/actions/scripts/rune.lua:12: attempt to compare nil with number
[19/08/2013 19:34:48] stack traceback:
[19/08/2013 19:34:48] 	data/actions/scripts/rune.lua:12: in function <data/actions/scripts/rune.lua:10>
[19/08/2013 19:36:23] [Warning - Event::loadScript] Event onCastSpell not found (data/spells/scripts/healing/donate mana.lua)
 
Won't work, you need to make it in actions i will post it here for you later when i have time.

- - - Updated - - -

this will work

goto actions\scripts and name is pally rune
local health = 150
local mana =150

function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(cid, "HEAL" ,19)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddHealth (cid, health)
doCreatureAddHealth (cid,health)
end
return true
end

PS: edit local health =~ to how much health u want it to heal
and edit local mana=~ to how much mana you want it to heal.
--------------
go to actions.xml
<action itemid="uritemid" script="pally rune.lua"/>

tested on tfs 0.4

- - - Updated - - -

this will work

goto actions\scripts and name is pally rune
local health = 150
local mana =150

function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(cid, "HEAL" ,19)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, health)
doCreatureAddHealth (cid,health)
end
return true
end

PS: edit local health =~ to how much health u want it to heal
and edit local mana=~ to how much mana you want it to heal.
--------------
go to actions.xml
<action itemid="uritemid" script="pally rune.lua"/>

tested on tfs 0.4


I didn't see i wrote do creature add health 2 times, sorry :)
 
Need It With

PHP:
local mana_minimum = (level * 5) + (mlevel * 3) - 55
local mana_maximum = (level * 6) + (mlevel * 8)
-- Mana Formula Settings END --
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
To Make Automatic
 
LUA:
local mana_min = (level * 5) + (mlevel * 3) - 55
local mana_max = (level * 6) + (mlevel * 8)
local health_min = (level * 5) + (mlevel * 3) - 55
local health_max = level * 6) + (mlevel * 8)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)


function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(mana_min, mana_max))
doCreatureAddHealth (cid,math.random(health_min, health_max))
end
return true
end
 
Last edited:
Won't work, you need to make it in actions i will post it here for you later when i have time.

- - - Updated - - -

this will work

goto actions\scripts and name is pally rune


PS: edit local health =~ to how much health u want it to heal
and edit local mana=~ to how much mana you want it to heal.
--------------
go to actions.xml
<action itemid="uritemid" script="pally rune.lua"/>

tested on tfs 0.4

- - - Updated - - -

this will work

goto actions\scripts and name is pally rune


PS: edit local health =~ to how much health u want it to heal
and edit local mana=~ to how much mana you want it to heal.
--------------
go to actions.xml
<action itemid="uritemid" script="pally rune.lua"/>

tested on tfs 0.4


I didn't see i wrote do creature add health 2 times, sorry :)

Thank You For Your Work :)

- - - Updated - - -

LUA:
local mana_min = (level * 5) + (mlevel * 3) - 55
local mana_max = (level * 6) + (mlevel * 8)
local health_min = (level * 5) + (mlevel * 3) - 55
local health_max = level * 6) + (mlevel * 8)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)


function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(mana_min, mana_max))
doCreatureAddHealth (cid,math.random(health_min, health_max))
end
return true
end

Don't Work Give This error

PHP:
[20/08/2013 08:55:22] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Rune.lua:4: unexpected symbol near ')'
[20/08/2013 08:55:22] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Rune.lua)
[20/08/2013 08:55:22] data/actions/scripts/Rune.lua:4: unexpected symbol near ')'
 
How won't it work? I just tried it and it works fine.. It's an actions script...

LUA:
local runes = {
	[2298] = { -- Put your rune/potion ID here
		voc = {3, 7, 11}, -- Put your vocation(s) here
		min = '(level * 1 + maglv * 5) * 5.90 - 500',
		max = '(level * 1 + maglv * 5) * 5.90',
		min2 = '(level * 5) + (maglv * 3) - 55',
		max2 = '(level * 6) + (maglv * 8)'		
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if i.min < 2500 then
		i.min = 2500
	end	

	if isInArray(i.voc, getPlayerVocation(cid)) then
		if isPlayer(itemEx.uid) then
			level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
			doCreatureAddHealth(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
			doPlayerAddMana(cid, math.random(loadstring('return '..i.min2)(), loadstring('return '..i.max2)()))			
			doSendMagicEffect(getThingPos(itemEx.uid), 49)
			doCreatureSay(itemEx.uid, "~Donor~", TALKTYPE_ORANGE_1) -- Change this to have it say something else in-game
			doRemoveItem(item.uid, 1)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)			
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
		end
	else
		doCreatureSay(itemEx.uid, "Only ~~~ can use this Rune!", TALKTYPE_ORANGE_1) -- Put error message for what vocations can use this rune...
	end
	return true
end

In actions.xml:

Code:
	<action itemid="2298" event="script" value="Liquids/Otland.lua"/>

Change the id and the location to what you need
 
this is because i missed a bracket.. sorry :)

LUA:
local mana_min = (level * 5) + (mlevel * 3) - 55
local mana_max = (level * 6) + (mlevel * 8)
local health_min = (level * 5) + (mlevel * 3) - 55
local health_max = (level * 6) + (mlevel * 8)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
 
 
function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(mana_min, mana_max))
doCreatureAddHealth (cid,math.random(health_min, health_max))
end
return true
end


LUA:
local kerd = {
	mana_min = (level * 5) + (mlevel * 3) - 55
	mana_max = (level * 6) + (mlevel * 8)
	health_min = (level * 5) + (mlevel * 3) - 55
	health_max = (level * 6) + (mlevel * 8)
	},

function onUse (cid, item, fromPosition, itemEx, toPosition)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(kerd.mana_min, kerd.mana_max))
doCreatureAddHealth (cid,math.random(kerd.health_min,kerd.health_max)
end
return true
end

this one is better actually
 
Last edited:
How won't it work? I just tried it and it works fine.. It's an actions script...

LUA:
local runes = {
	[2298] = { -- Put your rune/potion ID here
		voc = {3, 7, 11}, -- Put your vocation(s) here
		min = '(level * 1 + maglv * 5) * 5.90 - 500',
		max = '(level * 1 + maglv * 5) * 5.90',
		min2 = '(level * 5) + (maglv * 3) - 55',
		max2 = '(level * 6) + (maglv * 8)'		
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if i.min < 2500 then
		i.min = 2500
	end	

	if isInArray(i.voc, getPlayerVocation(cid)) then
		if isPlayer(itemEx.uid) then
			level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
			doCreatureAddHealth(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
			doPlayerAddMana(cid, math.random(loadstring('return '..i.min2)(), loadstring('return '..i.max2)()))			
			doSendMagicEffect(getThingPos(itemEx.uid), 49)
			doCreatureSay(itemEx.uid, "~Donor~", TALKTYPE_ORANGE_1) -- Change this to have it say something else in-game
			doRemoveItem(item.uid, 1)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z}, 30)
			doSendDistanceShoot(getCreaturePosition(cid), {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}, 30)			
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
		end
	else
		doCreatureSay(itemEx.uid, "Only ~~~ can use this Rune!", TALKTYPE_ORANGE_1) -- Put error message for what vocations can use this rune...
	end
	return true
end

In actions.xml:

Code:
	<action itemid="2298" event="script" value="Liquids/Otland.lua"/>

Change the id and the location to what you need

Don't work Too Sorry :(


LUA:
[20/08/2013 22:09:28] [Error - Action Interface] 
[20/08/2013 22:09:28] data/actions/scripts/Rune.lua:onUse
[20/08/2013 22:09:28] Description: 
[20/08/2013 22:09:28] data/actions/scripts/Rune.lua:12: attempt to index local 'i' (a nil value)
[20/08/2013 22:09:28] stack traceback:
[20/08/2013 22:09:28] 	data/actions/scripts/Rune.lua:12: in function <data/actions/scripts/Rune.lua:10>

- - - Updated - - -

this is because i missed a bracket.. sorry :)

LUA:
local mana_min = (level * 5) + (mlevel * 3) - 55
local mana_max = (level * 6) + (mlevel * 8)
local health_min = (level * 5) + (mlevel * 3) - 55
local health_max = (level * 6) + (mlevel * 8)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
 
 
function onUse (cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(mana_min, mana_max))
doCreatureAddHealth (cid,math.random(health_min, health_max))
end
return true
end


LUA:
local kerd = {
	mana_min = (level * 5) + (mlevel * 3) - 55
	mana_max = (level * 6) + (mlevel * 8)
	health_min = (level * 5) + (mlevel * 3) - 55
	health_max = (level * 6) + (mlevel * 8)
	},

function onUse (cid, item, fromPosition, itemEx, toPosition)
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isPlayer(itemEx.uid) then
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), 25)
doCreatureAddMana (cid, math.random(kerd.mana_min, kerd.mana_max))
doCreatureAddHealth (cid,math.random(kerd.health_min,kerd.health_max)
end
return true
end

this one is better actually

Just Don't Work Too :(


LUA:
[20/08/2013 22:08:31] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Rune.lua:3: '}' expected (to close '{' at line 1) near 'mana_max'
[20/08/2013 22:08:31] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Rune.lua)
[20/08/2013 22:08:31] data/actions/scripts/Rune.lua:3: '}' expected (to close '{' at line 1) near 'mana_max'
 
LUA:
local kerd = {
	mana_min = (level * 5) + (mlevel * 3) - 55,
	mana_max = (level * 6) + (mlevel * 8),
	health_min = (level * 5) + (mlevel * 3) - 55,
	health_max = (level * 6) + (mlevel * 8),
	}
 
function onUse (cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
	if isPlayer(itemEx.uid) then
		doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), 25)
		doPlayerAddMana (cid, math.random(kerd.mana_min, kerd.mana_max))
		doCreatureAddHealth (cid,math.random(kerd.health_min,kerd.health_max)
	end
return true
end
 
problem was with the comma

@up this one will work


btw, local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)

works too
 
LUA:
local kerd = {
	mana_min = (level * 5) + (mlevel * 3) - 55,
	mana_max = (level * 6) + (mlevel * 8),
	health_min = (level * 5) + (mlevel * 3) - 55,
	health_max = (level * 6) + (mlevel * 8),
	}
 
function onUse (cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
	if isPlayer(itemEx.uid) then
		doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), 25)
		doPlayerAddMana (cid, math.random(kerd.mana_min, kerd.mana_max))
		doCreatureAddHealth (cid,math.random(kerd.health_min,kerd.health_max)
	end
return true
end


LUA:
[21/08/2013 03:15:33] [Error - Action Interface] 
[21/08/2013 03:15:33] data/actions/scripts/Rune.lua:onUse
[21/08/2013 03:15:33] Description: 
[21/08/2013 03:15:33] data/actions/scripts/Rune.lua:12: attempt to index local 'i' (a nil value)
[21/08/2013 03:15:33] stack traceback:
[21/08/2013 03:15:33] 	data/actions/scripts/Rune.lua:12: in function <data/actions/scripts/Rune.lua:10>
 
LUA:
function onUse (cid, item, fromPosition, itemEx, toPosition)
    local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
    local mana_min, mana_max, health_min, health_max = (level * 5) + (mlevel * 3) - 55, (level * 6) + (mlevel * 8), (level * 5) + (mlevel * 3) - 55, (level * 6) + (mlevel * 8)
    if isPlayer(itemEx.uid) then
        doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
        doPlayerAddMana(cid, math.random(mana_min, mana_max))
        doCreatureAddHealth(cid, math.random(health_min, health_max))
        end
    return true
end
 
Back
Top