Jump to content
  • 0

[ Ajuda ] Script Spell Healarea Poketibia Não está Healando no Pvp


gabrielzika

Question

Espero Que Alguem Me Ajude , Observe o Clefable com essa Spell Heala Fora do Pvp mas no PVP não heala :/ Alguem Poderia me Ajudar?

 

Aqui a Spell

 

 

elseif spell == "Healarea" then
local min = (getCreatureMaxHealth(cid) * 30) / 100
local max = (getCreatureMaxHealth(cid) * 50) / 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

@Up

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

esse script está incompleto.

 

o elseif só vem depois de um if, que não estou achando.

elseif spell == "Healarea" then

por acaso você tem essas funções?

 

ehMonstro()
getPosfromArea
Edited by Caronte
Link to comment
Share on other sites

  • 0

Tente assim e me diga se funcionou:

 

 

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
Link to comment
Share on other sites

  • 0

@@Caronte

 

o Script Está Completo Sim ele fica no Arquivo Pokemon Moves.lua junto com Muitas outras Spell , Essa Spell Heala os Players eos Pokemons em qualquer Lugar Menos na Area de PVP

 

@@samlecter

 

Irei Testar, Mas poderia dizer oq tu mudou nele?

 

Praticamente tudo '-' , mas vai funcionar igual o seu só que sem bugs, se quiseer alterar a quantidade que cura, aconselho pelo configuration na propia spell, mas da pra mudar aqui também:

 

 

 local min = (getCreatureMaxHealth(cid) * 50) / 100
local max = (getCreatureMaxHealth(cid) * 60) / 100 
Link to comment
Share on other sites

  • 0

Se reala seu pokemon e nao reala os outros entao verifique a funçao canAttackOther(cid, pid) porque ali tem uma checagem pra isso procure a sua e arrume.

 

função que achei?

 

 

function canAttackOther(cid, pid) --Function q verifica se um poke/player pode atacar outro poke/player

if not isCreature(cid) or not isCreature(pid) then return "Cant" end

local master1 = isSummon(cid) and getCreatureMaster(cid) or cid
local master2 = isSummon(pid) and getCreatureMaster(pid) or pid

----
if getPlayerStorageValue(master1, 6598754) >= 5 and getPlayerStorageValue(master2, 6598754) >= 5 then
if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then
if isDuelingAgainst(master1, master2) then --alterado v1.8
if isSummon(cid) and isPlayer(pid) then
return "Cant"
else
return "Can"
end
end
end
end
---- pvp system
if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then
return "Can"
end
if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then ---estar em times diferentes
return "Can"
end
----
if ehMonstro(cid) and ehMonstro(pid) then
return "Can"
end

return "Cant"
end

 

Link to comment
Share on other sites

  • 0

@@nociam

 

Vamos se por se eu tiver em qualquer lugar do Mapa Exceto Pvp o Healarea Funciona Normal heala de boa agr se eu tiver no pvp e usar pra me curar Não Cura :/ tem como me Ajudar ? :/

 

no Meu tá assim:

 

function canAttackOther(cid, pid) --Function q verifica se um poke/player pode atacar outro poke/player
if not isCreature(cid) or not isCreature(pid) then return "Cant" end
local master1 = isSummon(cid) and getCreatureMaster(cid) or cid
local master2 = isSummon(pid) and getCreatureMaster(pid) or pid
----
if getPlayerStorageValue(master1, 6598754) >= 5 and getPlayerStorageValue(master2, 6598754) >= 5 then
if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then
if isDuelingAgainst(master1, master2) then --alterado v1.8
if isSummon(cid) and isPlayer(pid) then
return "Cant"
else
return "Can"
end
end
end
end
---- pvp system
if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then
return "Can"
end
if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then ---estar em times diferentes
return "Can"
end
----
if getTileInfo(getThingPos(cid)).pvp then
return "Can"
end
if ehMonstro(cid) and ehMonstro(pid) then
return "Can"
end
return "Cant"
end
Edited by gabrielzika
Link to comment
Share on other sites

  • 0
function canAttackOther(cid, pid) --Function q verifica se um poke/player pode atacar outro poke/player


if not isCreature(cid) or not isCreature(pid) then return "Cant" end


local master1 = isSummon(cid) and getCreatureMaster(cid) or cid

local master2 = isSummon(pid) and getCreatureMaster(pid) or pid


----

if getPlayerStorageValue(master1, 6598754) >= 5 and getPlayerStorageValue(master2, 6598754) >= 5 then

if getPlayerStorageValue(master1, 6598754) ~= getPlayerStorageValue(master2, 6598754) then

if isDuelingAgainst(master1, master2) then --alterado v1.8

if isSummon(cid) and isPlayer(pid) then

return "Cant"

else

return "Can"

end

end

end

end

---- pvp system

if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then

return "Can"

end

if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then ---estar em times diferentes

return "Can"

end

----

if getTileInfo(getThingPos(cid)).pvp then

return "Can"

end

if ehMonstro(cid) and ehMonstro(pid) then

return "Can"

end


return "Cant"

end

Edited by gabrielzika
Link to comment
Share on other sites

×
×
  • Create New...