exanime
I´m learning Lua
hello I would like to you can run this script because I want to do is the percentage of recharge mana and health when different levels , but I can not because I want element placed in the armor recharge blood every 2 seconds mana, but I manage not to run , I hope you can help me , this is my base. sorry for my bad English .
Code:
--percentage health--
local i = getCreatureMaxHealth(cid)
local a = 300
local b = 500
local c = math.random((i * (a/100)), (i * (b/100)))
--percentage Mana--
local j = getCreatureMaxMana(cid)
local d = 300
local e = 500
local f = math.random((j * (d/100)), (j * (e/100)))
--exhaust charge--
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 15000)
setCombatCondition(combat, exhaust)
--function for boots--
function onEquip(cid, item, slot)
if item.itemid == 4928 then
doPlayerAddSpentMana(cid, c)
doCreatureAddHealth(cid, f)
getCreatureCondition(cid, exhaust)
doAddCondition(cid, exhaust)
doAddCondition(cid, regeneration)
doSendMagicEffect(CONST_ME_MAGIC_BLUE)
else
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "quita las boot y pontelas de nuevo.")
return false
end
end
Last edited: