Se alguem quiser a barra de vida e poke assim igual a foto fala ai que posto '-' é simples mas é legal '0'

By lucashgas, 10 de jan. de 2012 in Tópicos Sem Resposta
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Se alguem quiser a barra de vida e poke assim igual a foto fala ai que posto '-' é simples mas é legal '0'

@Cleberadm
posta ai, assim o Slicer pode por junto com o que ele está fazendo. Vai ser muito util.
info
Group: Visconde
Joined: 03/01/11
Posts: 303
Reputation: +47

@slicer não sabe como fazer aquilo ali que eu falei ? e.e
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Tudo que vou fazendo vou colocando nesse link
http://kikiforpxg.ho...m/cleberadm.rar
vou deixar na minha assinatura '-'
@RICARDO, me fala como crio a barra que vou tentando, manda por PM se preferir.
Edited Outubro 3 by Cleberadm
info
Group: Visconde
Joined: 03/01/11
Posts: 303
Reputation: +47

@cleber não se trata da barra, a barra em si não é complicada, quero saber como mandar alguma informação pra uma barra criada pelo otcliente, por ex: mandar o uid da pokeball pra uma funcao do cliente (um sistema novo que tenho em mente)
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

@cleber não se trata da barra, a barra em si não é complicada, quero saber como mandar alguma informação pra uma barra criada pelo otcliente, por ex: mandar o uid da pokeball pra uma funcao do cliente (um sistema novo que tenho em mente)
Então, me manda como faz a barra, que eu vou tentando aqui de 1 jeito que to pensando ![]()
@slicer
vei,
Revive nao ta tirando miss, nem o medicine
como coloco pra tirar miss?
meu revive atual
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 990) >= 1 then
doPlayerSendCancel(cid, "You can't use revive during gym battles.")
return true
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
--
if item2.itemid <= 0 or not isPokeball(item2.itemid) then
doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
return true
end
for a, b in pairs (pokeballs) do
if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG
doTransformItem(item2.uid, b.on)
doSetItemAttribute(item2.uid, "hp", 1)
for c = 1, 15 do
local str = "move"..c
setCD(item2.uid, str, 0)
end
setCD(item2.uid, "control", 0)
setCD(item2.uid, "blink", 0) --alterado v1.6
doSendMagicEffect(getThingPos(cid), 14)
doRemoveItem(item.uid, 1)
doCureBallStatus(item2.uid, "all")
cleanBuffs2(item2.uid) --alterado v1.5
return true
end
end
return true
end
e meu medicine atual
function onUse(cid, item, frompos, item2, topos)
if not isCreature(item2.uid) then return true end
if not isSummon(item2.uid) then doPlayerSendCancel(cid, "This potion can only be used on pokémons.") return true end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
local pokeball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
doCureBallStatus(pokeball.uid, "all")
doCureStatus(item2.uid, "all", false) --alterado v1.4
if getCreatureSpeed(item2.uid) < getSpeed(item2.uid) then --alterado v1.4
doRegainSpeed(item2.uid)
end
if (getCreatureCondition(item2.uid, CONDITION_PARALYZE) == true) then
doRemoveCondition(item2.uid, CONDITION_PARALYZE)
end
doSendMagicEffect(getThingPos(item2.uid), 14)
doRemoveItem(item.uid, 1)
return true
end
Edited Outubro 3 by Brolly01
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

@Brolyslqoq,
REVIVE:
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 990) >= 1 then
doPlayerSendCancel(cid, "You can't use revive during gym battles.")
return true
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
--
if item2.itemid <= 0 or not isPokeball(item2.itemid) then
doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
return true
end
for a, b in pairs (pokeballs) do
if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG
doTransformItem(item2.uid, b.on)
doSetItemAttribute(item2.uid, "hp", 1)
for c = 1, 15 do
local str = "move"..c
setCD(item2.uid, str, 0)
end
setCD(item2.uid, "control", 0)
setCD(item2.uid, "blink", 0) --alterado v1.6
doSendMagicEffect(getThingPos(cid), 13)
doRemoveItem(item.uid, 1)
doCureBallStatus(item2.uid, "all")
cleanBuffs2(item2.uid) --alterado v1.5
return true
end
end
return true
end
Medicine:
function onUse(cid, item, frompos, item2, topos)
if not isCreature(item2.uid) then return true end
if not isSummon(item2.uid) then doPlayerSendCancel(cid, "This potion can only be used on pokémons.") return true end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
local pokeball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
doCureBallStatus(pokeball.uid, "all")
doCureStatus(item2.uid, "all", false) --alterado v1.4
if getCreatureSpeed(item2.uid) < getSpeed(item2.uid) then --alterado v1.4
doRegainSpeed(item2.uid)
end
if (getCreatureCondition(item2.uid, CONDITION_PARALYZE) == true) then
doRemoveCondition(item2.uid, CONDITION_PARALYZE)
end
doSendMagicEffect(getThingPos(item2.uid), 14)
doRemoveItem(item.uid, 1)
return true
end
![]()
info
Group: Visconde
Joined: 22/07/12
Posts: 298
Reputation: +28
Tibia Character: Lendreo

Se alguem quiser a barra de vida e poke assim igual a foto fala ai que posto '-' é simples mas é legal '0'
Se alguem quiser a barra de vida e poke assim igual a foto fala ai que posto '-' é simples mas é legal '0'
Cara tava tentando fazer isso, vlw ae ![]()
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

o unico jeito q achei foi por sendCancel e fazendo o player executar uma talk ;/ n sei se ha outro jeito...
mas aki eu fiz para n aparecer as msgs da barra ali no client.. por exemplo as msgs para atualizar a barra q aparecem ali emcima do console, aki n aparecem mais xD dai da pra usar o sendCancel avontade...
info
Group: Visconde
Joined: 03/01/11
Posts: 303
Reputation: +47

não aparece mais ali a cancel pro player ? e.e pq convenhamos é horrivel ficar vendo ali em baixo aqueles 12//, né ?
mas eaí, como fez?
libera ai pra galera hUASEUASH
Edited Outubro 3 by RicardoSohnn
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

