• 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 for Avesta 7.6

Create a file called manarune.lua and paste the code below in it.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)

local min_value = 200
local max_value = 500

mana = math.random(min_value, max_value)
doPlayerAddMana(cid, mana)
doPlayerSay(cid, "Aaaah...", 1)  

	return doCombat(cid, combat, var)
end

Now in spells.xml

PHP:
<rune name="WHATEVER HERE" id="2298" maglv="4" needtarget="1" aggressive="0" allowfaruse="1" charges="5" script="manarune.lua">
</rune>
 
It don't work here.


But i got one that works:

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 1 then
doSendMagicEffect(topos,1)
doPlayerSay(cid,"Ahhhh....",16)
doPlayerAddMana(cid, 250)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"VocÊ não tem ML requerido para usar esta mana.")
end
return 1
end


But, the problem is that i can use it only 1 time, where i change it to use more than 1 time?
 
Back
Top