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

Spell Manarune

LoLaye

Active Member
Joined
Dec 23, 2008
Messages
3,774
Solutions
1
Reaction score
44
Location
Sweden
Okay, i just finished my manarune

Well lets start, first off save this as manarune.lua
manaheal.lua in spells/scripts/custom
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) ---- What color you want to be displayed when using
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, XXXX) --- How much mana it heals
return doCombat(cid, combat, var)
end

Well done. now lets move on to spells.xml write this:
Lua:
	<rune name="Manarune" id="2280" charges="1" mana="1" maglv="0" exhaustion="1500" blocktype="solid" allowfaruse="1" script="custom/manaheal.lua"/>

Alright, thats my first manarune..


Lolaye

PS. im newbie in scripting .. so i will do more runes , more spells soon i hope you all like them
my server is high exp it got exp stage starts at 10k and ends at 5k so the players are high lvls and it needed a good manarune.... btw i have create it by myself and i dont think another server got this rune in the server as manarune..

(I JUST EDITED THIS POST 10/9/19 I KNOW THIS MANARUNE IS OLD)
 
Last edited:
great!!oneone111! rep+++

not:p


ok seriusly - maybe someone will need it :) btw If u want make more such spells please keep it in one thread :p Just my suggestion <x>
 
RPG Style

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) -- Color
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid,math.random(100,300)) -- Random Ammount
return doCombat(cid, combat, var)
end

Edit: (Will fill anywhere from 100,300)
PHP:
doPlayerAddMana(cid,math.random(100,300))
 
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) -- Color
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid,math.random(100,300)) -- Random Ammount
return doCombat(cid, combat, var)
end

Edit: (Will fill anywhere from 100,300)
PHP:
doPlayerAddMana(cid,math.random(100,300))

lawl, RPG?! Alot better for RPG servers will be manarune based on level/magic_level :)

anyway, you are just learning LUA, eh ? then keep on learning :thumbup:

gl.
 
suxy script juste copy past armonia? lol
and also use advanced mana rune from colandus insted of a cheep mana rune...

PHP:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.

function onUse(cid, item, frompos, item2, topos)
        
    minMana = 900 -- How much mana minium will you get?
    maxMana = 2400 -- How much mana max will you get?
    magToUse = 4 -- What magic level do you need to be to use the rune?
    useStats = true -- Shall given mana be affected by player level and magic level?
    runeID = 2276 -- Enter the item Id of the rune.
    loseCharges = false -- Write "true" if it shall lose charges. If not, then write something else such as "false".
    storeValue = 3567 -- Value where exhaust is saved.
    exhaustTime = 2 -- 1 = 1 second of exhaustion.
    animationColor = 41 -- The color of the "animation".
    mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
    missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
    exhaustMsg = "You are exhausted." -- Appears when you are exhausted.

    if item.itemid == runeID then
        if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
            if getPlayerMagLevel(cid) >= magToUse then
                if (exhaust(cid, storeValue, 1) > 0) then
                    if loseCharges == true or loseCharges == True then
                        if item.type > 1 then
                            doChangeTypeItem(item.uid, item.type-1)
                        else
                            doRemoveItem(item.uid, 1)
                        end
                    end
                    newMana = math.random(minMana, maxMana)
                    if useStats then
                        newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
                    end
                    manaNow = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, 999999)
                    manaMax = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, - manaMax + manaNow)
                    nMana = manaMax - manaNow
                    if newMana > nMana then
                        newMana = nMana
                    end
                    if getPlayerMana(item2.uid) == manaMax then
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doPlayerSendCancel(item2.uid, "Your mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        else
                            doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        end
                    else
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doSendMagicEffect(getPlayerPosition(cid), 12)
                            doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
                        else
                            doSendMagicEffect(getPlayerPosition(cid), 14)
                            doSendMagicEffect(getPlayerPosition(item2.uid), 12)
                            doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
                            doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
                        end
                        doPlayerAddMana(item2.uid, newMana)
                        doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
                    end
                else
                    doPlayerSendCancel(cid, exhaustMsg)
                end
            else
                doSendMagicEffect(getPlayerPosition(cid), 2)
                doPlayerSendCancel(cid, mLvlLowMsg)
            end
        else
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerSendCancel(cid, missPlayerMsg)
        end
        return 1
    end
end
  
  
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

also xml
Code:
        <action itemid="2276" script="quest/vipmr.lua"/>

+++
dont use RED GREEN BLUE
here u have some nice ;)

