Postado Junho 17, 2014 11 anos Autor NPC DE VENDER: <?xml version="1.0" encoding="UTF-8"?> <npc name="Frodo" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="114" body="113" legs="113" feet="113" corpse="2212"/> <parameters> <parameter key="module_shop" value="1" /> <parameter key="message_greet" value="Hiiii |PLAYERNAME|. I sell tools, backpacks and amulet of loss? Just say {trade} to see more details." /> <parameter key="shop_buyable" value="Amulet Of Loss,2173,10000;Bag,1987,100;Backpack,1988,500;Green Bag,1991,100;Yellow Bag,1992,100;Red Bag,1993,100;Purple Bag,1994,100;Blue Bag,1995,100;Gray Bag,1996,100;Golden Bag,1997,100;Green Backpack,1998,1000;Yellow Backpack,1999,1000;Red Backpack,2000,1000;Purple Backpack,2001,1000;Blue Backpack,2002,1000;Gray Backpack,2003,1000; Golden Backpack,2004,1000;Backpack of Holding,2365,25000;Camouflage Bag,3939,1000;Camouflage Backpack,3940,10000;Pirate Bag,5927,3000;Pirate Backpack,5928,10000;Beach Bag,5950,3000; Beach Backpack,5949,10000;Fur Bag,7343,3000;Fur Backpack,7342,10000;Backpack,1999,1000;Fishing Rod,2580,1000;Torch,2050,100;Rope,2120,500;Shovel,2554,500;" /> </parameters> </npc> Script: 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) end function onThink() npcHandler:onThink() end npcHandler:addModule(FocusModule:new()) TRABALHOS [iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/ [CreatureScripts] OwNeD ao character morrer: http://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/
Postado Junho 17, 2014 11 anos local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'Blessar') or msgcontains(msg, 'blessar')) and getPlayerItemCount(cid, 2342) == 1 then selfSay('Parabens! Você blessou seu helmet, ele tem duração de 4 horas!', cid) doPlayerAddItem(cid,2343, 1) doPlayerRemoveItem(cid, 2342, 1) doSendMagicEffect(getPlayerPosition(cid), 13) elseif(msgcontains(msg, 'Blessar') or msgcontains(msg, 'blessar')) and getPlayerItemCount(cid, 2342) < 1 then selfSay('Voce nao tem o item nescessario.', cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Junho 17, 2014 11 anos Autor Mano, não consigo fazer o Npc dele por iss não sei se o Script pego, Pois falo /n Faraj Faruk e não esta indo ja conferi tudo... <?xml version="1.0" encoding="UTF-8"?> <npc name="Faraj Faruk" script="data/npc/scripts/farajfaruk.lua" walkinterval="2000" floorchange="0"> <health now="1000" max="1000"/> <look type="128" head="78" body="110" legs="81" feet="114" addons="0"/> <parameters> <parameter key="message_greet" value="Hi |PLAYERNAME|. Olá meu caro joven, você veio blessar seu helmet, certo né?"/> </parameters> </npc> Erro Distro: [17/06/2014 12:36:51] Lua Script Error: [TalkAction Interface] [17/06/2014 12:36:51] data/talkactions/scripts/creature.lua:onSay [17/06/2014 12:36:51] luaDoCreateNpc(). Npc name(Faraj Faruk) not found Editado Junho 17, 2014 11 anos por Ribeiro Foda (veja o histórico de edições) TRABALHOS [iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/ [CreatureScripts] OwNeD ao character morrer: http://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/
Postado Junho 17, 2014 11 anos O Erro esta dizendo que você apenas errou o nome do NPC, e não tem nada a ver com o script.
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.