Ir para conteúdo
  • 0

Armar com roubo de Vida (não achei um meio correto pro tópico)


wenderotpoke

Pergunta

1 resposta a esta questão

Posts Recomendados

  • 0
Em 14/12/2019 em 12:35, wenderotpoke disse:
Versão do Servidor: TFS - 0.3.4
Tipo de Script: spell
Código:
  Ocultar conteúdo


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) >= 20 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

Galera seguinte eu quero que a arma cure baseado na metade dano que ela causa aqui nessa configuração ta curando quase nada....


Desculpa se o topico tiver no local errado não sabia onde colocar!

Nossa, o autor do script deixou bem complexo a conta rsrs, era mais fácil ter colocado o valor que ele queria direto em mat já que os número são constantes.

 

Tenta assim:

 

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 addhealth = skill / 2

if getPlayerLevel(cid) >= 20 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

 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...