GA

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

Por gabrielzika, 08 de jan. de 2016 em Scripts

poketibia
pokemon
healarea
spell
16
5.1k
gabrielzikaG
09 de janeiro de 2016 às 12:51

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

CaronteC
09 de janeiro de 2016 às 12:57

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

Editado Janeiro 9 por Caronte

samlecterS
09 de janeiro de 2016 às 13:37

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
gabrielzikaG
09 de janeiro de 2016 às 16:49

@@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?

samlecterS
09 de janeiro de 2016 às 17:24

@@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 
gabrielzikaG
16 de janeiro de 2016 às 15:19

@@samlecter

 

Desculpa a Demora , Bom Testei aqui e continua do msm jeito :/ Tipo heala numa hunt normal ... ai quando entro na area PVP ele Não heala quem está em volta :/


@UP


@Up


@UP


@Up


@Up

nociamN
16 de janeiro de 2016 às 16:08

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

 

gabrielzikaG
16 de janeiro de 2016 às 16:17

@@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

Editado Janeiro 16 por gabrielzika

nociamN
16 de janeiro de 2016 às 16:35

ache essa função e poste aqui function canAttackOther(cid, pid)

gabrielzikaG
16 de janeiro de 2016 às 16:38
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

Editado Janeiro 16 por gabrielzika

nociamN
17 de janeiro de 2016 às 05:48

retira essa parte e testa

 

if getTileInfo(getThingPos(cid)).pvp then

return "Can"
end

 

 

 

gabrielzikaG
19 de janeiro de 2016 às 15:59

@nociam Eu Já retirei e Funfo , mas ai o Pvp Não Funciona mais :/ n da pra atacar ngm :/


@UP


@Up

gabrielzikaG
22 de janeiro de 2016 às 17:16

@Up

gabrielzikaG
27 de janeiro de 2016 às 19:53

@Up


@Up

gabrielzikaG
02 de fevereiro de 2016 às 20:52

@UP