WE
action

Barra de HP no OTclient

Por Wend ll, 09 de abr. de 2014 em Tutoriais para Iniciantes

otclient
script
11
4k
Wend llW
09 de abril de 2014 às 10:43

Oiie :)

 

Trazendo um Tutorial Hoje Bem simples, mais que uns Membros estão precisando

Ele vai ensinar Para quando você soltar seu Pokemon o "HP" do Pokemon aparecer Logo abaixo do "HP" do Player..

Tipo assim como na imagem::

 

 

zn0o.png

 

 

Você esta com essa Mesma Dúvida?

Segue tutorial ae::

 

1* vá no Seu data\lib e abra o some functions.lua

Logo no começo do arquivo dê 2 vezes enter para pular 2 Linha, e coloque isso no começo do Arquivo::

 

 

 

function getVitalityByMaster(cid)
if not isCreature(cid) then return 0 end
local ball = getPlayerSlotItem(cid, 8).uid
if not ball or ball <= 1 or not pokes[getItemAttribute(ball, 'poke')] then return true end
return pokes[getItemAttribute(ball, 'poke')].vitality * (getPlayerLevel(cid) + (getItemAttribute(ball, 'boost') or 0))
end
 
function onPokeHealthChange(cid, zerar)
if not isCreature(cid) then return true end
if zerar then doPlayerSendCancel(cid, '#ph#,0,0') end
local ball = getPlayerSlotItem(cid, 8).uid
if not ball or ball <= 1 or not pokes[getItemAttribute(ball, 'poke')] then return true end
 
if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(cid, 212124) <= 0 then --alterado v1.6
local pokemon = getCreatureSummons(cid)[1]
local pokelife = (getCreatureHealth(pokemon) / getCreatureMaxHealth(pokemon))
doItemSetAttribute(ball, "hp", pokelife)
end
 
local rd = 1 - (tonumber(getItemAttribute(ball, "hp")))
local maxHp = HPperVITsummon * getVitalityByMaster(cid)
local hp = maxHp -(maxHp * rd)
doPlayerSendCancel(cid, '#ph#,'.. math.floor(hp) ..','.. math.floor(maxHp))
end

 

 

 

2* vá no data\movements\scripts e abra o arquivo portrait.lua

Procure por::

 

if not getItemAttribute(item.uid, "poke") then
e depois do end Adicione isso AQ::

onPokeHealthChange(cid)

ai procure por if not getItemAttribute(item.uid, "poke") then De novo,
e depois do end adicione isso::

onPokeHealthChange(cid, true)

3* vá em data\creaturescripts\scripts e abra o arquivo exp2.0.lua
e procure por::

 

valor = math.abs(valor) --alterado v1.9 if isSummon(attacker) then
e Substitua por esse::

valor = math.abs(valor) --alterado v1.9
if isSummon(cid) and valor >= getCreatureHealth(cid) then
onPokeHealthChange(getCreatureMaster(cid), true)
elseif isSummon(cid) then
onPokeHealthChange(getCreatureMaster(cid))
end
if isSummon(attacker) then

4* vá em data\actions\scripts e abra o revive.lua
Procure por::

 

doCureStatus(cid, "all", true)
e substitua por esse::

doCureStatus(cid, "all", true)
cleanBuffs2(item2.uid) --alterado v1.5
if useOTClient then
onPokeHealthChange(cid) --alterei aki
end

5* vá em data\actions\scripts e abra o potion.lua
procure por::

 

if math.floor(turn/10) == turn/10 then
doSendMagicEffect(getThingPos(cid), effect)
end
e substitua por esse;:

if math.floor(turn/10) == turn/10 then
doSendMagicEffect(getThingPos(cid), effect)
end
if useOTClient then
onPokeHealthChange(getCreatureMaster(cid)) --alterei aki
end

6* vá em data\npc\scripts e abra o arquivo heal.lua
e adicione isso lá no final do arquivo::

if useOTClient then
onPokeHealthChange(cid) --alterei aki
end

...

Atualizado 21/04/2015

Editado Abril 21 por AnnaFeeh

DeadpoolD
09 de abril de 2014 às 11:27

To gostando dos Seus Conteudos', REP+, apesar de já ter inbutido nos Clientes, quem quiser adicionar e modificar algo, ta ai, o tutorial' ^^

jeanflamengoJ
09 de abril de 2014 às 12:00

rep ++ apesar de eu ja ter colocado no meu serve xD parabens annah

dyego2008D
09 de abril de 2014 às 14:18

Parabéns Anna ótimo tutorial.

StrogmanS
09 de abril de 2014 às 18:36

nao tem precisão dessa linha essa linha nao é do sendcancel para a life do poke

 

 

function getStringOfTaskArray(array)
if type(array) ~= 'table' or not next(array) then return "" end

local result = {}
for _, value in ipairs(array) do
local thing, num = (type(value[1]) == 'string' and value[1] or getItemNameById(value[1])), value[2]
table.insert(result, (_ == 1 and "" or ", ")..num.." "..thing..(num == 1 and "" or "s"))
end
result[#result] = " and"..(result[#result]:sub(2,#result[#result]))
return table.concat(result)
end

 

@malconte

coloca só isso. coloca no final é so isso para a life do poke é só isso o sendcancel entao poe no final que deve da certo ^^

 if useOTClient then
onPokeHealthChange(getCreatureMaster(cid)) --alterei aki

end
Wend llW
10 de abril de 2014 às 05:06

@malcote

Como já lhe disseram bota isso no seu arquivo::

 

 

if useOTClient then

onPokeHealthChange(getCreatureMaster(cid)) --alterei aki
end

OmegaO
16 de abril de 2014 às 19:14

Parabéns, seu tutorial foi aprovado.

felipemuniz2013F
17 de abril de 2014 às 20:34

Muito bom em

nociamN
22 de abril de 2014 às 21:35

Coloca créditos pro slicer já que foi ele quem fez, que alias foi tudo retirado do otserve do stilo.

1 ano depois...
Wend llW
21 de abril de 2015 às 02:04

Atualizado 21/04/2015



resolvido problemas com erros futuros e organização do tópico :D


Editado Abril 21 por AnnaFeeh

3 meses depois...
tiagodj99T
22 de julho de 2015 às 12:17

espero q nao seja flood

no caso meu servido e dash eu tenho esse sistema no meu pda queria saber ser alguem tem ele pra servido dash pois eu fiz no dash fica hp mais ele n

desce como ser fosse travadp