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

cooldodo

New Member
Joined
Jan 17, 2014
Messages
297
Reaction score
4
I NEED a manarune to that increase by level so when i am lvl 8 it heals 100 mana and when i am lvl 10k it heals like 100k
 
Code:
--   -- advanced
--   level = 2.5,     -- player level * amount
--   magic = 3,       -- player magic level * amount
--   min = 4.6,       -- min heal |
--   max = 5.2,       -- max heal |
--
--     -- Example: Player_level 50, Magic_level 65
--     -- (50 * 2.5 + 65 * 3) * 4.6 == 1472 -- Min_heal
--     -- (50 * 2.5 + 65 * 3) * 5.2 == 1664 -- Max_heal
--
--   --basic
--   min_heal = 700,  -- min heal
--   max_heal = 1000  -- max heal

--///////////
-- USE BASIC if you want to set how much they heal, doesn't matter what level or magic level they have
-- In config below IGNORE level, magic, min, max.
--///////////
-- USE ADVANCED if you want the rune to heal more as they get more skills and levels.
-- In config below IGNORE min_heal, max_heal
--///////////

local cfg = {
   removeOnUse = 1, -- remove item on use | 1 = true  0 = false |
   advanced = 1,    -- 1 = Use Advanced, 0 = use Basic
   lvl = 35,      -- level required to use the item 
}
local vocation = {
   [1] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "knight"},
   [2] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "sorcerer"},
   [3] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "druid"},
   [4] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "paladin"},
 
   [5] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "elite knight"},
   [6] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "master sorcerer"},
   [7] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "elder druid"},
   [8] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "royal paladin"} 
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isPlayer(itemEx.uid) and getPlayerLevel(cid) >= cfg.lvl then
     for i = 1, #vocation do
       if vocation[i].name == getPlayerVocationName(itemEx.uid):lower() then
         if cfg.advanced == 1 then
           mini = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].min
           maxi = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].max
           local randa = math.random(mini, maxi)
           doCreatureAddMana(itemEx.uid, randa)
           doCreatureSay(itemEx.uid, "+".. randa .."", TALKTYPE_ORANGE_1)
         else
           local randb = math.random(vocation[i].min_heal, vocation[i].max_heal)
           doCreatureAddMana(itemEx.uid, randb)
           doCreatureSay(itemEx.uid, "+".. randb .."", TALKTYPE_ORANGE_1)
         end
         break
       end
     end
     doSendMagicEffect(toPosition, 12)
     doRemoveCondition(cid, 32)
     if cfg.removeOnUse == 1 then
       doRemoveItem(item.uid, 1)
     end
   else
     doCreatureSay(cid, "You must be level ".. cfg.lvl .." to use this rune.", TALKTYPE_ORANGE_1)
   end
   return true
end
Alternatively, a very simple infinite mana rune..
It will heal players mana by.. Character level * 10..

level 8
8 * 10 = 80 mana
level 100
100 * 10 = 1,000 mana
level 12,345
12,345 * 10 = 123,450 mana
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   heal = (getPlayerLevel(cid) * 10)
   doCreatureAddMana(itemEx.uid, heal)
   doCreatureSay(itemEx.uid, "+".. heal .."", TALKTYPE_ORANGE_1)
   doSendMagicEffect(toPosition, 12)
   -- doRemoveItem(item.uid, 1)
   return true
end
 
Code:
--   -- advanced
--   level = 2.5,     -- player level * amount
--   magic = 3,       -- player magic level * amount
--   min = 4.6,       -- min heal |
--   max = 5.2,       -- max heal |
--
--     -- Example: Player_level 50, Magic_level 65
--     -- (50 * 2.5 + 65 * 3) * 4.6 == 1472 -- Min_heal
--     -- (50 * 2.5 + 65 * 3) * 5.2 == 1664 -- Max_heal
--
--   --basic
--   min_heal = 700,  -- min heal
--   max_heal = 1000  -- max heal

--///////////
-- USE BASIC if you want to set how much they heal, doesn't matter what level or magic level they have
-- In config below IGNORE level, magic, min, max.
--///////////
-- USE ADVANCED if you want the rune to heal more as they get more skills and levels.
-- In config below IGNORE min_heal, max_heal
--///////////

local cfg = {
   removeOnUse = 1, -- remove item on use | 1 = true  0 = false |
   advanced = 1,    -- 1 = Use Advanced, 0 = use Basic
   lvl = 35,      -- level required to use the item
}
local vocation = {
   [1] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "knight"},
   [2] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "sorcerer"},
   [3] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "druid"},
   [4] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "paladin"},

   [5] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "elite knight"},
   [6] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "master sorcerer"},
   [7] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "elder druid"},
   [8] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "royal paladin"}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isPlayer(itemEx.uid) and getPlayerLevel(cid) >= cfg.lvl then
     for i = 1, #vocation do
       if vocation[i].name == getPlayerVocationName(itemEx.uid):lower() then
         if cfg.advanced == 1 then
           mini = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].min
           maxi = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].max
           local randa = math.random(mini, maxi)
           doCreatureAddMana(itemEx.uid, randa)
           doCreatureSay(itemEx.uid, "+".. randa .."", TALKTYPE_ORANGE_1)
         else
           local randb = math.random(vocation[i].min_heal, vocation[i].max_heal)
           doCreatureAddMana(itemEx.uid, randb)
           doCreatureSay(itemEx.uid, "+".. randb .."", TALKTYPE_ORANGE_1)
         end
         break
       end
     end
     doSendMagicEffect(toPosition, 12)
     doRemoveCondition(cid, 32)
     if cfg.removeOnUse == 1 then
       doRemoveItem(item.uid, 1)
     end
   else
     doCreatureSay(cid, "You must be level ".. cfg.lvl .." to use this rune.", TALKTYPE_ORANGE_1)
   end
   return true
end
Alternatively, a very simple infinite mana rune..
It will heal players mana by.. Character level * 10..

level 8
8 * 10 = 80 mana
level 100
100 * 10 = 1,000 mana
level 12,345
12,345 * 10 = 123,450 mana
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   heal = (getPlayerLevel(cid) * 10)
   doCreatureAddMana(itemEx.uid, heal)
   doCreatureSay(itemEx.uid, "+".. heal .."", TALKTYPE_ORANGE_1)
   doSendMagicEffect(toPosition, 12)
   -- doRemoveItem(item.uid, 1)
   return true
end
thanks but can u tell where to put what like what part to put in spells and what part to put in actions ? cuz its not working
 
Last edited:
thanks but can u tell where to put what like what part to put in spells and what part to put in actions ? cuz its not working
It's only in actions. If it's a spell.. it'd only be to create the rune.. The actual rune itself is in actions.xml
Code:
<action itemid="2273" event="script" value="aaCarlExampleScripts/heal rune vocations.lua"/>
 
Back
Top