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

staged manarune help

eternalthug

New Member
Joined
Jul 25, 2009
Messages
51
Reaction score
0
Could anyone give me a script for a manarune with stages? for my ot by lvl isn't going to cut it, i need a staged manarune for example at lvl 1k u heal 10k mana at lvl 30k u heal like 400k mana at lvl 60k u heal like 700k mana etc
 
local stageOneHeal =
local stageTwoHeal =
local stageThreeHeal =
local stageFourHeal =
local stageFiveHeal =
local stageOneLevel =
local stageTwoLevel =
local stageThreeLevel =
local getStage = getPlayerlevel(cid)
local getVocation = getPlayerVocation(cid)

if getVocation = 4 then
if getStage > stageOneLevel and getStage < stageTwoLevel then
doPlayerAddMana(cid,stageOneHeal)
elseif getStage > stageTwoLevel and getStage < stageThreeLevel then
doPlayerAddMana(cid,stageTwoHeal)
... I don't know if something like this would take too long to load or freeze a lot of things, but I'm sure itd work.
 
Oh hmm, maybe the global function of doPlayerAddMana(cid) has a limited # written int he function?

I dont think so, Ive seen mrs healing 300k in OTs :p

local stageOneHeal =
local stageTwoHeal =
local stageThreeHeal =
local stageFourHeal =
local stageFiveHeal =
local stageOneLevel =
local stageTwoLevel =
local stageThreeLevel =
local getStage = getPlayerlevel(cid)
local getVocation = getPlayerVocation(cid)

if getVocation = 4 then
if getStage > stageOneLevel and getStage < stageTwoLevel then
doPlayerAddMana(cid,stageOneHeal)
elseif getStage > stageTwoLevel and getStage < stageThreeLevel then
doPlayerAddMana(cid,stageTwoHeal)
... I don't know if something like this would take too long to load or freeze a lot of things, but I'm sure itd work.

Dude, thats exactly what I said in the other post, it wud be the same since u have to check for level like that:
if getPlayerLevel(cid) >= xxxx and getPlayerLevel(cid) < xxxx
And thats why I made a table :D
 
Really odd situation.. only thing we can do is make a small test script for each ways of doing it and bugTest to see if the table is doing something unexpected?
other than that, its a really wierd thing xD
@santig, sorry I diddnt' see your post responding to me, cuz i was going off n writing that basic stuff. ^^
 
Lua:
local t = {
	[{1,999}] = 2500,
	[{1000,4999}] = 10000,
	[{5000,9999}] = 100000,
	[{10000,19999}] = 250000,
	[{20000,29999}] = 400000,
	[{30000,math.huge}] = 500000
}

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, v)
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			doAddCondition(cid, exhaust)
			doSendAnimatedText(toPosition, 'Manarune!', math.random(255))
			return true
		end
	end
end
 
Back
Top