Postado Agosto 19, 2016 8 anos Bom galera do TK, eu estou traduzindo por completo meu servidor de poketibia, então pensei que alguns também podem estar fazendo o mesmo e decidi ajuda-los, de uma forma simples, que iria lhes poupar tempo. Então vamos direto ao Assunto. Primeiro vá em Pastadoseuserver/data/npc/scripts e crie um arquivo chamado Heal.lua (Caso já possua o arquivo, apenas substitua oque há dentro). Spoiler local posis = { --[storage da city] = {pos da nurse na city}, [897530] = {x = 1038, y = 1033, z = 7}, --saffron [897531] = {x = 1044, y = 879, z = 7}, --cerulean [897532] = {x = 1189, y = 1021, z = 7}, --lavender [897533] = {x = 1199, y = 1475, z = 7}, --fuchsia [897534] = {x = 847, y = 1011, z = 6}, --celadon [897535] = {x = 689, y = 1065, z = 7}, --viridian [897536] = {x = 1029, y = 1224, z = 7}, --vermilion [897537] = {x = 703, y = 834, z = 6}, --pewter [897538] = {x = 744, y = 1325, z = 7}, --cinnabar [897539] = {x = 1429, y = 1597, z = 6}, --snow [897540] = {x = 542, y = 675, z = 7}, --golden } function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Ate logo senhor!') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid for a, b in pairs(gobackmsgs) do local gm = string.gsub(b.go, "doka!", "") local bm = string.gsub(b.back, "doka!", "") if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then return true end end if((msgcontains(msg, 'oi') or msgcontains(msg, 'vida') or msgcontains(msg, 'ajuda')) and (getDistanceToCreature(cid) <= 3)) then if exhaustion.get(cid, 9211) then selfSay('Por favor, espere um momento antes de curar seus pokemon novamente!') return true end if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then selfSay("Por favor, entre no centro pokemon para cura-los!") return true end for e, f in pairs(posis) do local pos = getThingPos(getNpcCid()) if isPosEqual(pos, f) then if getPlayerStorageValue(cid, e) <= -1 then setPlayerStorageValue(cid, e, 1) end end end exhaustion.set(cid, 9211, 5) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid)) doCureStatus(cid, "all", true) doSendMagicEffect(getThingPos(cid), 132) local mypb = getPlayerSlotItem(cid, 8) if #getCreatureSummons(cid) >= 1 then if not nurseHealsPokemonOut then selfSay("Por favor, volte seu pokemon para a pokebola!") return true end local s = getCreatureSummons(cid)[1] doCreatureAddHealth(s, getCreatureMaxHealth(s)) doSendMagicEffect(getThingPos(s), 13) doCureStatus(s, "all", false) if getPlayerStorageValue(s, 1008) < baseNurseryHappiness then setPlayerStorageValue(s, 1008, baseNurseryHappiness) end if getPlayerStorageValue(s, 1009) > baseNurseryHunger then setPlayerStorageValue(s, 1009, baseNurseryHunger) end else if mypb.itemid ~= 0 and isPokeball(mypb.itemid) then doItemSetAttribute(mypb.uid, "hp", 1) if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger then doItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger) end for c = 1, 15 do local str = "move"..c setCD(mypb.uid, str, 0) end if getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness then doItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness) end if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then for a, b in pairs (pokeballs) do if isInArray(b.all, mypb.itemid) then doTransformItem(mypb.uid, b.on) end end end end end local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) local balls = getPokeballsInContainer(bp.uid) if #balls >= 1 then for _, uid in ipairs(balls) do doItemSetAttribute(uid, "hp", 1) for c = 1, 15 do local str = "move"..c setCD(uid, str, 0) end if getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger then doItemSetAttribute(uid, "hunger", baseNurseryHunger) end if getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness then doItemSetAttribute(uid, "happy", baseNurseryHappiness) end local this = getThing(uid) for a, b in pairs (pokeballs) do if isInArray(b.all, this.itemid) then doTransformItem(uid, b.on) end end end end selfSay('Ai esta! Voce e seus pokemon sao saudaveis novamente.') if useKpdoDlls then doUpdateMoves(cid) end end end Salve e feche. Agora vá em Pastadoseuserver/data/npc e abra o arquivo Nurse Joy.xml e substitua oque há dentro por isso... Spoiler <?xml version="1.0" encoding="UTF-8"?> <npc name="Nurse Joy" script="heal.lua" walkinterval="350000" floorchange="0" speed="0"> <health now="150" max="150"/> <look type="532" head="91" body="102" legs="83" feet="0"/> <parameters> <parameter key="message_greet" value="Bem vindo ao centro pokemon! voce quer {curar} seus pokemon agora?"/> <parameter key="message_farewell" value="Lembre de cuidar bem de seus pokemon!"/> <parameter key="message_idletimeout" value="Tenha um bom dia."/> <parameter key="message_walkaway" value="Ate Logo!"/> </parameters> </npc> Nessa parte você edita a outfit do NPC de acordo com o LookType do seu server. Citar <look type="532" head="91" body="102" legs="83" feet="0"/> Após isso, salve e feche. No Heal.lua tem a seguinte parte bem no início ... Citar local posis = { --[storage da city] = {pos da nurse na city}, [897530] = {x = 1038, y = 1033, z = 7}, --saffron [897531] = {x = 1044, y = 879, z = 7}, --cerulean [897532] = {x = 1189, y = 1021, z = 7}, --lavender [897533] = {x = 1199, y = 1475, z = 7}, --fuchsia [897534] = {x = 847, y = 1011, z = 6}, --celadon [897535] = {x = 689, y = 1065, z = 7}, --viridian [897536] = {x = 1029, y = 1224, z = 7}, --vermilion [897537] = {x = 703, y = 834, z = 6}, --pewter [897538] = {x = 744, y = 1325, z = 7}, --cinnabar [897539] = {x = 1429, y = 1597, z = 6}, --snow [897540] = {x = 542, y = 675, z = 7}, --golden Nisso você coloca a localização do NPC no SEU MAPA. caso possua mais cidades, você faz o seguinte. Copie e cole uma dessas linhas, e modifique para ficar da seguinte maneira Citar [897541] = {x = 190, y = 190, z = 7}, --Cidade Nova Como ja foi dito, onde está X= / Y= e Z= , você altera para as coordenadas do NPC em Seu mapa nas devidas Cidades. ( tem os nomes ao lado para facilitar) Perceba que eu aumentei UM numero na Storage, pois não se deve repetir, porque dará erro no server, eu mudei de 897540 para 897541, recomendo sempre aumentarem apenas UM número. O NPC atende pelos seguintes comandos. Citar Oi Ajuda Vida OBS: O NPC nao possui acentuação, para avitar possiveis erros no server. Bom, então foi isso, esse foi meu primeiro tópico no TK, e espero ter ajudado alguem, se ajudei deixe o REP+ pra fortalecer :D Não sei quem é o autor da script, então não deixarei seus créditos. Editado Agosto 19, 2016 8 anos por IceDream Esqueci uma pequena observaçao. (veja o histórico de edições)
Postado Agosto 20, 2016 8 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Spoiler Congratulations, your content has been approved! Thank you for your contribution, we of Tibia King we are grateful. Your content will help many other users, you received +1 REP. ➥ Regras | Seções OTServ | Seções BOT
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.