Postado Setembro 19, 2014 10 anos Olá galera do TK, venho trazer para vocês uma script bem utilizada em WODBO's, porem essa é pra 8.54. Função da script: Reseta o level, da 20.000 de [life|mana] e uma nova vocação. Vá ate data/npc copie um arquivo .xml e de um novo nome(Reborn.xml) e cole isso: <npc name="Reborn Man" script="data/npc/scripts/reborn.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1"> <health now="100" max="100"/> <look type="118" head="57" body="59" legs="40" feet="76" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. Reborn!" /> </parameters> </npc> Depois va ate data/npc/scripts copie um arquivo.lua e de um novo nome: (Reborn.lua) local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('?????.') 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) < 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 = 2 elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 300 and getPlayerVocation(cid) == 49 then setPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 42, 82) talk_state = 0 elseif msgcontains(msg, 'yes') and talk_state == 2 then selfSay('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 end end function 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 end end Para configurar a vocação atual, a vocação que vai dar reborn e a nova outfit é nessa tag: elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 300 and getPlayerVocation(cid) == 49 then setPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 42, 82) talk_state = 0 Adicionem isso na pasta lib/050-function pra funcionar a tag doReborn function doReborn(cid, level, looktype, vocation) db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") doRemoveCreature(cid) return TRUE Até a proxima galera. Creditos: DBWarrior Editado Outubro 6, 2014 10 anos por arthurabreu (veja o histórico de edições) I helped you ? REP +. Att: Abreu
Postado Setembro 19, 2014 10 anos parece ser um bom script, obrigado por trazê-lo Ot Design: https://discord.gg/VgtVRNmCD7
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.