Insignias na Skill Bar

Noninhouh
em Clients
  • 1
  • 2

Noninhouh

Danone
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/12Posts: 318Gênero: Masculino

Bom, apenas mais um sistema pra ajuda o povo que esta criando um ot Pokemon e usando o OTC

GOSTARIA DE FALAR QUE TESTEI NO SERVER PDA BY SLICER

 

primeiro vamos as edições no SERVER:

 

talkactions/scripts/talkGym.lua:

 

 

function onSay(cid, words, param)
    if gymbadges[param] then
        doPlayerSendCancel(cid, "#getBadges# "..param.." "..getPlayerItemCount(cid, gymbadges[param]))
    end
    return true
end

 

 

 

 

talkactions/talkactions.xml:

 

 

<talkaction words="#getGym#" event="script" value="talkGym.lua"/>

 

 

 

 

PARA QUEM QUISER QUE ATUALIZE NA HORA QUE GANHAR O GYM

npc/scripts/todos os npcs de gym:

 

Adicione esta linha:

doPlayerSendCancel(cid, "#getBadges# "..getCreatureName(this).." "..getPlayerItemCount(cid, gymbadges[getCreatureName(this)]))

embaixo dessa linha:

if b.uid > 0 then doTransformItem(b.uid, b.itemid - 8) end

ficando:

local function doWinDuel(cid, npc)
    if not isCreature(cid) then return true end
    local this = npc
    local a = gymbadges[getCreatureName(this)] + 8
    doCreatureSay(npc, "You won the duel! Congratulations, take this "..getItemNameById(a - 8).." as a prize.", 1)
    local b = getPlayerItemById(cid, true, a)
    if b.uid > 0 then doTransformItem(b.uid, b.itemid - 8) end
    doPlayerSendCancel(cid, "#getBadges# "..getCreatureName(this).." "..getPlayerItemCount(cid, gymbadges[getCreatureName(this)]))
end

 

 

 

 

Pronto, no server é isso...

Agora no seu OTC, na pasta modules/game_skills:

 

skill.otui:

 

 

em baixo de tudo, totalmente tudo:

    SkillButton
      id: pokeGym
      size: 143 69
      margin-top: 8
      UIButton
        id: gymBrock
        size: 32 32
        anchors.top: parent.top
        anchors.right: parent.right
        margin-right: 120
      UIButton
        id: gymMisty
        anchors.top: gymBrock.top
        anchors.left: gymBrock.right
        margin-left: 3
      UIButton
        id: gymSurge
        anchors.top: gymBrock.top
        anchors.left: gymMisty.right
        margin-left: 3
      UIButton
        id: gymErika
        anchors.top: gymBrock.top
        anchors.left: gymSurge.right
        margin-left: 3
      UIButton
        id: gymSabrina
        anchors.top: gymBrock.bottom
        anchors.left: gymBrock.left
        margin-top: 6
      UIButton
        id: gymKoga
        anchors.top: parent.top
        anchors.top: gymBrock.bottom
        anchors.left: gymMisty.left
        margin-top: 6
      UIButton
        id: gymBlaine
        anchors.top: parent.top
        anchors.top: gymBrock.bottom
        anchors.left: gymSurge.left
        margin-top: 6
      UIButton
        id: gymKira
        anchors.top: parent.top
        anchors.top: gymBrock.bottom
        anchors.left: gymErika.left
        margin-top: 6

 

 

 

skills.lua:

 

 

no inicio do script:

