Ir para conteúdo

Pergunta

 

Olá, a todos, eu tenho esse script aqui por creaturescripts, gostaria de pedir um pequeno favor, que seria trocar essa condição que só usa quando tiver menos de 100 de vida, gostaria pedir para me colocarem a condição se o jogador tiver 10% de vida, ao invéz de 100 de vida, só isso, agradeço pela atenção!.

Segue abaixo o script

 

local magia = "Magic Shield" local storage = 55695  function onStatsChange(cid, attacker, type, combat, value)    if isPlayer(cid) then        if getPlayerStorageValue(cid, storage) == 1 then            if combat ~= COMBAT_HEALING then                if getCreatureHealth(cid) < 100 then                    doCreatureCastSpell(cid, magia)                end            end        end    endreturn trueend

 

Link para o comentário
https://xtibia.com/forum/topic/241386-passiva-por-porcentagem/
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 1

 

local magia = "Magic Shield" local storage = 55695  function onStatsChange(cid, attacker, type, combat, value)    local calc = (getCreatureMaxHealth(cid) / 100) * 10        if isPlayer(cid) then        if getPlayerStorageValue(cid, storage) == 1 then            if combat ~= COMBAT_HEALING then                if getCreatureHealth(cid) <= calc then                    doCreatureCastSpell(cid, magia)                end            end        end    end        return trueend

 

Link para o comentário
https://xtibia.com/forum/topic/241386-passiva-por-porcentagem/#findComment-1699277
Compartilhar em outros sites

  • 1

 

local magia = "Magic Shield" local storage = 55695  function onStatsChange(cid, attacker, type, combat, value)    local calc = (getCreatureMaxHealth(cid) / 100) * 10        if isPlayer(cid) then        if getPlayerStorageValue(cid, storage) == 1 then            if combat ~= COMBAT_HEALING then                if getCreatureHealth(cid) <= calc then                    doCreatureCastSpell(cid, magia)                end            end        end    end        return trueend

 

Link para o comentário
https://xtibia.com/forum/topic/241386-passiva-por-porcentagem/#findComment-1699278
Compartilhar em outros sites

×
×
  • Criar Novo...