Jump to content
  • 0

se eu usa-la em min heala 75 % de life agora se eu usala em


Wiihtop

Question

galera precisso de uma action assim, se eu usar ela em min, eu ireia healar 75 % da minha vida

agora se eu usar em algum inimigo eu irei rancar 70 % de life e 70% de mana, e quero que tenha enxausted de 400 secundos

porfavor

agradeço desdeja

rep++ !!

 

<#3

versao do tibia 8.54

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0


local exhaust = 400

 

function onUse(cid, item, fromPos, itemEx)

if isPlayer(itemEx.uid) then

if os.time() > getPlayerStorageValue(cid, 1092763) + exhaust then

if itemEx.uid == cid then

local maxHealth = getCreatureMaxHealth(cid)

doCreatureAddHealth(cid, 0.75 * maxHealth)

else

local maxHealth, maxMana = getCreatureMaxHealth(itemEx.uid), getCreatureMaxMana(itemEx.uid)

local damage = maxHealth * 0.7

local manaDamage = maxMana * 0.7

doTargetCombatHealth(cid, itemEx.uid, COMBAT_UNDEFINEDDAMAGE, - damage, - damage, CONST_ME_DRAWBLOOD)

doTargetCombatMana(cid, itemEx.uid, - manaDamage, - manaDamage, CONST_ME_ENERGYHIT)

end

setPlayerStorageValue(cid, 1092763, os.time())

doRemoveItem(item.uid, 1)

else

doPlayerSendCancel(cid, "You are exhausted.")

doSendMagicEffect(getThingPos(cid), 2)

end

else

doPlayerSendCancel(cid, "You may only use this potion on players.")

end

return true

end

Link to comment
Share on other sites

×
×
  • Create New...