Beeki 284 Postado Março 10, 2012 Share Postado Março 10, 2012 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 ) Link para o comentário Compartilhar em outros sites More sharing options...
dragonfight 53 Postado Março 11, 2012 Share Postado Março 11, 2012 Legal o npc. Eu criei a função doReborn, igual do wodbo no meu ot 8.54. Link para o comentário Compartilhar em outros sites More sharing options...
Beeki 284 Postado Março 11, 2012 Autor Share Postado Março 11, 2012 kkk, Perdeu tempo criando essa função, como você viu no Script usei funções que já tem no distro! Link para o comentário Compartilhar em outros sites More sharing options...
dragonfight 53 Postado Março 17, 2012 Share Postado Março 17, 2012 Perdi tempo nada, eu gosto de mecher nas sources. Meu script de transform é compilado igual do wodbo também. Link para o comentário Compartilhar em outros sites More sharing options...
Beeki 284 Postado Março 17, 2012 Autor Share Postado Março 17, 2012 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ó! Link para o comentário Compartilhar em outros sites More sharing options...
Kaiser05 16 Postado Junho 19, 2012 Share Postado Junho 19, 2012 muito bom esse npc Estarei dando umas modificaçoes é utilizando no meu servidor Link para o comentário Compartilhar em outros sites More sharing options...
gustavo3754 55 Postado Julho 20, 2012 Share Postado Julho 20, 2012 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 Link para o comentário Compartilhar em outros sites More sharing options...
Beeki 284 Postado Julho 20, 2012 Autor Share Postado Julho 20, 2012 Olha bem o script e perceba que ele esta configurado para level 250 menos. Link para o comentário Compartilhar em outros sites More sharing options...
PostadorHunter 99 Postado Julho 20, 2012 Share Postado Julho 20, 2012 funciona na versão 8.6 ????? Link para o comentário Compartilhar em outros sites More sharing options...
AlexandreKG 134 Postado Julho 20, 2012 Share Postado Julho 20, 2012 Beeki tem como fazer,pra ele reborna 250+?estou empacado nisso preciso d+,rep+ se ajudar,Obrigado. Link para o comentário Compartilhar em outros sites More sharing options...
PostadorHunter 99 Postado Julho 20, 2012 Share Postado Julho 20, 2012 (editado) 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, 2012 por PostadorHunter Link para o comentário Compartilhar em outros sites More sharing options...
AlexandreKG 134 Postado Julho 20, 2012 Share Postado Julho 20, 2012 (editado) 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, 2012 por Mozark001 Link para o comentário Compartilhar em outros sites More sharing options...
PostadorHunter 99 Postado Julho 20, 2012 Share Postado Julho 20, 2012 e oq q deu errado ?? Link para o comentário Compartilhar em outros sites More sharing options...
AlexandreKG 134 Postado Julho 20, 2012 Share Postado Julho 20, 2012 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. Link para o comentário Compartilhar em outros sites More sharing options...
PostadorHunter 99 Postado Julho 20, 2012 Share Postado Julho 20, 2012 (editado) 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, 2012 por PostadorHunter Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados