Ir para conteúdo
  • 0

coloca pra dar mana para o player aqui


milos otzero

Pergunta

ta curando life , quero que cure mana !  tfs 0.3.6

 

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addhealth = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doCreatureAddHealth(cid, addhealth)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end

Editado por milos otzero
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0
  • Diretor

Mana no lugar de health? aqui:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addmana = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doCreatureAddMana(cid, addmana)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end

Caso queira ambos:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onUseWeapon(cid, var)
local skill = getPlayerSkill(cid,SKILL_AXE) -- Change this to the type of weapon you are using
local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5) -- Change 50 to the attack of the weapon
local min = 25 -- this means 5% minimum healing
local max = 40 -- this means 15% maximum healing
local addhealth = math.random((mat * (min/100)), (mat * (max/100)))
local addmana = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 5 then
doCreatureAddHealth(cid, addhealth)
doCreatureAddMana(cid, addmana)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...