cacaiu 10 Postado Setembro 7, 2012 Share Postado Setembro 7, 2012 Ola pessoal olha eu aqui de novo =D dessa vez vim pedir um script dificil mais não imposivel queria um script que fizesse o seguinte: O player fala com o npc: player: HI npc: ola (player name) voçe deseja viajar? player:Yes npc: OK! boa viajem. logo em seguiada o player quanha um outifit EX: outifit de um carinha montado na moto (eu ja tenho aki) e segue uma rota pre-destinada ate o local, que irei editar aki. OBS: ate chegar la o player n podera se mexer. quando o player chega la a outifit sai e ele volta ao normal. valendo rep+ Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/ Compartilhar em outros sites More sharing options...
0 notle2012 233 Postado Setembro 8, 2012 Share Postado Setembro 8, 2012 (editado) bom tava tentando fazer aqui o melhor que conseguir fazer foi assim ver video em tela grande eu não tenho newtype de moto então coloquei 127 de test ta parando no pz data\npc\nomedonpc.xml <npc name="NPC NOME" script="data/npc/scripts/nmoto.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|.voce deseja viajar?" /> <parameter key="message_farewell" value="Tchau." /> <parameter key="message_walkaway" value="Tchau." /> </parameters> </npc> data\npc\scripts\nmoto.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) pos = {x=1060,y=1065,z=7} -- aqui coloca na onde que vai ativa a moto newtypemoto = 127 -- newtype da sua moto effect = 34 -- efeito que sair atrás da moto fumaças local storages = { speed = 115625, status = 222995 } -- storages local cfg = { min_speed = 300, -- não mexe ou deixa de 200 a 300 pode regular max_speed = 200, -- melhor não diminuir do que isso [a velocidade máxima da sua Moto ] Moto_Explode = true -- não mexe } function isWalkable(pos, creature, pz) if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function getMotoSpeed(cid) return getPlayerStorageValue(cid,storages.speed) end function setMotoSpeed(cid,value) return setPlayerStorageValue(cid,storages.speed, getPlayerStorageValue(cid,storages.speed) + value) end function setMotoStatus(cid,value) return setPlayerStorageValue(cid,storages.status,value) end function MotoMove(cid) return getPlayerStorageValue(cid,storages.status) > 0 and true or false end function move(cid,time) local dir = getCreatureLookDir(cid) local place = getPositionByDirection(getThingPos(cid),dir,1) if isWalkable(place,true,true,true) then doTeleportThing(cid,place,false) addEvent(doSendMagicEffect,time+10,place,effect) if MotoMove(cid) then addEvent(move,time,cid,getMotoSpeed(cid)) else end else doCreatureSetNoMove(cid, 0) doPlayerSendTextMessage(cid,27,"You have hit somthng.") setMotoStatus(cid,0) if cfg.Moto_Explode then doRemoveCondition(cid, CONDITION_OUTFIT) doSendAnimatedText(getThingPos(cid),"Crashed",TEXTCOLOR_RED) doSendMagicEffect(getThingPos(cid),31) end end end 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 msgcontains(msg, 'yes') then selfSay("OK! boa viajem.", cid) if doTeleportThing(cid, pos) then doSetCreatureOutfit(cid, {lookType = newtypemoto}, -1) if not MotoMove(cid) then end setPlayerStorageValue(cid,storages.speed,cfg.min_speed) setMotoStatus(cid,1) doCreatureSetNoMove(cid, 1) move(cid,getMotoSpeed(cid)) else doPlayerSendCancel(cid,"Moto is already moving.") end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Setembro 8, 2012 por notle2012 Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1334528 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 8, 2012 Autor Share Postado Setembro 8, 2012 (editado) notle2012 vc é fod4 vlw msm veyi exatamente oq eu queria quando libera mais rep aki te dou lo uns 4 ^^ OBS: esse serve é o centurion hueheuheuh Duvida! onde mexo pra determina o destino da moto. Editado Setembro 8, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1334634 Compartilhar em outros sites More sharing options...
0 notle2012 233 Postado Setembro 8, 2012 Share Postado Setembro 8, 2012 (editado) notle2012 vc é fod4 vlw msm veyi exatamente oq eu queria quando libera mais rep aki te dou lo uns 4 ^^ OBS: esse serve é o centurion hueheuheuh Duvida! onde mexo pra determina o destino da moto. que nada to aprendendo agora essas paradas de for i = 0, 255 do esse scripts ta funcionando da seguinte forma vc coloca pos ={x=1060,y=1065,z=7}-- aqui coloca na onde que vai ativa a moto ai pra parar que é lugar onde vc quer chegar vc coloca no chão PZ com map editor exemplo se vc quer acelerar moto vc edita aqui local cfg = { min_speed = 300, -- recomendo de 200 a 300 eu não deixo mais melhor pq to aprendendo mais alguém mais experiente quiser edita ai se sinta a vontade edit sim o ot é o centurion baixei pra testa kkk ah tbm vou tenta aqui se eu conseguir melhorar mais eu aposto Editado Setembro 8, 2012 por notle2012 Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1334922 Compartilhar em outros sites More sharing options...
0 Gee1 1 Postado Setembro 9, 2012 Share Postado Setembro 9, 2012 Onde que configura o caminho que a moto tem que ir ? Tipo o sistema de barco por uma rota. Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1335678 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 11, 2012 Autor Share Postado Setembro 11, 2012 (editado) notle2012 tipo colocamos o caminho em pz ai o script vai seguindo o pz, ou so no final pra ele para de andar? galera axo q esse script aki poke ajuda pra defenir a rota: <?xml version="1.0" encoding="UTF-8"?> <mod name="BoatSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com"> <config name="BoatSystemLib"><![CDATA[ mydirs= { [1] = {type = 1, ids = {3587, 3590, 3591}, xy = {0, -1}}, [2] = {type = 2, ids = {3592, 3595, 3596}, xy = {1, 0}}, [3] = {type = 1, ids = {3587, 3590, 3591}, xy = {0, 1}}, [4] = {type = 2, ids = {3592, 3595, 3596}, xy = {-1, 0}} } allids = {3587, 3590, 3591, 3592, 3595, 3596} function newEndb(endb, dir) local xx = endb.x local yy = endb.y for i = 1, #dir do xx = xx+mydirs[dir].xy[1] yy = yy+mydirs[dir].xy[2] end return {x=xx, y=yy, z=endb.z} end function doMoveBoat(post, dir, cid) local newboat = {} for i,s in ipairs(post) do local backu = getThingPos(s) doRemoveItem(s, 1) doCreateItem(mydirs[dir].ids, 1, {x=backu.x+mydirs[dir].xy[1], y=backu.y+mydirs[dir].xy[2], z=backu.z}) table.insert(newboat, getThingFromPos({x=backu.x+mydirs[dir].xy[1], y=backu.y+mydirs[dir].xy[2], z=backu.z, stackpos=1}).uid) end if mydirs[dir].type ~= post.type and mydirs[dir].type == 1 then doCreateItem(getThing(newboat[1]).itemid, 1, {x=getThingPos(newboat[1]).x+1, y=getThingPos(newboat[1]).y-1, z=getThingPos(newboat[1]).z}) doRemoveItem(newboat[1], 1) doCreateItem(getThing(newboat[3]).itemid, 1, {x=getThingPos(newboat[3]).x-1, y=getThingPos(newboat[3]).y+1, z=getThingPos(newboat[3]).z}) doRemoveItem(newboat[3], 1) elseif mydirs[dir].type ~= post.type and mydirs[dir].type == 2 then doCreateItem(getThing(newboat[1]).itemid, 1, {x=getThingPos(newboat[1]).x-1, y=getThingPos(newboat[1]).y+1, z=getThingPos(newboat[1]).z}) doRemoveItem(newboat[1], 1) doCreateItem(getThing(newboat[3]).itemid, 1, {x=getThingPos(newboat[3]).x+1, y=getThingPos(newboat[3]).y-1, z=getThingPos(newboat[3]).z}) doRemoveItem(newboat[3], 1) end if cid then doTeleportThing(cid, {x=getCreaturePosition(cid).x+mydirs[dir].xy[1], y=getCreaturePosition(cid).y+mydirs[dir].xy[2], z=getCreaturePosition(cid).z}, false) end end function getPosBoat(cid, pos) local pcid = not pos and getCreaturePosition(cid) or pos local check = getThingFromPos({x=pcid.x, y=pcid.y, z=pcid.z, stackpos=1}).itemid == mydirs[1].ids[2] and 1 or 2 if check == 1 then return {getThingFromPos({x=pcid.x, y=pcid.y-1, z=pcid.z, stackpos=1}).uid, getThingFromPos({x=pcid.x, y=pcid.y, z=pcid.z, stackpos=1}).uid, getThingFromPos({x=pcid.x, y=pcid.y+1, z=pcid.z, stackpos=1}).uid, type = check} elseif check == 2 then return {getThingFromPos({x=pcid.x-1, y=pcid.y, z=pcid.z, stackpos=1}).uid, getThingFromPos({x=pcid.x, y=pcid.y, z=pcid.z, stackpos=1}).uid, getThingFromPos({x=pcid.x+1, y=pcid.y, z=pcid.z, stackpos=1}).uid, type = check} end return false end function reverse(t) local result = {} for i = #t, 1, -1 do table.insert(result, t == 1 and 3 or t == 2 and 4 or t == 3 and 1 or t == 4 and 2) end return result end ]]></config> <movevent type="StepIn" actionid="6616" event="script"><![CDATA[ domodlib("BoatSystemLib") local t = {4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2} local postart = {x=968, y=1001, z=7, stackpos=1} local posback = {x=994, y=978, z=7, stackpos=1} local delay = 350 if toPosition.x == posback.x and toPosition.y == posback.y then doCreatureSetNoMove(cid, true) for i = 1, #reverse(t) do addEvent(function() doMoveBoat(getPosBoat(cid), reverse(t), cid) end, i*delay) end addEvent(doCreatureSetNoMove, delay*#reverse(t)+100, cid, false) addEvent(function() doItemSetAttribute(getThingFromPos(postart).uid, "aid", 6616) end, delay*#t+100) elseif toPosition.x == postart.x and toPosition.y == postart.y then doCreatureSetNoMove(cid, true) for i = 1, #t do addEvent(function() doMoveBoat(getPosBoat(cid), t, cid) end, i*delay) end addEvent(doCreatureSetNoMove, delay*#t+100, cid, false) addEvent(function() doItemSetAttribute(getThingFromPos(posback).uid, "aid", 6616) end, delay*#t+100) end ]]></movevent> <movevent type="StepIn" actionid="6617" event="script"><![CDATA[ domodlib("BoatSystemLib") if not isInArray(allids, getThingFromPos({x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=1}).itemid) then doTeleportThing(cid, fromPosition, false) end ]]></movevent> </mod> edita nessa parte aki: local t = {4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2} local postart = {x=968, y=1001, z=7, stackpos=1} local posback = {x=994, y=978, z=7, stackpos=1} local delay = 350 No Local T sao Todas as Direçoes que o barco vai andar em sentido horario 1 = norte 2 = leste 3 = sul 4 = oeste sera que com isso pode ajudar a fazer? Editado Setembro 11, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1335844 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 (editado) Cara, eu acho que dá pra fazer uma edição no script pra, ao invés de criar um item, colocar uma outfit (motoqueiro na moto). Vou dar uma estudada nele aqui, se eu conseguir eu edito. Só que ai teria que fazer um NPC inteiro com as funções desse MOD. Infelizmente, eu não consigo fazer isso ainda. Muito complexo. O que poderia fazer é o player subir em cima da moto e começar a andar, mas ai teria que editar uma série de coisas, como o client (fazer uma moto que pode ser "pisada"). Vou consultar o Mestre Supremo dos Scripts, se ele conseguir ajudar, eu posto aqui. Editado Setembro 11, 2012 por LuckOake Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336737 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 11, 2012 Autor Share Postado Setembro 11, 2012 (editado) LuckOake blz, em relaçao com as sprites não se preucupe, conssigo fazer isso facil. Editado Setembro 11, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336751 Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 (editado) Fiz um script aqui, ele é bem complexozinho e eu não testei, portanto é bem provável que dê alguns bugs: 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 local config = { LOOKTYPE_DA_MOTO = 127, -- outfit da moto, apenas looktype DELAY_ENTRE_ANDADAS = 450, -- intervalo (em ms) a cada passo que o player dá VELOCIDADE_EXTRA = 1000, -- velocidade a mais que o player ganha na moto EMPURRAR_CRIATURAS = true, -- true/false, se true, todos os monstros/players que estiverem no caminho serão empurrados pro lado ATRAVESSAR_OBSTACULOS = true, -- true/false, se true, vai entrar e passar por dentro de paredes, árvores etc... POS_INICIAL = {x = 100, y = 100, z = 7}, -- onde o player irá ser teleportado ao confirmar a msg do npc POS_FINAL = {x = 102, y = 95, z = 7}, ROTA_AUTOMATICA = false, -- procura por direções automaticamente, sem precisar configurar as directions -- porém há grandes chance de encontrar obstáculos/falhar ROTA_POR_DIRECTION = {NORTH, NORTH, EAST, NORTH, NORTH, NORTH, EAST} -- apenas se ROTA_AUTOMATICA for false } local function getNextDir(playerpos, finalpos) local result = {} local xy = 999999 for newDir = 0, 3 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} elseif d == xy then table.insert(result, newDir) end end end if #result == 0 then for newDir = 4, 7 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} elseif d == xy then table.insert(result, newDir) end end end return #result == 0 and false or result[math.random(#result)] else return result[math.random(#result)] end return false end local function doPlayerFollowRoute(cid, stepId) if not isCreature(cid) then return true end if not stepId then doCreatureSetNoMove(cid, true) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doChangeSpeed(cid, config.VELOCIDADE_EXTRA) doSetCreatureOutfit(cid, {lookType = config.LOOKTYPE_DA_MOTO}, -1) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, 1) return true end local begin, finish = getThingPos(cid), config.POS_FINAL if (begin.x == finish.x and begin.y == finish.y) or (not config.ROTA_AUTOMATICA and stepId == #config.ROTA_POR_DIRECTION + 1) then doPlayerSendCancel(cid, "Destino alcançado!") doCreatureSetNoMove(cid, false) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) return true end if getCreatureOutfit(cid).lookType ~= config.LOOKTYPE_DA_MOTO then doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) return true end local nextPos = {} if config.ROTA_AUTOMATICA then nextPos = getPosByDir(getThingPos(cid), getNextDir(getThingPos(cid), config.POS_FINAL) or getDirectionTo(getThingPos(cid), config.POS_FINAL)) else nextPos = getPosByDir(getThingPos(cid), ROTA_POR_DIRECTION[stepId or 1]) end if not (doTileQueryAdd(cid, nextPos) == 1 or config.ATRAVESSAR_OBSTACULOS) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetNoMove(cid, false) return doPlayerSendCancel(cid, "Obstáculo encontrado!") end if config.EMPURRAR_CRIATURAS and config.ATRAVESSAR_OBSTACULOS and getTileInfo(nextPos).creatures > 0 then for pushCreatures = 1, #getTileInfo(nextPos).creatures do local creature = getTopCreature(nextPos).uid addEvent(doTeleportThing, 50, creature, getClosestFreeTile(creature, getThingPos(creature))) end end doTeleportThing(cid, nextPos) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, (stepId or 1) + 1) end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'yes') then selfSay("OK! boa viajem.", cid) doTeleportThing(cid, config.POS_INICIAL, false) doPlayerFollowRoute(cid) return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Use o mesmo XML que o Luck postou aqui e veja se funciona... Não se esqueça de configurar o npc! basta alterar aquela tabela "config" que tem várias variáveis com letra maiúscula Editado Setembro 11, 2012 por brun123 Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336787 Compartilhar em outros sites More sharing options...
0 ewertonsilva157 5 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 Parabéns pelo Script \o Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336840 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 11, 2012 Autor Share Postado Setembro 11, 2012 (editado) brun123 vou tes ta aki se pega te dou rep 2x xD uma duvida: ROTA_POR_DIRECTION = {NORTH, NORTH, EAST, NORTH, NORTH, NORTH, EAST} -- apenas se ROTA_AUTOMATICA for false aki eu escolho a rota certo! ex: cada NORTH é um sqm? e outra coisa: POS_INICIAL = {x = 856, y = 502, z = 2}, -- onde o player irá ser teleportado ao confirmar a msg do npc POS_FINAL = {x = 856, y = 520, z = 2}, se eu bota a pos final, so quando o ele procura a rota altomaticamente? ou não vai interferir no false da rota altomatica? @EDIT: Bugs: 1°:ao chegar perto do npc e so fala yes ele ja manda vc pro local inicial. 2°:quando é teleportado o player não anda pra local nenhum. imagem \/ No distro: [11/09/2012 12:07:25] [Error - Npc interface] [11/09/2012 12:07:25] In a timer event called from: [11/09/2012 12:07:25] data/npc/scripts/Motorista Jonh.lua:onCreatureSay [11/09/2012 12:07:25] Description: [11/09/2012 12:07:25] data/npc/scripts/Motorista Jonh.lua:74: attempt to index global 'ROTA_POR_DIRECTION' (a nil value) [11/09/2012 12:07:25] stack traceback: [11/09/2012 12:07:25] data/npc/scripts/Motorista Jonh.lua:74: in function <data/npc/scripts/Motorista Jonh.lua:49> Adiçoes: podia botar pra o player não poder relogar quando estiver na viajem? e poderia por uma funçao pra o npc remover um X item quando o player fala com ele? Editado Setembro 11, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336910 Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 (editado) Aqui: local avoidLogout = createConditionObject(CONDITION_INFIGHT, -1, 1660) 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 local config = { ITEM_REMOVIDO = 2160, -- id do item a ser removido ITEM_COUNT = 10, -- quantidade do item a ser removido LOOKTYPE_DA_MOTO = 127, -- outfit da moto, apenas looktype DELAY_ENTRE_ANDADAS = 450, -- intervalo (em ms) a cada passo que o player dá VELOCIDADE_EXTRA = 1000, -- velocidade a mais que o player ganha na moto EMPURRAR_CRIATURAS = true, -- true/false, se true, todos os monstros/players que estiverem no caminho serão empurrados pro lado ATRAVESSAR_OBSTACULOS = true, -- true/false, se true, vai entrar e passar por dentro de paredes, árvores etc... POS_INICIAL = {x = 100, y = 100, z = 7}, -- onde o player irá ser teleportado ao confirmar a msg do npc POS_FINAL = {x = 102, y = 95, z = 7}, ROTA_AUTOMATICA = false, -- procura por direções automaticamente, sem precisar configurar as directions -- porém há grandes chance de encontrar obstáculos/falhar ROTA_POR_DIRECTION = {NORTH, NORTH, EAST, NORTH, NORTH, NORTH, EAST} -- apenas se ROTA_AUTOMATICA for false } local function getNextDir(cid, playerpos, finalpos) local result = {} local xy = 999999 for newDir = 0, 3 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end if #result == 0 then for newDir = 4, 7 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end return #result == 0 and false or result[math.random(#result)] else return result[math.random(#result)] end return false end local function doPlayerFollowRoute(cid, stepId) if not isCreature(cid) then return true end if not stepId then doCreatureSetNoMove(cid, true) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doChangeSpeed(cid, config.VELOCIDADE_EXTRA) doSetCreatureOutfit(cid, {lookType = config.LOOKTYPE_DA_MOTO}, -1) doAddCondition(cid, avoidLogout) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, 1) return true end local begin, finish = getThingPos(cid), (config.ROTA_AUTOMATICA and config.POS_FINAL or {x = -1, y = -1}) if (begin.x == finish.x and begin.y == finish.y) or (not config.ROTA_AUTOMATICA and stepId == #config.ROTA_POR_DIRECTION + 1) then doPlayerSendCancel(cid, "Destino alcançado!") doCreatureSetNoMove(cid, false) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT, 1660) return true end if getCreatureOutfit(cid).lookType ~= config.LOOKTYPE_DA_MOTO then doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT, 1660) return true end local nextPos = {} if config.ROTA_AUTOMATICA then nextPos = getPosByDir(getThingPos(cid), getNextDir(cid, getThingPos(cid), config.POS_FINAL) or getDirectionTo(getThingPos(cid), config.POS_FINAL)) else nextPos = getPosByDir(getThingPos(cid), config.ROTA_POR_DIRECTION[stepId or 1]) end if not (doTileQueryAdd(cid, nextPos) == 1 or config.ATRAVESSAR_OBSTACULOS) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT, 1660) return doPlayerSendCancel(cid, "Obstáculo encontrado!") end if config.EMPURRAR_CRIATURAS and config.ATRAVESSAR_OBSTACULOS and getTileInfo(nextPos).creatures > 0 then for pushCreatures = 1, #getTileInfo(nextPos).creatures do local creature = getTopCreature(nextPos).uid addEvent(doTeleportThing, 50, creature, getClosestFreeTile(creature, getThingPos(creature))) end end doTeleportThing(cid, nextPos) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, (stepId or 1) + 1) end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'yes') then if not doPlayerRemoveItem(cid, config.ITEM_REMOVIDO, config.ITEM_COUNT) then selfSay("Você não tem o item necessário!") return true end selfSay("OK! boa viajem.", cid) doTeleportThing(cid, config.POS_INICIAL, false) doPlayerFollowRoute(cid) return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Detalhes: 1 - Achei que você quisesse que ao falar yes, o player fosse teleportado para uma certa posição (POS_INICIAL no caso) e aí sim começasse a andar, se não quiser isso, basta remover essa linha: doTeleportThing(cid, config.POS_INICIAL, false) 2 - O POS_FINAL é só se a ROTA_AUTOMATICA estiver true, o player fica andando até alcançar a POS_FINAL e aí ele para de andar. 3 - Se você determinar a ROTA_POR_DIRECTIONS e colocar ROTA_AUTOMATICA como false, ele vai seguir a ROTA_POR_DIRECTION até chegar na última direction especificada e para de andar novamente. No caso: {NORTH, NORTH, EAST, NORTH, EAST}, o player vai andar 1 sqm pro NORTE, depois mais 1 pro NORTE, aí 1 pro LESTE, aí um pro NORTE de novo e outro pro LESTE e vai finalizar a viagem. 4 - adicionado a condição infight pro player não dar logout, adicionado também as configurações ITEM_REMOVIDO e ITEM_COUNT pra configurar um item a ser removido pra poder viajar, e sua quantidade também. As direções são: NORTH /\ (norte, pra cima) EAST > (leste, pra direita) SOUTH \/ (sul, pra baixo) WEST < (oeste, para esquerda) SOUTHWEST (diagonal para baixo/esquerda) SOUTHEAST (diagonal para baixo/direita) NORTHWEST (diagonal para cima/esquerda) NORTHEAST (diagonal para cima/direita) você deve usar as palavras grifadas para completar a tabela de direções, ou então você usa números, sendo: 0 = norte 1 = leste 2 = sul 3 = oeste 4 = sudoeste 5 = sudeste 6 = noroeste 7 = nordeste Editado Setembro 11, 2012 por brun123 Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336943 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 11, 2012 Autor Share Postado Setembro 11, 2012 (editado) brun123 vou7 testa, se aparecer bug eu edito XD agora sim brun ficou show ta 99% =D esse 1% é: a funçao do player não relogar não ta saindo dps q acaba a viajem =l rep pra vc ja xD Editado Setembro 11, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1336951 Compartilhar em outros sites More sharing options...
0 Zikar 3 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 Nussa, esse script me ajudo d++, so gostaria de fazer um pedido, quando o player chega na POS_FINAL ele ser TELEPORTADO Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1337059 Compartilhar em outros sites More sharing options...
0 notle2012 233 Postado Setembro 11, 2012 Share Postado Setembro 11, 2012 (editado) brun123 vou7 testa, se aparecer bug eu edito XD agora sim brun ficou show ta 99% =D esse 1% é: a funçao do player não relogar não ta saindo dps q acaba a viajem =l rep pra vc ja xD depois do brun123 ter feito essa configuração tão complexa fico facil deixa 100% tenta assim quando acaba a viajem se da pra desloga com esse scripts a baixo local avoidLogout = createConditionObject(CONDITION_INFIGHT, -1 ,1660) 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 local config = { ITEM_REMOVIDO = 2160, -- id do item a ser removido ITEM_COUNT = 10, -- quantidade do item a ser removido LOOKTYPE_DA_MOTO = 127, -- outfit da moto, apenas looktype DELAY_ENTRE_ANDADAS = 450, -- intervalo (em ms) a cada passo que o player dá VELOCIDADE_EXTRA = 1000, -- velocidade a mais que o player ganha na moto EMPURRAR_CRIATURAS = true, -- true/false, se true, todos os monstros/players que estiverem no caminho serão empurrados pro lado ATRAVESSAR_OBSTACULOS = true, -- true/false, se true, vai entrar e passar por dentro de paredes, árvores etc... POS_INICIAL = {x = 1058, y = 1065, z = 7}, -- onde o player irá ser teleportado ao confirmar a msg do npc POS_FINAL = {x = 1009, y = 1065, z = 7}, ROTA_AUTOMATICA = false, -- procura por direções automaticamente, sem precisar configurar as directions -- porém há grandes chance de encontrar obstáculos/falhar ROTA_POR_DIRECTION = {WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST,WEST} -- apenas se ROTA_AUTOMATICA for false } local function getNextDir(cid, playerpos, finalpos) local result = {} local xy = 999999 for newDir = 0, 3 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end if #result == 0 then for newDir = 4, 7 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end return #result == 0 and false or result[math.random(#result)] else return result[math.random(#result)] end return false end local function doPlayerFollowRoute(cid, stepId) if not isCreature(cid) then return true end if not stepId then doCreatureSetNoMove(cid, true) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doChangeSpeed(cid, config.VELOCIDADE_EXTRA) doSetCreatureOutfit(cid, {lookType = config.LOOKTYPE_DA_MOTO}, -1) doAddCondition(cid, avoidLogout) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, 1) return true end local begin, finish = getThingPos(cid), (config.ROTA_AUTOMATICA and config.POS_FINAL or {x = -1, y = -1}) if (begin.x == finish.x and begin.y == finish.y) or (not config.ROTA_AUTOMATICA and stepId == #config.ROTA_POR_DIRECTION + 1) then doPlayerSendCancel(cid, "Destino alcançado!") doCreatureSetNoMove(cid, false) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT) return true end if getCreatureOutfit(cid).lookType ~= config.LOOKTYPE_DA_MOTO then doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT) return true end local nextPos = {} if config.ROTA_AUTOMATICA then nextPos = getPosByDir(getThingPos(cid), getNextDir(cid, getThingPos(cid), config.POS_FINAL) or getDirectionTo(getThingPos(cid), config.POS_FINAL)) else nextPos = getPosByDir(getThingPos(cid), config.ROTA_POR_DIRECTION[stepId or 1]) end if not (doTileQueryAdd(cid, nextPos) == 1 or config.ATRAVESSAR_OBSTACULOS) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) return doPlayerSendCancel(cid, "Obstáculo encontrado!") end if config.EMPURRAR_CRIATURAS and config.ATRAVESSAR_OBSTACULOS and getTileInfo(nextPos).creatures > 0 then for pushCreatures = 1, #getTileInfo(nextPos).creatures do local creature = getTopCreature(nextPos).uid addEvent(doTeleportThing, 50, creature, getClosestFreeTile(creature, getThingPos(creature))) end end doTeleportThing(cid, nextPos) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, (stepId or 1) + 1) end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'yes') then if not doPlayerRemoveItem(cid, config.ITEM_REMOVIDO, config.ITEM_COUNT) then selfSay("Você não tem o item necessário!") return true end selfSay("OK! boa viajem.", cid) doTeleportThing(cid, config.POS_INICIAL, false) doPlayerFollowRoute(cid) return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Setembro 11, 2012 por notle2012 Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1337146 Compartilhar em outros sites More sharing options...
0 cacaiu 10 Postado Setembro 17, 2012 Autor Share Postado Setembro 17, 2012 (editado) notle2012 ou brun123 tem como por pra o npc dar outifit, masculino ou feminino nesse script? eu tentei aki mais n deu. eu adicionei tbm uma tag assim: local avoidLogout = createConditionObject(CONDITION_INFIGHT, -1 ,1660) 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 local config = { ITEM_REMOVIDO = 2160, -- id do item a ser removido ITEM_COUNT = 1, -- quantidade do item a ser removido LOOKTYPE_DA_MOTO = 127, -- outfit da moto, apenas looktype DELAY_ENTRE_ANDADAS = 200, -- intervalo (em ms) a cada passo que o player dá VELOCIDADE_EXTRA = 1000, -- velocidade a mais que o player ganha na moto EMPURRAR_CRIATURAS = true, -- true/false, se true, todos os monstros/players que estiverem no caminho serão empurrados pro lado ATRAVESSAR_OBSTACULOS = true, -- true/false, se true, vai entrar e passar por dentro de paredes, árvores etc... POS_INICIAL = {x = 1084, y = 1076, z = 7}, -- onde o player irá ser teleportado ao confirmar a msg do npc POS_FINAL = {x = 856, y = 520, z = 7}, ROTA_AUTOMATICA = false, -- procura por direções automaticamente, sem precisar configurar as directions -- porém há grandes chance de encontrar obstáculos/falhar ROTA_POR_DIRECTION = {EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,SOUTH,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,EAST,} -- apenas se ROTA_AUTOMATICA for false } local function getNextDir(cid, playerpos, finalpos) local result = {} local xy = 999999 for newDir = 0, 3 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end if #result == 0 then for newDir = 4, 7 do local p = getPosByDir(playerpos, newDir) if doTileQueryAdd(cid, p, config.EMPURRAR_CRIATURAS and 4 or 0) == 1 or config.ATRAVESSAR_OBSTACULOS then local d = math.abs(p.x - finalpos.x) + math.abs(p.y - finalpos.y) if d < xy then result = {newDir} xy = d elseif d == xy then table.insert(result, newDir) end end end return #result == 0 and false or result[math.random(#result)] else return result[math.random(#result)] end return false end local function doPlayerFollowRoute(cid, stepId) if not isCreature(cid) then return true end if not stepId then doCreatureSetNoMove(cid, true) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doChangeSpeed(cid, config.VELOCIDADE_EXTRA) doSetCreatureOutfit(cid, {lookType = config.LOOKTYPE_DA_MOTO}, -1) doAddCondition(cid, avoidLogout) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, 1) return true end local begin, finish = getThingPos(cid), (config.ROTA_AUTOMATICA and config.POS_FINAL or {x = -1, y = -1}) if (begin.x == finish.x and begin.y == finish.y) or (not config.ROTA_AUTOMATICA and stepId == #config.ROTA_POR_DIRECTION + 1) then doPlayerSendCancel(cid, "Destino alcançado!") doCreatureSetNoMove(cid, false) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT) return true end if getCreatureOutfit(cid).lookType ~= config.LOOKTYPE_DA_MOTO then doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(cid, CONDITION_INFIGHT) return true end local nextPos = {} if config.ROTA_AUTOMATICA then nextPos = getPosByDir(getThingPos(cid), getNextDir(cid, getThingPos(cid), config.POS_FINAL) or getDirectionTo(getThingPos(cid), config.POS_FINAL)) else nextPos = getPosByDir(getThingPos(cid), config.ROTA_POR_DIRECTION[stepId or 1]) end if not (doTileQueryAdd(cid, nextPos) == 1 or config.ATRAVESSAR_OBSTACULOS) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doChangeSpeed(cid, -getCreatureSpeed(cid) + getCreatureBaseSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) return doPlayerSendCancel(cid, "Obstáculo encontrado!") end if config.EMPURRAR_CRIATURAS and config.ATRAVESSAR_OBSTACULOS and getTileInfo(nextPos).creatures > 0 then for pushCreatures = 1, #getTileInfo(nextPos).creatures do local creature = getTopCreature(nextPos).uid addEvent(doTeleportThing, 50, creature, getClosestFreeTile(creature, getThingPos(creature))) end end doTeleportThing(cid, nextPos) addEvent(doPlayerFollowRoute, config.DELAY_ENTRE_ANDADAS, cid, (stepId or 1) + 1) end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'yes') then if not doPlayerRemoveItem(cid, config.ITEM_REMOVIDO, config.ITEM_COUNT) then selfSay("Você não tem 100 Hundread Dollar!") return true end if #getCreatureSummons(cid) > 0 then selfSay("Você tem que puxa seu Pokemon para Pokebola!") return false end selfSay("OK! você deve abrir o baú, que vai se encontra no topo da montanha.", cid) doTeleportThing(cid, config.POS_INICIAL, false) doPlayerFollowRoute(cid) return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) mais ai ta acontecendo o seguinte: quando o poke ta fora da ball ele fala: Você tem que puxa seu Pokemon para Pokebola! mais ai ele tira a grana do cara sem ele viajar tem como arruma? Editado Setembro 17, 2012 por cacaiu Link para o comentário https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/#findComment-1340846 Compartilhar em outros sites More sharing options...
Pergunta
cacaiu 10
Ola pessoal olha eu aqui de novo =D
dessa vez vim pedir um script dificil mais não imposivel queria um script que fizesse o seguinte:
O player fala com o npc:
player: HI
npc: ola (player name) voçe deseja viajar?
player:Yes
npc: OK! boa viajem.
logo em seguiada o player quanha um outifit EX: outifit de um carinha montado na moto (eu ja tenho aki)
e segue uma rota pre-destinada ate o local, que irei editar aki.
OBS: ate chegar la o player n podera se mexer.
quando o player chega la a outifit sai e ele volta ao normal.
valendo rep+
Link para o comentário
https://xtibia.com/forum/topic/193673-script-acho-que-%C3%A9-dificil-mais-n%C3%A3o-imposivel/Compartilhar em outros sites
28 respostass a esta questão
Posts Recomendados