Tudo que Mathias Kenfi postou
-
Pedido spells de cura
Eu sinto muito se eu errei em algo, mas atualizei o script. OBS: Eu não testei o scripts pois não tenho tibia baixado no meu computador.
-
Pedido spells de cura
Vá em data/spells/scripts e cria 1 arquivo .lua de preferencia meditar.lua Após isso adicione este script dentro do arquivo. local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat1, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat1, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat1, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 12) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 5) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat2, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat2, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, 12) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 5) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat3, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat3, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat3, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, 12) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 5) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat4, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat4, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat4, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, 12) setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 5) local combat5 = createCombatObject() setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat5, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat5, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat5, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat5, COMBAT_PARAM_EFFECT, 12) setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 5) function onCastSpell(cid, var) addEvent(doCombat, 000, cid, combat1, var) addEvent(doCombat, 1000, cid, combat2, var) addEvent(doCombat, 2000, cid, combat3, var) addEvent(doCombat, 3000, cid, combat4, var) addEvent(doCombat, 4000, cid, combat5, var) addEvent(doCombat, 000, cid, combat1, var) addEvent(doCombat, 1000, cid, combat2, var) addEvent(doCombat, 2000, cid, combat3, var) addEvent(doCombat, 3000, cid, combat4, var) addEvent(doCombat, 4000, cid, combat5, var) return doCombat(cid, combat, var) end Agora, em spell.xml adicione esta linha <instant name="Meditar" words="Meditar" lvl="100" mana="0" prem="1" selftarget="1" aggressive="0" exhaustion="0" needlearn="0" event="script" value="meditar.lua"> <vocation id="3"/> <vocation id="7"/> </instant> Informações da habilidade: Você pode mudar o intervalo de cura nesta parte do script. addEvent(doCombat, 000, cid, combat1, var) addEvent(doCombat, 1000, cid, combat2, var) addEvent(doCombat, 2000, cid, combat3, var) addEvent(doCombat, 3000, cid, combat4, var) Caso não saiba editar, aqui vai 1 explicação rápida setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, ML, MIN, LVL, MAX) ML=% do magic Level MIN= cura minima LVL=% do level MAX= cura máxima Espero ter ajudado xD. Ajudei? REP+
-
Efeito em volta do char
Amigo tem 1 tópico no tibiaking, ensinando passo a passo como editar xD!
-
(Resolvido)[Resolvido] Storage por x tempo
@Sekk Já tentei e procurei mas não achei nada de "Melhor resposta"
-
(Resolvido)[Resolvido] Storage por x tempo
@Vodkart @Sekk Muito obrigado ajudaram muito REP+ pros dois.
-
(Resolvido)[Resolvido] Storage por x tempo
@Vodkart Sim mano é assim que ta o script da minha spell, com o storage e tals, porem o comando que quero, e que ele tenha 1 cooldown tipo de 6 segundos, e que dure 10 segundos, após os 10 segundos remove o storage do player, impossibilitando de usar a magia.
-
(Resolvido)[Resolvido] Storage por x tempo
@Sekk Então amigo funcionou porem, não está totalmente do jeito que eu quero. E que eu criei 1 magia que precisa do storage 15000, porem que só pudesse usar durante 1 tempo de 10 segundos. OBS: A magia eu tenho, só quero que o storage fique no player por 10 segundos, é tipo a vip que fica 30 dias no player porem por 10 segundos entendeu?
-
(Resolvido)[Resolvido] Storage por x tempo
Bom galera, meu pedido é bem simples. Eu quero 1 script de talkaction que quando o player falar "!ativar" vai adicionar a storage "15000" no player po 10 Segundos alguém pode me ajudar ae?
-
Como editar o Effect do Atack do Monster
@RonaldAlves Edite em radius. <attacks> <attack name="melee" interval="1500" min="-4880" max="-6700"/> <attack name="manadrain" interval="1000" chance="10" range="7" min="-60" max="-575"> <attribute key="areaEffect" value="holyarea"/> </attack> <attack name="Katon Gamabunta Ryukaa" interval="4000" chance="20" target="1" min="-5300" max="-7500"> </attack> <attack name="physical" interval="8000" chance="10" radius="4" target="1" min="-60" max="-575"> <attribute key="areaEffect" value="holyarea"/> </attack>
-
Como editar o Effect do Atack do Monster
Amigo é pelo nome do efeito. Exemplo: <attacks> <attack name="melee" interval="1500" min="-4880" max="-6700"/> <attack name="manadrain" interval="1000" chance="10" range="7" min="-60" max="-575"> <attribute key="areaEffect" value="holyarea"/> </attack> <attack name="Katon Gamabunta Ryukaa" interval="4000" chance="20" target="1" min="-5300" max="-7500"> </attack> <attack name="speed" interval="8000" chance="10" radius="4" target="1" speedchange="-8000" duration="4000"> <attribute key="areaEffect" value="holyarea"/> </attack> Esse seria o efeito de holy 49 basta olhar sua lib e ver os efeitos que você quer, ou consulte este tópico e veja os efeitos
-
Player quando morre não perde NADA!
Tirso baixe outro otserv, pega a pasta Data do seu otserv atual config.lua do seu otserv atual e coloque no outro, porque ai vai ficar tudo ok
-
Player quando morre não perde NADA!
Editei meu comentario ve la xD
-
Player quando morre não perde NADA!
Volta tudo como estava antes, e o ERRO é em player.cpp É melhor voce salvar sua pasta Data e seu config.lua e pegar outro Server, anão ser que seu ot seja Open Source.
-
Player quando morre não perde NADA!
Fica em data/creaturescripts/scripts/login.lua e adicione a tag: registerCreatureEvent(cid, "PlayerDeath") E em creaturescripts.xml adicione: <?xml version="1.0" encoding="UTF-8"?> <creaturescripts> <event type="login" name="PlayerLogin" event="script" value="login.lua"/> <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/> <event type="receivemail" name="Mail" event="script" value="mail.lua"/> <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/> <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/> <event type="think" name="Idle" event="script" value="idle.lua"/> <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/> <event type="think" name="Courtel" event="script" value="Courtel.lua"/> <event type="think" name="Vampire Bride" event="script" value="Vampire Bride.lua"/> <event type="think" name="Nifra" event="script" value="nifra.lua"/> <event type="outfit" name="Addons" event="script" value="outfits.lua"/> <event type="advance" name="lvlup" event="script" value="lvlup.lua"/> <event type="kill" name="Licznik" event="script" value="licznik.lua"/> <event type="think" name="lottery" interval="10800" event="script" value="lottery.lua"/> <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/> <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/> <event type="login" name="Conected" script="conected.lua"/> <event type="advance" name="Advance" script="advance.lua"/> <event type="login" name="expRate" event="script" value="extraExpRate.lua"/> <event type="attack" name="AttackGuild" script="attackguild.lua"/> <event type="kill" name="duszek" script="duszek.lua"/> <event type="login" name="fraglook_register" event="script" value="fraglook.lua"/> <event type="look" name="fraglook" event="script" value="fraglook.lua"/> <event type="look" name="questlook" event="script" value="questlook.lua"/> <event type="combat" name="Kamulec" event="script" value="metin_stones.lua"/> <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/> </creaturescripts>
-
Player quando morre não perde NADA!
<?xml version="1.0" encoding="UTF-8"?> <creaturescripts> <event type="login" name="PlayerLogin" event="script" value="login.lua"/> <event type="death" name="Aol" event="script" value="aol.lua"/> <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/> <event type="receivemail" name="Mail" event="script" value="mail.lua"/> <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/> <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/> <event type="think" name="Idle" event="script" value="idle.lua"/> <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/> <event type="death" name="Golgordan" script="golgordan.lua"/> <event type="death" name="Werewolf" script="werewolf.lua"/> <event type="death" name="Undead Gladiator" script="undead gladiator.lua"/> <event type="think" name="Courtel" event="script" value="Courtel.lua"/> <event type="think" name="Vampire Bride" event="script" value="Vampire Bride.lua"/> <event type="think" name="Nifra" event="script" value="nifra.lua"/> <event type="outfit" name="Addons" event="script" value="outfits.lua"/> <event type="advance" name="lvlup" event="script" value="lvlup.lua"/> <event type="kill" name="Licznik" event="script" value="licznik.lua"/> <event type="think" name="lottery" interval="10800" event="script" value="lottery.lua"/> <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/> <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/> <event type="death" name="Reward" event="script" value="reward.lua"/> <event type="login" name="Conected" script="conected.lua"/> <event type="advance" name="Advance" script="advance.lua"/> <event type="login" name="expRate" event="script" value="extraExpRate.lua"/> <event type="attack" name="AttackGuild" script="attackguild.lua"/> <event type="kill" name="duszek" script="duszek.lua"/> <event type="login" name="fraglook_register" event="script" value="fraglook.lua"/> <event type="look" name="fraglook" event="script" value="fraglook.lua"/> <event type="death" name="Portal" event="script" value="death portal.lua" /> <event type="death" name="DeathBroadcast" event="script" value="deathBroadcast.lua"/> <event type="look" name="questlook" event="script" value="questlook.lua"/> <event type="death" name="metin_death" event="script" value="metin_kill.lua"/> <event type="combat" name="Kamulec" event="script" value="metin_stones.lua"/> <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/> </creaturescripts> Vamos lá! Removendo todos os arquivos que tenha "death". <?xml version="1.0" encoding="UTF-8"?> <creaturescripts> <event type="login" name="PlayerLogin" event="script" value="login.lua"/> <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/> <event type="receivemail" name="Mail" event="script" value="mail.lua"/> <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/> <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/> <event type="think" name="Idle" event="script" value="idle.lua"/> <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/> <event type="think" name="Courtel" event="script" value="Courtel.lua"/> <event type="think" name="Vampire Bride" event="script" value="Vampire Bride.lua"/> <event type="think" name="Nifra" event="script" value="nifra.lua"/> <event type="outfit" name="Addons" event="script" value="outfits.lua"/> <event type="advance" name="lvlup" event="script" value="lvlup.lua"/> <event type="kill" name="Licznik" event="script" value="licznik.lua"/> <event type="think" name="lottery" interval="10800" event="script" value="lottery.lua"/> <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/> <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/> <event type="login" name="Conected" script="conected.lua"/> <event type="advance" name="Advance" script="advance.lua"/> <event type="login" name="expRate" event="script" value="extraExpRate.lua"/> <event type="attack" name="AttackGuild" script="attackguild.lua"/> <event type="kill" name="duszek" script="duszek.lua"/> <event type="login" name="fraglook_register" event="script" value="fraglook.lua"/> <event type="look" name="fraglook" event="script" value="fraglook.lua"/> <event type="look" name="questlook" event="script" value="questlook.lua"/> <event type="combat" name="Kamulec" event="script" value="metin_stones.lua"/> <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/> </creaturescripts> Ficando assim /\. Agora teste, se der certo ótimo facil descobrir a fonte do erro. Senão der certo volte como estava antes. E o Problema pode ser em player.cpp. Importante que tenha registerCreatureEvent(cid, "PlayerDeath") registrado no login.lua Teste e avise.
-
Player quando morre não perde NADA!
Poste aqui seu creaturescripts.xml
-
Player quando morre não perde NADA!
xD entendi seu erro so confundi e lerdei 1 pouco. Vá em data/creacture/scripts e procura a pasta playerdeath.lua(caso não exista crie uma) e cole isso dentro dela: local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) if(config.deathListEnabled ~= TRUE) then return end local hitKillerName = "field item" local damageKillerName = "" if(lastHitKiller ~= FALSE) then if(isPlayer(lastHitKiller) == TRUE) then hitKillerName = getPlayerGUID(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then if(isPlayer(mostDamageKiller) == TRUE) then damageKillerName = getPlayerGUID(mostDamageKiller) else damageKillerName = getCreatureName(mostDamageKiller) end end end db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");") local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";") if(rows:getID() ~= -1) then local amount = rows:getRows(true) - config.maxDeathRecords if(amount > 0) then if(config.sqlType == DATABASE_ENGINE_SQLITE) then for i = 1, amount do db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);") end else db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";") end end end end Depos vá em creaturescripts.xml e adicione esta tag: <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/> Teste!
-
Player quando morre não perde NADA!
Script é de amuleto, só funciona com amuleto xD(Também pode ser rings)
-
Player quando morre não perde NADA!
Segue os passos. data\creaturescripts\scripts\login.lua registerCreatureEvent(cid, "redSkullAmulet") data\creaturescripts\creaturescripts.xml <event type="death" name="redSkullAmulet" event="script" value="redamulet.lua"/> data\creaturescripts\scripts\redamulet.lua function onDeath(cid, corpse, deathList) local ID_ITEM = Id do amuleto if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == ID_ITEM) and (getCreatureSkullType(cid) == SKULL_RED) then doCreateItem(cid, ID MARIJUANA, 1) doCreatureSetDropLoot(cid, false) end return true end
-
Erro WOE
@tirso Não há nenhuma pasta no movements, lib, globalevents, creaturescripts que tenha o evento não? Pois para checar uma posição ela precisa ou estar no proprio script ou no lib, procure e poste aqui.
-
Sistema !autoloot com Item Remove
Procure pela tag local need = if item2.itemid == 7424 then doPlayerRemoveItem(cid, need, 1) else doPlayerSendCancel(cid, "Você não tem 7424 para usar auto loot") Return true end e remova o return true
-
Armas com efeitos
Fala galera do TK, hoje vim trazer 1 script de arma com efeito mostrado abaixo: Quando não sabe editar, parece ser muito complicado, mas depois que aprende é tao simples quanto fazer uma spell qualquer. Passarei o script e ensinarei a editar. Siga os passos e você logo logo aprenderá a editar a seu gosto. Simples o dano é normal basta editar. Pois o que nos interessa agora é os efeitos que se localiza aqui. Como editar a posição e tals? Pow é só mecher nos números. Não entendeu? Leia denovo, ou pegue os efeitos e edite você mesmo. AJUDEI? REP+
-
Alguem Pode Me Ajuda Numa Script de fly
Troca seu sistema por este. function onSay(cid, words, param) local config = { pz = true, -- players precisam estar em protection zone para usar? (true or false) battle = false, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) vip = true, -- somente vip players poderam usar o comando? ("yes" or "no") storage = 13500 -- Storage Id da sua vip account caso for usar somente vips } --[[ Config lugares]]-- local lugar = { ["depot"] = { -- nome do lugar pos = {x=1016, y=1045, z=7},level = 8,price = 0}, ["temple"] = { -- nome do lugar pos = {x=1032, y=1016, z=7},level = 8, price = 0}, ["arena"] = { -- nome do lugar pos = {x=1016, y=1052, z=8},level = 8,price = 0}, ["viparea"] ={ -- nome do lugar pos = {x=701, y=1015, z=7},level = 8,price = 0}, ["trainer"] ={ -- nome do lugar pos = {x=965, y=1057, z=7},level = 8,price = 0} } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] if not(a) then doPlayerSendTextMessage(cid, 25, "desculpe,este lugar não existe") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 25, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 25, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.vip == true and getPlayerStorageValue(cid, tonumber(config.storage)) - os.time() <= 0 then doPlayerSendTextMessage(cid, 25, "Desculpe,voce nao e Player vip Para Usar o !fly!.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doBroadcastMessage("" .. getPlayerName(cid) .. " has flown to " .. param .. " using !fly." ,MESSAGE_INFO_DESCR) return TRUE end
-
Sistema !autoloot com Item Remove
-- Sistema de auto loot criado por Vitor Bertolucci - Killua local aloot_boost = {[2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 195000, [2398] = 36, [2475] = 7200, [2519] = 6500, [2497] = 10700, [2523] = 180000, [2494] = 325000, [2400] = 144000, [2491] = 6000, [2421] = 325000, [2646] = 260000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 52000, [2647] = 600, [2534] = 32500, [7402] = 19500, [2466] = 26000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 91000, [2388] = 24, [2645] = 26000, [2434] = 2400, [2463] = 480, [2536] = 11700, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [7382] = 13000, [2462] = 1300, [2520] = 39000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 52000, [2378] = 120, [2487] = 24000, [2476] = 6500, [8891] = 36000, [2459] = 36, [2195] = 52000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 13000, [2431] = 108000, [2492] = 52000, [2515] = 240, [2430] = 2400, [2393] = 13000, [7419] = 36000, [2522] = 130000, [2514] = 65000} local function getPlayerStorageZero(cid, storage) -- By Killua local sto = getPlayerStorageValue(cid, storage) if tonumber(sto) then return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0) end return tonumber(0) end local tabela = {} local need = if item2.itemid == 7424 then doPlayerRemoveItem(cid, need, 1) else doPlayerSendCancel(cid, "Você não tem 7424 para usar auto loot") Return true End local function getPlayerList(cid) local tab = {} if getPlayerStorageValue(cid, 04420021) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420021)) end if getPlayerStorageValue(cid, 04420031) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420031)) end if getPlayerStorageValue(cid, 04420041) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420041)) end if getPlayerStorageValue(cid, 04420051) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420051)) end if #tab > 0 then return tab end return {} end local function boost(cid) return tonumber(getPlayerStorageValue(cid,722381)) >= os.time() end local function autoLoot(cid, pos) if not isPlayer(cid) then return end local check = false local str = "" local position = {} for i = 1, 255 do pos.stackpos = i if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then position = pos check = true break end end if check then local corpse = getContainerItemsInfo(getThingFromPos(position).uid) if corpse then for index, info in pairs(corpse) do if index < countTable(corpse) then if info.uid and info.itemid then if isContainer(info.uid) then local bag = getContainerItemsInfo(info.uid) for i = 1, countTable(bag) do if isInArray(getPlayerList(cid), bag.itemid) then if bag.quant > 1 then doRemoveItem(bag.uid, bag.quant) doPlayerAddItem(cid, bag.itemid, bag.quant) str = str.." "..bag.quant.." "..getItemNameById(bag.itemid).." +" else doRemoveItem(bag.uid) if boost(cid) then if aloot_boost[bag.itemid] then doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[bag.itemid]) str = str.." 1 "..getItemNameById(bag.itemid).." ("..aloot_boost[bag.itemid].."gp no banco) +" else doPlayerAddItem(cid, bag.itemid, 1) str = str.." 1 "..getItemNameById(bag.itemid).." +" end else doPlayerAddItem(cid, bag.itemid, 1) str = str.." 1 "..getItemNameById(bag.itemid).." +" end end end end end end end if isInArray(getPlayerList(cid), info.itemid) then if info.quant > 1 then doRemoveItem(info.uid, info.quant) doPlayerAddItem(cid, info.itemid, info.quant) str = str.." "..info.quant.." "..getItemNameById(info.itemid).." +" else doRemoveItem(info.uid) if boost(cid) then if aloot_boost[info.itemid] then doPlayerSetBalance(cid,getPlayerBalance(cid) + aloot_boost[info.itemid]) str = str.." 1 "..getItemNameById(info.itemid).." ("..aloot_boost[info.itemid].."gps no banco) +" else doPlayerAddItem(cid, info.itemid, 1) str = str.." 1 "..getItemNameById(info.itemid).." +" end else doPlayerAddItem(cid, info.itemid, 1) str = str.." 1 "..getItemNameById(info.itemid).." +" end end end end end end setPlayerTableStorage(cid,822564,{[1] = str, [2] = 0}) end local function autoGold(cid, pos) if not isPlayer(cid) then return end local check = false local total = 0 local position = {} for i = 1, 255 do pos.stackpos = i if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then position = pos check = true break end end if check then local corpse = getContainerItemsInfo(getThingFromPos(position).uid) if corpse then for index, info in pairs(corpse) do if info.uid and info.itemid then if index < countTable(corpse) then if isContainer(info.uid) then local bag = getContainerItemsInfo(info.uid) for i = 1, countTable(bag) do if isInArray({2148, 2152, 2160}, bag.itemid) then local multiplie = 1 if bag.itemid == 2148 then multiplie = 1 elseif bag.itemid == 2152 then multiplie = 100 elseif bag.itemid == 2160 then multiplie = 10000 end doRemoveItem(bag.uid, bag.quant) doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(bag.quant) * multiplie) total = total + bag.quant * multiplie doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie)) end end end end if isInArray({2148, 2152, 2160}, info.itemid) then local multiplie = 1 if info.itemid == 2148 then multiplie = 1 elseif info.itemid == 2152 then multiplie = 100 elseif info.itemid == 2160 then multiplie = 10000 end doRemoveItem(info.uid, info.quant) doPlayerSetBalance(cid, getPlayerBalance(cid) + info.quant * multiplie) doPlayerSetStorageValue(cid, 04421021, tonumber(getPlayerStorageZero(cid, 04421021)) + tonumber(info.quant) * tonumber(multiplie)) total = total + info.quant * multiplie end end end end end if total > 0 then total = total - (total * 0.2) total = math.ceil(total) doPlayerSetBalance(cid,getPlayerBalance(cid) + total) local tab = getPlayerTableStorage(cid,822564) tab[2] = total setPlayerTableStorage(cid,822564,tab) end end local function sendMsg(cid) if not isPlayer(cid) then return end local tab = getPlayerTableStorage(cid,822564) if countTable(tab) >= 1 then if tab[1] then if tab[2] and tab[2] > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. tab[1] .." ".. tab[2] .." gold coins.") else if type(tab[1]) == "string" and string.len(tab[1]) > 1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[1]) end end elseif not tab[1] then if tab[2] then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..tab[2].." gold coins.") end end end doPlayerSetStorageValue(cid,822564,-1) end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getPlayerStorageValue(cid, 04421001) == 1 and #getPlayerList(cid) > 0 then local pos = getCreaturePosition(target) addEvent(autoLoot, 500, cid, pos) end if getPlayerStorageValue(cid, 04421011) == 1 then local pos = getCreaturePosition(target) addEvent(autoGold, 540, cid, pos) end if getPlayerStorageValue(cid, 04421001) == 1 or getPlayerStorageValue(cid, 04421011) == 1 then addEvent(sendMsg, 560, cid) end end return true end
-
Erro WOE
Poderia me passar o script do arquivo com erro?