BR

[Encerrado] (Pedido) Npc Saffari

Por BrunooMaciell, 15 de out. de 2013 em Tópicos Sem Resposta

pedido - poketibia
resolvido
script
6
861
BrunooMaciellB
15 de outubro de 2013 às 21:38

Estou aqui pra pedir uma coisa relacionado a script do npc saffari !!

 

SCRIPT

 

focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
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) < 3 then
selfSay('Hello, i can let you enter in the saffari zone for 1HD, do you accept?')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 or getPlayerItemCount(cid, 12617) >= 1 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("You already are in the saffari zone!")
focus = 0
talk_start = 0
elseif doPlayerRemoveMoney(cid, 100000) then
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 12617, 30)
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
else
selfSay("You don't have that much of money. Cya") --alterado v1.9
focus = 0
talk_start = 0
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end

function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end

 

 

PEDIDO

 

eu queria por a linha onde posso editar o lugar que ele vai teleporta o player porque nao achei na script e ela ta teleportando o player no lugar errado dai nao tem como arrumar =/

 

Curti+

Jeffer000J
15 de outubro de 2013 às 21:52

é só trocar

doTeleportThing(cid, SafariEnter)

por

local pos = {x=1333,y=1470,z=7} -------------- Pos para onde o player sera levado
doTeleportThing(cid, pos)
WiishtW
15 de outubro de 2013 às 21:56

Amigo acho que não é preciso trocar as linhas /\

a Posição dos teleportes estão encontradas em lib/configuration.lua

"------------- Posiçoes de entrada e saida do saffari! ----------------------"

está neste local.

BrunooMaciellB
15 de outubro de 2013 às 22:11

vlw !!

 

deu certo ^^

 

Curti+

AlexclusiveA
15 de outubro de 2013 às 23:59

Tópico movido para a seção de dúvidas e pedidos resolvidos.

4 anos depois...
StigalS
21 de abril de 2018 às 03:10
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.