• 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 0.3.6pl1

Muniek

Hello Kitty
Joined
Jan 14, 2009
Messages
58
Reaction score
0
Location
Poland, Bydgoszcz
Hi! I'm looking for manarune which is going down and can count charges. I think that should be in spells folder. My engine is TFS 0.3.6pl1. Someone have script?
 
damn he wants a real manarune, hold on buddy, i have one, i'll do test then i post here..

on actions/scripts/custom/manarune.lua

Code:
function onUse(cid, item, frompos, item2, topos)

minMana = 50
maxMana = 400
bigmana = 2 -- Multiplier according to small manarune
storevalue = 1986
exhaustion = 2
smallruneid = 2275
bigruneid = 2276

if (item.itemid == smallruneid) then
-- Normal mana rune (with my settings: 80-120 mana, 100 on average)
exhast = exhaust(cid, storevalue, exhaustion)
if (exhast == 0) then
doPlayerSendCancel(cid, "You are exhausted.")
else
if (getPlayerAccess(item2.uid) >= 0) then

if (item.type > 1) then
doChangeTypeItem(item.uid, item.type-1)
elseif (getPlayerAccess(cid) >= 0) then
doRemoveItem(item.uid, 1)
end

mana = math.random(minMana, maxMana)
if (topos.x ~= getPlayerPosition(cid).x or topos.y ~= getPlayerPosition(cid).y or topos.z ~= getPlayerPosition(cid).z) then
doPlayerSendTextMessage(item2.uid, 20, getPlayerName(cid).." gave you "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

doPlayerSendTextMessage(cid, 20, "You gave "..getPlayerName(item2.uid).." "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

storemana = getPlayerStorageValue(item2.uid, 444) + mana
setPlayerStorageValue(item2.uid, 444, storemana)
else
doPlayerSendTextMessage(item2.uid, 20, "You received "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

storemana = getPlayerStorageValue(cid, 444) + mana
setPlayerStorageValue(cid, 444, storemana)
end

if (getPlayerAccess(cid) >= 1) then
doPlayerSendTextMessage(item2.uid, 20, getPlayerName(cid).." gave you "..mana.." mana.")
end

doPlayerAddMana(item2.uid, mana)
else
doPlayerSendCancel(cid, "You can only use this rune on players.")
end
end
return 1

elseif (item.itemid == bigruneid) then
-- Normal mana rune (with my settings: 240-360 mana, 300 on average)

exhast = exhaust(cid, storevalue, exhaustion)
if (exhast == 0) then
doPlayerSendCancel(cid, "You are exhausted.")
else
if (getPlayerAccess(item2.uid) >= 0) then
-- Decrease charges - remove if 0
if (item.type > 1) then
doChangeTypeItem(item.uid, item.type-1)
elseif (getPlayerAccess(cid) >= 0) then
doRemoveItem(item.uid, 1)
end

mana = math.random(minMana*bigmana, maxMana*bigmana)
if (topos.x ~= getPlayerPosition(cid).x or topos.y ~= getPlayerPosition(cid).y or topos.z ~= getPlayerPosition(cid).z) then
doPlayerSendTextMessage(item2.uid, 20, getPlayerName(cid).." gave you "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

doPlayerSendTextMessage(cid, 20, "You gave "..getPlayerName(item2.uid).." "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

storemana = getPlayerStorageValue(item2.uid, 444) + mana
setPlayerStorageValue(item2.uid, 444, storemana)
else
doPlayerSendTextMessage(item2.uid, 20, "You received "..mana.." mana.")
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", 198)
doSendMagicEffect(topos, 12)
doSendMagicEffect(topos, 12)

storemana = getPlayerStorageValue(cid, 444) + mana
setPlayerStorageValue(cid, 444, storemana)
end

if (getPlayerAccess(cid) >= 1) then
doPlayerSendTextMessage(item2.uid, 20, getPlayerName(cid).." gave you "..mana.." mana.")
end

doPlayerAddMana(item2.uid, mana)
else
doPlayerSendCancel(cid, "You can only use this rune on players.")
end
end
return 1

else
return 0
end
end

function exhaust(cid, storevalue, exhausttime)
-- Returns 1 if not exhausted and 0 if exhausted

newExhaust = os.time()
oldExhaust = getPlayerStorageValue(cid, storevalue)
if (lastexhaust == nil or lastexhaust < 0) then
lastexhaust = 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

on Actions.xml

Code:
<action itemid="2275" script="custom/manarune.lua" allowfaruse="1" blockwalls="0" /> -- manarune --
	<action itemid="2276" script="custom/manarune.lua" allowfaruse="1" blockwalls="0" /> -- big manarune --

Credits to PYRO

this is 2x1 manarune, i hope you can use it.

Rep if i helped :p
 
Last edited:
Thanks! Nice script and it's running. xd rep++
But it doesn't count charges. Can you fix it or tell me what i must do.(ex. in actions.xml)

Edit:

Hmm... Perhaps you edit this manarune, like that you can't add mana other player?
 
Last edited:
Back
Top