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

Temple Potions

sebbe hbk

Mapper - Hoster
Joined
Sep 1, 2009
Messages
164
Reaction score
3
Location
I ditt garage
Hey

I need help with: I want to have potions in the temple, if you right-click on it you will get full HP and another for Mana..

Please make a easy tutorial:p

Rep++
 
Here try this.

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local mana = getCreatureMaxMana(cid)
local maxheal = (mana * 0.05)
local min,max = 1+getPlayerLevel(cid)*0.4+maxheal , 50+getPlayerLevel(cid)*0.6+maxheal

if exhaustion.check(cid,1990) == true then
min = min * 1.25
max = max * 1.25
end

local random = math.random(min, max)
doPlayerAddMana(cid, random)
return doCombat(cid, combat, var)
end

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local health = getCreatureMaxHealth(cid)
local maxheal = (health * 0.05)
local min,max = 1+getPlayerLevel(cid)*0.4+maxheal , 50+getPlayerLevel(cid)*0.6+maxheal

if exhaustion.check(cid,1990) == true then
min = min * 1.25
max = max * 1.25
end

local random = math.random(min, max)
doPlayerAddHealth(cid, random)
return doCombat(cid, combat, var)
end

Make 2 new files in data/actions/scripts. Then put 1 script in 1 file and the other in the other file.

Then open your actions.xml and post these in there.
XML:
<action itemid="    " event="script" value="           "/>
<action itemid="    " event="script" value="           "/>
itemid = the id of the item you want people to click on to heal themselves.
Make them different items.
value = name of the 2 files you just made with the scripts i gave you.

I didn't test these, so if you get any errors please show them.
 
Back
Top