Postado Outubro 27, 2014 10 anos Quero que me expliquem o script de reborn de Wodbo: local focus = 0local talk_start = 0local target = 0local following = falselocal attacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos) if focus == cid thenselfSay('?????.')focus = 0talk_start = 0 endendfunction 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) < 4 then selfSay('Hello. If you ready I can "Reborn" you.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.') elseif focus == cid then talk_start = os.clock()if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30023) == 1 then selfSay('Sorry, but you are after reborn.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 300 and getPlayerStorageValue(cid,30023) ~= -1 then selfSay('Hehe, I say If you READY. You do not have 300 lvl.') elseif msgcontains(msg, 'reborn') then selfSay('Are you sure?')talk_state = 2elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 300 and getPlayerVocation(cid) == 49 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 42, 82)talk_state = 0elseif msgcontains(msg, 'yes') and talk_state == 2 thenselfSay('Sorry, ' .. getCreatureName(cid) .. '! You must have got last transform.') elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye.') focus = 0 talk_start = 0 end endendfunction onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end endend Agradeço desde já!!!
Postado Outubro 28, 2014 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Scripting → Monsters e NPCs" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Ot Design: https://discord.gg/VgtVRNmCD7
Postado Outubro 28, 2014 10 anos Autor Me desculpe Kod, Mais tem como alguem me explica como coloco mais de 1 vocation pra reborn ?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.