Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. Área incorreta, tópico movido. Mais cuidado da próxima vez. PS: Vejo que reputou os usuários acimas. Isso significa que o pedido foi resolvido? Por favor, relate.
  2. zipter98

    Npc

    Para checar se o jogador possui os 9 items, eu recomendaria fazer assim: local items = {ids} local check = 0 for i = 1, #items do if getPlayerItemCount(cid, items[i]) >= 1 then check = check + 1 end end if check == #items then ... else ... end
  3. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  4. Err, posso mover o tópico para resolvidos?
  5. Por ser apenas um elemento, recomendaria retirar a tabela. Ao invés de local itemid = {2391} Ficaria: local itemid = 2391
  6. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  7. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  8. local config = { money = 40000000, -- Dinheiro que vai custar item = 7892, -- ID do item que vai vender count = 1, -- Quantidade vocations = {...}, --Coloque aqui a(s) vocation(s) que poderão comprar o item. Exemplo de como essa tabela poderia ficar: {1, 2, 4} Assim, apenas jogadores de vocation 1, 2 ou 4 poderiam comprar o item. } function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if item.itemid == 1945 then if isInArray(config.vocations, getPlayerVocation(cid)) then if doPlayerRemoveMoney(cid, config.money) == TRUE then doPlayerAddItem(cid, config.item, config.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você acaba de comprar "..config.count.." "..getItemNameById(config.item)..".") doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) else return doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você precisa de 40kk para comprar esse item") and doSendMagicEffect(pos, CONST_ME_POFF) end else return doPlayerSendCancel(cid, "Sorry, not possible.") end end return true end
  9. Tópico atendido e movido para a seção de pedidos entregues.
  10. Seu servidor é com ou sem level nos pokémons? Ou, se não, você retirou o level system dele? Na linha que mencionei, é feito um cálculo com um atributo da corpse do pokémon (que armazena o nível deste). Porém, este nível está assumindo um valor nulo, causando então, este erro.
  11. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  12. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  13. O exausted, você coloca na tag da spell. Fiz rápido ambos os códigos, pois logo estarei saindo. PS: Suponho que você saiba fazer as tags (não se esqueça de registrar o evento em login.lua). Spell: function onCastSpell(cid, var) local msg = "If you die while Izanagi's effect (%d seconds) is activated, you'll be teleported to an place, then teleported to your death's position." local time = 30 --Duração do efeito do Izanagi. local msg_two = "In %d seconds, the Izanagi's effect will end." local IZANAGI_STORAGE = 91831 if getPlayerStorageValue(cid, IZANAGI_STORAGE) > os.time() then return doPlayerSendCancel(cid, msg_two:format(getPlayerStorageValue(cid, IZANAGI_STORAGE))) else doPlayerSendTextMessage(cid, 27, msg:format(time)) setPlayerStorageValue(cid, IZANAGI_STORAGE, os.time() + time) end return true end Prepare death: local time = 5 --Depois de quanto tempo o jogador será teleportado para o local da morte (já que quando "morrer" será teleportado para outro local, como você disse no tópico). local pos = {x = x, y = y, z = z} --Para onde será teleportado. local IZANAGI_STORAGE = 91831 local function Revive(cid, id) addEvent(function() if not isCreature(cid) then if id then local pos = db.getResult("SELECT value FROM player_storage WHERE player_id = "..id.." AND key = 91832") if pos:getID() == -1 then return true end local x = pos.x local y = pos.y local z = pos.z return db.executeQuery("UPDATE players SET posx = "..x..", posy = "..y..", posz = "..z.." WHERE id = "..id) end else local posis = {} posis.x = getPlayerStorageValue(cid, 91832).x posis.y = getPlayerStorageValue(cid, 91832).y posis.z = getPlayerStorageValue(cid, 91832).z doTeleportThing(cid, posis) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been teleported to your death's place.") end end, time * 1000) end function onPrepareDeath(cid) if isPlayer(cid) and getPlayerStorageValue(cid, IZANAGI_STORAGE) > os.time() then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) setPlayerStorageValue(cid, 91832, getThingPos(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("You have been revived by Izanagi. In %d, you will be teleported to your death's place.", time) doTeleportThing(cid, pos) Revive(cid, getPlayerGUID(cid)) end return true end
  14. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  15. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  16. Tópico atendido e movido para a seção de pedidos entregues.
  17. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  18. Poderia enviar o quê está escrito na linha 24 de catch system.lua?
  19. Seria interessente se você enviasse o quê se encontra na linha 4621 de pokemon moves.lua. Sobre as storages, não sei. Talvez sim. Vou revisar o código do Protection aqui. Qualquer coisa, reescrevo-o. #EDIT: Código reescrito. Aqui, pelo menos, está funcionando perfeitamente. elseif spell == "Protection" then local area = heal --Área do Protection. local pos = getPosfromArea(cid, area) local n = 0 local duel_sto_1 = xxx --Storage de duel. local duel_sto_2 = xxx --Storage de duel. local pvp_sto_1 = xxx --Storage de PvP. local pvp_sto_2 = xxx --Storage de PvP. local duration = 8 --Duração do buff. local eff = 117 local ret = {} local function isMonster(cid) if isCreature(cid) then if not isPlayer(cid) and not isSummon(cid) and not ehNPC(cid) then return true else return false end end return nil end if isSummon(cid) then ret.id = cid ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) local owner = getCreatureMaster(cid) ret.id = owner doCondition2(ret) elseif isMonster(cid) then ret.id = cid ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end while n < #pos do n = n + 1 local posis = {x = pos[n].x, y = pos[n].y, z = pos[n].z, stackpos = 253} local thing = getThingFromPosWithProtect(posis) if isCreature(thing) then if isSummon(cid) then local owner = getCreatureMaster(cid) if isSummon(thing) then if getPlayerStorageValue(owner, duel_sto_1) >= 1 then if getPlayerStorageValue(getCreatureMaster(thing), duel_sto_2) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, duel_sto_2) >= 1 then if getPlayerStorageValue(getCreatureMaster(thing), duel_sto_1) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, pvp_sto_2) >= 1 then if getPlayerStorageValue(getCreatureMaster(thing), pvp_sto_1) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, pvp_sto_1) >= 1 then if getPlayerStorageValue(getCreatureMaster(thing), pvp_sto_2) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end end elseif isPlayer(thing) then if getPlayerStorageValue(owner, duel_sto_1) >= 1 then if getPlayerStorageValue(thing, duel_sto_2) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, duel_sto_2) >= 1 then if getPlayerStorageValue(thing, duel_sto_1) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, pvp_sto_2) >= 1 then if getPlayerStorageValue(thing, pvp_sto_1) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end elseif getPlayerStorageValue(owner, pvp_sto_1) >= 1 then if getPlayerStorageValue(thing, pvp_sto_2) < 1 then ret.id = thing ret.cd = duration ret.eff = eff ret.check = 0 ret.buff = spell ret.first = true doCondition2(ret) end end end end end end
  20. Também esqueci de mencionar isso: Em some functions.lua, procurem por: function doReduceStatus(cid, off, def, agi) if not isCreature(cid) then return true end E troquem por: function doReduceStatus(cid, off, def, agi) if not isCreature(cid) then return true elseif not pokes[getCreatureName(cid)] then return true end
  21. Ué, mas não é assim que o Protection funciona? ._.
  22. zipter98

    PokeVB

    Atualização! •Missão da Equipe Rocket adicionada abaixo do Cassino de Viridian. •Adicionadas duas novas outfits. •Remakes adicionados para os seguintes pokémons: Feraligatr, Meganium, Typhlosion, Jynx, Forretress, Electivire e Magmortar. •Reativada evolução de Electabuzz e Magmar. Link do novo client, aqui.
  23. Nada. Sanado, movido.
  24. Há uma maneira mais simples e menor de fazer isso: tabelas. Aqui está o seu código (não lhe culpo se não entender, não sou bom com explicações): local tabela_de_exemplo = { [1] = {item, "mensagem"}, --[valor da storage] = {id do item, mensagem}, [2] = {item, "mensagem"}, [3] = {item, "mensagem"}, } if tabela_de_exemplo[getPlayerStorageValue(cid, storage)] then --Se o valor da storage "storage" do jogador for igual à algum dos valores entre colchetes da tabela_de_exemplo, então: local tab = tabela_de_exemplo[getPlayerStorageValue(cid, storage)] doPlayerAddItem(cid, tab[1], 1) --O jogador receberá o item com ID programado no índice 1 da tabela equivalente ao valor da storage do jogador entre colchetes na tabela_de_exemplo. doPlayerSendTextMessage(cid, 27, tab[2]) --Será enviada ao jogador uma mensagem programada no índice 2 da tabela equivalente ao valor da storage do jogador entre colchetes na tabela_de_exemplo. else --Caso contrário: return doPlayerSendCancel(cid, "Mensagem") --Enviará uma mensagem. end Entende-se como cid quem executou a ação. PS: Não entendi muito bem a parte de "storages que o jogador tem". Assim, é possível entender como keys, e não values. Porém, suponho que seu objetivo fosse a segunda opção.
  25. @nociam Cara, como alguém vai adicionar essa função no PDA sem as sources?
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...