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

Problem With Quest

LuckyM

Ett är Ett
Joined
Jun 13, 2009
Messages
1,426
Solutions
1
Reaction score
184
Location
Sweden
Hello OTlanders.

can someone post a manrune based by Magic Level ;) Of Course i give Rep++
 
Code:
local req = {
	lvl = 20,
	mlvl = 5
}
local multiplier = {
	min = {
		lvl = 0.25,
		mlvl = 3,
		final = 3.8
	},
	max = {
		lvl = 0.25,
		mlvl = 3,
		final = 4.2
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local lvl = getPlayerMagLevel(cid)
	local mlvl = getPlayerMagLevel(cid)
	if lvl >= req.lvl and mlvl >= req.mlvl then
		doPlayerAddMana(itemEx.uid, math.random((lvl*multiplier.min.lvl + mlvl*multiplier.min.mlvl) * multiplier.min.final, (lvl*multiplier.max.lvl + mlvl*multiplier.max.mlvl) * multiplier.max.final))
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		doRemoveItem(item.uid,1)
	else
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendCancel(cid,"You don't have the required " .. (mlvl < req.mlvl and "magic " or "") .. "level to use that rune.")
	end
	return TRUE
end
 
Last edited:
Code:
local req = {
	lvl = 20,
	mlvl = 5
}
local multiplier = {
	min = {
		lvl = 0.25,
		mlvl = 3,
		final = 3.8
	},
	max = {
		lvl = 0.25,
		mlvl = 3,
		final = 4.2
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local lvl = getPlayerMagLevel(cid)
	local mlvl = getPlayerMagLevel(cid)
	if lvl >= req.lvl and mlvl >= req.mlvl then
		doPlayerAddMana(itemEx.uid, math.random((lvl*multiplier.min.lvl + mlvl*multiplier.min.mlvl) * multiplier.min.final, (lvl*multiplier.max.lvl + mlvl*multiplier.max.mlvl) * multiplier.max.final))
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		doRemoveItem(item.uid,1)
	else
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendCancel(cid,"You don't have the required " .. (mlvl < req.mlvl and "magic " or "") .. "level to use that rune.")
	end
	return TRUE
end

Thanks :) , But i need to ask you about help,

You are not allowed to get rewards from quests.
I test it with my God, and my normal character.
 
Back
Top