[Poke-Tibia] Script Saffari Ajuda

Neo Sonny
em Resolvidos

Neo Sonny

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/12/16Posts: 11

Preciso fazer 1 NPC Teleport Saffari ( sem balls ) precise dinheiro para fazer Teleport , Quando faz teleport da ---- 50 balls saffari ou qualquer outro item ---.. 

REP + Quiem meu Poda Ajudar Pfv

Mulizeu

Programar ate cair os dedos
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 05/08/10Posts: 218Gênero: Masculino

Vá em Data/ Npcs Crie Um arquivo chamado Saffari.xml e coloque

<?xml version="1.0" encoding="UTF-8"?><npc name="Loren" script="saffari.lua" walkinterval="350000" floorchange="0" speed="0" lookdir="2"><health now="150" max="150"/><look type="495" head="0" body="15" legs="20" feet="25"/>    <parameters>        <parameter key="message_greet" value="Hello, I am living here with Professor Oak and Professor Ivy, I am training those Lapras, but they need some {travel}s to get stronge."/>    </parameters></npc>

 

Agora em npcs/Script crie um Arquivo chamado saffari.lua e coloque

focus = 0talk_start = 0target = 0following = falseattacking = falselocal SaffariBalls = {ID SAFFARI BALLS}local SafariEnter = {x=1676, y=1389, z=6} -- Posição da Entrada Safarifunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid then   selfSay('See ya.')   focus = 0   talk_start = 0endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str)return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction 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á 1k vc aceita??')   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("Você não pode entrar no Saffari com nenhuma outra ball exceto a Saffari!! 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, 100000) then       setPlayerStorageValue(cid, 98796, 1)      setPlayerStorageValue(cid, 98797, 1)      doPlayerAddItem(cid, 12617, SaffariBalls)        doTeleportThing(cid, SafariEnter)      doSendMagicEffect(getThingPos(cid), 21)      talk_start = os.clock()   else      selfSay("Você não tem dinheiro suficiente")         focus = 0      talk_start = 0   endelseif (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 = 0endendfunction onCreatureChangeOutfit(creature)endfunction onThink()if (os.clock() - talk_start) > 30 thenif focus > 0 thenselfSay('See ya.')endfocus = 0endend

 

Deadpool

!!!
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 25/10/11Posts: 2175Gênero: MasculinoChar no Tibia: Sociopata

Caro membro, seu tópico foi movido de Scripts > Otserv > NPCs, monsters e raids para Otserv > Suporte Otserv.

 

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

 

 

 

 

DICA

Utilize botão @UP, no início de seu tópico, para atualizar o destaque de seu tópico em "Tópicos Recentes" na index, fará com que mais pessoas o vejam.