lelesho 0 Postado Outubro 8, 2012 Share Postado Outubro 8, 2012 Eu gostaria de um npc que da as 2 addons, Citizen Hat: Requisitos: • 100 Chicken Feathers • 50 Honeycombs • 1 Legion Helmet Citação: Hi hat yes Bye *Ela te da a addon. Recompensa Citizen Backpack Requisitos: • 100 Minotaur Leather Citação: Hi backpack yes *Ela lhe dará a addon. alguem poderia fazer ou me ensinar porfavor? Link para o comentário https://xtibia.com/forum/topic/195939-npc-citzen-global/ Compartilhar em outros sites More sharing options...
0 KUNGLOW 14 Postado Outubro 8, 2012 Share Postado Outubro 8, 2012 O script do NPC: 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 -- Storage IDs -- local citizen = 22001 local newaddon = 'Here you are, enjoy your brand new addon!' local noitems = 'You do not have all the required items.' local noitems2 = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.' local already = 'It seems you already have this addon, don\'t you try to mock me son!' -- CITIZEN START -- function CitizenFirst(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if isPremium(cid) then addon = getPlayerStorageValue(cid,citizen) if addon == -1 then if getPlayerItemCount(cid,5878) >= 100 then if doPlayerRemoveItem(cid,5878,100) then selfSay(newaddon) doSendMagicEffect(getCreaturePosition(cid), 13) doPlayerAddOutfit(cid, 128, 1) doPlayerAddOutfit(cid, 136, 1) setPlayerStorageValue(cid,citizen,1) end else selfSay(noitems) end else selfSay(already) end end end function CitizenSecond(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if isPremium(cid) then addon = getPlayerStorageValue(cid,citizen+1) if addon == -1 then if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then selfSay(newaddon) doSendMagicEffect(getCreaturePosition(cid), 13) doPlayerAddOutfit(cid, 128, 2) doPlayerAddOutfit(cid, 136, 2) setPlayerStorageValue(cid,citizen+1,1) end else selfSay(noitems) end else selfSay(already) end end end keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the Citizen outfit."}) keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first citizen addon' or 'second citizen addon'. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"}) local node1 = keywordHandler:addKeyword({'first citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 minotaur leathers. Do you have them with you?'}) node1:addChildKeyword({'yes'}, CitizenFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true}) local node2 = keywordHandler:addKeyword({'second citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 chicken feathers, 50 honeycombs and a legion helmet. Do you have them with you?'}) node2:addChildKeyword({'yes'}, CitizenSecond, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true}) npcHandler:addModule(FocusModule:new()) Link para o comentário https://xtibia.com/forum/topic/195939-npc-citzen-global/#findComment-1358463 Compartilhar em outros sites More sharing options...
0 lelesho 0 Postado Outubro 8, 2012 Autor Share Postado Outubro 8, 2012 Obrigado. funcionou muito bem. Link para o comentário https://xtibia.com/forum/topic/195939-npc-citzen-global/#findComment-1358694 Compartilhar em outros sites More sharing options...
0 KUNGLOW 14 Postado Outubro 8, 2012 Share Postado Outubro 8, 2012 De nada. Irei reportar para que movam o tópico. Link para o comentário https://xtibia.com/forum/topic/195939-npc-citzen-global/#findComment-1358752 Compartilhar em outros sites More sharing options...
0 Critical 70 Postado Outubro 8, 2012 Share Postado Outubro 8, 2012 Dúvida sanada, tópico movido. Atenciosamente, Critical. Link para o comentário https://xtibia.com/forum/topic/195939-npc-citzen-global/#findComment-1358833 Compartilhar em outros sites More sharing options...
Pergunta
lelesho 0
Eu gostaria de um npc que da as 2 addons,
Citizen Hat:
Requisitos:
• 100 Chicken Feathers
• 50 Honeycombs
• 1 Legion Helmet
Citação:
Hi
hat
yes
Bye
*Ela te da a addon.
Recompensa
Citizen Backpack
Requisitos:
• 100 Minotaur Leather
Citação: Hi
backpack
yes
*Ela lhe dará a addon.
alguem poderia fazer ou me ensinar porfavor?
Link para o comentário
https://xtibia.com/forum/topic/195939-npc-citzen-global/Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados