[Encerrado] [NPC] NPC SAFFARI PDA

HxRedBully
em Tópicos Sem Resposta

HxRedBully

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 07/05/13Posts: 102Char no Tibia: Kakashi Senami

Alguem poderia me dizer o pq do meu npc saffari tar tirando do saffari apos jogar 1 ball?

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('Olá a entrada no Saffari custará 50DL vc aceita??')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 getPlayerItemCount(cid,2393) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,12617) >= 1 then
selfSay("Você não pode entrar no Saffari com nenhuma outra ball exceto a Great Ball!! Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("Você já está na saffari zone!")
focus = 0
talk_start = 0
elseif doPlayerRemoveMoney(cid, 500) then --1000dl --alterado v1.9
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30) --alterado v1.9
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
else
selfSay("Você não tem dinheiro suficiente") --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

2qml0n9.png

Pokerangers

Ajuda? Manda PM!
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 15/05/13Posts: 290

Tente usar o meu, aqui está normal.

 

 

 

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 3000 Dollars, 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 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 then
selfSay("You don't have that much of money. 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
else
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30)
doPlayerRemoveMoney(cid, 300000)
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
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

Atenciosamente

Pokerangers

HxRedBully

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 07/05/13Posts: 102Char no Tibia: Kakashi Senami

 

Tente usar o meu, aqui está normal.

 

 

 

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 3000 Dollars, 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 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 then
selfSay("You don't have that much of money. 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
else
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30)
doPlayerRemoveMoney(cid, 300000)
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
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

 

Continua teleportando para fora apos tacar 1 ball C:

2qml0n9.png

Jakson Souza

cout << "Hello world!";
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/10/13Posts: 504Gênero: Masculino

ola amigo, irei tentar ajudar

 

bom em saffari.lua deleta tudo que tiver la e coloca isso \/

 

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 500 Dollars, 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, 50000) then --500dl --alterado v1.9
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 12617, 30) --alterado v1.9
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

 

e no npc leila.xml deixe assim \/

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>

<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

assim esta igual o meu e esta funcionando 100% :>

                                      0Vsoo6A.png                                WfsgI4h.png
 
O maior erro que você pode cometer, é o de ficar o tempo todo com medo de cometer algum.                                               

Pokerangers

Ajuda? Manda PM!
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 15/05/13Posts: 290

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

Atenciosamente

Pokerangers

Jakson Souza

cout << "Hello world!";
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/10/13Posts: 504Gênero: Masculino

 

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

no configuration são só as cordenadas amigo ^^

                                      0Vsoo6A.png                                WfsgI4h.png
 
O maior erro que você pode cometer, é o de ficar o tempo todo com medo de cometer algum.                                               

Pokerangers

Ajuda? Manda PM!
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 15/05/13Posts: 290

 

 

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

no configuration são só as cordenadas amigo ^^

 

Sim, eu sei, porem eu tive que arrumar isto no meu servidor,

Eu tinha um problema parecido...

Atenciosamente

Pokerangers

HxRedBully

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 07/05/13Posts: 102Char no Tibia: Kakashi Senami

@Snix
bom alterei para great ball e continuou saindo apos 1 ball

@Pokerangers
ai seria para mudar entrada/saida ;c
----
pelo visto esta configurado em algum lugar do pda que se tacar ball que n é saffari é teleportado C:

2qml0n9.png

jeanflamengo

[> ObservandU essa bagaÇa <]
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 31/07/09Posts: 205Gênero: Masculino

ve seu arquivo catch.lua e procura por issu

 

if getPlayerStorageValue(cid, 98796) >= 1 and getPlayerItemCount(cid, 12617) <= 0 then --alterado v1.9
setPlayerStorageValue(cid, 98796, -1)
setPlayerStorageValue(cid, 98797, -1)
doTeleportThing(cid, SafariOut, false)
doSendMagicEffect(getThingPos(cid), 21)
doPlayerSendTextMessage(cid, 27, "You spend all your saffari balls, good luck in the next time...")
end
se issu "and getPlayerItemCount(cid, 12617) <= 0 then" nao estiver assim mude

HxRedBully

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 07/05/13Posts: 102Char no Tibia: Kakashi Senami

Obrigado jean.
alguem reporta para fechar topico? ;c

2qml0n9.png

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

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

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel