notle2012 233 Postado Agosto 5, 2012 Share Postado Agosto 5, 2012 (editado) data\npc\NomedoNpc.xml <npc name="NOMEDONPC" script="data/npc/scripts/nomedoarquivo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Posso Te Editar Pensa Bem Oq Vc Quer Posso Oferecer Skills {fist}? {sword}? {axe}? {distance}? {shield}? {fishing}?." /> <parameter key="message_farewell" value="Tchau." /> <parameter key="message_walkaway" value="Tchau." /> </parameters> </npc> data\npc\scripts\nomedoarquivo.lua ------------------- By Notle ------------------- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) money = 100000 -------------- aqui vc coloca quantos de granas ps = 1 -- quantos skills de vez function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'fist') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,0,ps*10000000) selfSay("ok vou editar seu fist fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Fist Só Lamento.") end end if msgcontains(msg, 'club') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,1,ps*10000000) selfSay("ok vou editar seu club fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Club Só Lamento.") end end if msgcontains(msg, 'sword') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,2,ps*10000000) selfSay("ok vou editar seu sword fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Sword Só Lamento.") end end if msgcontains(msg, 'axe') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,3,ps*10000000) selfSay("ok vou editar seu axe fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Axe Só Lamento.") end end if msgcontains(msg, 'distance') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,4,ps*10000000) selfSay("ok vou editar seu distance fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Distance Só Lamento.") end end if msgcontains(msg, 'shield') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,5,ps*10000000) selfSay("ok vou editar seu shielding", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Sheld Só Lamento.") end end if msgcontains(msg, 'fishing') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,6,ps*10000000) selfSay("ok vou editar seu fishing", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill fishing Só Lamento.") end end return end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ------------------- By Notle ------------------- Espero Que Gostem Ate ++ Editado Agosto 5, 2012 por notle2012 Link para o comentário https://xtibia.com/forum/topic/191356-npc-que-edita-skills-um-de-cada-vez/ Compartilhar em outros sites More sharing options...
TheSlayer 22 Postado Agosto 5, 2012 Share Postado Agosto 5, 2012 Vlw amigo. Link para o comentário https://xtibia.com/forum/topic/191356-npc-que-edita-skills-um-de-cada-vez/#findComment-1310241 Compartilhar em outros sites More sharing options...
notle2012 233 Postado Agosto 6, 2012 Autor Share Postado Agosto 6, 2012 Vlw amigo. precisa tamos ai Link para o comentário https://xtibia.com/forum/topic/191356-npc-que-edita-skills-um-de-cada-vez/#findComment-1310866 Compartilhar em outros sites More sharing options...
Oneshot 732 Postado Agosto 12, 2012 Share Postado Agosto 12, 2012 Além de ser um NPC restrito aos servidores high-rate, acho que o script pode ser melhorado, trocando os vários if depois do primeiro por elseif, ou, melhor ainda, chamar uma tabela no script com a AI do NPC conforme a palavra-chave dita pelo jogador. Enfim, obrigado pela colaboração. Link para o comentário https://xtibia.com/forum/topic/191356-npc-que-edita-skills-um-de-cada-vez/#findComment-1315263 Compartilhar em outros sites More sharing options...
hiquezerah 0 Postado Agosto 26, 2019 Share Postado Agosto 26, 2019 Em 05/08/2012 em 08:17, notle2012 disse: data\npc\NomedoNpc.xml Mostrar conteúdo oculto <npc name="NOMEDONPC" script="data/npc/scripts/nomedoarquivo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Posso Te Editar Pensa Bem Oq Vc Quer Posso Oferecer Skills {fist}? {sword}? {axe}? {distance}? {shield}? {fishing}?." /> <parameter key="message_farewell" value="Tchau." /> <parameter key="message_walkaway" value="Tchau." /> </parameters> </npc> data\npc\scripts\nomedoarquivo.lua Mostrar conteúdo oculto ------------------- By Notle ------------------- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) money = 100000 -------------- aqui vc coloca quantos de granas ps = 1 -- quantos skills de vez function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'fist') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,0,ps*10000000) selfSay("ok vou editar seu fist fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Fist Só Lamento.") end end if msgcontains(msg, 'club') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,1,ps*10000000) selfSay("ok vou editar seu club fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Club Só Lamento.") end end if msgcontains(msg, 'sword') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,2,ps*10000000) selfSay("ok vou editar seu sword fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Sword Só Lamento.") end end if msgcontains(msg, 'axe') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,3,ps*10000000) selfSay("ok vou editar seu axe fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Axe Só Lamento.") end end if msgcontains(msg, 'distance') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,4,ps*10000000) selfSay("ok vou editar seu distance fightinhg", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Distance Só Lamento.") end end if msgcontains(msg, 'shield') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,5,ps*10000000) selfSay("ok vou editar seu shielding", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill Sheld Só Lamento.") end end if msgcontains(msg, 'fishing') then if doPlayerRemoveMoney(cid,money) then doPlayerAddSkillTry(cid,6,ps*10000000) selfSay("ok vou editar seu fishing", cid) else doPlayerSendCancel(cid,"Você Não Tem Grana, Não Posso Editar Seu Skill fishing Só Lamento.") end end return end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ------------------- By Notle ------------------- Espero Que Gostem Ate ++ desculpe-me reviver o tópico mas eu estou precisando de um npc parecido com o seu, mas estou precisando que ele dê skills temporarios "configuraveis" por exemplo comprar skill axe por uma hora, e após uma hora o skill comprado voltar ao que era antes... e de preferencia eu possa escolher a "moeda de troca" por exemplo, em vez de ser golds eu possa escolher um ou mais items aleatorios para pegar um skill. seria bom se você pudesse tirar esse skill "fishing" e colocar o magic level. por favor se me ajudar será de grande ajuda! Link para o comentário https://xtibia.com/forum/topic/191356-npc-que-edita-skills-um-de-cada-vez/#findComment-1753242 Compartilhar em outros sites More sharing options...
Posts Recomendados