Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    72

Tudo que zipter98 postou

  1. zipter98

    TP SCROLL

    Tenta: function onUse(cid, item, topos, item2, frompos) local pos = {x = xxx, y = yyy, z = zzz} --Coordenadas para onde o player será teleportado. local efeito = 12 function teleport_thing(cid, toPos, time, storage, cd) if isCreature(cid) then addEvent(doTeleportThing, time*1000, cid, toPos) addEvent(setPlayerStorageValue, time*1000, cid, storage, os.time () + cd) end return true end if getCreatureSkull(cid) >= 3 then return doPlayerSendCancel(cid, "Você não pode usar este item enquanto está PK.") end if not isPremium(cid) then return doPlayerSendCancel(cid, "Você não é premium.") end if getPlayerStorageValue(cid, 141029) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 141029) - os.time ().." para se teleportar novamente.") end local a = 10 for i = 1, 10 do a = a - 1 addEvent(doCreatureSay, i*1000, cid, "" ..a.."", TALKTYPE_ORANGE_1) addEvent(doSendMagicEffect, i*1000, getThingPos(cid), efeito) addEvent(doPlayerSetNoMove, i*1000, cid, false) doPlayerSetNoMove(cid, true) end teleport_thing(cid, pos, 10, 141029, 30) return true end
  2. data/movements, movements.xml <movevent type="StepIn" itemid="id do tile" event="script" value="nome do arquivo.lua"/> No lugar de id do tile, você coloca um ID que não esteja em uso no seu servidor. Então, basta ir no map editor, selecionar o tile desejado, e configurá-lo de acordo com o itemid que você colocou na tag; no lugar de nome do arquivo, você coloca o nome do arquivo .lua que passei acima.
  3. zipter98

    TP SCROLL

    function onUse(cid, item, topos, item2, frompos) local pos = {x = xxx, y = yyy, z = zzz} --Coordenadas para onde o player será teleportado. local efeito = 12 function teleport_thing(cid, toPos, time, storage, cd) if isCreature(cid) then addEvent(doTeleportThing, time*1000, cid, toPos) addEvent(setPlayerStorageValue, time*1000, cid, storage, os.time () + cd) end return true end if getCreatureSkull(cid) >= 3 then return doPlayerSendCancel(cid, "Você não pode usar este item enquanto está PK.") end if not isPremium(cid) then return doPlayerSendCancel(cid, "Você não é premium.") end if getPlayerStorageValue(cid, 141029) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 141029) - os.time ().." para se teleportar novamente.") end local a = 10 for i = 1, 10 do a = a - 1 addEvent(doCreatureSay, i*1000, cid, "" ..a.."", TALKTYPE_ORANGE_1) addEvent(doSendMagicEffect, i*1000, getThingPos(cid), efeito) end teleport_thing(cid, pos, 10, 141029, 30) return true end Testado, funcionando perfeitamente. Basta configurar o que é indicado.
  4. zipter98

    TP SCROLL

    function onUse(cid, item, topos, item2, frompos) local pos = {x = xxx, y = yyy, z = zzz} --Coordenadas para onde o player será teleportado. function teleport_thing(cid, toPos, time, storage, cd) if isCreature(cid) then addEvent(doTeleportThing, time*1000, cid, toPos) addEvent(setPlayerStorageValue, time*1000, cid, storage, os.time () + cd) end return true end if getCreatureSkull(cid) >= 3 then return doPlayerSendCancel(cid, "Você não pode usar este item enquanto está PK.") end if not isPremium(cid) then return doPlayerSendCancel(cid, "Você não é premium.") end if getPlayerStorageValue(cid, 141029) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 141029) - os.time ().." para se teleportar novamente.") end local a = 10 for i = 1, 10 do a = a - 1 addEvent(doCreatureSay, i*1000, cid, "" ...a..."", TALKTYPE_ORANGE_1) addEvent(doSendMagicEffect, i*1000, getThingPos(cid), 12) --No lugar de 12, coloque o efeito desejado. end teleport_thing(cid, pos, 10, 141029, 30) return true end
  5. Tenta assim: function onStepIn(cid, item, position, fromPosition) local flag = 0 local pos = {x = xxx, y = yyy, z = zzz} --Para onde o player será teleportado. for i = 12252, 12259 do if getPlayerItemCount(cid, i) >= 1 then flag = flag + 1 end end if flag == 8 then doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), 21) else doPlayerSendCancel(cid, "Você precisa de todas as insígnias para passar por aqui.") doTeleportThing(cid, fromPosition) end return true end A tag, você sabe fazer?
  6. Sobre esse NPC de task diária, foi algo que eu já tentei criar, mas faz um tempo já. E, como você deve imaginar, não funcionou e.e Sobre onde colocar essa proteção que passei, é abaixo do doPlayerSendCancel(cid, "Your ditto is not transformed.") markPos(mysum, unfix) return true end
  7. zipter98

    TP SCROLL

    Fiz correndo aqui, qualquer erro, só postar. function onUse(cid, item, topos, item2, frompos) local pos = {x = xxx, y = yyy, z = zzz} --Coordenadas para onde o player será teleportado. function teleport_thing(cid, toPos, time, storage, cd) if isCreature(cid) then addEvent(doTeleportThing, time*1000, cid, toPos) addEvent(setPlayerStorageValue, time*1000, cid, storage, os.time () + cd) end return true end if getCreatureSkull(cid) >= 3 then return doPlayerSendCancel(cid, "Você não pode usar este item enquanto está PK.") end if not isPremium(cid) then return doPlayerSendCancel(cid, "Você não é premium.") end if getPlayerStorageValue(cid, 141029) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 141029) - os.time ().." para se teleportar novamente.") end local a = 10 for i = 1, 10 do a = a - 1 addEvent(doPlayerSendTextMessage, i*1000, cid, 27, "Você será teleportado em "..a.." segundo(s).") end teleport_thing(cid, pos, 10, 141029, 30) return true end
  8. Foi mal, tinha esquecido de colocar uma coisa e.e Testado, funcionando perfeitamente! if string.find(getCreatureName(item2.uid), "Shiny") or string.find(getCreatureName(item2.uid), "shiny") then doPlayerSendCancel(cid, "Seu Ditto não pode se transformar em pokémons shinies.") markPos(mysum, unfix) return true end
  9. zipter98

    /Name

    Tenta assim, fica rapidin: function onSay(cid, words, param, channel) local p = string.explode(param, ',') local item_id = 2145 local item_count = 1 --Mude aqui a qnt de diamonds q vai remover do player. local proibido = {"tutor", "gm", "cm", "god", "mapper", "scripter", "programador", "spriter", "account manager", "character"} -- simbolos proibidos if(param == "") then doPlayerSendCancel(cid, "Command requires param.") return true end if getPlayerItemCount(cid, item_id) <= 4 then return doPlayerSendCancel(cid, "vc precisa de 5 diamonds.") end if(string.find(param:lower(), "[^%l%s]") ~= nil) then doPlayerSendCancel(cid, 20, "Voce nao pode usar simbolos no nome.") return TRUE end if getPlayerGroupId(p[1]) >= 3 then return doPlayerSendCancel(cid, "Você não pode alterar o nick de tutores, GMs, Subs e GODs.") end if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.") elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.") end doPlayerRemoveItem(cid, item_id, item_count) db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") doPlayerSendTextMessage(cid, 20, "You have changed " .. p[1] .. "'s name to " .. p[2] .. " You will be logged out in 5 seconds.") addEvent(doRemoveCreature, 5*1000, cid, true) return true end
  10. Muito obrigado pela informação, Maenilse e Oneshot (só não dou rep+ no momento, porque atingi meu limite de reputações positivas diárias )! Editei o código acima com essa função, espero que agora esteja tudo correto.
  11. Ah, entendi. A maneira de usar o doPlayerSetPromotionLevel(cid, promotion) é a mesmo do setvocation? (cid, id da vocação)?
  12. zipter98

    Livro de p.a

    data/movements/scripts. Tentou o script que passei acima? Usei como base uma talkaction que adiciona VIP do sistema do Mock.
  13. Qual o servidor que você utiliza? PDA by slicer, by bolz? Poderia informar? Talvez seja alguma coisa adicionada pela pessoa que editou o server, que tenha bugado o broke count system.
  14. Oneshot, poderia dizer qual a diferença entre essas duas funções? Possibilidade de bug sobre o primeiro? Alguma limitação?
  15. Tentei fazer uma coisa aqui, não sei se vai funcionar. Suponho que as tags, você já saiba. Spell: function onCastSpell(cid, var) local config = { [2] = {level = 15, newvoc = 18, outfit = 125, eff = 59}, [18] = {level = 200, newvoc = 2, outfit = 144, eff = 59} } trans = config[getPlayerVocation(cid)] if not trans then doPlayerSendCancel(cid, "You can not transform.") return false elseif getPlayerLevel(cid) >= trans.level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You not level " .. trans.level .. " to transform.") end doSetCreatureOutfit(cid, {lookType = trans.outfit}, -1) doPlayerSetPromotionLevel(cid, 1) doSendMagicEffect(getCreaturePosition(cid), trans.eff) doPlayerSendCancel(cid, "You Transformed!") setPlayerStorageValue(cid, 102913, 1) return true end Creaturescript: function onLogin(cid) if getPlayerStorageValue(cid, 102913) >= 1 then doPlayerSetPromotionLevel(cid, 0) setPlayerStorageValue(cid, 102913, -1) else return true end return true end O que eu fiz, foi simplesmente setar uma storage no player ao usar a spell. Ai, quando ele logar/relogar, caso tenha esta storage, será setado nele a vocation Druid (não esqueça de configurar o ID dela na variável voc_id).
  16. Seria, simplesmente, um NPC que retira um único item x do player e adiciona 25 de outro item? Ou nesse NPC teria vários outros items, sendo uma espécie de Mark? Estou indo para o curso de inglês agora, na volta, se ninguém tiver te ajudado ainda, tentarei fazer o NPC para você.
  17. zipter98

    Ak-Gold

    Sobre "unir" os scripts, você quer dizer algo assim? Não entendi direito e.e local ak_chumbo = 2171 -- id da sua ak-47 de chumbo local ak_bullets = 2170 -- id da sua ak-47 de bullets function onSay(cid, words, param) if(words == "!ak bullet") then if getPlayerItemCount(cid, ak_bullets) >= 1 then doPlayerRemoveItem(cid, ak_bullets, 1) doPlayerAddItem(cid, ak_chumbo, 1) doPlayerSendTextMessage(cid, 25,"Transformou sua AK-47 de bullets para chumbo.") else doPlayerSendTextMessage(cid, 25,"Voce nao tem a AK-47 de bullets.") end end if(words == "!ak chumbo") then if getPlayerItemCount(cid, ak_chumbo) >= 1 then doPlayerRemoveItem(cid, ak_chumbo, 1) doPlayerAddItem(cid, ak_bullets, 1) doPlayerSendTextMessage(cid, 25,"Transformou sua AK-47 de chumbo para bullets.") else doPlayerSendTextMessage(cid, 25,"Voce nao tem a AK-47 de chumbo.") end end return true end Ou assim? Dessa última maneira, deverá ser setado no player, ao equipar uma munição pela primeira vez, a storage correspondente a munição, para poder trocar de munição com a talkaction abaixo. local ak_chumbo = 2171 -- id da sua ak-47 de chumbo local ak_bullets = 2170 -- id da sua ak-47 de bullets function onSay(cid, words, param) local storage_chumbo = xxx --storage do chumbo local storage_bullet = xxx --storage do bullet if getPlayerStorageValue(cid, storage_chumbo) == 0 and getPlayerStorageValue(cid, storage_bullet) == 0 then return doPlayerSendTextMessage(cid, 27, "Equipe uma munição, primeiramente!") end if getPlayerStorageValue(cid, storage_chumbo) >= 1 then doPlayerRemoveItem(cid, ak_chumbo, 1) doPlayerAddItem(cid, ak_bullets, 1) doPlayerSendTextMessage(cid, 25,"Transformou sua AK-47 de chumbo para bullets.") setPlayerStorageValue(cid, storage_chumbo, -1) setPlayerStorageValue(cid, storage_bullet, 1) elseif getPlayerStorageValue(cid, storage_bullet) >= 1 then doPlayerRemoveItem(cid, ak_bullets, 1) doPlayerAddItem(cid, ak_chumbo, 1) doPlayerSendTextMessage(cid, 25,"Transformou sua AK-47 de bullets para chumbo.") setPlayerStorageValue(cid, storage_bullet, -1) setPlayerStorageValue(cid, storage_chumbo, 1) end return true end Fiz rapidinho esses códigos, talvez tenha algo errado '-'
  18. pokeballs.lua, localizado em data/talkactions/scripts.
  19. Em order.lua [actions], adicione, abaixo do doPlayerSendCancel(cid, "Your ditto is not transformed.") markPos(mysum, unfix) return true end Isso: if string.find(item2.uid, "Shiny") or string.find(item2.uid, "shiny") then doPlayerSendCancel(cid, "Seu Ditto não pode se transformar em pokémons shinies.") markPos(mysum, unfix) return true end
  20. zipter98

    npc

    Eu pensava que ambos serviam para players, valeu pela informação \o
  21. zipter98

    Castle

    De nada Reportado para moverem p/ Pedidos e dúvidas resolvidos - Scripting.
  22. zipter98

    Castle

    Você poderia postar aqui o script que teleporta o player para o castle? Neste, o player recebe um "valor", que, com ele, poderá criar condições (como uma utilizada em meu comentário anterior), até que este valor seja retirado do jogador. Realmente, não sou bom com explicação, tente descobrir qual o código que teleporta (provável) o jogador para o castelo. Para adicionar/registrar esses códigos que passei, faça o seguinte: Vá em data/creaturescripts/scripts, copie e cole um arquivo com extensão .lua qualquer desta pasta, delete todo o conteúdo. Depois, adicione nele o código que passei. Feito isso, vá em data/creaturescripts e abra o arquivo creaturescripts.xml. Nele, você verá várias "tags", como, por exemplo: <event type="look" name="LookSystem" event="script" value="look.lua"/> Neste arquivo, você deve adicionar a seguinte tag: <event type="preparedeath" name="Nome do arquivo (para registrar depois no login.lua)" event="script" value="nome do arquivo.lua criado (como expliquei acima).lua"/> Salve então o arquivo. Após ter criado o arquivo.lua e colocado a tag no creaturescripts.xml, vá em data/creaturescripts/scripts, e abra o arquivo login.lua. Lá, procure pela parte que terá vários semelhantes a esses: registerCreatureEvent(cid, "EffectOnAdvance") registerCreatureEvent(cid, "GeneralConfiguration") registerCreatureEvent(cid, "SaveReportBug") registerCreatureEvent(cid, "LookSystem") Após o último registro de creatureevent, pule uma linha e coloque isso (ou coloque entre eles, isso você decide): registerCreatureEvent(cid, "Nome do arquivo que você colocou na tag em actions.xml") Como eu disse, não sou muito bom em explicações, mas espero que você tenha entendido um pouco sobre o que fazer.
  23. zipter98

    Castle

    Tirei como base um script que achei por ae no fórum. Se quiser tentar: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local storage_castle = xxx --Storage que o player recebe ao entrar no castelo. if isPlayer(cid) and getPlayerStorageValue(cid, storage_castle) >= 1 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, false) return false end return true end E tem esse também '-' function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local storage_castle = xxx --Storage do castle. if isPlayer(cid) and getPlayerStorageValue(cid, storage_castle) >= 1 then doCreatureSetDropLoot(cid, false) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + 65500, true) end return true end
  24. zipter98

    npc

    Eita, agora que reparei que esqueci do - nessa parte. Vlw por lembrar, amoeba!
  25. Certo, qualquer erro, só postar aqui, ou mandar PM mesmo.
  • Quem Está Navegando   0 membros estão online

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