Tudo que Killua postou
- Evento Blood Castle [Automático]
-
Life Steal
O dano dividido por 10 não é 10℅ do dano kkk
- Evento Blood Castle [Automático]
-
(Resolvido)[Ajuda] setPlayerStorageValue Lendo variáveis
Hmm, quando quiser somar é só fazer doPlayerSetStorageValue(cid, X, getPlayerStorageValue(cid, X) + 1)
-
suporte lua
Faz um movement com onEquip e onDeEquip. Na onEquip vc seta um storage com a hora atual + o tempo que vc quer e na onDeEquip vc só checa e retorna false
-
(Resolvido)[Ajuda] setPlayerStorageValue Lendo variáveis
Na verdade desde o início o script tava certo. O valor padrão pra storages é -1, e -1 + 1 = 0.
-
Account VIP System por Killua
Eu dei uma olhada e acho que pro 1.0 vc só tem que fazer assim: local database1 = db.storeQuery("SELECT `id` FROM `guild_ranks` WHERE guild_id = '".. GuildID .."'") if not database1 then return ValidAccsID end Pelo q parece agora ela retorna false direto
-
Account VIP System por Killua
Eu fiz pra 0.3.6 e 0.4, mas deve funcionar
-
Account VIP System por Killua
Esse é um sistema de VIP por account, com comandos in game para adicionar/remover/checar dias de VIP. Para instalar crie Killua VIP System.lua em data/lib e coloque: -- Account VIP System criado por Vitor Bertolucci - Killua function installVipSystem() local func = db.query or db.executeQuery if func("CREATE TABLE `killua_vip_time` (`account_id` int(11) NOT NULL default '0', `time` varchar(255) NOT NULL default '0')") then return print(os.date("%X").." - Killua VIP System instalado com sucesso.") and true end return print(os.date("%X").." - Killua VIP System ja esta instalado.") and false end function getAccountVipTime(accid) local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = '"..accid.."' LIMIT 1") if time_:getID() ~= -1 then return time_:getDataInt("time") end return false end function setAccountVipTime(accid, time) local func = db.query or db.executeQuery local time_ = db.getResult("SELECT `time` FROM `killua_vip_time` WHERE `account_id` = '"..accid.."' LIMIT 1") if time_:getID() ~= -1 then func("UPDATE `killua_vip_time` SET `time` = '"..time.."' WHERE `account_id` = '"..accid.."' LIMIT 1") time_:free() return true end return func("INSERT INTO `killua_vip_time` (`account_id`, `time`) VALUES ('"..accid.."', '"..time.."')") end function isVip(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) >= os.time() end return false end function doPlayerSetVipDays(cid, days) if days and tonumber(days) and tonumber(days) >= 0 then if tonumber(days) == 0 then return setAccountVipTime(getPlayerAccountId(cid), days) end return setAccountVipTime(getPlayerAccountId(cid), (os.time() + (days * 60 * 60 * 24))) end return print("Aviso: Nao foi possivel executar a funcao doPlayerAddVipDays. O parametro days deve ser um numero.") end function getPlayerVipDays(cid) if getAccountVipTime(getPlayerAccountId(cid)) then return getAccountVipTime(getPlayerAccountId(cid)) > 0 and math.ceil((getAccountVipTime(getPlayerAccountId(cid)) - os.time()) / 60 / 60 / 24) or 0 end return 0 end PS: Se na sua pasta lib já tiver algum arquivo com vip no nome, delete o arquivo. Em data/talkactions/scripst crie vip.lua e coloque: -- Account VIP System criado por Vitor Bertolucci - Killua function onSay(cid, words, param, channel) if param == "" then return doPlayerSendCancel(cid, "Utilize os parametros corretos.") end local t = string.explode(param, ',') if t[1] ~= "days" and getPlayerGroupId(cid) < 4 then return doPlayerSendCancel(cid, "Comandos disponiveis apenas para gods. Player podem usar /vip days") end if t[1] == "days" then if isVip(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem "..getPlayerVipDays(cid).." dias de VIP.") else doPlayerSendCancel(cid, "Voce nao tem VIP.") end elseif t[1] == "add" then if getPlayerByName(t[2]) and tonumber(t[3]) and tonumber(t[3]) > 0 then doPlayerSetVipDays(getPlayerByName(t[2]), getPlayerVipDays(getPlayerByName(t[2])) + tonumber(t[3])) doPlayerSendTextMessage(getPlayerByName(t[2]), 25, "Voce recebeu "..t[3].." dias de VIP.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[3].." dias de VIP adicionados para "..t[2]) else doPlayerSendCancel(cid, "Voce fez algo errado! Utilize /vip add, PLAYERNAME, dias.") end elseif t[1] == "remove" then if getPlayerByName(t[2]) and tonumber(t[3]) and tonumber(t[3]) > 0 then if isVip(getPlayerByName(t[2])) then if getPlayerVipDays(getPlayerByName(t[2])) > tonumber(t[3]) then doPlayerSetVipDays(getPlayerByName(t[2]), getPlayerVipDays(getPlayerByName(t[2])) - tonumber(t[3])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[3].." dias de vip removidos de "..t[2]) doPlayerSendTextMessage(getPlayerByName(t[2]), MESSAGE_STATUS_WARNING, "Fora retirados "..t[3].." dias de VIP da sua account.") else doPlayerSetVipDays(getPlayerByName(t[2]), 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." tinha menos que "..t[3].." dias de VIP. A VIP dele foi removida.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Sua VIP acabou.") end else doPlayerSendCancel(cid, t[2].." nao eh VIP.") end else doPlayerSendCancel(cid, "Voce fez algo errado! Utilize /vip remove, PLAYERNAME, dias.") end elseif t[1] == "check" then if getPlayerByName(t[2]) then if isVip(getPlayerByName(t[2])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." tem "..getPlayerVipDays(getPlayerByName(t[2])).." dias de VIP Account.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t[2].." nao eh VIP.") end else doPlayerSendCancel(t[2].." Nao esta online ou nao existe!") end elseif t[1] == "install" then if installVipSystem() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema foi instalado com sucesso.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema ja esta instalado.") end end return true end E em talkactions.xml coloque: <talkaction words="/vip" event="script" value="vip.lua"/> Comandos: Funções que fiz pro sistema e podem acabar sendo úteis: Pronto. Vou por aqui tbm um piso que só jogadores VIP podem passar, usem esse script como base para criarem outros. Crie piso vip.lua em data/movements/scripts e coloque: function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if not isVip(cid) then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Somente jogadores VIP podem passar.") doSendMagicEffect(fromPosition, CONST_ME_POFF) else doSendMagicEffect(toPosition, 12) end return true end E em movements.xml: <movevent type="StepIn" actionid="5723" event="script" value="piso vip.lua"/> Depois disso é só colocar actionID 5723 nos pisos que somente jogadores VIP podem passar.
- Sistema de Plantação por Killua
-
Sistema de Plantação por Killua
Sistema de Plantação Crie cultivo.lua em data/actions/scripts e cole: -- Plantation System created by Vítor Bertolucci - Killua -- 02/04/2014 local usableDirt = 103 -- Dirt to seed local mustBeInHouse = true -- Is it only enabled inside houses? [true/false] local fruits = {2682, 5097, 8838, 2685, 2674} -- Fruits that can grow local failChance = 0 -- Fail chance in % function transformIt(pos, id) -- Seeds the ground pos.stackpos = 0 return doTransformItem(getThingFromPos(pos).uid, id) end function getUnwantedItem(pos) -- Checks for unwanted items for i = 1, 5 do pos.stackpos = i if getThingFromPos(pos).itemid > 0 and getThingFromPos(pos).itemid ~= 7732 then return true end end return false end function transformTo(pos, fromid, toid) -- Makes the plants grow for s = 1, 5 do pos.stackpos = s local item = getThingFromPos(pos) if item.itemid == fromid then doTransformItem(item.uid, toid) end end end function doRemoveMe(pos, id) -- Removes weeds for stackpos = 1, 5 do pos.stackpos = stackpos local item = getThingFromPos(pos) if item.itemid == id then doRemoveItem(item.uid) end end end function onUse(cid, item, fromPosition, itemEx, toPosition) if mustBeInHouse and not getHouseFromPos(toPosition) then return doPlayerSendCancel(cid, "You can only plant inside houses.") end toPosition.stackpos = 0 local tile = getThingFromPos(toPosition) if tile.itemid == usableDirt and not getUnwantedItem(toPosition) and itemEx.itemid ~= 7732 then if item.itemid == 2552 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have plowed the ground.") doTransformItem(tile.uid, 804) addEvent(transformIt, math.random(44600, 48600), toPosition, usableDirt) end elseif item.itemid == 7732 and tile.itemid == 804 and not getUnwantedItem(toPosition) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have planted the seed.") doRemoveItem(item.uid, 1) doCreateItem(6216, 1, toPosition) doSendMagicEffect(toPosition, CONST_ME_SMALLPLANTS) local chance = math.random(1, 100) local time1 = math.random(8500, 12600) local time2 = math.random(24500, 28600) if chance <= failChance then addEvent(transformTo, time1, toPosition, 6216, 2784) addEvent(doSendMagicEffect, time1, toPosition, 7) addEvent(doRemoveMe, time2, toPosition, 2784) addEvent(doSendMagicEffect, time2, toPosition, CONST_ME_POFF) else addEvent(transformTo, time1, toPosition, 6216, 2779) addEvent(doSendMagicEffect, time1, toPosition, CONST_ME_SMALLPLANTS) addEvent(doSendMagicEffect, time2, toPosition, CONST_ME_PLANTATTACK) addEvent(transformTo, time2, toPosition, 2779, fruits[math.random(1, #fruits)]) end elseif itemEx.itemid == 2784 or itemEx.itemid == 2779 then if tile.itemid == 804 or tile.itemid == 103 then doRemoveItem(itemEx.uid, 1) doSendMagicEffect(toPosition, 3) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have removed the plant.") end else doPlayerSendCancel(cid, "You cannot plow this ground.") end return true end Em actions.xml coloque: <action itemid="2552" event="script" value="cultivo.lua"/> <action itemid="7732" event="script" value="cultivo.lua"/> Use a enchada (ID: 2552) para arar o solo e plante uma semente (ID: 7732) nele.
-
[AJUDA] Script Talkaction Promotion
Assim local voc = { {vocatual = 1, vocnova = 5, preco = 2, item = 2160, nome = "0 k"}, {vocatual = 2, vocnova = 6, preco = 2, item = 2160, nome = "0 k"}, {vocatual = 3, vocnova = 7, preco = 2, item = 2160, nome = "0 k"}, {vocatual = 4, vocnova = 8, preco = 2, item = 2160, nome = "0 k"} } function onSay(cid, words, param, channel) for index, vocation in pairs(voc) do if getPlayerVocation(cid) == vocation.vocatual then if doPlayerRemoveItem(cid, vocation.item, vocation.preco) then doPlayerSetVocation(cid, vocation.vocnova) doPlayerSendTextMessage(cid, 22, "Voce foi promovido para "..getPlayerVocationName(cid)) doSendMagicEffect(getThingPos(cid), 13) else doPlayerSendCancel(cid, "Voce nao possui "..vocation.preco.." "..getItemNameById(vocation.item)) end end end return true end
- [AJUDA] Script Talkaction Promotion
- Você Jogaria Este Otserv?
- Bot para Dragonsouls Otserver
- Sistema de Upgrade Bronson Server (refinar)
-
Sistema de Upgrade Bronson Server (refinar)
Este é um sistema de refinar itens feito com base no do Bronson Server. Para refinar, o jogador precisa ter uma certa quantidade de Iron Ores (dependendo do level do item) e de um Iron Hammer. Somente equipamentos e armas podem ser refinados. crie Killua Upgrading System.lua em data/actions/scripts e coloque: --- Sistema de Upgrade de itens feito por Killua. --- Sistema feito com base no do Bronson Server. local vocations = {1, 2, 4, 5, 6, 7, 8} -- Vocações que podem refinar itens local ids_bloqueados = {2160, 5706, 2463} -- Itens que não podem ser refinados local controle = { {level = 0, quantOre = 1, chance = 100}, -- Level do item, quantidade de Iron Ore necessaria, chance de sucesso {level = 1, quantOre = 2, chance = 90}, {level = 2, quantOre = 3, chance = 80}, {level = 3, quantOre = 4, chance = 70}, {level = 4, quantOre = 5, chance = 60}, {level = 5, quantOre = 6, chance = 50}, {level = 6, quantOre = 7, chance = 40}, {level = 7, quantOre = 8, chance = 30}, {level = 8, quantOre = 9, chance = 20}, {level = 9, quantOre = 10, chance = 10} } function getItemLevel(uid) if uid > 0 then return getItemAttribute(uid, "lvl") or 0 end return false end function doItemAddLevel(uid, count) if uid > 0 and tonumber(count) > 0 then return doItemSetAttribute(uid, "lvl", getItemLevel(uid) + count) end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) if not isInArray(vocations, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Sua vocacao nao pode refinar.") elseif isInArray(ids_bloqueados, itemEx.uid) then return doPlayerSendCancel(cid, "Este item nao pode ser refinado.") end if getItemInfo(itemEx.itemid).attack > 0 or getItemInfo(itemEx.itemid).defense > 0 or getItemInfo(itemEx.itemid).armor > 0 then for _, upgrade in pairs(controle) do local atk = getItemAttribute(itemEx.uid, "attack") or getItemInfo(itemEx.itemid).attack local def = getItemAttribute(itemEx.uid, "defense") or getItemInfo(itemEx.itemid).defense local arm = getItemAttribute(itemEx.uid, "armor") or getItemInfo(itemEx.itemid).armor local chance = math.random(1, 100) if getItemLevel(itemEx.uid) == upgrade.level then if doPlayerRemoveItem(cid, 5880, upgrade.quantOre) then doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_CRAPS) if chance <= upgrade.chance then if getItemLevel(itemEx.uid) == 0 then doItemSetAttribute(itemEx.uid, "description", "Esse item foi refinado por" ..getCreatureName(cid)) end doItemAddLevel(itemEx.uid, 1) doItemSetAttribute(itemEx.uid, "name", getItemNameById(itemEx.itemid).. " + " ..getItemLevel(itemEx.uid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce refinou com sucesso! Agora seu "..getItemNameById(itemEx.itemid).." eh level " ..getItemLevel(itemEx.uid)) if getItemInfo(itemEx.itemid).attack > 0 then doItemSetAttribute(itemEx.uid, "attack", atk + 1) return true elseif getItemInfo(itemEx.itemid).armor > 0 then doItemSetAttribute(itemEx.uid, "armor", arm + 1) return true elseif getItemInfo(itemEx.itemid).defense > 0 and getItemInfo(itemEx.itemid).attack <= 0 then doItemSetAttribute(itemEx.uid, "defense", def + 1) return true end else doTransformItem(itemEx.uid, 2256) doItemSetAttribute(itemEx.uid, 'name', "metal trash") doItemSetAttribute(itemEx.uid, 'attack', 0) doItemSetAttribute(itemEx.uid, 'armor', 0) doItemSetAttribute(itemEx.uid, 'defense', 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce falhou.") return true end else doPlayerSendCancel(cid, "Voce nao tem iron ores o suficiente. Voce precisa de "..upgrade.quantOre.." iron ores.") end end end else doPlayerSendCancel(cid, "Esse item nao pode ser refinado.") end return true end Em data/actions/actions.xml coloque essa TAG: <action itemid="2422" event="script" value="Killua Upgradin System.lua"/> Para configurar, leia meus comentários dentro do código.
-
Anti Magebomb (Anti Nuke)
Magebomb não usa vários clientes... E só "vaza" se o cara tiver usando um proxy
-
Anti Magebomb (Anti Nuke)
Esse script impossibilita que alguem entre com magebomb e logue milhares de account managers em seu ot Crie antimc.lua em data/creaturescripts/scripts e coloque: -- Anti Mage Bomb System por Killua local config = { max = 2, -- Quantos acc manager o mesmo ip pode logar de uma vez acc_name = "Account Manager", -- Nome do account manager ip_banishment = "false", -- Se logar mais acc manager do que o permitido, leva ban? "true" ou "false" banishment_length = 20 -- Quantos dias o ip fica banido? } local accepted_ip_list = {""} -- lista dos ips permitidos a logar varios acc manager, exemplo: {"200.85.3.60", "201.36.5.222"} function onLogin(cid) if getPlayerName(cid) == config.acc_name then if isInArray(accepted_ip_list, doConvertIntegerToIp(getPlayerIp(cid))) then return true end if #getPlayersByIp(getPlayerIp(cid)) >= config.max then if config.ip_banishment == "true" then doAddIpBanishment(doConvertIntegerToIp(getPlayerIp(cid)), banishment_length * 24 * 60 * 60) end return false end end return true end Em data/creaturescripts/creaturescripts.xml coloque: <event type="login" name="AntiMc" event="script" value="antimc.lua"/>
- Evento Blood Castle [Automático]
-
Como usar addEvent
Usando addEvent O uso do addEvent tem inúmeras utilidades e pode ser complicado para algumas pessoas, inclusive era para mim quando eu estava começando a aprender LUA. Para que serve o addEvent? Para "chamar" uma função após um periodo de tempo, ou seja, executar uma função após um tempo estipulado. O addEvent tem como parâmetros: callback, delay e ... addEvent(callback, delay, ...) Onde callback é a função que será chamada, delay é o tempo (em milissegundos) até que se chame essa função e ... são os parâmetros que a função chamada utiliza. Exemplo: addEvent(doBroadcastMessage, 1000, "Bom dia", 23) Aqui, após 1 segundo (1000 ms), a função doBroadcastMessage(message, type) será executada com os parâmetros message = "Bom dia" e type = 23. O addEvent pode ser usado de duas maneiras: Chamando uma função existente ou criando uma nova função. Para chamar uma função existente, basta usar como acima, para usá-lo para criar uma nova função, usa-se assim, por exemplo: addEvent(function() if isCreature(cid) then doPlayerAddItem(cid, 2160, 10) doPlayerSendTextMessage(cid, 25, "Voce ganhou 10k.") end end, 1000) Assim é basicamente a mesma coisa, mas pude colocar várias funções dentro de um único addEvent e mantive o delay 1000 (1 segundo). Obs: Precisei usar 2 ends, um para fechar function() e outro para fechar o if. Atenção! Além disso, existe uma outra diferença entre as duas formas de uso, vou tentar explicar da melhor maneira possível: Quando usamos o addEvent com uma função já existente (1o exemplo), as informações usadas serão as geradas no momento em que o evento foi chamado, por exemplo: function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 10 then doPlayerSendTextMessage(cid, 25, "Uma pedra sera criada na sua posiçao dentro de 2 segundos.") addEvent(doCreateItem, 2000, 1308, 1, getThingPos(cid)) end return true end Se usarmos assim, a pedra será criada na posição onde o jogador se encontrava no momento em que "deu use" e não onde ele estará 2 segundos depois. Se você quiser que a pedra seja criada na nova posição do jogador (pos de 2 segundos depois), você deve fazer uma nova checagem, criando uma função: function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 10 then doPlayerSendTextMessage(cid, 25, "Uma pedra sera criada na sua posiçao dentro de 2 segundos.") addEvent(function() if isCreature(cid) then doCreateItem(1308, 1, getThingPos(cid)) end end, 2000) end return true end Atenção novamente: A checagem if isCreature(cid) que utilizei, é muito importante para um addEvent que envolva criaturas. Se você executasse o addEvent sem a checagem e o player logasse ou morresse antes desses 2 segundos se passarem, daria um erro na distro e interromperia o resto do script. Recursão Uma outra ótima funcionalidade dos addEvents é a recursão, ou seja, criar um evento que fica se repetindo. É simplesmente um addEvent chamando a sí mesmo. Para usar, crie uma função, exemplo: function respawnMonster(name, pos) if doCreateMonster(name, pos) then doBroadcastMessage(name.." nasceu!") end addEvent(respawnMonster, 10000, name, pos) end Quando chamada, esta função ficará criando um monstro e uma determinada área a cada 10 segundos, sem nunca parar. Para chamar a função, seria assim: respawnMonster("Demon", {x = 123, y = 123, z = 5}) Considerações Reloads param os addEvents. Se um script talkaction executou um addEvent programado para acontecer depois de 5 minutos e se dentro deste intervalo de tempo, você usar /reload talkactions, o addEvent será interrompido. Erros no código podem fazer o evento ser interrompido, preste sempre atenção. Se ainda ficou com alguma dúvida, poste aqui.
-
(Resolvido)addEvent Send magic effect Alguém sabe?
Du, vc n colocou parametro na function effect(), tirou aquele cid de onde? E ele quer que nunca pare de enviar o efeito enquanto o player esta on, nesse seu loop só vai mandar o efeito 31 vezes. E pq vc usou variáveis i e j se elas vão ter sempre o mesmo valor até mesmo dentro do loop? Bastava usar uma só
- (Resolvido)addEvent Send magic effect Alguém sabe?
-
(Resolvido)[erro] Pq o storage desse script não esta setando devolta?
Ele criou o parametro pos na function potion(pos, cid)..... O erro dele foii utilizar o parametro de forma errada na funçao. Deveria ser assim function potion(cid) local limitedeuso = 49012 doPlayerSetExperienceRate(cid,expfinal) doPlayerSendTextMessage(cid,22,textofinal) setPlayerStorageValue(cid, limitedeuso, 0) end
- (Resolvido)addEvent Send magic effect Alguém sabe?