alexandrexf 3 Postado Março 12, 2011 Share Postado Março 12, 2011 (editado) Eae galera, blz? Eu queria saber se alguem poderia me passar algum script de Promotion Quest, ele é mais ou menos assim: Eu crio no meu mapa um monte de bichos e no final tem um Npc que Você fala assim: Hi, promotion, yes Ou só assim: Hi, promotion E o Npc não pede nada em troca, ou seja, a Promotion é de graça E se possível eu queria que tivesse outra fala com o Npc assim: Quando o player não sabe como ganhar a Promotion ele fala assim: Help Depois o Npc explica como ganhar a Promotion Obrigado desde já ---- Edit: Obrigado Vodkart pelo Script e obrigado Demonbholder pela Xml do npc, mas eu queria fazer uma pergunta boba, aonde eu coloco a ID da Vocation pra promove ele? Att ---- Edit: (29/03/2011) Resolvido, pode dar Closed, por favor, Obrigado Era só mudar na parte de Vocations.xml no fromvoc="" Att, Alexandre Editado Março 30, 2011 por Alexandre Ferreira Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/ Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Março 12, 2011 Share Postado Março 12, 2011 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, 'promotion') or msgcontains(msg, 'promote')) then if(getPlayerPromotionLevel(cid) >= 1) then return selfSay('You are already promoted!.', cid) end setPlayerPromotionLevel(cid, 1) selfSay('Congratulations! You are now promoted.', cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/#findComment-1012105 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Março 12, 2011 Share Postado Março 12, 2011 (editado) XML... <?xml version="1.0" encoding="UTF-8"?> <npc name="Npc Name" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="142" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|, Diga promote para ser promovido."/> <parameter key="message_farewell" value="Adeus |PLAYERNAME|."/> </parameters> </npc> Vodkart, entra no msn. Editado Março 12, 2011 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/#findComment-1012127 Compartilhar em outros sites More sharing options...
MaxLinux 2 Postado Março 15, 2011 Share Postado Março 15, 2011 Para fazer eu NPC em XML Bem se seu Servidor for XML (DO SECULO PASSADO) tente este Script. Vá em Data/NPCs, crie um arquivo .lua com o seguinte nome: promotionpc.lua Abra-o e cole isto: <?xml version="1.0"?> <npc name="Promotion" script="data/npc/scripts/promotionpcscript.lua" access="3" autowalk="25" lookdir="1"> <health now="1000" max="1000"/> <look type="140" head="0" body="0" legs="0" feet="0" addons="0" corpse="3128"/> </npc> No local em vermelho edite para o nome que desejar. Depois vá até Data/Npcs/Scripts, crie um arquivo promotionpcscript.lua e cole isto dentro dele: local focus = 0 local talk_start = 0 local target = 0 local days = 0 function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') 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) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Ola ' .. creatureGetName(cid) .. ',o que o traz até mim?') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. creatureGetName(cid) .. ' estou ocupada! Falo com voce daqui a pouco.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'hail the queen') then selfSay('O que o traz até mim?') talk_state = 0 elseif msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then selfSay('Voce quer ser promovido por 10 Crystal Coin?') talk_state = 0 elseif msgcontains(msg, 'yes') then if getPlayerVocation(cid) > 4 then selfSay('Desculpe, voce ja foi promovido.') talk_state = 0 elseif getPlayerLevel(cid) < 100 then selfSay('Desculpe, voce precisa ser nivel 100 para ser promovido.') talk_state = 0 elseif not isPremium(cid) then selfSay('Sorry, you must be premium to buy promotion.') talk_state = 0 elseif doPlayerRemoveItem(cid,2160,10) == 1 then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) doSendAnimatedText(getPlayerPosition(cid), "Promoted", TEXTCOLOR_WHITE_EXP) doSendMagicEffect(getPlayerPosition(cid),14) selfSay('Parabéns agora você esta mais poderoso.') talk_state = 0 else selfSay('Voce não tem dinheiro suficiente para promotion. [100k]') talk_state = 1 end elseif msgcontains(msg, 'hi') or msgcontains(msg, 'hello') then selfSay('Please Respect Child!') elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end Locais em Verde edite para o valor da Promotion. Locais em Azul edite para o Level necessário Espero ter Ajudado! Created by Max Linux Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/#findComment-1013215 Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Março 15, 2011 Share Postado Março 15, 2011 não ajudou não,primeiro porque você não leu o tópico,se tivesse lido saberia que o npc que ele pediu é bem diferente do seu, e segundo o tópico já foi respondido,não tinha necessidade de colocar outro script,a não ser que o meu não tenha funcionado. faloust =* Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/#findComment-1013247 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Março 15, 2011 Share Postado Março 15, 2011 ---- Edit: Obrigado Vodkart pelo Script e obrigado Demonbholder pela Xml do npc, mas eu queria fazer uma pergunta boba, aonde eu coloco a ID da Vocation pra promove ele? Att Não precisa colocar id de vocação no script, ele vai promover os jogadores que são kina, sorc, druid e paly para suas devidas promoções. Caso esteja se referindo ao vocations.xml, deve se editar o fromvoc="" da vocação promotion, e colocar o id da vocação que sucede a promoção. Link para o comentário https://xtibia.com/forum/topic/153256-pedido-promotion-quest/#findComment-1013260 Compartilhar em outros sites More sharing options...
Posts Recomendados