Noninhouh 118 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 (editado) 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() OBS: É APENAS A PARTE QUE ESTA EM VERMELHO NA IMAGEM ACIMA Editado Agosto 26, 2013 por Noninhouh Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/ Compartilhar em outros sites More sharing options...
paulgrande 23 Postado Agosto 26, 2013 Share Postado Agosto 26, 2013 Legal cara mas poe fotos pro tópico ficar com mais conteúdo parabéns pelo sistema foi vc que fez? Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1554452 Compartilhar em outros sites More sharing options...
Noninhouh 118 Postado Agosto 26, 2013 Autor Share Postado Agosto 26, 2013 (editado) vlw paul jah atualizei o topic e s, eu fiz o sistema ;p Editado Agosto 26, 2013 por Noninhouh Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1554477 Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Agosto 31, 2013 Share Postado Agosto 31, 2013 Bem legal em Danone! xD rep+ Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1556380 Compartilhar em outros sites More sharing options...
kttallan 319 Postado Agosto 31, 2013 Share Postado Agosto 31, 2013 Boaaa danooone fico xD manow Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1556494 Compartilhar em outros sites More sharing options...
nociam 90 Postado Setembro 17, 2013 Share Postado Setembro 17, 2013 (editado) porque ta esse erro ERROR: Unable to send extended opcode 1, extended opcodes are not enabledERROR: 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 functionERROR: 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 endif mode == MessageModes.Failure thenif text:find("#getBadges#") thenlocal t = string.explode(text, " ")local badges = skillsWindow:recursiveGetChildById("gym"..t[2])badges:setImageSource(gyms[t[2]..""..tonumber(t[3])])endend end Editado Setembro 17, 2013 por nociam Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1562120 Compartilhar em outros sites More sharing options...
vvdda91 8 Postado Setembro 23, 2013 Share Postado Setembro 23, 2013 Pô cara, muito bacana! Parabéns pela criação e por liberar o conteúdo! Fica aí meu positivo. Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1564439 Compartilhar em outros sites More sharing options...
Danilo53 0 Postado Setembro 28, 2013 Share Postado Setembro 28, 2013 Fiz tudo certinho aqui mas não deu certo :s Mas Parabens pelo sys rep+ Se possivel posta o download desse seu client. Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1566520 Compartilhar em outros sites More sharing options...
Mattziin 12 Postado Outubro 16, 2013 Share Postado Outubro 16, 2013 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á! Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1572991 Compartilhar em outros sites More sharing options...
Noninhouh 118 Postado Outubro 16, 2013 Autor Share Postado Outubro 16, 2013 usa sendCancel... se vc me explicar melhor eu faço e deixo disponivel ai pra vc e pra qm kiser ;p Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573017 Compartilhar em outros sites More sharing options...
Applezin 8 Postado Outubro 17, 2013 Share Postado Outubro 17, 2013 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 Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573365 Compartilhar em outros sites More sharing options...
Noninhouh 118 Postado Outubro 17, 2013 Autor Share Postado Outubro 17, 2013 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... Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573399 Compartilhar em outros sites More sharing options...
Applezin 8 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) 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 ? Editado Outubro 18, 2013 por Applezin Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573502 Compartilhar em outros sites More sharing options...
Noninhouh 118 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 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 Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573661 Compartilhar em outros sites More sharing options...
Applezin 8 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 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 ? Link para o comentário https://xtibia.com/forum/topic/220032-insignias-na-skill-bar/#findComment-1573720 Compartilhar em outros sites More sharing options...
Posts Recomendados