Postado Abril 24, 2013 12 anos Autor Hey ta que ta complicado, olha não estava aparescendo o NPC no game, ai coloquei mais um end no fim do script... O npc aparesce eu falo Hi, ele responde "Hello, GOD Otx! Would like to do a mission for me?" e acaba, quando digo mission, ele nao fala nada... estou saindo agora, mas obrigado pelo esforço.. to deixando o meu +REP Meus Trabalhos: *Spell Rajada de Flechas: http://migre.me/eI3aE
Postado Abril 24, 2013 12 anos Bom, agora eu estou em casa e to com meu pc º/ Vi que pelo jeito a Script não deu muito certo, então vamo lá.... Vá em data/npc e crie um arquivo taskshards.XML e põe isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Professor" script="taskshards.lua" floorchange="0" speed="0"> <health now="150" max="150"/> <look type="171" head="97" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Ola eu sou o professor Oak."/> <parameter key="message_farewell" value="Good bye!"/> <parameter key="message_idletimeout" value="Good bye!"/> <parameter key="message_walkaway" value="Good bye!"/> </parameters> </npc> Nome do NPC. Mensagem que o NPC irá falar. Agora vá em data/npc/scripts e crie um taskshards.lua e cole isso dentro: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {20} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false storage = 10004 --storage id. item = 8823 -- feather, ou outro item q ele pede pra buscar. quantiitem = 30 -- quantidade de item q precisa pegar. premio1 = 2160 -- item do premio no caso se for dinheiro. quant1 = 10 -- quantidade do premio. pexp = 500 -- experiencia do premio. 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 onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.',cid) focus = 0 talk_start = 0 talkState[talkUser] = 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if getDistanceToCreature(cid) > 4 then return false end if talkState[talkUser] ~= 3 then msg = string.lower(msg) end if (msgcontains(msg, 'hi')) then if #getCreatureSummons(cid) >= 1 then selfSay('Please back your Pokemon to the pokeball...', cid) focus = 0 talkState[talkUser] = 1 return false end if getPlayerStorageValue(cid, 17001) == 1 then focus = 0 talkState[talkUser] = 1 selfSay('You Are riding .', cid) return false end if getPlayerStorageValue(cid, 7778) >= 1 then focus = 0 talkState[talkUser] = 1 selfSay('You are using ability.', cid) return false end fala = "olá! eu preciso urgente de 30 feather para um projeto meu... pode me ajudar?" selfSay(fala,cid) talkState[talkUser] = 1 elseif ( ( msgcontains(msg,"yes") or (msgcontains(msg,"sim") ) ) and talkState[talkUser] == 1 ) then quest1 = getPlayerStorageValue(cid,storage) if quest1 == 2 then selfSay('Bem! você já me ajudou!',cid) else if quest1 ==1 then selfSay('Bom! Então vc trouxe minhas feathers? Deixe-me ve-lo.',cid) if doPlayerRemoveItem(cid, item, quantiitem) == true then selfSay('Obrigado! Agora poderei fazer meu projeto. Aqui sua recompença!',cid) doPlayerAddItem(cid,premio1,quant1) doPlayerAddExp(cid,pexp) setPlayerStorageValue(cid,storage, 2) talkState[talkUser] = 0 else selfSay('Voce não trouxe minhas feathers... Volte quando tivelas.',cid) talkState[talkUser] = 0 end else selfSay('Me traga 30 feathers para um projeto meu, Se voce me trazer te recompensarei com 10 hd e 500 de experiencia!',cid) setPlayerStorageValue(cid,storage, 1) end end elseif(msgcontains(msg, 'no')) then talkState[talkUser] = 0 selfSay('Ok Bye Then.', cid) elseif(msgcontains(msg, 'bye')) then selfSay('Ok Bye Then.', cid) talkState[talkUser] = 0 end end function onCreatureChangeOutfit(creature) end Se o premio for xp, é só remover a linha do premio1 = 2160 e a linha quant1 = 10 e deixar a linha pexp = 500. Mas se o premio for dinheiro e xp, você pode deixar assim mesmo rsrs'
Postado Abril 24, 2013 12 anos Autor brigado Ajudou muito +REP Meus Trabalhos: *Spell Rajada de Flechas: http://migre.me/eI3aE
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.