Hello.
I got a old script from my 0.2 server, i would like to add my manarune like this, it will be adding people mana depending on mag lvl/vocation
also i will upload the 0.3 manarune i use right now, if anyone please could add it for me.
0.2 manarune is in "spells"
0.3 manarune is a "action"
0.2 script V
0.3 manarune script an "action"
I got a old script from my 0.2 server, i would like to add my manarune like this, it will be adding people mana depending on mag lvl/vocation
also i will upload the 0.3 manarune i use right now, if anyone please could add it for me.
0.2 manarune is in "spells"
0.3 manarune is a "action"
0.2 script V
Code:
-- Script 100% by Colandus (Except for the exhaustion system).
-- If you edit this script, make sure to leave the credits to me, Colandus.
-- >>CONFIG<< --
--local ACCESS = {NO_REMOVE = 5, NO_EXHAUST = 5} -- The access of players that does not lose charges/get exhausted using the rune.
local MIN_MANA = 800 -- How much mana minium will you get?
local MAX_MANA = 1600 -- How much mana max will you get?
local STORE_VALUE = 3568 -- Value where exhaust is saved.
local EXHAUST_TIME = 2 -- Exhaust time in seconds.
local ANIMATION_COLOR = 41 -- The color of the "animation".
-- >>CONFIG<< --
local vocMultiply = {0.35, 0.35, 0.85, 1.05, 0, 0, 0.65, 0.80}
function onCastSpell(cid, var)
local removeMana = 0
local pos = getCreaturePosition(cid)
if variantToNumber(var) == cid then
-- if isExhausted(cid, STORE_VALUE, EXHAUST_TIME) == FALSE then
local maxMana = getPlayerMaxMana(cid)
if getPlayerMana(cid) < maxMana then
local randMana = math.random(MIN_MANA, MAX_MANA)
if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 8 then
removeMana = vocMultiply[getPlayerVocation(cid)]
end
local newMana = math.ceil(randMana + getPlayerLevel(cid) * 1.2 + getPlayerMagLevel(cid) * 1.5 - (randMana * removeMana))
if getPlayerMana(cid) + newMana > maxMana then
newMana = maxMana - getPlayerMana(cid)
end
0.3 manarune script an "action"
Code:
function onUse(cid, item, frompos, item2, topos)
if isExhausted(cid, 4231133, 1) == 1 then
warnPlayer(cid, "You are exhausted.")
elseif getPlayerLevel(cid) >= 50 then
local chance = math.random(1, #text)
local mana = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 5) + getPlayerMagLevel(cid) * 30
local mana = math.random(1800, 2500)
local chance1 = math.random(1, #textcolor)
local pos = getCreaturePosition(cid)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
for x = -1, 1 do
for y = -1, 1 do
if(x ~= 0 and y ~= 0) then
for i = 1, 1 do
doSendDistanceShoot(pos, {x = pos.x + x * i, y = pos.y + y * i, z = pos.z}, 3)
end
doSendDistanceShoot(pos, {x = pos.x + x * 2, y = pos.y + y * 2, z = pos.z}, 35) --
--doSendMagicEffect({x = pos.x + x * 6, y = pos.y + y * 6, z = pos.z}, CONST_ME_FIREAREA)
end
end
end
doPlayerAddMana(cid, mana)
doSendAnimatedText(pos, mana, TEXTCOLOR_ORANGE)
--doSendAnimatedText(pos, text[chance], textcolor[chance1])
for i = 1, 3 do
doSendMagicEffect(pos, effect[i][math.random(1, #effect[i])])
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Refilled " ..mana.." mana!")
setExhaust(cid, 4231133, 1)
else
warnPlayer(cid, "Your level is too low.")
end
return TRUE
end