local gyms = {
   ["Brock0"] = "/images/game/pokemon/clan/brock", ---- terminados em 0 apagado, terminados em 1 aceso
   ["Brock1"] = "/images/game/pokemon/clan/brock",
   ["Misty0"] = "/images/game/pokemon/clan/misty",
   ["Misty1"] = "/images/game/pokemon/clan/misty",
   ["Surge0"] = "/images/game/pokemon/clan/surge",
   ["Surge1"] = "/images/game/pokemon/clan/surge",
   ["Erika0"] = "/images/game/pokemon/clan/erika",
   ["Erika1"] = "/images/game/pokemon/clan/erika",
   ["Sabrina0"] = "/images/game/pokemon/clan/sabrina",
   ["Sabrina1"] = "/images/game/pokemon/clan/sabrina",
   ["Koga0"] = "/images/game/pokemon/clan/koga",
   ["Koga1"] = "/images/game/pokemon/clan/koga",
   ["Blaine0"] = "/images/game/pokemon/clan/blaine",
   ["Blaine1"] = "/images/game/pokemon/clan/blaine",
   ["Kira0"] = "/images/game/pokemon/clan/kira",
   ["Kira1"] = "/images/game/pokemon/clan/kira",
}

em baixo de:

  connect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })

coloque:

connect(g_game, 'onTextMessage', getGym)

ficando:

  connect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })
connect(g_game, 'onTextMessage', getGym)

em baixo de:

  g_keyboard.unbindKeyDown('Ctrl+S')
  skillsWindow:destroy()
  skillsButton:destroy()
end

coloque:

function autoUpdateTalks()
  local player = g_game.getLocalPlayer()
  if not player then return end
----------
  g_game.talk("#getGym# Brock")
  g_game.talk("#getGym# Misty")
  g_game.talk("#getGym# Surge")
  g_game.talk("#getGym# Erika")
  g_game.talk("#getGym# Sabrina")
  g_game.talk("#getGym# Koga")
  g_game.talk("#getGym# Blaine")
  g_game.talk("#getGym# Kira")
----------
end



function getGym(mode, text)
  local t = string.explode(text, " ")
  local badges = skillsWindow:recursiveGetChildById("gym"..t[2])
  if not g_game.isOnline() then return end
  if mode == MessageModes.Failure then
    if text:find("#getBadges#") then
      badges:setImageSource(gyms[t[2]..""..tonumber(t[3])])
    end
  end
end

ficando:

  g_keyboard.unbindKeyDown('Ctrl+S')
  skillsWindow:destroy()
  skillsButton:destroy()
end

function autoUpdateTalks()
  local player = g_game.getLocalPlayer()
  if not player then return end
----------
  g_game.talk("#getGym# Brock")
  g_game.talk("#getGym# Misty")
  g_game.talk("#getGym# Surge")
  g_game.talk("#getGym# Erika")
  g_game.talk("#getGym# Sabrina")
  g_game.talk("#getGym# Koga")
  g_game.talk("#getGym# Blaine")
  g_game.talk("#getGym# Kira")
----------
end

function getGym(mode, text)
  local t = string.explode(text, " ")
  local badges = skillsWindow:recursiveGetChildById("gym"..t[2])
  if not g_game.isOnline() then return end
  if mode == MessageModes.Failure then
    if text:find("#getBadges#") then
      badges:setImageSource(gyms[t[2]..""..tonumber(t[3])])
    end
  end
end

em baixo de:

function refresh()
  local player = g_game.getLocalPlayer()
  if not player then return end

coloque:

autoUpdateTalks()

ficando:

function refresh()
  local player = g_game.getLocalPlayer()
  if not player then return end

  autoUpdateTalks()

 

 

 

 

nxrm05.png

OBS: É APENAS A PARTE QUE ESTA EM VERMELHO NA IMAGEM ACIMA

paulgrande

Perceba que você é sua própria criação Você é seu próprio mestre
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 09/12/10Posts: 138Char no Tibia: Loh Pabllitooh

Legal cara mas poe fotos pro tópico ficar com mais conteúdo parabéns pelo sistema foi vc que fez?

zshgs7w.png

coming soon

 

 

