BE

[Npc] Rebornfor Wodbo 8.54

Por Beeki, 10 de mar. de 2012 em NPCs, monsters e raids

npc reborn
otserv
tibia
script
35
8.6k
BeekiB
10 de março de 2012 às 12:10

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 )

dragonfightD
11 de março de 2012 às 17:06

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

BeekiB
11 de março de 2012 às 19:33

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

dragonfightD
17 de março de 2012 às 09:46

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

BeekiB
17 de março de 2012 às 10:44

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ó!

3 meses depois...
Kaiser05K
18 de junho de 2012 às 23:21

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

1 mês depois...
gustavo3754G
19 de julho de 2012 às 22:27

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

BeekiB
19 de julho de 2012 às 23:26

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

19 de julho de 2012 às 23:41

funciona na versão 8.6 ?????

AlexandreKGA
20 de julho de 2012 às 12:17

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

20 de julho de 2012 às 13:54

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

Editado Julho 20 por PostadorHunter

AlexandreKGA
20 de julho de 2012 às 13:55

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())

Editado Julho 20 por Mozark001

20 de julho de 2012 às 14:13

e oq q deu errado ??

AlexandreKGA
20 de julho de 2012 às 14:19

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.

20 de julho de 2012 às 14:31

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

Editado Julho 20 por PostadorHunter