• 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
 
http://otland.net/f81/basic-manarune-based-upon-level-magic-level-99982/
Or
Lua:
local t = {
[2263] = {vocation = 1, level = 50, magic_level = 60, voc = 5},
[2267] = {vocation = 2, level = 50, magic_level = 60, voc = 6},
[2270] = {vocation = 3, level = 50, magic_level = 15, voc = 7},
[2272] = {vocation = 4, level = 40, magic_level = 5, voc = 8}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
lvlmin = getPlayerLevel(cid)*2
lvlmax = getPlayerLevel(cid)*3
ppos = getPlayerPosition(cid)
local v = t[item.itemid]
      if v then
        if getPlayerLevel(cid) >= v.level then
            if getPlayerMagLevel(cid) >= v.magic_level then
              if isInArray({v.vocation, v.voc},getPlayerVocation(cid)) then
              doPlayerAddMana(cid,math.random(lvlmin, lvlmax))
           doSendMagicEffect(ppos,CONST_ME_MAGIC_BLUE)
           doAddCondition(cid, exhausted)
           doSendAnimatedText(ppos, "Mana rune!", math.random(1,100))
            else
                doPlayerSendCancel(cid,"You do not have the required vocation to use this rune")
            end
        else
            doPlayerSendCancel(cid,You do not have the required magic level to use this rune")
        end
      else
          doPlayerSendCancel(cid,"You do not have the level required to use this rune")
      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
return true
end
end

data/actions/actions.xml
XML:
<action itemid="2263;2267;2270;2272" event="script" value="manar.lua"/>

Edit formulas here:
Lua:
lvlmin = getPlayerLevel(cid)*2
lvlmax = getPlayerLevel(cid)*3

4 mrs one for each voc.
 
No no no lol, its cause i have 4 manarunes 1 is 10k healing for lvl 0-5k, at 5k theres 25k mana, 10k is 75k, 20k is 150k, 30k is 350k, 50k is like 550k and i tried putting a manarune by lvl but if i set it accuratly for lvl 10k, at lvl 30k its weaker. cause im trying to make a donor manarune that wont make al monsters super easy, so i need stages. at lvl 5k it heals like 35k mana, at 10k it heals 100k mana, 20k 250k mana, 30k 500k mana etc. know what i mean?
 
Thats exactly my mana rune, let me do it instead of 4 manarunes, to a file with only 1 (It will be the same cuz its working with level formulas) [Playerlevel * 'x' nr]
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
lvlmin = getPlayerLevel(cid)*2
lvlmax = getPlayerLevel(cid)*3
     doPlayerAddMana(cid,math.random(lvlmin, lvlmax))
     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

data/actions/actions.xml
XML:
<action itemid="2263" event="script" value="manar.lua"/>

EDIT: If you need to heal EXACTLY
5k > 35k
10k > 100k
20k > 250k
30k > 500k
Then tell me. Although I tihnk that using formulas is better.
 
Last edited:
i need exact stages cause all other manarunes aren't lvl based. and itd be easier to set, formulas i'd have to go and test until i have it right. and it could be a hastle.
 
Alright Ill do it now, wait me :p
EDIT:
Lua:
local t = {
[5000] = {35000,10000},
[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

So, to edit it:
Lua:
[5000] = {35000,10000}

5000 will be the level that will heal > {35000,
And ,10000} Is the max level for getting 35k heal :p
 
Last edited:
Yes
EDIT:
I'm not sure, but I think levels/stages must be written in 'back order': 20000, 10000, 5000, not 5000,10000... because after first level check it return value and doesn't check if player has higher level (better healing).

other thing... it should check 'is player exhausted' before he use manarune <_<

The exhausted thing got stuck from my mr, didnt want to put it :p
And about the other thing, I tihnk it shud work anyway, but idk, prolly you are right, you know more than I do
 
Soo weird,
Lua:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

local t = {
[5000] = {heal = 35000, maxl = 10000},
[10000] = {heal = 100000, maxl = 20000},
[20000] = {heal = 250000, maxl = 30000},
[30000] = {heal = 500000, maxl = 600000}
}
 
 
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.maxl then
       doPlayerAddMana(cid,v.heal)
       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

This works fine for me, but after I get 10k+ its still healing me 35k instead of 100k :/
 
It wud be kinda the same, since Ill have to this too.
Lua:
if lvl >= 5000 and lvl < 10000 then
   do....
 
Back
Top