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

Mana request

Zatacka

Mapper, Basic Scripter
Joined
May 12, 2009
Messages
222
Reaction score
14
Location
Sweden
Hello guys i need a ring that gives 20% mana of the maximum mana every sec (Regeneration mana ring)
itemid: 10138
 
Only add this lines to the item:

Code:
		<attribute key="manaGain" value="500"/>
		<attribute key="manaTicks" value="2500"/>

500 = is the mana that gains in 2500 ticks (2.5 sec)

don't forged to add it in movements.xml

Code:
<movevent type="Equip" itemid="10138" slot="ring" event="function" value="onEquipItem"/>
 
yeah but how about the 20% of maximum mana?
Try this:
go to movements/scripts and create a manaring.lua and add this inside:
Lua:
local rate = 1.2 -- 1.1 = 10% / 1.2 = 20% and so on...

function onEquip(cid, item, slot)
    setCreatureMaxMana(cid, getCreatureMaxMana(cid) * rate)
  return TRUE
end

function onDeEquip(cid, item, slot)
    setCreatureMaxMana(cid, getCreatureMaxMana(cid) / rate)
  return TRUE
end

now go to movements.xml and add this:
Lua:
<movevent type="Equip" itemid="10138" slot="ring" event="script" value="manaring.lua">
<movevent type="DeEquip" itemid="10138" slot="ring" event="script" value="manaring.lua">

hope it helps = )
 
^ Not what he wants...

Here:

Lua:
<movevent type="Equip" itemid="10138" slot="ring" event="script" value="manaring.lua">
<movevent type="DeEquip" itemid="10138" slot="ring" event="script" value="manaring.lua">

Lua:
local configs = {
  percent = 20 -- percent of max mana that will be added
  interval = 5 -- time to add mana again
}
local function addMana(cid, interval)
if getCreatureMana(cid) < getCreatureMaxMana then
doCreatureAddMana(cid, getCreatureMaxMana(cid) * configs.percent / 100)
end
addEvent(addMana, interval, cid, interval)
return true
end

function onEquip(cid, item, slot)
addEvent(addMana, 0, cid, configs.interval)
return true
end

function onDeEquip(cid, item, slot)
stopEvent(addMana)
return true
end

Maybe that works... Hope it... xDDD
 
Back
Top