Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 04/12/17 em todas áreas

  1. Poccnn

    Npc shop offline

    Hail Xtibianos! Trago um npc que vende seus items no jogo pelo preço que vocês quiserem oferta-lo. Tu que tem um item e não quer ficar ofertando no canal de trade, ponha a venda com o npc, assim, quem quiser comprar um item seu, verifica as ofertas que tem naquele determinado npc (pois depende de onde ele estiver). O sistema do npc consiste no seguinte: O player põe o item na lista de ofertas (venda) com o npc. O player pode cancelar sua's oferta's naquele npc em que foi feita a oferta. O player pode comprar os items na lista, somente naquele local (pois é determinado pelo town). O player recebe o valor do item, desde que tenha sido vendido. Bom... vamos ao que interessa; o código. Para usar esse npc, tu irás precisar usar a livraria xml criada por mim que se encontra nesse link. Algumas funções extras que tu irás precisar por no seu servidor. Npc.xml Npc.lua Lembrando que todos os códigos estão formatados em UTF8, converta para ANSI antes de usá-los. Qualquer erro ou incompatibilidade no seu servidor, deixe nos comentarios.
    1 ponto
  2. Verdade, esqueci de adicionar, funciona em 8.60 também local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {} function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction 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 local config1 = {cooldown = 82800, } if msgcontains(msg, 'teleport') or msgcontains(msg, 'tp') or msgcontains(msg, 'quest') or msgcontains(msg, 'help') then npcHandler:say('Hahaha, eu posso leva-lo a um local mistico, voce quer ir {transportar}?.', cid)talkState[talkUser] = 2elseif msgcontains(msg, 'transportar') or msgcontains(msg, 'yes') and (talkState[talkUser] == 2) thentalkState[talkUser] = 0if os.time() - getPlayerStorageValue(cid, 28126) >= config1.cooldown then -------- AQUI SÃO OS JOGADORES DO LEVEL 1 A 49if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 49 thenlocal sorte = math.random(1,3)--- POSIÇÃO DOS LOCAIS NO QUAL O JOGADOR SERÁ TELETRANSPORTADOlocal teleport1 = {x=1074, y=654, z=7}local teleport2 = {x=1074, y=654, z=7}local teleport3 = {x=1074, y=654, z=7}if sorte == 1 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport1)talkState[talkUser] = 0elseif sorte == 2 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport2)talkState[talkUser] = 0elseif sorte == 3 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport3)talkState[talkUser] = 0endendend----- #FIM DOS TPS DO JOGADOR LEVEL 1 A49-------- AQUI SÃO OS JOGADORES DO LEVEL 1 A 49if getPlayerLevel(cid) >= 50 and getPlayerLevel(cid) <= 100 thenlocal sorte = math.random(1,3)--- POSIÇÃO DOS LOCAIS NO QUAL O JOGADOR SERÁ TELETRANSPORTADOlocal teleport4 = {x=1074, y=654, z=7}local teleport5 = {x=1074, y=654, z=7}local teleport6 = {x=1074, y=654, z=7}if sorte == 1 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport4)talkState[talkUser] = 0elseif sorte == 2 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport5)talkState[talkUser] = 0elseif sorte == 3 thennpcHandler:say('Hahaha, boa viagem meu caro.', cid)doTeleportThing(cid, teleport6)talkState[talkUser] = 0endendsetPlayerStorageValue(cid, 28126, os.time())----- #FIM DOS TPS DO JOGADOR LEVEL 1 A49if getPlayerLevel(cid) >= 101 thennpcHandler:say('Somente jogadores entre o nivel 8 a 100 podem utilizar esse servico.', cid)talkState[talkUser] = 0endelsenpcHandler:say('Voce ja foi teletransportado, espere '..(config1.cooldown - (os.time() - getPlayerStorageValue(cid, 28126)))..' segundos para poder ser transportado novamente.')endendnpcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
    1 ponto
  3. hehehe, ta show de bola ein. Curti bastante
    1 ponto
Líderes está configurado para São Paulo/GMT-03:00
×
×
  • Criar Novo...