Ir para conteúdo

Featured Replies

Postado

Olá pessoas, tudo bem?
Então depois de muitas buscas, downloads de servidores, pedidos e mais pedidos para que criassem o script ou que arrumassem, venho trazer a vocês a SOLUÇÃO DOS SEUS PROBLEMAS! kkk
Tem vários servidores que usam um sistema de reborn que não funciona, pra não dizer todos, mas depois de muita busca (muita mesmo) consegui achar um simples que vai funcionar certinho sem problema).

No post que vi em outro forum a pessoa dedica os créditos a um tal de (CrazzyMaster), e quem dedica os créditos é o (DBWBrasil), não sei se são a mesma pessoa, ou se ele trouxe o script, em fim dado os créditos vamos ao script.

Criem um arquivo .xml com nome Reborn e coloquem na pasta NPC que fica em (PASTA DO SERVIDOR/data/npc).

Spoiler

<npc name="Reborn" script="data/npc/scripts/reborn.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1">
<health now="100" max="100"/>
<look type="153" head="57" body="59" legs="40" feet="76" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Reborn!" />
</parameters>
</npc>

 



Criem um arquivo .lua com nome reborn e coloquem na pasta scripts que fica em (PASTA DO SERVIDOR/data/npc/script).

Spoiler

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid)     end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink()     npcHandler:onThink()     end
local config = {
--[Vocation] = ( Nova Vocation, New Outfit )
[1] = { 211, 137},
[2] = { 20, 100},
[3] = { 30, 100},
[4] = { 40, 100}
}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30025) == 4 then
selfSay('You are reborn.', cid)
focus = 0
talk_start = 0

elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30025) ~= 4 then
selfSay('Hmm, Desculpe. Você não tem level 250.', cid)

elseif msgcontains(msg, 'reborn') then
selfSay('Are you sure? {yes}', cid)
talkState[talkUser] = 2

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 and getPlayerLevel(cid) >= 250 then
local voc = config[getPlayerVocation(cid)]
doPlayerSetVocation(cid, voc[1])
local outfit = {lookType = voc[2]}
doCreatureChangeOutfit(cid, outfit)
doPlayerAddExp(cid, -(getPlayerExperience(cid)-getExperienceForLevel(1)))
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+20000)
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+30000)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
setPlayerStorageValue(cid,30025,4)
talkState[talkUser] = 0

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Voce precisa reverter ou transformar para rebornar.', cid)
talkState[talkUser] = 0

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye.', cid)
focus = 0
talk_start = 0
end

return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

Postado

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo