Ir para conteúdo

Insignias na Skill Bar


Noninhouh

Posts Recomendados

  • 1 month later...

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

Ola amigo como eu faço para minha barra de habilidades ficar igual a sua, com lv, pesca, headbutt etc?

Link para o comentário
Compartilhar em outros sites

 

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

Ola amigo como eu faço para minha barra de habilidades ficar igual a sua, com lv, pesca, headbutt etc?

 

Se eu não me engano, tem que mecher nas Sources, ou se não tem que editar uns arquivo .lua '='

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...