Ir para conteúdo

Featured Replies

Postado

Boa tarde, preciso da ajuda de vocês.

 

Tentei bloquear a spell Healarea em certas situações não consegui.

 

Gostaria que o player que tivesse com a storage 990, seu summon não seria healado pela spell.

 

Por exemplo: Sou o player 1, tenho o Clefable, pokemon que tem a spell de Healarea, quando o poke usar tal spelll, player que possuem a storage 990, seus summons não são healados.

 

Alguém pode me ajudar?

 

Segue abaixo o script da spell.

 

 

 Healarea:

	local function doHealArea(cid, min, max)
    local amount = math.random(min, max)
    if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
        amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
    end
    if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
       doCreatureAddHealth(cid, amount)
       doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
    end
    end
    
	doSendMagicEffect(getThingPosWithDebug(cid), 132)
    doHealArea(cid, min, max)
    
	
elseif spell == "Healarea" then
	
	local min = (getCreatureMaxHealth(cid) * 50) / 100
	local max = (getCreatureMaxHealth(cid) * 60) / 100
    
    local function doHealArea(cid, min, max)

    local amount = math.random(min, max)
    if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
        amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
    end
    if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
       doCreatureAddHealth(cid, amount)
       doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
    end
    end
    
    local pos = getPosfromArea(cid, heal)
    local n = 0
    doHealArea(cid, min, max)
    
    while n < #pos do
    n = n+1
    thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
    local pid = getThingFromPosWithProtect(thing)
    
    doSendMagicEffect(pos[n], 12)

    if isCreature(pid) then
       if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
          if canAttackOther(cid, pid) == "Cant" then
             doHealArea(pid, min, max)
          end 
       elseif ehMonstro(cid) and ehMonstro(pid) then
          doHealArea(pid, min, max)
       end
    end 
    end

                                                                                               1zcn2mb.jpg

 

                                                                                                                       Danera Global Server

                                                                                                                       Versão: 10.77 - 10.79

                                                                                                                       Sem Items VIP

                                                                                                                       Venha se divertir

Resolvido por Nextbr

Ir para solução
  • Respostas 9
  • Visualizações 616
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

Testa ae:

Mostrar conteúdo oculto

local function doHealArea(cid, min, max)


local amount = math.random(min, max)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end

doSendMagicEffect(getThingPosWithDebug(cid), 132)
doHealArea(cid, min, max)


elseif spell == "Healarea" then

local min = (getCreatureMaxHealth(cid) * 50) / 100
local max = (getCreatureMaxHealth(cid) * 60) / 100

local function doHealArea(cid, min, max)

local amount = math.random(min, max)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end

local pos = getPosfromArea(cid, heal)
local n = 0
doHealArea(cid, min, max)

while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
local pid = getThingFromPosWithProtect(thing)

doSendMagicEffect(pos[n], 12)

if isCreature(pid) then
if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
if canAttackOther(cid, pid) == "Cant" then
doHealArea(pid, min, max)
end
elseif ehMonstro(cid) and ehMonstro(pid) then
doHealArea(pid, min, max)
------- Edited ------
elseif ehMonstro(cid) and ehMonstro(pid) and getPlayerStorageValue(cid, 990) >= 1 then
doHealArea(pid, 0, 0)
print("Test")
------ Edited -----
end
end
end

 

 

Postado
  • Autor

Healou normal e não deu print em nada

                                                                                               1zcn2mb.jpg

 

                                                                                                                       Danera Global Server

                                                                                                                       Versão: 10.77 - 10.79

                                                                                                                       Sem Items VIP

                                                                                                                       Venha se divertir

Postado

Mostrar conteúdo oculto

local function doHealArea(cid, min, max)


local amount = math.random(min, max)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end

doSendMagicEffect(getThingPosWithDebug(cid), 132)
doHealArea(cid, min, max)


elseif spell == "Healarea" then

local min = (getCreatureMaxHealth(cid) * 50) / 100
local max = (getCreatureMaxHealth(cid) * 60) / 100

local function doHealArea(cid, min, max)

local amount = math.random(min, max)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end

local pos = getPosfromArea(cid, heal)
local n = 0
doHealArea(cid, min, max)

while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
local pid = getThingFromPosWithProtect(thing)

doSendMagicEffect(pos[n], 12)

if isCreature(pid) then
if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then
if canAttackOther(cid, pid) == "Cant" then
doHealArea(pid, min, max)
elseif isSummon(cid) and getPlayerStorageValue(cid, 990) >= 1 then
doHealArea(cid, 0, 0)
print("Test")
elseif ehMonstro(cid) and ehMonstro(pid) then
doHealArea(pid, min, max)

end
end
end
end

 

 

Postado
  • Autor

------- Edited ------
elseif ehMonstro(cid) and ehMonstro(pid) or getPlayerStorageValue(getCreatureMaster(pid), 990) >= 1 then
doHealArea(pid, 0, 0)
print("Test")
------ Edited -----
end

 

 

Esseu deu print, mas continuou healando. Vou testar esse ultimo que vc passou.

                                                                                               1zcn2mb.jpg

 

                                                                                                                       Danera Global Server

                                                                                                                       Versão: 10.77 - 10.79

                                                                                                                       Sem Items VIP

                                                                                                                       Venha se divertir

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo