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

Help with manarune.

Scootakid

New Member
Joined
Jun 6, 2009
Messages
32
Reaction score
0
I am looking for a level based, and magic level based manarune. I have a script, but I want it to be an action, so I can use healing spells at the same time, if I'm correct. Can someone give me a script to put in actions or edit this to be put in actions?

HTML:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)

local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local pos = getPlayerPosition(cid)

-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local mana_minimum = (level * 1) + (mlevel * 1) - 50
local mana_maximum = (level * 1.2) + (mlevel * 1)
-- Mana Formula Settings END --
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
return doCombat(cid, combat, var)
end
 
You can even make it like a normal rune and have it with a different exhaustion from the healing ones...

Check out first if in spells.xml in the rune's config. You've something that says: " exhaustion="1000" " if u have that... then follow this steps:

1. Put that equivalent to 0. So that, it would be something like this:
Code:
<rune name="ManaRune" id="2295" allowfaruse="1" charges="5" lvl="8" maglv="0" exhaustion="0" needtarget="1" blocktype="solid" script="manarune.lua"></rune>

2. Go to spells/lib and add this in the top:
Code:
-- ManaRune exhausted
function exhaust(cid, storevalue, exhausttime)
-- Returns 1 if not exhausted and 0 if exhausted
    
    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 or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end

3. Then.. Inside the code of your manarune add:
Code:
local storevalue = 37752 
local exhausttime = 1

Note that the "exhausttime" is in seconds.. So, if you want like .5 seconds of exhausted.. Just put "0.5". And, the storevalue must be a storage value that is not used, yet...

As I see, the code of the manarune would be something like this:
Code:
local storevalue = 37752 
local exhausttime = 1

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)

local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local pos = getPlayerPosition(cid)

-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local mana_minimum = (level * 1) + (mlevel * 1) - 50
local mana_maximum = (level * 1.2) + (mlevel * 1)
-- Mana Formula Settings END --
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
return doCombat(cid, combat, var)
end

Try that... If it doesn't work or u still want it to be an action.. Tell me and I'll try to make it an action x)
 
I found an actions file, I tried this but im trying to be able to use the rune and healing spells at the same time. i made the rune a potion. the actions file script works like i need it to but i need it edited. if you think you could edit it that would be great, all the info on what i would like is on the thread.

http://otland.net/f16/please-edit-script-62230/
 
The script I give you will give you the possibility to use healing spells at the same time... What it does is to make another exhausted value.. So, it would be:
Offensive Exhausted
Healing Exhausted
and.. ManaRune Exhausted
 
Check in your config.lua if you have something like this:

Code:
Animated spells? (yes/no)

Search something like that, it doesn't need to be exactly the same... When you find that, put it to "yes". And that's it :)

PS. No all the distros have that option...
 
Back
Top