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

Help with healing tile

Xleniz

New Member
Joined
Jul 6, 2009
Messages
178
Reaction score
3
Location
Sweden
I need help with healing tile (click on tile and it heals):

here's code:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
function onGetFormulaValues(cid, level, maglevel)
	return - level * 5, - level * 8
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUse(cid, item, fromPosition, itemEx, toPosition)
	return doCombat(cid, combat, positionToVariant(getPlayerPosition(cid)))
end

nothing happens when used.

Thx.
 
Try this one:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local lvl,mlvl = getPlayerLevel(cid),getPlayerMagLevel(cid)
local min,max = lvl * 3 + mlvl * 2, lvl * 5 + mlvl * 4
doAreaCombatHealth(0,COMBAT_HEALING,getCreaturePosition(cid), 0, min, max, 12)
return true
end

I just set a random formula for min and max healing. You can either change the formula or set a static min and max healing like 50 min and 200 max:
Code:
local min,max = 50, 200
 
If you want to heal player full use this:
Code:
local min, max = getCreatureMaxHealth(cid), getCreatureMaxHealth(cid)

if you want by lvl,mlvl formula use the script with:

Code:
local min,max = lvl*3+mlvl*2, lvl*5+mlvl*4

This is minimum healing: lvl*3+mlvl*2
This is maximum healing: lvl*5+mlvl*4
Just edit the formulas..
 
Back
Top