Ir para conteúdo

Pergunta

e ai galera , eu estou querendo arrumar script do meu npc aqui ele bloqueia somente pokeball queria que bloqueasse revives tbm. 

 

  Mostrar conteúdo oculto

o mais importante é ele bloquear revive já coloquei id do revive junto com a da ball e não deu. 

se possivel queria que falasse tower em vez de quest para o jogador entrar.

E que quando entrasse adicionasse 20 revives ou permitir entrar so com 20

 

mas lembrando só de broquear os revive se conseguirem ja esta bom

 

id do revive = 12344

Link para o comentário
https://xtibia.com/forum/topic/243002-npc-que-bloqueia-item/
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
local revive = {itemid = 12344, max_count = 20}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction Saffari(cid, message, keywords, parameters, node)    if not npcHandler:isFocused(cid) then        return false    end    if getPlayerItemCount(cid, revive.itemid) > revive.max_count then        npcHandler:say("To enter here, you can only carry "..revive.max_count.." revive(s). Deposit the rest on the DP, please.", cid)        return true    end    if not parameters.premium and not isPremium(cid) then        npcHandler:say('Sorry, you need to be premium account!', cid)        return true    elseif not doPlayerRemoveMoney(cid, parameters.price) then        npcHandler:say('Sorry, you dont have enought money!', cid)        return true    end        doPlayerSendTextMessage(cid, 22, 'Good Luck!.')    doTeleportThing(cid, parameters.enter)    npcHandler:resetNpc()    return trueendlocal node1 = keywordHandler:addKeyword({'tower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {tower} possui monstros muito fortes você esta pronto para enfrenta-los?? Mais antes guarde suas pokebolas no DP....ah você so tem 60 minutos de tempo para realizar essa quest!!!!'})node1:addChildKeyword({'yes'}, Saffari, {premium = no, price = 0, enter = {x = 1235, y = 630, z = 8}, exit = {x = 1235, y = 630, z = 8}, minutes = 60})node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})npcHandler:addModule(FocusModule:new())

 

Link para o comentário
https://xtibia.com/forum/topic/243002-npc-que-bloqueia-item/#findComment-1709097
Compartilhar em outros sites

  • 0
  Em 14/12/2016 em 23:11, zipter98 disse:
local revive = {itemid = 12344, max_count = 20}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction Saffari(cid, message, keywords, parameters, node)    if not npcHandler:isFocused(cid) then        return false    end    if getPlayerItemCount(cid, revive.itemid) > revive.max_count then        npcHandler:say("To enter here, you can only carry "..revive.max_count.." revive(s). Deposit the rest on the DP, please.", cid)        return true    end    if not parameters.premium and not isPremium(cid) then        npcHandler:say('Sorry, you need to be premium account!', cid)        return true    elseif not doPlayerRemoveMoney(cid, parameters.price) then        npcHandler:say('Sorry, you dont have enought money!', cid)        return true    end        doPlayerSendTextMessage(cid, 22, 'Good Luck!.')    doTeleportThing(cid, parameters.enter)    npcHandler:resetNpc()    return trueendlocal node1 = keywordHandler:addKeyword({'tower'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Nessa {tower} possui monstros muito fortes você esta pronto para enfrenta-los?? Mais antes guarde suas pokebolas no DP....ah você so tem 60 minutos de tempo para realizar essa quest!!!!'})node1:addChildKeyword({'yes'}, Saffari, {premium = no, price = 0, enter = {x = 1235, y = 630, z = 8}, exit = {x = 1235, y = 630, z = 8}, minutes = 60})node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})npcHandler:addModule(FocusModule:new())

 

Expand  

eu fiz aqui com esse e umas gambiarra

if getPlayerItemCount(cid,12344) >= 1 then

     selfSay("Coloque seus revives no DP!")

    return true

  end

 

dps add  

doPlayerAddItem(cid,12344,20)

 

mas seu esta ótimo tbm. obgd

Editado por Azon25
Link para o comentário
https://xtibia.com/forum/topic/243002-npc-que-bloqueia-item/#findComment-1709136
Compartilhar em outros sites

×
×
  • Criar Novo...