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

Whats wrong with this manarune script? :<

Ekholmen

New Member
Joined
Dec 12, 2010
Messages
52
Reaction score
0
Location
Sweden
Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local min, max
	local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
	if isSorcerer(cid) or isDruid(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isPaladin(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isKnight(cid) then
		min = lvl * 0.5 + mag * 0.5
		max = lvl * 1.0 + mag * 1.0
	end
	
	local rand = math.random(min, max)
	if rand > 400 then
		rand = 400
	end
	
	if rand < 100 then
		rand = 100
	end
	
	if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end
	
	if not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
	
	if(getCreatureMana(cid) >= getCreatureMaxMana(cid)) then
		return doPlayerSendCancel(cid, "Your mana is currently full.")
	end
	
	return doChangeTypeItem(item.uid, item.type - 1) and doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doPlayerAddMana(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
end

local t = {
[13] = {35,150},
[50] = {150,250},
[100] = {250,400},
[200] = {400,500},
[309] = {666,666},
[10000] = {100000,20000},
[10000] = {100000,20000},
[10000] = {100000,20000},
[10000] = {100000,20000},
[10000] = {100000,20000},
[10000] = {100000,20000},
[20000] = {250000,30000},
[30000] = {500000,xxxxx}
}
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
lvl = getPlayerLevel(cid)
for k, v in pairs(t) do
    if lvl >= k and lvl < v[2] then
       doPlayerAddMana(cid,v[1])
       doSendMagicEffect(ppos,CONST_ME_MAGIC_BLUE)
       doAddCondition(cid, exhausted)
       doSendAnimatedText(ppos, "Mana rune!", math.random(1,100))
if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
      return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
      end
if not isPlayer(itemEx.uid) then
      return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
   end
return true
end
end
end

I want it to heal 35-150 mana at lvl 13-50 and so on... and im using the 2294 id rune but the manarune is healing 600 ALL the time does not matter wich lvl/m lvl and so :(
 
What is formulas :$

Code:
	if isSorcerer(cid) or isDruid(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isPaladin(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isKnight(cid) then
		min = lvl * 0.5 + mag * 0.5
		max = lvl * 1.0 + mag * 1.0
	end

Google
 
Some years ago people were probaly laughing at you to when you were a noob so you better lower your self esteem and stop being such a dick to "newbies" ;)
 
Some years ago people were probaly laughing at you to when you were a noob so you better lower your self esteem and stop being such a dick to "newbies" ;)

I was a newbie once, but instead of asking dumb questions I looked anything I didn't understand up and learnt.
We now live in a world of impatient children that want everything done for them right here and right now.
 
Back
Top