Postado Janeiro 21, 2015 10 anos Cria o arquivo data/npc/juca.xml e coloca isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Juca" script="juca.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|, I am a bootmaker."/> </parameters> </npc> Cria o arquivo data/npc/scripts/juca.lua e coloca isso dentro: local pergaminhoid = 2154 -- Itemid do pergaminho local vocations = { [5] = {9, 10, 11}, [6] = {12, 13, 14}, [7] = {15, 16, 17}, [8] = {17, 15, 10} } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, typeb, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then if msgcontains(msg, "hi") then talkState[talkUser] = 0 end return true end local voc = vocations[getPlayerVocation(cid)] if voc then if msgcontains(msg, "pergaminho") then if getPlayerItemCount(cid, pergaminhid) > 0 then local str = "" local ret = {} for _, v in pairs(voc) do str = str .. "{".. getVocationInfo(v).name .. "}, " table.insert(ret, getVocationInfo(v).name:lower()) end npcHandler:say("Ora ora, voce tem o pergaminho, então escolha sua vocaçao vip: ".. str:sub(1, #str - 2) .. ".", cid) talkState[talkUser] = ret else npcHandler:say("Você não tem o pergaminho.", cid) end elseif type(talkState[talkUser]) == "table" and isInArray(talkState[talkUser], msg:lower()) then if doPlayerRemoveItem(cid, pergaminhoid, 1) then for _, v in pairs(voc) do if getVocationInfo(v).name:lower() == msg:lower() then doPlayerSetVocation(cid, voc) break end end npcHandler:say("Ótima escolha, agora voce é {".. msg:lower() .. "}, até mais!", cid) talkState[talkUser] = 0 else npcHandler:say("Você não tem o pergaminho.", cid) end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Janeiro 21, 2015 10 anos Autor Mano tem um erro, eu falo "hi" ai o dps o NPC fala "Hello |PLAYERNAME|, I am a bootmaker." e agr oq faço? "O sucesso é uma consequência e não um objetivo. A persistência é o caminho do êxito".
Postado Janeiro 21, 2015 10 anos Mano tem um erro, eu falo "hi" ai o dps o NPC fala "Hello |PLAYERNAME|, I am a bootmaker." e agr oq faço? Muda o que tem na linha 7 do arquivo juca.xml. Uma dúvida: Seu nome é Yan? theGazette no Pokémon da SvkE? Editado Janeiro 21, 2015 10 anos por MaXwEllDeN (veja o histórico de edições) -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Janeiro 21, 2015 10 anos Autor kkkk, Todos os personagens eu Coloco The Gazette ou Gazette mas meu nome é Gustavo. The Gazette muito fodaaa uhuuuuuuu!!! Edit: em npc/script/juca.xml ---- não tem nada na 7 linha. em npc/juca.xml ---- so tem isso </parameters> Editado Janeiro 21, 2015 10 anos por Storm Night (veja o histórico de edições) "O sucesso é uma consequência e não um objetivo. A persistência é o caminho do êxito".
Postado Janeiro 21, 2015 10 anos kkkk, Todos os personagens eu Coloco The Gazette ou Gazette mas meu nome é Gustavo. The Gazette muito fodaaa uhuuuuuuu!!! Edit: em npc/script/juca.xml ---- não tem nada na 7 linha. em npc/juca.xml ---- so tem isso </parameters> Me desculpe se estou errado, mas acho que eh para tirar a letra S do final de "parameters". GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
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.