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

Lua Manarune based on magic level!

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello :)

I need a manarune based on magic level!
I cant find anything good. If somone could edit this one it should be great but post another if you guys got one.

This is mine but its not based on anything, just random heals.

Code:
local t = {
	min = 800,
	max = 1100,
	text = "Aaaah...",
	effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		if math.random(1, 100) == 1 then
		doRemoveItem(item.uid, 0)
		end
		doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
		doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
		doSendMagicEffect(toPosition, t.effect)
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end

The purple and "Aaaah..." should be untouched :)
 
LUA:
local runes = {
	[2275] = {
		min = 'level * 1 + maglv * 3',
		max = 'level * 1 + maglv * 4'
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		level, maglv, i = getPlayerLevel(cid), getPlayerMagLevel(cid), runes[item.itemid]
		doPlayerAddMana(itemEx.uid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
		level, maglv, i = nil, nil, nil
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		doCreatureSay(itemEx.uid, 'Aaaah...', TALKTYPE_ORANGE_1)
		if math.random(100) == 1 then
			doRemoveItem(item.uid)
		end
	else
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	end
	return true
end
 
LUA:
local runes = {
	[2275] = {
		min = 'level * 1 + maglv * 3',
		max = 'level * 1 + maglv * 4'
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		level, maglv, i = getPlayerLevel(cid), getPlayerMagLevel(cid), runes[item.itemid]
		doPlayerAddMana(itemEx.uid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
		level, maglv, i = nil, nil, nil
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		doCreatureSay(itemEx.uid, 'Aaaah...', TALKTYPE_ORANGE_1)
		if math.random(100) == 1 then
			doRemoveItem(item.uid)
		end
	else
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	end
	return true
end



Thank you Cykotitan, very useful :)!
 
Back
Top