Postado Setembro 17, 2017 7 anos Eu gostaria de um NPC estilo o REBORN, ao falar com ele te deixará nivel 1 e te dará uma transformação nova (configuravel por favor) e adicionará no personagem +10000 de vida e +10000 de mana
Postado Setembro 17, 2017 7 anos Poste seu script de reborn pra modificar em cima dele. Te ajudei? Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta" Skype: JoadsonAion
Postado Setembro 17, 2017 7 anos Autor 1 hora atrás, joadson disse: Poste seu script de reborn pra modificar em cima dele. Eu estou PEDINDO, eu não tenho nenhum script
Postado Setembro 17, 2017 7 anos Solução EDIT... Crie o arquivo XML do npc. <?xml version="1.0" encoding="UTF-8"?> <npc name="Rebornar" script="rebornar.lua" walkinterval="0"> <health now="100" max="100"/> <look type="446"/> <parameters> <parameter key="message_greet" value="Olá, |PLAYERNAME|! Eu posso te {Rebornar}." /> </parameters> </npc> e crie um arquivo rebornar.lua na pasta scripts local hpADD = 10000 -- HP adicionado ao rebornar local mpADD = 10000 -- MP adicionado... local function doPlayerReborn(cid, level, looktype, vocation) setGlobalStorageValue(1000,getPlayerGUID(cid)) setPlayerStorageValue(cid, 30023, 4) setPlayerStorageValue(cid, 30024, getPlayerLevel(cid)) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+hpADD) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+mpADD) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveCreature(cid) db.query("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.query("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") db.query("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";") return TRUE end ----------------------------funções padrão do NPC----- 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('Olá! Se voce está pronto, diga "reborn".') 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) == 4 then selfSay('Desculpe, mas voce já é rebornado.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') and (getPlayerLevel(cid) < 200 and getPlayerStorageValue(cid,30023) ~= 4) or (getPlayerLevel(cid) > 400 and getPlayerStorageValue(cid,30023) ~= 4) then selfSay('Apenas level 200 ao 400 podem rebornar.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') then selfSay('Realmente quer isto?') talk_state = 2 -- configuração da vocação elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) <= 400 and getPlayerVocation(cid) == 8 then -- mude o 8 para o numero da ultima transformação doPlayerReborn(cid,1,10,9)-- explicação: 1 é o level que ficará após rebornar, 10 é o looktype e 9 é a nova vocação talk_state = 0 elseif msgcontains(msg, 'yes') and talk_state == 2 then selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Voce deve estar na ultima transformação.') elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Adeus!') 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) > 5 then selfSay('Adeus!') focus = 0 end end end Editado Setembro 17, 2017 7 anos por joadson Adicionado o Script (veja o histórico de edições) Te ajudei? Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta" Skype: JoadsonAion
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.