"Sozinho eu sou agora o meu inimigo intimo.
Lembranças más vem, pensamentos bons vai,
Me ajude, sozinho penso merda pra caralho.
Gente que acredito, gosto e admiro,
Brigava por justiça e paz levou tiro:
Malcom X, Ghandi, Lennon, Marvin Gaye,
Che Guevara, 2Pac, Bob Marley e
O evangélico Martin Luther King.
Lembrei de um truta meu falar assim:
- Não joga pérolas aos porcos irmão,
Joga lavagem eles prefere assim.

Noninhouh

Danone
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/12Posts: 318Gênero: Masculino

vlw paul jah atualizei o topic

e s, eu fiz o sistema ;p

Gabrieltxu

O Héroi
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/06/12Posts: 2180Gênero: MasculinoChar no Tibia: Supreme Player

Bem legal em Danone! xD rep+

Canal do facebook de lives!! cola la galera me ajudar seguindo a pagina hehe ! ❤️

 

               https://www.facebook.com/Tuxao0

kttallan

Lord Sorte
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 06/03/13Posts: 1574Gênero: MasculinoChar no Tibia: Lord Sorte

Boaaa danooone fico xD manow

                                                                Scripter em Treinamento

 

Codigos

 

Simples Pet Sistema < New

 

Assim que possivel mais codigos, com criatividade.

nociam

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 04/02/13Posts: 541Gênero: Masculino

porque ta esse erro

ERROR: Unable to send extended opcode 1, extended opcodes are not enabled
ERROR: protected lua call failed: LUA ERROR:
/game_skills/skills.lua:121: attempt to concatenate field '?' (a nil value)
stack traceback:
[C]: ?
/game_skills/skills.lua:121: in function
ERROR: protected lua call failed: LUA ERROR:
/game_skills/skills.lua:121: attempt to concatenate field '?' (a nil value)
stack traceback:
[C]: ?
/game_skills/skills.lua:121: in function

 

 

linha 121 - local badges = skillsWindow:recursiveGetChildById("gym"..t[2])

 

Arrumei e apenas os local nos lugares errado coloquei assim a função getGym

 

 

function getGym(mode, text)
if not g_game.isOnline() then return end
if mode == MessageModes.Failure then
if text:find("#getBadges#") then
local t = string.explode(text, " ")
local badges = skillsWindow:recursiveGetChildById("gym"..t[2])
badges:setImageSource(gyms[t[2]..""..tonumber(t[3])])
end
end

end

vvdda91

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/04/13Posts: 26

Pô cara, muito bacana! Parabéns pela criação e por liberar o conteúdo!

Fica aí meu positivo.

Danilo53

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 31/05/13Posts: 18

Fiz tudo certinho aqui mas não deu certo :s

 

Mas Parabens pelo sys rep+

 

 

Se possivel posta o download desse seu client.

Mattziin

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 11/11/11Posts: 115

Como seria se eu botasse para aparecer imagem por getvocation ? qual comando que eu usaria ? pq o opcode nao ta funfando ! assim eu poderia deixa meu skills mais legal do que já está!

Noninhouh

Danone
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/12Posts: 318Gênero: Masculino

usa sendCancel...

se vc me explicar melhor eu faço e deixo disponivel ai pra vc e pra qm kiser ;p

Applezin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/13Posts: 15

Também gostaria de saber como funciona isso. eu já tentei bota uma image por vocação, usando getvocation, só q nao está funcionando.

 

Como eu usaria o sendcancel Noninhouh ? Poderia mostrar um script de exemplo ? Nonin

Noninhouh

Danone
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/12Posts: 318Gênero: Masculino

mds gente... é so fazer uma talk q manda o sendCancel, ai fazer:

 

 

function getParams(mode, text)
  if not g_game.isOnline() then return end
  if mode == MessageModes.Failure then
    if text:find("#getClan#") then
      local icon = skillsWindow:recursiveGetChildById("clanIcon")
      if icon then
        local t = string.explode(text, " ")
        icon:setImageSource(clans[tonumber(t[2])])
      end
    end
  end
end

 

no script a cima por exemplo, se ele receber um sendCancel que contenha no texto "#getClan#", ele executara a ação de troca a imagem...