PHP:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_NONE = 255

this u can find in global.lua (0.2 tfs)
 
suxy script juste copy past armonia? lol
and also use advanced mana rune from colandus insted of a cheep mana rune...

PHP:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.

function onUse(cid, item, frompos, item2, topos)
        
    minMana = 900 -- How much mana minium will you get?
    maxMana = 2400 -- How much mana max will you get?
    magToUse = 4 -- What magic level do you need to be to use the rune?
    useStats = true -- Shall given mana be affected by player level and magic level?
    runeID = 2276 -- Enter the item Id of the rune.
    loseCharges = false -- Write "true" if it shall lose charges. If not, then write something else such as "false".
    storeValue = 3567 -- Value where exhaust is saved.
    exhaustTime = 2 -- 1 = 1 second of exhaustion.
    animationColor = 41 -- The color of the "animation".
    mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
    missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
    exhaustMsg = "You are exhausted." -- Appears when you are exhausted.

    if item.itemid == runeID then
        if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
            if getPlayerMagLevel(cid) >= magToUse then
                if (exhaust(cid, storeValue, 1) > 0) then
                    if loseCharges == true or loseCharges == True then
                        if item.type > 1 then
                            doChangeTypeItem(item.uid, item.type-1)
                        else
                            doRemoveItem(item.uid, 1)
                        end
                    end
                    newMana = math.random(minMana, maxMana)
                    if useStats then
                        newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
                    end
                    manaNow = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, 999999)
                    manaMax = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, - manaMax + manaNow)
                    nMana = manaMax - manaNow
                    if newMana > nMana then
                        newMana = nMana
                    end
                    if getPlayerMana(item2.uid) == manaMax then
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doPlayerSendCancel(item2.uid, "Your mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        else
                            doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        end
                    else
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doSendMagicEffect(getPlayerPosition(cid), 12)
                            doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
                        else
                            doSendMagicEffect(getPlayerPosition(cid), 14)
                            doSendMagicEffect(getPlayerPosition(item2.uid), 12)
                            doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
                            doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
                        end
                        doPlayerAddMana(item2.uid, newMana)
                        doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
                    end
                else
                    doPlayerSendCancel(cid, exhaustMsg)
                end
            else
                doSendMagicEffect(getPlayerPosition(cid), 2)
                doPlayerSendCancel(cid, mLvlLowMsg)
            end
        else
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerSendCancel(cid, missPlayerMsg)
        end
        return 1
    end
end
  
  
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

also xml
Code:
        <action itemid="2276" script="quest/vipmr.lua"/>

+++
dont use RED GREEN BLUE
here u have some nice ;)

PHP:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_NONE = 255

this u can find in global.lua (0.2 tfs)
Using newest TFS, 0.3.5? I get this error:
03:56 You lose 7337 mana.
03:56 You received 1621 mana.
I don't actually lose any mana, but it's disturbing.. :blink:
 
i think he made it to 0.2 =( and also u can rescript on 2 sec deleted line abt lose mana ;)
 
i think he made it to 0.2 =( and also u can rescript on 2 sec deleted line abt lose mana ;)

There is no line about lose mana. If its 2 sec job, maybe u could do it? It also shoves numbers at same time instead of one :O

tfs 0.3.5
 
Using newest TFS, 0.3.5? I get this error:

I don't actually lose any mana, but it's disturbing.. :blink:

There is no line about lose mana. If its 2 sec job, maybe u could do it? It also shoves numbers at same time instead of one :O

tfs 0.3.5

Lua:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.

