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

Manarune By Stages

Roddet

Staff member
Global Moderator
Joined
May 1, 2013
Messages
945
Solutions
103
Reaction score
763
Location
Mex
Hello,

I'm looking for some help for this script.

This script is staged by level but i want add too vocation and show how much mana added with each use on console.

Like if level x and vocation x then... add mana

Something like this

Lua:
{1} < Vocation {1,10} < Level {35,80} < Mana

Lua:
local t = {
	[{1,35}] = {150,150},
	[{51,100}] = {150,250},
	[{101,250}] = {250,400},
	[{251,350}] = {400,600},
	[{450,550}] = {600,750},
	[{551,650}] = {750,1000},
	[{650,math.huge}] = {1000,1300}
}
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEAL)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	elseif not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
 
	local lvl = getPlayerLevel(cid)
	for k, v in pairs(t) do
		if lvl >= k[1] and lvl <= k[2] then
			doPlayerAddMana(itemEx.uid,math.random(v[1], v[2]))
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			doAddCondition(cid, exhaust)
			doSendAnimatedText(toPosition, 'Manarune!', math.random(255))
			return true
		end
	end
end

++REP :p
 
Last edited:
Back
Top