Ir para conteúdo
Banner com Efeitos

Flavio S. Cabral

Membro
  • Registro em

  • Última visita

Tudo que Flavio S. Cabral postou

  1. Muito bom cara como sempre, com certeza vou acompanhar, espero aprender muitas coisas com seus ensinamento.
  2. quais são as vocations ? de o máximo de detalhes possível porque se não fica difícil alguém ajudar... requerimento de level, se ganha algum item, etc ...
  3. local vocations = {5, 6, 7, 8} -- Não modifique... local stg = 98749 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 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:lower(), 'voc suprem') then selfSay('Deseja virar {Voc suprem} ?', cid) talkState[talkUser] = 1 elseif msgcontains(msg:lower(), 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, stg) < 1 then if isInArray(vocations, getPlayerVocation(cid)) > 4 then if getPlayerItemCount(cid, 142) >= 1 then doPlayerRemoveItem(cid, 142, 1) doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) selfSay('Parabéns você acaba de completar Asgard.', cid) setPlayerStorageValue(cid, stg, 1) talkState[talkUser] = 0 else selfSay('Você não tem {suprem vocation} suficientes.', cid) talkState[talkUser] = 0 end else selfSay('Você não tem a primeira promotion', cid) talkState[talkUser] = 0 end else selfSay('Você já tem vocation suprema', cid) talkState[talkUser] = 0 end elseif msgcontains(msg:lower(), 'no') or msgcontains(msg:lower(), 'bye') then selfSay('Bye!', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. function onStepIn(cid, item, frompos, item2, topos) if isPlayer(cid) then doSendAnimatedText(getPlayerPosition(cid), ""..getPlayerName(cid).."", TEXTCOLOR_DARKRED) doPlayerAddItem(cid, 965, 1) end return true end
  5. No such file or directory --> Nenhum arquivo ou diretório encontrado. Verifique se o caminho e o nome do arquivo ou a extensão (.lua) esteja correta. Crie outro arquivo se necessário com um nomediferente.lua e tente.
  6. 1º char tem que estar deslogado. 2º após a alteração de qualquer valor clicar em > <
  7. <?xml version="1.0" encoding="UTF-8"?> <npc name="Luke" script="data/npc/scripts/npcinfo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="152" head="95" body="95" legs="29" feet="56" addons="2" corpse="6080"/> <parameters> <parameter key="message_greet" value="Questions come to the right place just say whatever... {aol}, {vip}, {hunts}, {houses}, {quests}, {task} ?" /> </parameters> </npc> npcinfo.lua local text = { aol = '', -- escreva o texto vip = '', -- escreva o texto hunts = '', -- escreva o texto houses = '', -- escreva o texto quests = '', -- escreva o texto task = '' -- escreva o texto } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) npcHandler.topic = {} 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 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg:lower(), 'aol') then npcHandler:say(text.aol, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'vip') then npcHandler:say(text.vip, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'hunts') then npcHandler:say(text.hunts, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'houses') then npcHandler:say(text.houses, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'quests') then npcHandler:say(text.quests, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'task') then npcHandler:say(text.task, cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg:lower(), 'bye') or msgcontains(msg:lower(), 'ok') then npcHandler:say('Bye!', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  8. só essas 3 opções de fala ? se não fale todos ... ele só vai dar apenas informações ?
  9. local boss = {"annihilon", "demon"} -- Monstros que serão anunciados quando morrerem function onKill(cid, target, lastHit) if isPlayer(cid) and isInArray(boss, getCreatureName(target)) then broadcastMessage("O jogador ".. getCreatureName(cid) .." matou o boss " .. getCreatureName(target) ..".") end return true end
  10. local tab = { pos = {x = 275, y = 73, z = 7}, -- posição x, y, z do local a teleportar o player item = {2143, 500}, -- {itemID, count} price = 1000, -- quantidade em crystal coins level = 2000 -- level necessario } 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 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, 'teleport')) then talkState[talkUser] = 1 selfSay('Are you sure?', cid) selfSay('Remember..you need '..tab.item[2]..' '..getItemNameById(tab.item[1])..' and '..tab.price..' crystal coins to be teleported.', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerLevel(cid) >= tab.level then if (getPlayerItemCount(cid, tab.item[1]) >= tab.item[2] and doPlayerRemoveMoney(cid, tab.price * 10000)) then doTeleportThing(cid, tab.pos) doPlayerRemoveItem(cid, tab.item[1], tab.item[2]) doPlayerRemoveMoney(cid, tab.price * 10000) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) selfSay('Have a good trip.', cid) else talkState[talkUser] = 0 selfSay('I can not teleport you. You do not have the required items.', cid) end else selfSay('Sorry you dont has level necessary.', cid) talkState[talkUser] = 0 end elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then talkState[talkUser] = 0 selfSay('Okay, maybe another time.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())

Informação Importante

Confirmação de Termo