BrunooMaciell 84 Postado Dezembro 13, 2013 Share Postado Dezembro 13, 2013 Estou aqui pra fazre um pedido relacionado a npc travel !! NPC Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid)) thenreturn falseendlocal talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cidif(msgcontains(msg, 'ticket')) thenif getPlayerMoney(cid) >= 500 thenselfSay('You want to buy 1 travel ticket?, it cost 5 dollars', cid)talkState[talkUser] = 1elseselfSay('You don\'t have enough money, it cost 5 dollars.', cid)endelseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) thenif doPlayerRemoveMoney(cid, 500) == TRUE thensetPlayerStorageValue(cid, 4592, 1)selfSay('Here is your ticket, it can not be transfere, when you have used the ticket at the boat, it can not be used again, go to the boat to use it.', cid)endendreturn TRUEendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new()) Eu queria que o cara que for usa este npc ele tem que este com o pokemon dentro da ball !! q quem for mi ajuda se possivelmente puter posta a linha pois tem +3 npcs assim dai eu ia adicionar nos outros 3 ^^ Curti++ Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/ Compartilhar em outros sites More sharing options...
Warby 1 Postado Dezembro 14, 2013 Share Postado Dezembro 14, 2013 (editado) Bruno Maciel,Peguei uma pequena linha do Script da Bike no PDA do Slicer. if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Return your pokemon.") endJá que eu não entendo quase nada de Script, tente colocar isso no topo do comando, qualquer erro meu me corrija por favor.@EditNão esqueça de fazer um Backup de seu arquivo!. Editado Dezembro 14, 2013 por Warby Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592384 Compartilhar em outros sites More sharing options...
BrunooMaciell 84 Postado Dezembro 14, 2013 Autor Share Postado Dezembro 14, 2013 tipo esta tag pode ate funciona porem tem que sabe o lugar certo da script pra add pra nao da erro de linha !! Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592387 Compartilhar em outros sites More sharing options...
Warby 1 Postado Dezembro 14, 2013 Share Postado Dezembro 14, 2013 Bruno,Pegue a script da Bike inteira e tente onde você acha. Como eu disse acima, sou novo em Scriptings. Mostrar conteúdo oculto local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) end local function BikeSpeedOff(cid, t) setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getThingPos(cid) local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 500} if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "Return your pokemon.") end if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then --alterado v2.9 return doPlayerSendCancel(cid, "You can't do that right now.") end if getPlayerStorageValue(cid, t.s) <= 0 then doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.') BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 1394}, -1) else doSetCreatureOutfit(cid, {lookType = 1393}, -1) end else doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.') BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT) end return true end Creio que seja no topo do comando. Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592396 Compartilhar em outros sites More sharing options...
zipter98 1101 Postado Dezembro 14, 2013 Share Postado Dezembro 14, 2013 Tenta assim: Mostrar conteúdo oculto 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, 'ticket')) then if getPlayerMoney(cid) >= 500 then selfSay('You want to buy 1 travel ticket?, it cost 5 dollars', cid) talkState[talkUser] = 1 else selfSay('You don\'t have enough money, it cost 5 dollars.', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if #getCreatureSummons(cid) >= 1 then selfSay("Retorne seu pokémon para a pokeball, antes...") talkState[talkUser] = 1 return true elseif doPlayerRemoveMoney(cid, 500) == TRUE then setPlayerStorageValue(cid, 4592, 1) selfSay('Here is your ticket, it can not be transfere, when you have used the ticket at the boat, it can not be used again, go to the boat to use it.', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592397 Compartilhar em outros sites More sharing options...
BrunooMaciell 84 Postado Dezembro 14, 2013 Autor Share Postado Dezembro 14, 2013 Vlw ^^ Curti++ Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592605 Compartilhar em outros sites More sharing options...
zipter98 1101 Postado Dezembro 14, 2013 Share Postado Dezembro 14, 2013 Tópico movido para a seção de dúvidas e pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1592638 Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/225585-encerrado-pedido-npc/#findComment-1735966 Compartilhar em outros sites More sharing options...
Posts Recomendados