OMG!
Liberou pra all.
UHAuhahua
Da nada isso ai.
Black Onix Team.
=)
Muito bom esse npc ai.
Eu testei ele óh =O
\o
//Renan Cunhaz
info
Grupo: Campones
Registrado: 23/05/07
Posts: 15
Reputação: +1

OMG!
Liberou pra all.
UHAuhahua
Da nada isso ai.
Black Onix Team.
=)
Muito bom esse npc ai.
Eu testei ele óh =O
\o
//Renan Cunhaz
, haja criatividade em!
Esse ai vou testar assim que chegar em casa ^^
Errr...
Mas pra que serve exatamente?
Joga ímpar/par e faz o que?
info
Grupo: Grão-Duque
Registrado: 02/10/06
Posts: 3.3k
Reputação: +151
Gênero: Masculino

damus sempre inovando kra....
mtu bom seus trabalhos,e esse ai nao fica de fora..mtu interessanta esse npc ai...
parabens....
jogar par ou impar? xD inovador é a palavra certa
Esse é um NPC descartado do projeto BlackOnix, para eu não precisar deletá-lo, irei postá-lo para todos.
Primeiramente, crie um arquivo chamado par_impar.lua em: data\npc\scripts
E ponha:
------ NPC Par/Impar ------------- -- Data de criação: --06/06/07 -> 10:58 - 11:01 --Autor do script: Nostradamus --Projeto Cassino -> BlackOnix --Projeto descartado pela equipe --------------------------------------- -- Config local price_to_play = 1 local price = 200 --- local focus = 0 local talk_start = 0 function onCreatureAppear(creature) end function onCreatureTurn(creature) end function onCreatureChangeOutfit(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end 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) < 4 then selfSay('Olá ' .. getCreatureName(cid) .. '! O que acha de apostarmos ' .. price .. ' numa disputa de par ou ímpar? Se quiser, escolha "par" ou "impar".') focus = cid talk_state = 0 talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay(getCreatureName(cid) .. ', por favor aguarde sua vez.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'par') and talk_state == 0 then talk_start = os.clock() talk_state = 0 if doPlayerRemoveMoney(cid, price_to_play) == 1 then player_random = math.random(1, 10) npc_random = math.random(1, 10) if player_random == 2 or player_random == 4 or player_random == 6 or player_random == 8 or player_random == 10 then selfSay('Parabéns! Você acaba de ganhar ' .. price .. '!') doPlayerAddMoney(cid, price) else selfSay('Que pena, você perdeu ' .. price .. '. Mais sorte da próxima vez.') doPlayerRemoveMoney(cid, price) end talk_state = 1 else selfSay('Você não tem dinheiro o suficiente para jogar.') end talk_state = 0 end if msgcontains(msg, 'impar') and talk_state == 0 then talk_start = os.clock() talk_state = 0 if doPlayerRemoveMoney(cid, price_to_play) == 1 then player_random = math.random(1, 10) npc_random = math.random(1, 10) if player_random == 1 or player_random == 3 or player_random == 5 or player_random == 7 or player_random == 9 then selfSay('Parabéns! Você acaba de ganhar ' .. price .. '!') doPlayerAddMoney(cid, price) else selfSay('Que pena, você perdeu ' .. price .. '. Mais sorte da próxima vez.') doPlayerRemoveMoney(cid, price) end talk_state = 1 else selfSay('Você não tem dinheiro o suficiente para jogar.') end talk_state = 0 end if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Até mais, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Próximo por favor...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 3 then selfSay('Tchau.') focus = 0 end end end
Configuração
A variável price_to_play determina o preço para se jogar.
A variável price determina o valor da aposta.
Agora o XML do npc:
Crie um arquivo chamado Gamer.xml (ou algum outro nome de preferência), e nele coloque:
<?xml version="1.0"?> <npc name="Gamer" script="data/npc/scripts/par_impar.lua" autowalk="0" floorchange="0"> <health now="100" max="100"/> <look type="133" head="20" body="39" legs="45" feet="7"/> </npc>
Edite o nome à gosto.
Espero que tenham gostado.
BlackOnix Team -> Setor de scripting
Script rejeitado.
Porq ele nao responde quando agente fala ? :neutral:
info
Grupo: Visconde
Registrado: 10/06/06
Posts: 338
Reputação: +6
Char no Tibia: Setyte Berseker
Esse é um NPC descartado do projeto BlackOnix, para eu não precisar deletá-lo, irei postá-lo para todos.
Primeiramente, crie um arquivo chamado par_impar.lua em: data\npc\scripts
E ponha:
------ NPC Par/Impar ------------- -- Data de criação: --06/06/07 -> 10:58 - 11:01 --Autor do script: Nostradamus --Projeto Cassino -> BlackOnix --Projeto descartado pela equipe --------------------------------------- -- Config local price_to_play = 1 local price = 200 --- local focus = 0 local talk_start = 0 function onCreatureAppear(creature) end function onCreatureTurn(creature) end function onCreatureChangeOutfit(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end 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) < 4 then selfSay('Olá ' .. getCreatureName(cid) .. '! O que acha de apostarmos ' .. price .. ' numa disputa de par ou ímpar? Se quiser, escolha "par" ou "impar".') focus = cid talk_state = 0 talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay(getCreatureName(cid) .. ', por favor aguarde sua vez.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'par') and talk_state == 0 then talk_start = os.clock() talk_state = 0 if doPlayerRemoveMoney(cid, price_to_play) == 1 then player_random = math.random(1, 10) npc_random = math.random(1, 10) if player_random == 2 or player_random == 4 or player_random == 6 or player_random == 8 or player_random == 10 then selfSay('Parabéns! Você acaba de ganhar ' .. price .. '!') doPlayerAddMoney(cid, price) else selfSay('Que pena, você perdeu ' .. price .. '. Mais sorte da próxima vez.') doPlayerRemoveMoney(cid, price) end talk_state = 1 else selfSay('Você não tem dinheiro o suficiente para jogar.') end talk_state = 0 end if msgcontains(msg, 'impar') and talk_state == 0 then talk_start = os.clock() talk_state = 0 if doPlayerRemoveMoney(cid, price_to_play) == 1 then player_random = math.random(1, 10) npc_random = math.random(1, 10) if player_random == 1 or player_random == 3 or player_random == 5 or player_random == 7 or player_random == 9 then selfSay('Parabéns! Você acaba de ganhar ' .. price .. '!') doPlayerAddMoney(cid, price) else selfSay('Que pena, você perdeu ' .. price .. '. Mais sorte da próxima vez.') doPlayerRemoveMoney(cid, price) end talk_state = 1 else selfSay('Você não tem dinheiro o suficiente para jogar.') end talk_state = 0 end if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Até mais, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Próximo por favor...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 3 then selfSay('Tchau.') focus = 0 end end endConfiguração
A variável price_to_play determina o preço para se jogar.
A variável price determina o valor da aposta.
Agora o XML do npc:
Crie um arquivo chamado Gamer.xml (ou algum outro nome de preferência), e nele coloque:
Edite o nome à gosto.
Espero que tenham gostado.
BlackOnix Team -> Setor de scripting
Script rejeitado.