Ir para conteúdo

Featured Replies

Postado

Base: 0.4

Antes de começar, eu sei que tem 500 posts assim aqui no fórum e vai por mim, eu teste todos eles e ainda não ficou "perfeito"

O que eu queria era um lifesteal que o heal fosse de acordo com o hit do player, por exemplo, se ele hitou 500 do bicho, e o lifesteal ta com 50%, ele curaria 250 de vida, se ele hitasse 502, curaria 251.

 

Tem script que coloca hit mínimo e hit máximo, mas eu queria que fosse de acordo com o ataque da arma, ou seja, do quanto que o player hitou do bicho

 

Eu tenho uma scrip aqui que quase funcionou, mas o problema e que ele cura voce um valor fixo independente de quanto voce hitou:

Citar

    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_SWORD)
    local mat = 0.085*0.5*50*skill+(getPlayerLevel(cid)/5)
    local min = 100 
    local max = 100 
    local addhealth = math.random((mat * (min/100)), (mat * (max/100)))
 
    if getPlayerLevel(cid) >= 20 then
        doCreatureAddHealth(cid, addhealth)
        doCombat(cid, combat, var)
    else
        doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
    end
end

 

 

  • Respostas 6
  • Visualizações 803
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado

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_SWORD) -- 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 = 5 -- this means 5% minimum healing
local max = 15 -- this means 15% maximum healing
local dmg = math.random((mat * (min/100)), (mat * (max/100)))

if getPlayerLevel(cid) >= 20 then
local target = getCreatureTarget(cid)
doCreatureAddHealth(target, -dmg)
doCreatureAddHealth(cid, (math.ceil(dmg/2)))
doSendAnimatedText(getPlayerPosition(target),"-"..dmg.."", TEXTCOLOR_RED)
doSendMagicEffect(getThingPos(target), 0)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end
 

ta na mão

Toda terça-feira um tópico novo:

Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/

Peça sua spell (Suporte):                https://tibiaking.com/forums/topic/84162-peça-sua-spell/                        

Chuva de flechas (Spell):                https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/

Doom (Spell):                                https://tibiaking.com/forums/topic/51622-doom-spell/

Utilização do VS Code (Infra)       https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/

SD com Combo (Spell):                 https://tibiaking.com/forums/topic/94520-sd-modificada/

Alteração attack speed (C++):        https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/  

Bônus de Speed (NPC)                  https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
 

Postado

image.thumb.png.0334fdf41bda0d2b2db0146fa68668a3.pngimage.thumb.png.6e33ebe581c1d7f717b4a613f7ba2596.png

pra mim ta funcionando certinho, vc testou?

 

 

Toda terça-feira um tópico novo:

Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/

Peça sua spell (Suporte):                https://tibiaking.com/forums/topic/84162-peça-sua-spell/                        

Chuva de flechas (Spell):                https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/

Doom (Spell):                                https://tibiaking.com/forums/topic/51622-doom-spell/

Utilização do VS Code (Infra)       https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/

SD com Combo (Spell):                 https://tibiaking.com/forums/topic/94520-sd-modificada/

Alteração attack speed (C++):        https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/  

Bônus de Speed (NPC)                  https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
 

Postado
  • Autor
Em ‎09‎/‎06‎/‎2018 em 20:41, Zazeros disse:

@Reds Cara, essa é literalmente o script que eu postei como base. Ele funciona bem, mas o único problema é que parece que ele calcula o lifesteal indiferente do dano que a pessoa inflige no mob 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo