Ir para conteúdo

RigBy

Visconde
  • Total de itens

    411
  • Registro em

  • Última visita

  • Dias Ganhos

    10

Tudo que RigBy postou

  1. Eu uso essa Trunk.r3777.r19 e não tenho nenhum problema. Caso você teja problema para compilar pode ser sua Dev c++
  2. #DarkHell Obrigado #Vodkart Sim, pode servir até para a anihilator ou demon aok, invitando que um segundo time entre na sala antes que o primeiro time acabe.
  3. Script novinho :http://www.xtibia.com/forum/topic/235070-limite-de-player-por-sala/
  4. #topico local level = 50 -- level que precisa ter para usar o item local items = {2650, 2674} -- items que vai ganha function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= level then doRemoveItem(item.uid, 1) for i,_ in pairs(items) do doPlayerGiveItem(cid, items[i], 1) end else doPlayerSendCancel(cid, "Você precisa ser level "..level.." para usar o item.") end return true end #joão cria um tópico com seu pedido ps: não tinha visto o topico do skymagnum ai em cima(energia ta caindo toda hora aqui)
  5. Em action .lua local items = {2650, 2674, 7752, 4343, 5345, 4345} -- items que vai ganha function onUse(cid, item, fromPosition, itemEx, toPosition) for i,_ in pairs(items) do doPlayerGiveItem(cid, items[i], 1) doRemoveItem(item.uid, 1) end return true end .xml - tag <action itemid="ITEM QUE VAI CLICAR" event="script" value="Nomedoscript.lua"/>
  6. Acho que ninguém não ta fazendo, então vou começar a fazer amanha.
  7. Obrigado :hi:
  8. Limite de player por sala Introdução: Esse script pode ser bem útil para baiak onde as salas tão sempre cheia de player upando ou então para eventos. O script simplesmente checa a quantidade de player que tem dentro da sala, caso não tenha atingido o limite o player pode entrar caso não, manda uma mensagem falando que a sala esta lotada. Exemplo de uso: pode servir até para a anihilator ou demon aok, invitando que um segundo time entre na sala antes que o primeiro acabe. Caso a sala esteja lotada. Caso não. Em data/movement/script, crie LimiteArea.lua e adicione. Em movement/movement.xml Adicione essa tag E depois adicionar o actionid no piso ou teleport pelo mapa editor. O script é fácil de se configurar mas caso tenha algum problema pode posta ai que eu vou ajuda. Caso você adicione mais locais você terá que adicione na tag também.
  9. RigBy

    Magia virar passiva

    Pronto .lua local porcetagem = 50 -- 50% dele solta a magia durante o combate local magia = "blood rage" -- magia que ele ira solta, tem que ser o nome da magia e não a palavra magica local storage = 5834843857 -- storage que vai ser usada, o valor é 1 para ser ativado function onCombat(cid, target) if isPlayer(cid) then if getPlayerStorageValue(cid, storage) == 1 then if math.random (0, 100) <= porcetagem then doCreatureCastSpell(cid, magia) end end end return true end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) then if getPlayerStorageValue(cid, storage) == 1 then if combat ~= COMBAT_HEALING then if math.random (0, 100) <= porcetagem then doCreatureCastSpell(cid, magia) end end end end return true end .xml <event type="StatsChange" name="Passivee" event="script" value="NomedoScript.lua"/> <event type="combat" name="Passive" event="script" value="NomedoScript.lua"/> Login.lua antes do ultimo end registerCreatureEvent(cid, "Passive") registerCreatureEvent(cid, "Passivee")
  10. opa foi mal, tinha mudado para onUse tem querer(ja editei la) Você tem que usar os dois em conjunto, tanto o globalevent(vai criar o teleport no dia marcado) e o movement(o que teleporta e impede que outras vocações teleport)
  11. RigBy

    Magia virar passiva

    você vai ter que adiciona essa função na sua source, ela obriga a solta a magia, é muito útil. .lua local porcetagem = 50 -- 50% dele solta a magia durante o combate local magia = "blood rage" -- magia que ele ira solta, tem que ser o nome da magia e não a palavra magica function onCombat(cid, target) if isPlayer(cid) then if math.random (0, 100) <= porcetagem then doCreatureCastSpell(cid, magia) end end return true end .xml <event type="combat" name="Passive" event="script" value="NomedoScript.lua"/> Login.lua antes do ultimo end registerCreatureEvent(cid, "Passive")
  12. não precisa juntar os script so basta substituir o que cria o teleport no dia da semana por esse(não esqueça de configura) e deixa o movement. local config = { day = "Monday","Wednesday","Friday","Sunday", pos = {x=1023, y=1023, z=7}, time = 5, -- tempo que o teleport ira sumir em minutos msg_open = "O Portal vai se abrir em 5 minutos.", msg_close = "O Portal se fechou." action = XXXX -- aqui você coloca o action id } local function DelTp() local t = getTileItemById(config.pos, 1387) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(config.pos, CONST_ME_POFF) end end function onTimer() if (os.date("%A") == config.day) then local item = doCreateItem(1387, 1, config.pos) doItemSetAttribute(item, "aid", config.action) doBroadcastMessage(config.msg_open) addEvent(DelTp, config.time*60*1000) addEvent(doBroadcastMessage, config.time*60*1000, config.msg_close) end return true end
  13. RigBy

    Livro ser o questlog

    local quest = { [12200] = {name = "Salve o mundo", done = 1}, [12201] = {name = "A volta dos que nao foram", done = 1}, [12202] = {name = "Eu, eu mesmo e Irene", done = 1}, [12203] = {name = "Todo Poderoso", done = 1}, } function onUse(cid, item, fromPosition, itemEx, toPosition) local t = {} for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if(spell.level ~= 0) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end local tabela = {} for a, b in pairs(quest) do if getPlayerStorageValue(cid, a) == b.done then table.insert(tabela, ""..b.name.."\n") end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.level) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n" end if #tabela > 0 then local info = 'Nome : '..getCreatureName(cid)..' \nLevel : '..getPlayerLevel(cid)..' \nHealth : ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..'] \nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..'] \n \n' doShowTextDialog(cid, item.itemid,''..info..'Quests completadas:\n\n'..table.concat (tabela)..'\n'..text..'') else doShowTextDialog(cid, item.itemid,''..info..'Nenhuma quest completada.'..text..'') end if(fromPosition.x ~= CONTAINER_POSITION) then doSendMagicEffect(fromPosition, CONST_ME_HITBYFIRE) end return true end
  14. centésimo rep :D
  15. RigBy

    Livro ser o questlog

    Fiz o meu com base no do bruno local quest = { [12200] = {name = "Salve o mundo ", done = 1}, [12201] = {name = "A volta dos que nao foram ", done = 1}, [12202] = {name = "Eu, eu mesmo e Irene ", done = 1}, [12203] = {name = "Todo Poderoso ", done = 1}, } function onUse(cid, item, fromPosition, itemEx, toPosition) local tabela = {} for a, b in pairs(quest) do if getPlayerStorageValue(cid, a) == b.done then table.insert(tabela, ""..b.name.."\n") end end if #tabela > 0 then doShowTextDialog(cid, item.itemid, "Quests completadas:\n\n"..table.concat (tabela).."") else doShowTextDialog(cid, item.itemid, "Nenhuma quest completada.") end return true end
  16. RigBy

    Livro ser o questlog

    troca isso for quest, _ in pairs(q) done por isso for quest, _ in pairs(q) do
  17. Isso é um movement .lua local vocation = {1, 2} -- vocações que vai poder usar o teleport local pos = {x = 129, y = 54, z = 6} -- local para onde sera teleportado function onStepIn(cid, player, position, FromPosition) if isInArray(vocation, getPlayerVocation(cid)) then doTeleportThing(cid, pos) else doTeleportThing(cid,FromPosition) doPlayerSendCancel(cid,"Você não tem a vocação necessária para entrar aqui!") end return true end .Xml, tag <movevent type="StepIn" actionid="XXXX" event="script" value="nome do arquivo.lua"/> agora so basta abrir o editor de mapas e coloca o actionid no teleport.
  18. Que ressaca!!!
  19. #Partiu São João
  20. /\ pronto editei o post ai agora ele ta atacando a cada 1 segundo(configurado), e o dano é pelo level. obs: não repita o level e math.huge que dizer infinito #não tinha visto o post, ta jaja eu posto com o efeito pronto local dps = 1 -- dano por segundo local a = { {levelMin = 0, levelMax = 10, danoMin = 1 , danoMax = 3}, {levelMin = 11, levelMax = 20, danoMin = 4 , danoMax = 7}, {levelMin = 21, levelMax = math.huge, danoMin = 20 , danoMax = 40} } function onAttack(cid, target) for _, b in pairs(a) do if getPlayerLevel(target) >= b.levelMin and getPlayerLevel(target) <= b.levelMax then if getPlayerStorageValue(cid, 8374239743824793874) < os.time() then doSendDistanceShoot(getThingPos(cid), getThingPos(target), CONST_ANI_SPEAR) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -b.danoMin, -b.danoMax, CONST_ME_BLOCKHIT) setPlayerStorageValue(cid, 8374239743824793874, os.time() + dps) end end end return true end
  21. pronto testa agora: local dps = 1 -- dano por segundo local a = { {levelMin = 0, levelMax = 10, danoMin = 1 , danoMax = 3}, {levelMin = 11, levelMax = 20, danoMin = 4 , danoMax = 7}, {levelMin = 21, levelMax = math.huge, danoMin = 20 , danoMax = 40} } function onAttack(cid, target) for _, b in pairs(a) do if getPlayerLevel(target) >= b.levelMin and getPlayerLevel(target) <= b.levelMax then if getPlayerStorageValue(cid, 8374239743824793874) < os.time() then doTargetCombatHealth(cid, target, COMBAT_LIFEDRAIN, -b.danoMin, -b.danoMax, CONST_ME_BLOCKHIT) setPlayerStorageValue(cid, 8374239743824793874, os.time() + dps) end end end return true end
  22. RigBy

    Parchment que mostra

    So coloquei nome, level, health e mana caso você queria outro é so fala function onUse(cid, item, fromPosition, itemEx, toPosition) local t = {} for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if(spell.level ~= 0) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.level) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n" end doShowTextDialog(cid, item.itemid, 'Nome : '..getCreatureName(cid)..' \nLevel : '..getPlayerLevel(cid)..' \nHealth : ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..'] \nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..'] \n \n'..text..'') -- é aqui onde adiciona mais return true end
  23. ps: não testei mas acho que ta funcionando de boa .lua local config = { [10] = {danoMin = 1, danoMax = 10}, -- [level] = {dano minimo, dano maximo}, [20] = {danoMin = 10, danoMax = 20}, [30] = {danoMin = 30, danoMax = 40}, [200] = {danoMin = 40, danoMax = 50}, } function onAttack(cid, target) for level, dpl in pairs(config) do if getPlayerLevel(target) >= level then doTargetCombatHealth(cid, target, COMBAT_LIFEDRAIN, -dpl.danoMin, -dpl.danoMax, CONST_ME_BLOCKHIT) end end return true end .xml <event type="attack" name="mobAttack" event="script" value="nomedoscript.lua"/> e registre no mob que vai ataca <script> <event name="mobAttack"/> </script>
  • Quem Está Navegando   0 membros estão online

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