function onUse(cid, item, frompos, item2, topos)
        
    minMana = 30 -- How much mana minium will you get?
    maxMana = 70 -- How much mana max will you get?
    magToUse = 4 -- What magic level do you need to be to use the rune?
    useStats = true -- Shall given mana be affected by player level and magic level?
    runeID = 2270 -- Enter the item Id of the rune.
    loseCharges = true -- Write "true" if it shall lose charges. If not, then write something else such as "false".
    storeValue = 3567 -- Value where exhaust is saved.
    exhaustTime = 2 -- 1 = 1 second of exhaustion.
    animationColor = 41 -- The color of the "animation".
    mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
    missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
    exhaustMsg = "You are exhausted." -- Appears when you are exhausted.

    if item.itemid == runeID then
        if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
            if getPlayerMagLevel(cid) >= magToUse then
                if (exhaust(cid, storeValue, 1) > 0) then
                    if loseCharges == true or loseCharges == True then
                        if item.type > 1 then
                            doChangeTypeItem(item.uid, item.type-1)
                        else
                            doRemoveItem(item.uid, 1)
                        end
                    end
                    newMana = math.random(minMana, maxMana)
                    if useStats then
                        newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
                    end
                    manaNow = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, 999999)
                    manaMax = getPlayerMana(item2.uid)
                    doPlayerAddMana(item2.uid, - manaMax + manaNow)
                    nMana = manaMax - manaNow
                    if newMana > nMana then
                        newMana = nMana
                    end
                    if getPlayerMana(item2.uid) == manaMax then
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doPlayerSendCancel(item2.uid, "Your mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        else
                            doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
                            doChangeTypeItem(item.uid, item.type)
                        end
                    else
                        if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
                            doSendMagicEffect(getPlayerPosition(cid), 12)
                            doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
                        else
                            doSendMagicEffect(getPlayerPosition(cid), 14)
                            doSendMagicEffect(getPlayerPosition(item2.uid), 12)
                            doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
                            doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
                        end
                        doPlayerAddMana(item2.uid, newMana)
                        doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
                    end
                else
                    doPlayerSendCancel(cid, exhaustMsg)
                end
            else
                doSendMagicEffect(getPlayerPosition(cid), 2)
                doPlayerSendCancel(cid, mLvlLowMsg)
            end
        else
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerSendCancel(cid, missPlayerMsg)
        end
        return 1
    end
end
  
  
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

Code:
<action itemid="2270" script="manarune.lua" allowfaruse="1" blockwalls="0" />
 
you can do sonting like that

function onGetFormulaValues(cid, level, maglevel)
local min = -((level*4.2)+(maglevel*5.2))
local max = -((level*4.2)+(maglevel*5.2))

return min, max
end



That is how much mana cure that..

plx do it.. i realy apress that

rep+ XD
 
My Simple Manarune

Lua:
local cfg =
{
    minMana = 100, -- Minimum Mana
    maxMana = 300, -- Maximum Mana
    rune = 2270, -- Rune ID Number
    expLevel = 100, -- Experience Level
    magLevel = 10 -- Magic Level
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local newMana = math.random(cfg.minMana, cfg.maxMana)
    if item.itemid == cfg.rune then
	if getPlayerMagLevel(cid) >= cfg.magLevel then
	    if getPlayerLevel(cid) >= cfg.expLevel then
		doPlayerAddMana(cid, newMana)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
		doSendAnimatedText(getCreaturePosition(cid), "+"".. newMana ..", TEXTCOLOR_RED)
	    else
		doPlayerSendCancel(cid, "You must be atleast level ".. cfg.expLevel .." to use this rune.")
	    end
	else
	    doPlayerSendCancel(cid, "You must have atleast magic level ".. cfg.magLevel .." to use this rune.")
	end
    end
    return TRUE
end

Special Effect:

+250 (Above Player)
 
Last edited:
Lua:
local cfg =
{
    minMana = 100, -- Minimum Mana
    maxMana = 300, -- Maximum Mana
    rune = 2270, -- Rune ID Number
    expLevel = 100, -- Experience Level
    magLevel = 10 -- Magic Level
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local newMana = math.random(cfg.minMana, cfg.maxMana)
    if item.itemid == cfg.rune then
	if getPlayerMagLevel(cid) >= cfg.magLevel then
	    if getPlayerLevel(cid) >= cfg.expLevel then
		doPlayerAddMana(cid, newMana)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
		doSendAnimatedText(getCreaturePosition(cid), "+"".. newMana ..", TEXTCOLOR_RED)
	    else
		doPlayerSendCancel(cid, "You must be atleast level ".. cfg.expLevel .." to use this rune.")
	    end
	else
	    doPlayerSendCancel(cid, "You must have atleast magic level ".. cfg.magLevel .." to use this rune.")
	end
    end
    return TRUE
end


guys why not makin your own threads and put your manarunes there?

i posted my manarune in my thread and you 2 post your manarune's in my thread..

what the hell.. make a own thread man
 
Last edited:
Back
Top