Bom primeiramente bom dia a todos, vou ensinar vcs a fazerem 1 npc chamado Silvio Santos, no qual você tem que responder as perguntas dele para ganha o premio.
Mãos na massa!!
Abra a pasta data, lá haverá 1 pasta chamada "npc" entre nela. A seguir faça 1 copia de qualquer npc e renomeie para "Silvio Santos". Clique com o botão direito nele e apague tudo que há aí e ponha
<?xml version="1.0"?><npc name="Silvio Santos" script="data/npc/scripts/silvio.lua" access="3" lookdir="1">
<health now="1000" max="1000"/>
<look type="128" head="116" body="95" legs="95" feet="114" corpse="3128"/>
</npc>
A seguir vá na pasta "scripts" localizada ai dentro da pasta "npc". Lá copie qualquer arquivo .xml ;cole e renomeie para "silvio". Em seguida apague tudo oque está escrito e ponha :
focus = 0contador = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(id, stackpos)
if id == focus then
focus = 0
contador = 0
selfSay("Ate breve.")
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('HeheheHaHaHae ' .. creatureGetName(cid) .. ' Bem vindo ao Show do Milhão! O que deseja fazer?')
contador = 1
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Só tem lugar pra um ' .. creatureGetName(cid) .. '.')
end
if string.find(msg, '(%a*)jogar(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
jogar = getPlayerStorageValue(cid,3333)
if jogar == -1 then
selfSay('Podemos começar?')
contador = 5
setPlayerStorageValue(cid,3333,1)
end
if jogar == 1 then
selfSay('Desculpe, voce ja participou.')
end
end
if msgcontains(msg, 'sim') and focus == cid and contador == 5 then
selfSay('Vamos lá! Primeira Pergunta: EM qual destas cidades tem Demon? 1-Edron, 2-Carlin, 3-Darashia, 4-Thais')
contador = 2
talk_start = os.clock()
end
if string.find(msg, '(%a*)carlin(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)darashia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)thais(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'sim') and focus == cid and contador == 1 then
talk_start = os.clock()
queststatus = getPlayerStorageValue(cid,2563)
if queststatus == -1 then
selfSay('Vamos para a primeira pergunta, esta pronto?')
contador = 3
else
selfSay('Voce ja perdeu...')
end
end
if msgcontains(msg, 'edron') and focus == cid and contador == 2 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 6
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 6 then
selfSay('Vamos lá! Segunda Pergunta: Quantos tipos de troll existem? 1-Um, 2-Cinco, 3-Quatro, 4-Três.')
contador = 7
talk_start = os.clock()
end
if string.find(msg, '(%a*)um(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)cinco(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)quatro(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'três') and focus == cid and contador == 7 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 8
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 8 then
selfSay('Vamos lá! Terceira Pergunta: Qual o nome do continente desértico do Tibia? 1-Darashia, 2-Darama, 3-Edron, 4-Ankrahmun.')
contador = 9
talk_start = os.clock()
end
if string.find(msg, '(%a*)darashia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)edron(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)ankrahmun(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'darama') and focus == cid and contador == 9 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 10
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 10 then
selfSay('Vamos lá! Quarta Pergunta: Qual o nome do esconderijo dos warlocks? 1-Demonia, 2-Demon Land, 3-Warlocklandia, 4-Demona.')
contador = 11
talk_start = os.clock()
end
if string.find(msg, '(%a*)demonia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)demon land(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)warlocklandia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'demona') and focus == cid and contador == 11 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 12
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 12 then
selfSay('Vamos lá! Última Pergunta!!! Qual é o nome do meu pai? 1-Clark Kent, 2-José, 3-Manuel, 4-Jacó.')
contador = 11
talk_start = os.clock()
end
if string.find(msg, '(%a*)clark kent(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)josé(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)manuel(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'jacó') and focus == cid and contador == 11 and getDistanceToCreature(cid) < 3 then
selfSay('Certa a Resposta!!!!! Voce ganhou 10000 gold pieces!')
buy(cid,2973,100,0)
focus = 0
talk_start = 0
end
if msgcontains(msg, 'nao') or msgcontains(msg, 'não') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('OK, mas perdeu uma grande chance!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Adeus, Boa Sorte. HahahaHeheHAhae')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 40 then
if focus > 0 then
selfSay('Quem quer dinheiro!?')
end
focus = 0
end
--nothing special has happened
--but perhaps we want to walk around a bit?
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,50)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end
Pronto.. agora você tem seu npc de jogo de perguntas e respostas!!
Agora, para por spaw dele, vá na pasta "world" localizada na pasta "data". Lá havera 1 arquivo .xml xamado npc clique com o botão direito, a seguir clique em "Editar".
Vamos Supor que o lugar que você keira por ele seja x=1 y=2 e z=3
então fikara assim:
<npc name="Silvio Santos" x="1" y="2" z="3"/>
FIM!!
--CREDITS BY MTK E ANDRE !!!!
Pô esse ai foi bom ein!!! Merece sessão oficial!!!
;D flwssssss
BYEEEE
CREDITS BY MTK
ANDRÉ.. V-A-I-S-E-F-U-D-E----SEU--F-D-P!!!