Ir para conteúdo

lucasromero

Artesão
  • Total de itens

    101
  • Registro em

  • Última visita

Tudo que lucasromero postou

  1. Fiz um edit no post, creio que agora só criara quando todos os monstros morrerem.
  2. function onCastSpell(cid, var) local monsters = {'Rat', 'Demon', 'Medusa', 'Hydra'} local summons = getCreatureSummons(cid) local MaximoSummon = 4 local MaximoSummonn = 0 if(table.maxn(summons) > MaximoSummon) then doPlayerSendCancel(cid, "Você só pode criar apenas 4 summons.") return false end local player = getCreaturePosition(cid) if(table.maxn(summons) == MaximoSummonn) and isPlayer(cid) then for i = 1, #monsters do local a = doCreateMonster(monsters[i], player) doConvinceCreature(cid, a) else return doPlayerSendCancel(cid, "Você só pode criar quando todos os monstros morrerem.") end return true end Créditos: Duuh
  3. Ta ai: function onStepIn(cid, item, pos) local mana = 5 if getCreatureMana(cid) < 4 then doCreatureAddHealth(cid, -mana) return false end if isPlayer(cid) then doCreatureAddMana(cid, -mana) end return true end TAG: <moveevent type="StepIn" uniqueid="5680" event="script" value="script.lua"/> Coloque o Uniqueid 5680 (pode escolher) no tile em que voce quer que o script seja executado.
  4. Tenta agora.. Fiz edit. Créditos duuh.
  5. Desculpe-me, mas como disse, só fiz oque ele pediu, caso contrario fiz o mesmo que o duuh fez: http://www.xtibia.com/forum/topic/230466-quando-usar-tal-item-em-algum-player-o-player-ira-teleportar/ Se vier aqui postar só para ganhar posts, então não venha.
  6. Ai, o do Duuh com vocations function onUse(cid, item, fromPosition, itemEx, toPosition) local ids = {1,2,3,4,5} --Coloque o ID das vocations nesta tabela. local storage = 1234 -- storage local time = 1 -- tempo em minutos local mana = getCreatureMana(itemEx.uid) if getTilePzInfo(getCreaturePosition(cid)) or getTilePzInfo(getCreaturePosition(itemEx.uid)) then return false end if getPlayerStorageValue(cid, storage) - os.time() <= 0 then if isPlayer(itemEx.uid) then if isInArray(ids, getPlayerVocation(cid)) then doCreatureAddMana(itemEx.uid, -mana) doCreatureAddMana(cid, mana) doSendMagicEffect(getCreaturePosition(cid), 11) doSendMagicEffect(getCreaturePosition(itemEx.uid), 12) setPlayerStorageValue(cid, storage, os.time()+1*60) else doPlayerSendCancel(cid, "Voce nao pertence a vocation necessaria.") end else doPlayerSendCancel(cid, "Você só pode usar o item em players.") end else doPlayerSendCancel(cid, "Você só pode usar o item a cada "..time.." segundos.") end return true end
  7. lucasromero

    Item summon

    Ta ai: function onUse(cid, item, fromPosition, itemEx, toPosition) local ids = {1,2,3,4,5} --Coloque o ID das vocations nesta tabela. local summons = getCreatureSummons(cid) local MaximoSummon = 2 local playerpos = getPlayerPosition(cid) local maxhealth = getCreatureMaxHealth(cid) if(table.maxn(summons) > MaximoSummon) then doPlayerSendTextMessage(cid, 27, "Voce so pode criar duas criaturas.") return false end if isInArray(ids, getPlayerVocation(cid)) then local monster = doCreateMonster("monstroaqui", playerpos) doConvinceCreature(cid, monster) setCreatureMaxHealth(monster, maxhealth) doCreatureAddHealth(monster, maxhealth) doRemoveItem(item.uid, 1) else return doPlayerSendTextMessage(cid, 27, "Voce nao pertence a vocation necessaria.") end return true end
  8. lucasromero

    Item summon

    Poderia me informar se é de controlar o summon, ou o summon é livre?
  9. Seu item é de use with? Pois aqui é funcional.
  10. Testa ae: local monsters = {'Rat', 'Demon', 'Medusa', 'Hydra'} local storage = 123 local time = 1 -- tempo para usar a spells novamente em minutos. function onCastSpell(cid, var) local summons = getCreatureSummons(cid) local MaximoSummon = 4 if(table.maxn(summons) > MaximoSummon) then doPlayerSendCancel(cid, "Você só pode criar apenas 4 summons.") return false end local player = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) - os.time() <= 0 then for i = 1, #monsters do local a = doCreateMonster(monsters[i], player) doConvinceCreature(cid, a) end setPlayerStorageValue(cid, storage, os.time()+time*1*60) else return doPlayerSendCancel(cid, "Você só pode usar essa spells a cada "..time.." segundos.") end return true end Creditos: Duuh
  11. lucasromero

    Item summon

    Caso os de cima não der, tente esse:
  12. Testa ae.
  13. Se for oque eu tenha intendido. Ai está: function onUse(cid, item, fromPosition, itemEx, toPosition) local target = getCreatureTarget(cid) local mana = getCreatureMana(itemEx.uid) local temp = { exhausted = 120, --tempo em segundos, por exemplo, 60x2 = 120 = 2 minutos. storage = 298 --storage } if getTilePzInfo(topos) == 0 then doPlayerSendCancel(cid,"O player esta dentro do PZ.") return false end if getPlayerStorageValue(cid, 298) > os.time() then doPlayerSendTextMessage(cid, 22, "Voce está exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s")) return true end if isPlayer(itemEx.uid) then doCreatureAddMana(cid, mana) doPlayerSay(cid, 'Sharingan', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted) else return doPlayerSendCancel(cid, "Você só pode usar esse item em players.") end return true end Tag: <action itemid="iddoitem" script="nomedoscript.lua" allowfaruse="1"/>
  14. Ta aí: local cfg = { item = {5938, 1}, infinite = true, --Poderá pegar o item infinitas vezes? [true/sim] [false/não] } local storage = 91836 function onCastSpell(cid, var) if cfg.infinite then doPlayerAddItem(cid, cfg.item[1], cfg.item[2]) else if getPlayerStorageValue(cid, storage) < 1 then doPlayerAddItem(cid, item[1], item[2]) setPlayerStorageValue(cid, storage, 1) else return doPlayerSendCancel(cid, "Voce ja criou o item.") end end return true end Obs: foi o Zipter que fez, só estou passando o script dele.
  15. Use a tag : <action itemid="iddoitem" script="nomedoscript.lua" allowfaruse="1"/>
  16. Está falando disso? function onUse(cid, item, fromPosition, itemEx, toPosition) local position = {x = 1248, y = 730, z = 6} -- pos pra onde sera levado o cara local temp = { exhausted = 300, --delay storage = 301 -- storage } if getPlayerStorageValue(cid, 301) > os.time() then doPlayerSendTextMessage(cid, 22, "Voce está exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s")) return true end if isPlayer(itemEx.uid) then doTeleportThing(itemEx.uid, position) doPlayerSay(cid, 'KAMUI', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted) else return doPlayerSendCancel(cid, "Você só pode usar esse item em players.") end return true end Use a tag: <action itemid="iddoitem" script="nomedoscript.lua" allowfaruse="1"/>
  17. Ia acabar de fazer o edit, mais ta ai, o do duuh funciona xD E duuh, aproveitando o tópico, eu estou criando um edo system que é por use with, pra remover o corpo após usar o item no itemEx é so usar o DoRemoveItem?
  18. Fiz um edit ali, testei e funcionou. O jeito que eu fiz, ele tem que estar com Target no alvo.
  19. function onUse(cid, item, fromPosition, itemEx, toPosition) local position = {x = 1248, y = 730, z = 6} -- pos pra onde sera levado o cara local temp = { exhausted = 300, --delay storage = 303 -- storage } if getPlayerStorageValue(cid, 303) > os.time() then doPlayerSendTextMessage(cid, 22, "Voce está exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s")) return true end if isPlayer(itemEx.uid) then doTeleportThing(itemEx.uid, position) doPlayerSay(cid, 'Kamui!', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted) else return doPlayerSendCancel(cid, "Você só pode usar esse item em players.") end return true end Tag Actions.xml: <action itemid="IDdoITEM" script="NomeDoScript.lua" />
  20. Uhum, acrescentando addEvent. Entendi, Obrigadoo
  21. Pessoal, é o seguinte. Eu consegui fazer uma spell e com isso, após acabar o tempo da storage que eu coloquei com os.time Aparece uma mensagem: Seu tempo acabou. Creio que isso é no creaturescripts, então poderiam me falar com function que é? Eu não sei se é essa: onStatsChange(cid, attacker, type, combat, value) Se for, como que eu posso faze-la no script? Acabou o os.time da storage e dizer: Seu tempo acabou. Entenderam? Caso alguma dúvida so postar no tópico.
  22. Sim, eu fiz a parte de checar, eu só não sabia como adicionar o addEvent desse tipo. Obrigado de novo '-'
  23. Rep + Obrigado pela ajuda do addEvent, eu tinha visto um tutorial, mais não sabia que havia maneiras de por function (fica mais fácil na minha opinião).
  24. Pessoal, eu queria saber como que posso fazer um addEvent com essa função aqui: doRemoveItem(getTileItemById(poss, 1316).uid) Essa função remove um item criado em tal position (poss). Só que eu queria que essa função só fizesse depois de 1 segundo após executar a spell. Qualquer dúvida sobre o meu post só dizer.
  25. Substituir ou colocar em baixo do código? Pois se eu substituir dá erro na hora de compilar. Outra coisa, o script funcionou, copiou nome etc.. Mais quando eu estou UPANDO e mato um bixo não nasce o respawn. Poderia ajudar? @Edit Pronto, arrumei o erro, era só dar uma editada no script(distro) e fica funcional para mim. Ótimo script.
  • Quem Está Navegando   0 membros estão online

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