Tudo que zipter98 postou
-
(Resolvido)Dado premiado
Configure na tabela items, como indicado. Siga o modelo que deixei com os items de ID 2160 e 2158.
-
(Resolvido)Dado premiado
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
-
Teleport pra mew e mewtwo
Muda o nome do arquivo para mewdeath.lua (não MewDeath.lua, como está atualmente).
- (Resolvido)[Pedido/Ajuda] Arquivo look.lua mostrando Gods com descrição de player
-
[PEDIDO] 2 Spells.
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
-
(Resolvido)[PEDIDO] Broadcast
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
-
(Resolvido)[PEDIDO] Broadcast
De 1 em 1 minuto?
-
[Pedido] Sistema de critical hit estilizado.
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
-
Spells PXG
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.
-
Capturar pokequest
- Capturar pokequest
- [AJUDA] Erro em 2 Scripts
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- (Resolvido)[PEDIDO] Quest de livro escrito
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- Capturar pokequest
- (Resolvido)[PEDIDO] Broadcast
PS: A hora é configurada na tag. <globalevent name="dayBroadcast" time="19:00" event="script" value="nome_do_arquivo.lua"/>- Capturar pokequest
- (Resolvido)[AJUDA] teleport evento
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- Spells PXG
EDIT: Códigos alterados e testados. Editei meu comentário anterior com eles.- (Resolvido)[Pedido/Ajuda] Arquivo look.lua mostrando Gods com descrição de player
- Spells PXG
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- (Resolvido)[Pedido/Ajuda] Arquivo look.lua mostrando Gods com descrição de player
- [PEDIDO] Vip no nome
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- Mudar de outfit ao atacar
Muda: doCreatureSetLookDirection(cid, getDirectionTo(getPlayerPosition(cid), getPlayerPosition(target)) para: doCreatureSetLookDirection(cid, getDirectionTo(getPlayerPosition(cid), getPlayerPosition(target)))- (Resolvido)[Pedido/Ajuda] Arquivo look.lua mostrando Gods com descrição de player
- (Resolvido)Pedido script /relatorio
De nada.
Informação Importante
Confirmação de Termo