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

Converting mana stage to uh > [Request]

Ekholmen

New Member
Joined
Dec 12, 2010
Messages
52
Reaction score
0
Location
Sweden
Code:
local t = {
	[{1,35}] = {150,150},
	[{51,100}] = {150,250},
	[{101,250}] = {250,400},
	[{251,350}] = {400,600},
	[{450,550}] = {600,750},
	[{551,650}] = {750,1000},
	[{650,math.huge}] = {1000,1300}
}
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 500)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEAL)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	elseif not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
 
	local lvl = getPlayerLevel(cid)
	for k, v in pairs(t) do
		if lvl >= k[1] and lvl <= k[2] then
			doPlayerAddHealth(itemEx.uid,math.random(v[1], v[2]))
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			doAddCondition(cid, exhaust)
						return true
		end
	end
end




already changed DoPlayerAddMana to DoplayeraddHealth


what more should i change i want it to give hp?
 
Back
Top