Ir para conteúdo

Featured Replies

Postado
Vocês poderiam me ajudar? preciso de um npc 
Função: quando o player atingir a vocação x, com o lv 250 pra cima ele pode rebornar, assim ganhando uma nova vocação e 20k de MANA E LIFE, e uma nova outfit. ganhando uma storage. pra fazer so uma vez por char.
Obs: se tiver como fazer pra varias vocações.
Quem jogou wodbo sabe como é
Versão 8.54?
 
Já tenho essa que achei na net, porem não funciona
 
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},
}
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, 'lol') 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())

 

I helped you ? REP +.

 

Att: Abreu

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 520.1k

Informação Importante

Confirmação de Termo