Ir para conteúdo

Danihcv

Conde
  • Total de itens

    926
  • Registro em

  • Última visita

  • Dias Ganhos

    18

Tudo que Danihcv postou

  1. @@pirilampoo, ah, ok. É porque "alguem" (dono do tópico ou algum membro da equipe) marcou como resolvido... sauhsahusa Tópico Movido Este tópico foi movido de "OTServ → Scripting → Suporte Scripting → Pedidos e dúvidas resolvidos - Scripting" para "OTServ → Scripting → Suporte Scripting".
  2. @@Skulls, sobre multiplicar por 1000, isso não é necessario, pois o os.time retorna o valor em segundos e não em milissegundos. Sobre uma certa injustiça permanecer no meu script, isso está correto. Não havia pensado na possibilidade de "pausar" o tempo de uso... hehehehe Seus scripts me parecem ter uma certa inconsistência tb (acredito que pela falta de pratica, que tb é o meu caso ). Segue os novos codigos: @[member=Sekk], Adicione uma tag ao arquivo creaturescripts.xml: <event type="logout" name="questLogout" event="script" value="arquivo.lua"/> Agora crie um arquivo.lua em creaturescripts\scripts: function onLogout(cid) if getCreatureStorage(cid, 5834) ~= -1 then doCreatureSetStorage(cid, 5834, getCreatureStorage(cid, 5834)-os.time()) end return true end parte para por no login.lua: if getCreatureStorage(cid, 5834) ~= -1 then tempoRestante = getCreatureStorage(cid, 5834) doCreatureSetStorage(cid, 5834, tempoRestante + os.time()) addEvent( function() doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, 22, "Seu tempo acabou, e foi transportado de volta ao templo!") doCreatureSetStorage(cid, 5834, -1) end, tempoRestante*1000) end #edit: correção na logica...
  3. Tópico movido para dúvidas / pedidos resolvidos.
  4. Tópico movido para dúvidas / pedidos resolvidos.
  5. Tópico movido para dúvidas / pedidos resolvidos.
  6. Danihcv

    Erro script quest

    Tópico movido para dúvidas / pedidos resolvidos.
  7. Tópico movido para dúvidas / pedidos resolvidos.
  8. Tópico movido para dúvidas / pedidos resolvidos.
  9. Tópico movido para dúvidas / pedidos resolvidos.
  10. Tópico movido para dúvidas / pedidos resolvidos.
  11. Danihcv

    Dano da Spell ?

    Tópico movido para dúvidas / pedidos resolvidos.
  12. Tópico movido para dúvidas / pedidos resolvidos.
  13. Tópico movido para dúvidas / pedidos resolvidos.
  14. @, ao usar os.time(), o comando retorna a quantidade de segundos que se passaram desde o dia 1 de janeiro de 1970 até o presente momento (em que o comando foi requisitado)
  15. Na vdd... Nem precisa complicar tanto.. sahusahuasuh É só usar os.time: script: local position = {x = 123, y = 456, z = 7} local templepos = {x = 123, y = 456, z = 7} local tempo = 10 function onUse(cid) doTeleportThing(cid, position) doCreatureSetStorage(cid, 5834, os.time()+tempo) addEvent( function() doTeleportThing(cid, templepos) doPlayerSendTextMessage(cid, 22, "Seu tempo acabou, e foi transportado de volta ao templo!") doCreatureSetStorage(cid, 5834, -1) end, 1000 * tempo) return true end parte do login.lua: local tempo = 10 --tem que ser o mesmo tempo usado na script da action if os.time() >= getCreatureStorage(cid, 5834) then doCreatureSetStorage(cid, 5834, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end #edit: correção na logica...
  16. @, na vdd não... Pois quando o player deslogar, ele vai interromper/cancelar o addEvent. E então ele ficará com a storage em 1 para sempre ao relogar.
  17. Sim. Acaba sendo um pouco injusto, exatamente como o @@Skulls falou. *edit: se ngm postar um script mais "justo", eu acho que posto em breve.
  18. Ola, @@diogolima. Sim, isto eh errado. Caso vc queira postar um servidor para download, basta upá-lo em um site (como 4 shared, por exemplo) e então disponibilizar o link no topico para baixá-lo. P.s.: não esqueça de postar o scan do mesmo tb. Para fazer o scan, recorra ao site virus total. *O motivo disso ser errado eh pq nós aqui da equipe do forum, preferimos que todo o conteúdo passado aos nossos usuários sejam passados por nós (equipe) antes/também. E tb não apoiamos suporte/etc fora do forum, pois caso uma situação desagradável aconteça, nós n poderemos fazer nada a respeito. Agradeço a compreensão. Abraços. ^^
  19. Não. Essa checagem feita no login.lua eh apenas feita no momento do login. Ou seja, se qnd o player logar, ele estiver com a storage em 1, aí será settada pra -1.
  20. Caso o do caronte não dê certo, tenta assim: local storage = 79845 --storage para o exhaustion local tempo = 5 --em segundos local monsters = { [1] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 2 }, [2] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 }, [5] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 }, [6] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6 }, } function onSay(cid, words, param, channel) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 22, "You are exhausted.") return true end --Player Status local playerpos = getPlayerPosition(cid) for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do if (param == v)then if (monsters[getPlayerVocation(cid)]) and #getCreatureSummons(cid) >= monsters[getPlayerVocation(cid)].maxSummons then return doPlayerSendCancel(cid, "Você já tem sumons demais.") else --Summon if getPlayerLevel(cid) < monster[getPlayerVocation(cid)].summons[param].level then return doPlayerSendCancel(cid, "Level insuficiente.") elseif getCreatureMana(cid) < monster[getPlayerVocation(cid)].summons[param].mana then return doPlayerSendCancel(cid, "Mana insuficiente.") elseif getPlayerLevel(cid) >= monster[getPlayerVocation(cid)].summons[param].level and getCreatureMana(cid) >= monster[getPlayerVocation(cid)].summons[param].mana then doConvinceCreature(cid, doCreateMonster(param, playerpos)) doPlayerAddMana(cid, -monster[getPlayerVocation(cid)].summons[param].mana, false) exhaustion.set(cid, storage, tempo) doSendMagicEffect(playerpos, 2) return true end end else doPlayerSendCancel(cid, "You can't summon this monster.") end end return true end
  21. Putz... Então o problema eh na source msm. Soh n sei como faz pra consertar, pq n mexo com source...
  22. Tenta agr: local storage = 79845 --storage para o exhaustion local tempo = 5 --em segundos local monsters = { [1] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 2 }, [2] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 }, [5] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 4 }, [6] = {summons = {["rat"] = {level = 10, mana = 20}, ["dragon"] = {level = 100, mana = 200} }, maxSummons = 6 }, } function onSay(cid, words, param, channel) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, 22, "You are exhausted.") return true end --Player Status local playerpos = getPlayerPosition(cid) for k, v in pairs(monsters[getPlayerVocation(cid)].summons) do if (param == v)then if (monsters[getPlayerVocation(cid)]) and #getCreatureSummons(cid) >= monsters[getPlayerVocation(cid)].maxSummons then return doPlayerSendCancel(cid, "Você já tem sumons demais.") else --Summon if getPlayerLevel(cid) < monster[getPlayerVocation(cid)].summons[param].level then return doPlayerSendCancel(cid, "Level insuficiente.") elseif getCreatureMana(cid) < monster[getPlayerVocation(cid)].summons[param].mana then return doPlayerSendCancel(cid, "Mana insuficiente.") end doConvinceCreature(cid, doCreateMonster(param, playerpos)) doPlayerAddMana(cid, -monster[getPlayerVocation(cid)].summons[param].mana, false) exhaustion.set(cid, storage, tempo) doSendMagicEffect(playerpos, 2) return true end else doPlayerSendCancel(cid, "You can't summon this monster.") end end return true end
  23. <p>Tópico movido para dúvidas / pedidos resolvidos.</p>
  24. Vê assim: function onKill(cid, target, lastHit) if(isPlayer(target) ~= true) then return true end if getPlayerIp(cid) ~= getPlayerIp(target) then if (isPlayer(cid) == true) and (isPlayer(target) == true) then if getPlayerSkullType(target) == SKULL_WHITE then addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_YELLOW then addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_RED then addPlayerRep(cid, 40, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_BLACK then addPlayerRep(cid, 45, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_NONE then removePlayerRep(cid, 30, TEXTCOLOR_RED) end return true end else doPlayerSendCancel(cid, "The IP of your enemy has to be different from yours.") return true end end
  25. function onKill(cid, target, lastHit) if(isPlayer(target) ~= true) then return true end if getPlayerIp(cid) ~= getPlayerIp(target) then if (isPlayer(cid) == true) and (isPlayer(target) == true) then if getPlayerSkullType(target) == SKULL_WHITE then addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_YELLOW then addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_RED then addPlayerRep(cid, 40, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_BLACK then addPlayerRep(cid, 45, TEXTCOLOR_LIGHTBLUE) elseif getPlayerSkullType(target) == SKULL_NONE then removePlayerRep(cid, 30, TEXTCOLOR_RED) end return true end else doPlayerSendCancel(cid, "The IP of your enemy has to be different from yours.") end end
  • Quem Está Navegando   0 membros estão online

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