• 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! / How to fix so you can't use it on others?

Rollern

Intermediate OT User
Joined
Sep 8, 2010
Messages
409
Reaction score
130
As the topic says, I wan't to disable the function to heal others mana.

So you can only use it on yourself.

I have this in actions:

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 REMOVE_CHARGES = true -- true/false shall it remove charges?
local MIN_MANA = 50 -- How much mana minium will you get?
local MAX_MANA = 150 -- How much mana max will you get?
local USE_STATS = false -- Shall given mana be affected by player level and magic level?
local STORE_VALUE = 3567 -- Value where exhaust is saved.
local EXHAUST_TIME = 1 -- Exhaust time in seconds.
local ANIMATION_COLOR = 58 -- The color of the "animation".
-- >>CONFIG<< --

local vocMultiply = {0.35, 0.35, 0.85, 1.05, 0, 0, 0.65, 1.05} -- Remove and/or comment it out if you wish not to use it.
local removeMana = 0

function onUse(cid, item, frompos, item2, topos)
if isPlayer(item2.uid) == 1 then
local maxMana = getPlayerMaxMana(item2.uid)
if vocMultiply and getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 8 then
removeMana = vocMultiply[getPlayerVocation(cid)]
end
local newMana = math.random(MIN_MANA, MAX_MANA)
if USE_STATS then
newMana = math.ceil(newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid) - (newMana * removeMana))
end
if (maxMana - newMana) < 0 then
newMana = maxMana - getPlayerMana(cid)
end
if getPlayerMana(item2.uid) < maxMana then
if exhaust(cid, STORE_VALUE, EXHAUST_TIME) > 0 then
if REMOVE_CHARGES then
if item.type > 1 then
doChangeTypeItem(item.uid, item.type - 1)
else
doRemoveItem(item.uid, 1)
end
end
if comparePos(getPlayerPosition(cid), getPlayerPosition(item2.uid)) then
doPlayerSay(cid, "Aaaah...", 1)
doSendMagicEffect(getPlayerPosition(cid), 1)
else
doPlayerSay(cid, "Get Some...", 1)
doSendMagicEffect(getPlayerPosition(cid), 7)
doSendMagicEffect(getPlayerPosition(item2.uid), 1)
end
doPlayerAddMana(item2.uid, newMana)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
else
if comparePos(getPlayerPosition(cid), getPlayerPosition(item2.uid)) then
doPlayerSendCancel(item2.uid, "Your mana is already full.")
else
doPlayerSendCancel(cid, getPlayerName(item2.uid) .. " mana is already full.")
end
doSendMagicEffect(getPlayerPosition(cid), 2)
end
else
doPlayerSendCancel(cid, "You can only use this rune on players.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return 1
end

- - - Updated - - -

PS. Using Avesta 7.6 distro!
 
I think you can use it on others because you're using a rune id which is in some group called ITEM_GROUP_RUNE.

Can you test maybe using other id than a rune? (just for testing)

And by the way, why are you even using mana rune?
 
Hi.

I'm using manarune because I have runes stacked, which means you can have a 100x SD. So I want to make it fair and use a 100x mana. I rather use manafluid but :p

- - - Updated - - -

Is it possible to use manafluid and get 100x?

- - - Updated - - -

Or the look of manafluid!
 
I don't think it is impossible but at the moment all I can think of is using storage ... but hmm ... I will write here if I come up with solutions xD
 
if isPlayer(item2.uid) == 1

This part is checking if the target is a player, That's why it heal others too.
Right now I can't help you a little more because I'm having some problems with my server <_<

I'm not sure BUT! For what I saw (little), I think if you remove this line if isPlayer(item2.uid) == 1 then
AND change any (item2.uid) for (cid) you are ready to go.
 
Back
Top