[Npc] Rebornfor Wodbo 8.54

Beeki
Por Beeki
em NPCs, monsters e raids

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Bem venho aqui trazer para vocês um NPC de Reborn para quem está criando um servidor de WoDBO na versão 8.54, pode ser usado em qualquer OTserver também, bem aqui vai...

 

Reborn.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Reborn" script="data/npc/scripts/Reborn.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look type="143" head="78" body="82" legs="120" feet="94" addons="1"/>
</npc>

 

Reborn.lua, muito facil configurar, já tem uma tabelinha ai encinando como, até

 

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 )
[21] = { 22, 137},
[254] = { 255, 351},
[36] = { 37, 148},
[51] = { 52, 144},
[65] = { 66, 152},
[378] = { 379, 451},
[80] = { 81, 150},
[93] = { 94, 150},
[107] = { 108, 509},
[118] = { 119, 118},
[131] = { 132, 34},
[144] = { 145, 15},
[155] = { 156, 15},
[167] = { 168, 173},
[179] = { 180, 178},
[191] = { 192, 184},
[205] = { 206, 190},
[217] = { 218, 221},
[229] = { 230, 281},
[242] = { 243, 60},
[254] = { 255, 351},
[265] = { 266, 334},
[275] = { 276, 80},
[286] = { 287, 338},
[296] = { 297, 198},

}
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('Hehe, I say If you READY. You do not have 250 level.', 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 getPlayerLevel(cid) ~= 250 then
 selfSay('Desculpe, ' .. getCreatureName(cid) .. '! You need level 250 to reborn.', cid)
 talkState[talkUser] = 0

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
 selfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert or transform to reborn.', 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())

 

Créditos:

Rodrigo Ritter ( Criador )

Beeki ( Trazer ao XTibia )

Fabio Augustus - Infraestrutura

Skype: guhsvasc

dragonfight

Sometimes I can't believe it
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 12/09/10Posts: 249

Legal o npc. Eu criei a função doReborn, igual do wodbo no meu ot 8.54.

tumblr_mbtch9L7iC1r2wtdzo1_500.jpg

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

kkk, Perdeu tempo criando essa função, como você viu no Script usei funções que já tem no distro!

Fabio Augustus - Infraestrutura

Skype: guhsvasc

dragonfight

Sometimes I can't believe it
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 12/09/10Posts: 249

Perdi tempo nada, eu gosto de mecher nas sources. Meu script de transform é compilado igual do wodbo também.

tumblr_mbtch9L7iC1r2wtdzo1_500.jpg

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Hm... é achei um pouco perda de tempo... o script de transform da para fazer em lua também, bem mais Fácil, para fazer seu wodbo 8.54 unica coisa que você teria que mecher nas source era pra adicionar os novos efeitos e + alguns customs e só!

Fabio Augustus - Infraestrutura

Skype: guhsvasc

Kaiser05

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 19/06/12Posts: 174

muito bom esse npc Estarei dando umas modificaçoes é utilizando no meu servidor :D

gustavo3754

Jallel
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 24/10/11Posts: 133Char no Tibia: ...

cara, esse script n ta funfando eu falo 'hi' - 'reborn' e fala 'yes' ai ele fala que não tenho level 250.. mais to 2000 wacko.png

AJUDEI ? DA REP+

"A guerra começa por tanto quererem uma paz inalcansavel.."

Quer uma VPS grátis por 3 meses? É só clicar aqui

Yz4U8tE.png

 

Meus Trabalhos:

 

 

Servidors derivados:

 

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Olha bem o script e perceba que ele esta configurado para level 250 menos.

Fabio Augustus - Infraestrutura

Skype: guhsvasc

PostadorHunter

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 10/12/11Posts: 962Gênero: Masculino

funciona na versão 8.6 ?????

AlexandreKG

Estudante de TI
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 30/10/11Posts: 1153Gênero: Masculino

Beeki tem como fazer,pra ele reborna 250+?estou empacado nisso preciso d+,rep+ se ajudar,Obrigado.

PostadorHunter

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 10/12/11Posts: 962Gênero: Masculino

ei mozark tenta assim

aonde ta

 

 

 

 

elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30025) ~= 4 then

selfSay('Hehe, I say If you READY. You do not have 250 level.', cid)

 

 

tenta troca o < 250 por > 250

n sei se vai funcionar

e axo q vai ser so para maiores de 250 n tenho certeza pq < é menor e > e maior

AlexandreKG

Estudante de TI
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 30/10/11Posts: 1153Gênero: Masculino

Vo tenta ja edito ake,Obrigado.

 

@Edit:Puts nao funfo mano,Se puder ajudar ainda eu agradeço.

 

Parei meu wodbo 8.54 por causa desse npc.

 

Meu npc esta assim:

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 )

[6] = { 7, 137},

 

}

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('Hehe, I say If you READY. You do not have 250 level.', 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 getPlayerLevel(cid) == 250 then

selfSay('Desculpe, ' .. getCreatureName(cid) .. '! You need level 250 to reborn.', cid)

talkState[talkUser] = 0

 

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then

selfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert or transform to reborn.', 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())

PostadorHunter

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 10/12/11Posts: 962Gênero: Masculino

e oq q deu errado ??

AlexandreKG

Estudante de TI
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 30/10/11Posts: 1153Gênero: Masculino

Por exemplo, eu to level 240,ele dis q precisa de level 250 pra reborna,e kuadn oeu to 251+ ele dis que n tenho 250 tbm ...

Queria por pra no minimo 250 reborna.

PostadorHunter

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 10/12/11Posts: 962Gênero: Masculino

vo ver aqui ja edito

edit

ahh

meu erro aki desculpe eu n tinha lido tudo

 

aki e o lvl q e quando n pode rebornar

 

 

elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) > 250 and getPlayerStorageValue(cid,30025) ~= 4 then

selfSay('Hehe, I say If you READY. You do not have 250 level.', cid)

i botei > era < mesmo

 

o lvl de q pode rebornar axo q e aki

 

if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30025) == 4 then

selfSay('You are reborn.', cid)

dps vejo tenhoq sai