modules/game_textmessage/textmessage.lua
MessageSettings = {
none = {},
consoleRed = { color = TextColors.red, consoleTab='Default' },
consoleOrange = { color = TextColors.orange, consoleTab='Default' },
consoleBlue = { color = TextColors.blue, consoleTab='Default' },
centerRed = { color = TextColors.red, consoleTab='Server Log', screenTarget='lowCenterLabel' },
centerGreen = { color = TextColors.green, consoleTab='Server Log', screenTarget='highCenterLabel', consoleOption='showInfoMessagesInConsole' },
centerWhite = { color = TextColors.white, consoleTab='Server Log', screenTarget='middleCenterLabel', consoleOption='showEventMessagesInConsole' },
bottomWhite = { color = TextColors.white, consoleTab='Server Log', screenTarget='statusLabel', consoleOption='showEventMessagesInConsole' },
status = { color = TextColors.white, consoleTab='Server Log', screenTarget='statusLabel', consoleOption='showStatusMessagesInConsole' },
statusSmall = { color = TextColors.white, screenTarget='statusLabel' },
private = { color = TextColors.lightblue, screenTarget='privateLabel' }
}
MessageTypes = {
[MessageModes.MonsterSay] = MessageSettings.consoleOrange,
[MessageModes.MonsterYell] = MessageSettings.consoleOrange,
[MessageModes.BarkLow] = MessageSettings.consoleOrange,
[MessageModes.BarkLoud] = MessageSettings.consoleOrange,
[MessageModes.Failure] = MessageSettings.statusSmall,
[MessageModes.Login] = MessageSettings.bottomWhite,
[MessageModes.Game] = MessageSettings.centerWhite,
[MessageModes.Status] = MessageSettings.status,
[MessageModes.Warning] = MessageSettings.centerRed,
[MessageModes.Look] = MessageSettings.centerGreen,
[MessageModes.Loot] = MessageSettings.centerGreen,
[MessageModes.Red] = MessageSettings.consoleRed,
[MessageModes.Blue] = MessageSettings.consoleBlue,
[MessageModes.PrivateFrom] = MessageSettings.consoleBlue,
[MessageModes.DamageDealed] = MessageSettings.status,
[MessageModes.DamageReceived] = MessageSettings.status,
[MessageModes.Heal] = MessageSettings.status,
[MessageModes.Exp] = MessageSettings.status,
[MessageModes.DamageOthers] = MessageSettings.none,
[MessageModes.HealOthers] = MessageSettings.none,
[MessageModes.ExpOthers] = MessageSettings.none,
[MessageModes.TradeNpc] = MessageSettings.centerWhite,
[MessageModes.Guild] = MessageSettings.centerWhite,
[MessageModes.PartyManagement] = MessageSettings.centerWhite,
[MessageModes.TutorialHint] = MessageSettings.centerWhite,
[MessageModes.Market] = MessageSettings.centerWhite,
[MessageModes.BeyondLast] = MessageSettings.centerWhite,
[MessageModes.Report] = MessageSettings.consoleRed,
[MessageModes.HotkeyUse] = MessageSettings.centerGreen,
[254] = MessageSettings.private
}
messagesPanel = nil
function init()
connect(g_game, 'onTextMessage', displayMessage)
connect(g_game, 'onGameEnd', clearMessages)
messagesPanel = g_ui.loadUI('textmessage.otui', modules.game_interface.getRootPanel())
end
function terminate()
disconnect(g_game, 'onTextMessage', displayMessage)
disconnect(g_game, 'onGameEnd',clearMessages)
clearMessages()
messagesPanel:destroy()
end
function calculateVisibleTime(text)
return math.max(#text * 100, 4000)
end
function displayMessage(mode, text)
if not g_game.isOnline() then return end
local msgtype = MessageTypes[mode]
if not msgtype then
perror('unhandled onTextMessage message mode ' .. mode .. ': ' .. text)
return
end
if msgtype == MessageSettings.none then return end
if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or Options.getOption(msgtype.consoleOption)) then
modules.game_console.addText(text, msgtype, tr(msgtype.consoleTab))
--TODO move to game_console
end
if msgtype.screenTarget then
if string.find(text, '12//,') or string.find(text, '12|,') or string.find(text, 'p#,') or string.find(text, '12&,') then
return --alterado!
end
local label = messagesPanel:recursiveGetChildById(msgtype.screenTarget)
label:setText(text)
label:setColor(msgtype.color)
label:setVisible(true)
removeEvent(label.hideEvent)
label.hideEvent = scheduleEvent(function() label:setVisible(false) end, calculateVisibleTime(text))
end
end
function displayPrivateMessage(text)
displayMessage(254, text)
end
function displayStatusMessage(text)
displayMessage(MessageModes.Status, text)
end
function displayGameMessage(text)
displayMessage(MessageModes.Game, text)
end
function clearMessages()
for _i,child in pairs(messagesPanel:recursiveGetChildren()) do
if child:getId():match('Label') then
child:hide()
removeEvent(child.hideEvent)
end
end
end
ta com a tag '--alterado!', enjoy ^^
vlw pela dica do setColor ^^ consegui mudar aki!
Edited Outubro 3 by Slicer
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Tamo ae \o/ aproveita e olha a PM lá .-.
Edited Outubro 3 by Cleberadm
info
Group: Visconde
Joined: 03/01/11
Posts: 303
Reputation: +47

Tenso, eu fiz um botao no menu em cima lá, que era só pra dizer uma talk, mas ele fala apenas 1x e depois nao fala mais --'
se alguem me arrumar um botao que fique na esquerda ou direita, lá em cima, que apenas use uma talkaction, eu agradeceria '-'
Edited Outubro 3 by RicardoSohnn
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino
@zeref
o color n deu certo hehe
diz q n pode usa table ou n sei oq la uahua
@off
vlw pela ajjudar galera, mas pelo q vi tinha algumas ali q sao repetidas... ;x mais tarde vo fazer todos os pokes e ver quais cds tao faltando xD
Edited Outubro 3 by Slicer