Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. Configure na tabela items, como indicado. Siga o modelo que deixei com os items de ID 2160 e 2158.
  2. itemid -> ID do item. chance -> Chance, em porcentagem, de sair o item. count -> Quantidade do item. local items = { --[itemid] = {chance, count}, [2160] = {50, 100}, [2158] = {70, 50}, } function onUse(cid, item) local number = math.random(1, 100) local _item = 0 for itemid, chance in pairs(items) do if _item == 0 then _item = itemid else local new_chance = (chance[1] - number) > 0 and chance[1] - number or number - chance[1] local old_chance = (items[_item][1] - number) > 0 and items[_item][1] - number or number - items[_item][1] if new_chance < old_chance then _item = itemid end end end if _item ~= 0 then local count = items[_item][2] if not isItemStackable(_item) then if count > 1 then for i = 1, count do doPlayerAddItem(cid, _item, 1) end else doPlayerAddItem(cid, _item, 1) end else doPlayerAddItem(cid, _item, count) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received: "..count.."x "..getItemNameById(_item)..(count > 1 and "s" or "")..".") doRemoveItem(item.uid, 1) end return true end
  3. Muda o nome do arquivo para mewdeath.lua (não MewDeath.lua, como está atualmente).
  4. Ah, agora eu li a função melhor e entendi. Em configuration.lua, altere a tabela youAre para a seguinte: youAre = { [3] = "a Senior Tutor", } Apenas isso. Remova a modificação que enviei anteriormente.
  5. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { hp = 500, --Quantia de HP que irá ser curada a cada turno. mana = 500, --Quantia de mana que irá ser curada a cada turno. interval = 500, --Intervalo de tempo, em milésimos. 1000 - 1 segundo turns = 10, --Quantos turnos a spell durará. } local function heal(cid, turn) if isCreature(cid) then if turn <= 0 then return true end doCreatureAddHealth(cid, config.hp) doCreatureAddMana(cid, config.mana) addEvent(heal, config.interval, cid, turn - 1) end end function onCastSpell(cid, var) heal(cid, config.turns) return true end
  6. Tag: <globalevent name="dayBroadcast" time="18:55" event="script" value="nome_do_arquivo.lua"/> Código: local open = 5 --Tempo para abrir o evento (minutos). function onTime() local days = {"Monday", "Tuesday"} local messages = {"O evento foi aberto!!", "%d minutos para o evento abrir."} if isInArray(days, os.date("%A")) then broadcastMessage(messages[2]:format(open)) for i = 1, open do addEvent(function() local time = open - i if time <= 0 then broadcastMessage(messages[1]) else broadcastMessage(messages[2]:format(time)) end end, i * 60 * 1000) end end return true end
  7. Não testei. local config = { attack = 45, --Ataque mínimo da arma. chance = 25, --Chance de dar crítico. multiplier = 1.5, --Multiplicador de crítico. } function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then for i = 5, 6 do local item = getPlayerSlotItem(attacker, i) if item then if getItemAttack(item) >= config.attack then if math.random(1, 100) <= config.chance then value = math.floor(value * config.multiplier) doSendAnimatedText(getThingPos(cid), "CRITICAL!", TEXTCOLOR_DARKRED) break end end end end end return true end
  8. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    data/lib, newStatusSyst.lua: Troque: doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) end Troque: doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) end Troque: doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end end EDIT: Para evitar futuros bugs, alterei os códigos do meu segundo comentário. Se possível, substitua seus scripts pelos novos.
  9. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    Se possível, poste o código inteiro.
  10. Dou uma olhada depois no primeiro erro. Já sobre o segundo: function onSay(cid, words, param) if not param or param == "" then return doPlayerSendCancel(cid, "/command number[1-10]") elseif not tonumber(param) then return doPlayerSendCancel(cid, "/command number[1-10]") elseif getPlayerStorageValue(cid, 828121) >= 0 then return doPlayerSendTextMessage(cid, 27, "Você já está participando do evento!") elseif getGlobalStorageValue(9183112) == -1 then return doPlayerSendTextMessage(cid, 27, "O evento não está em execução, Aguarde ele comecar!") elseif tonumber(param) < 1 or tonumber(param) > 10 then return doPlayerSendTextMessage(cid, 27, "Somente números de 1 á 10.") elseif not doPlayerRemoveMoney(cid, 100000) then return doPlayerSendTextMessage(cid, 27, "Você não possui dinheiro o suficiente para participar do evento! É necessário ter 100k!") else setPlayerStorageValue(cid, 828121, param) doPlayerSendTextMessage(cid, 27, "Agora você está participando do evento, seu número: "..param..". Aguarde o resultado, boa sorte!") end return true end
  11. Este sistema de multilingua que você se refere é o que fiz neste tópico? --Comando que muda linguagem. local lang = { ["portuguese"] = 1, ["english"] = 2, ["spanish"] = 3, } local storage = 8971 function onSay(cid, words, param) if not param or param == "" then return doPlayerSendCancel(cid, "Command: command portuguese/english/spanish") elseif not lang[param:lower()] then return doPlayerSendCancel(cid, "This language isn't available.") elseif getPlayerStorageValue(cid, storage) == lang[param:lower()] then return doPlayerSendCancel(cid, "Your game is already on this language.") end doPlayerSendTextMessage(cid, 27, "Game language changed to "..param..".") setPlayerStorageValue(cid, storage, lang[param:lower()]) return true end --Exemplo de talkaction que manda um popup com linguagem dependendo da configurada pelo comando acima. local messages = { [1] = "Oi, como vai?", [2] = "Hello, how are you?", [3] = "Hola, cómo estás?", } local default = "Hello, how are you?" --Mensagem padrão. function onSay(cid, words) return doPlayerPopupFYI(cid, messages[getPlayerStorageValue(cid, 8971)] or default) end
  12. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    Você quer remover quais pokémons desta tabela? Todos?
  13. PS: A hora é configurada na tag. <globalevent name="dayBroadcast" time="19:00" event="script" value="nome_do_arquivo.lua"/>
  14. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    data/actions/scripts, o nome do arquivo deve ser algo relacionado a catch.
  15. local configuration = { day = "Saturday", to_pos = {x = x, y = y, z = z}, --Para onde o teleport levará. pos = {x = x, y = y, z = z}, --Onde o teleport será criado. teleport_id = 1387, --ID do teleport. aid = 3434, --Action ID do teleport. time = 10, --Tempo para fechar, em minutos. } function onTime() if os.date("%A") == configuration.day then local item = getTileItemById(configuration.pos, configuration.teleport_id).uid if item < 1 then local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos) doItemSetAttribute(tp, "aid", configuration.aid) broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING) addEvent(function() tp = getTileItemById(configuration.pos, configuration.teleport_id).uid if tp and tp > 0 then doRemoveItem(tp) broadcastMessage("Teleportes fechados.") end end, configuration.time * 60 * 1000) end end return true end
  16. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    EDIT: Códigos alterados e testados. Editei meu comentário anterior com eles.
  17. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    Em data/lib, pokemons moves.lua: abaixo de: local table = getTableMove(cid, spell) --alterado v1.6 adicione: if spell == "DB" then table = getTableMove(cid, "Destiny Bound") end Código do Destiny Bound: elseif spell == "Destiny Bound" then local death = 3 --Tempo para morrer, em segundos. setPlayerStorageValue(cid, 8401, 1) addEvent(function() if isCreature(cid) and getPlayerStorageValue(cid, 8401) > -1 then setPlayerStorageValue(cid, 8401, -1) doCreatureAddHealth(cid, -getCreatureHealth(cid)) end end, death * 1000) Código da spell que o Destiny Bound irá executar (caso o pokémon seja morto): elseif spell == "DB" then spell = "Destiny Bound" local config = { effect = 136, --Effect. area = selfArea1, --Área do golpe (criada em data/lib/areas.lua). element = ghostDmg, --Elemento do ataque. } setPlayerStorageValue(cid, 8401, -1) doMoveInArea2(cid, config.effect, config.area, config.element, min, max, spell) data/actions/scripts, goback.lua: acima de: doReturnPokemon(cid, z, item, effect) adicione: if getPlayerStorageValue(z, 8401) > -1 then return setPlayerStorageValue(z, 8401, -1) and doCreatureAddHealth(z, -getCreatureHealth(z)) elseif getPlayerStorageValue(z, 8402) > -1 then return setPlayerStorageValue(z, 8402, -1) and doCreatureAddHealth(z, -getCreatureHealth(z)) end abaixo de: local pk = getCreatureSummons(cid)[1] if not isCreature(pk) then return true end adicione: if getPlayerStorageValue(pk, 8401) > -1 then return setPlayerStorageValue(pk, 8401, -1) and doCreatureAddHealth(pk, -getCreatureHealth(pk)) elseif getPlayerStorageValue(pk, 8402) > -1 then return setPlayerStorageValue(pk, 8402, -1) and doCreatureAddHealth(pk, -getCreatureHealth(pk)) end data/creaturescripts/scripts, exp2.0.lua: troque: if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) end end por: local config = { sturdy = { --Pokémons que possuem a habilidade Sturdy. Configuração: ["nome_do_pokemon"] = lookType, ["Aggron"] = lookType, }, cd = 30, --Cooldown da habilidade. duration = 8, --Duração, em segundos, do Sturdy. storages = { db = 8401, s = 8402, s_cd = 8403, }, } if getPlayerStorageValue(cid, config.storages.s) > -1 then return false end local hp = getCreatureHealth(cid) - valor if not isPlayer(cid) then if hp <= 1 then if config.sturdy[getCreatureName(cid)] then local b = true if isSummon(cid) then local ball = getPlayerSlotItem(getCreatureMaster(cid), 8) if ball and getCD(ball.uid, "sturdy") > 0 then b = false end end if b then if hp < 1 then doCreatureAddHealth(cid, hp < 0 and (hp * -1) + 1 or 1) end setPlayerStorageValue(cid, config.storages.s, 1) if isSummon(cid) then local ball = getPlayerSlotItem(getCreatureMaster(cid), 8) if ball then setCD(ball.uid, "sturdy", config.duration + config.cd) end end doSetCreatureOutfit(cid, {lookType = config.sturdy[getCreatureName(cid)]}, config.duration * 1000) addEvent(function() if isCreature(cid) and getPlayerStorageValue(cid, config.storages.s) > -1 then setPlayerStorageValue(cid, config.storages.s, -1) doCreatureAddHealth(cid, -getCreatureHealth(cid)) end end, config.duration * 1000) end end end end if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) if not isPlayer(cid) and getPlayerStorageValue(cid, config.storages.db) > -1 then docastspell(cid, "DB") end end end data/lib, newStatusSyst.lua: Troque: doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage, 15, COLOR_BURN) end Troque: doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS) end Troque: doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end por: if getPlayerStorageValue(cid, 8402) == -1 then doCreatureAddHealth(cid, -damage) doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144) doSendMagicEffect(getThingPos(cid), 45) ------ local newlife = life - getCreatureHealth(cid) if newlife >= 1 and attacker ~= 0 then doSendMagicEffect(getThingPos(attacker), 14) doCreatureAddHealth(attacker, newlife) doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32) end end
  18. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { removeItem = "yes", strInName = "[VIP] ", vipStorage = 13500, vipDays = 15 } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) if getCreatureName(cid):find(config.strInName) then return doPlayerSendCancel(cid, "Sorry, not possible.") end local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time()) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end
  19. Muda: doCreatureSetLookDirection(cid, getDirectionTo(getPlayerPosition(cid), getPlayerPosition(target)) para: doCreatureSetLookDirection(cid, getDirectionTo(getPlayerPosition(cid), getPlayerPosition(target)))
  20. Em configuration.lua, altere a tabela youAre para a seguinte: youAre = { [3] = "a Senior Tutor", }

Informação Importante

Confirmação de Termo