Applezin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/13Posts: 15

mds gente... é so fazer uma talk q manda o sendCancel, ai fazer:

 

 

function getParams(mode, text)
  if not g_game.isOnline() then return end
  if mode == MessageModes.Failure then
    if text:find("#getClan#") then
      local icon = skillsWindow:recursiveGetChildById("clanIcon")
      if icon then
        local t = string.explode(text, " ")
        icon:setImageSource(clans[tonumber(t[2])])
      end
    end
  end
end

 

no script a cima por exemplo, se ele receber um sendCancel que contenha no texto "#getClan#", ele executara a ação de troca a imagem...

 

Mas cadê a função getvocation ? tentei fazer umas gambarriada aqui e nem funfou :S

 

Olha como ficou \/

 

 

 

 

function getNinjaInfo(mode, text)

if not g_game.isOnline() then return end
if mode == MessageModes.Failure then
if text:find("#getClan#") then
player:setVocation(clanName)
skillsWindow:recursiveGetChildById('clanMiniature'):setImageSource(clans[clanName][2])
setSkillValue('clan', clans[clanName][1])
skillsWindow:recursiveGetChildById('clanMiniature'):setImageSource(clans[clanName][2])
skillsWindow:recursiveGetChildById('portraitPanel'):setImageSource(clans[clanName][3])
if text:find("#getRank#") then
setSkillValue('rank', ranks[rank][1])
skillsWindow:recursiveGetChildById('rankMiniature'):setImageSource(ranks[rank][2])
if text:find("#getVillage#") then
setSkillValue('village', villages[village][1])
skillsWindow:recursiveGetChildById('villageMiniature'):setImageSource(villages[village][2])
if text:find("#getattack#") then
setSkillValue('atkSpeed', attackspeed)
if text:find("#getspeed#") then
player:setBaseSpeed(basespeed)
if text:find("#getvspeed#") then
setSkillValue('movSpeed', movspeed)
if text:find("#bount#") then
setSkillValue('bounty', bounty)
if text:find("#reputation#") then
setSkillValue('reputation', reputation)
if text:find("#skillspoints#") then
setSkillValue('skillPointsLabel', skillPoints)
setSkillValue('rankd', msg:getData() - 1)
setSkillValue('rankc', msg:getData() - 1)
setSkillValue('rankb', msg:getData() - 1)
setSkillValue('ranka', msg:getData() - 1)
setSkillValue('ranks', msg:getData() - 1)
player:setSoul(skillPoints)
onSoulChange(player, skillPoints)
updateLvUpIcons(skillPoints)
end

Assim ?

Noninhouh

Danone
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/12Posts: 318Gênero: Masculino

tuh fez as talk com sendCancel? e desse jeito n tah certo pelo q eu vi...

tenta colocar:

 

local t = string.explode(text, " ")

 

ai tipo, se o sendCancel for assim "#getClan# 4", vc coloca t[2], que no caso seria o numero 4...

 

"#getClan# 4 male 18", seria:

t[2] = '4'

t[3] = 'male'

t[4] = '18'

 

ai vc pode fazer do jeito que vc kiser no server ;)

Applezin

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/10/13Posts: 15

tuh fez as talk com sendCancel? e desse jeito n tah certo pelo q eu vi...

tenta colocar:

local t = string.explode(text, " ")

ai tipo, se o sendCancel for assim "#getClan# 4", vc coloca t[2], que no caso seria o numero 4...

 

"#getClan# 4 male 18", seria:

t[2] = '4'

t[3] = 'male'

t[4] = '18'

 

ai vc pode fazer do jeito que vc kiser no server ;)

 

ai no talkaction ficaria assim

 

 

function onSay(cid, words, param)
    if getPlayerVocation[param] then
        doPlayerSendCancel(cid, "#getClan# "..param.." "..getPlayerItemCount(cid, getPlayerVocation[param]))
    end
    return true
end
?
  • 1
  • 2