
Tudo que Vorkhon postou
-
[SPELL] METEORO
Cara ficou muito legal! Parabéns! Visualmente ficou muito show. A unica coisa é que ela está dando dano em área mas não esta aparecendo o efeito de explosão.
-
[SPELL] METEORO
Estou tentando editar uma spell faz um tempo já e cheguei no meu limite. Quero que o player lance um projetil de fogo para o norte, e depois de X segundos, caiam X bolas de pedra ao redor do alvo dando dano em área 3x3 de explosão. No código atual o efeito de ir para o norte com fogo funciona, mas depois caem 3 efeitos de fogo (Const_ani_fire) e fire damage normal. Já mudei de tudo e nada faz com que saia o efeito de fogo no final. Além da spell estar dando um dano absurdo. E outra coisa que não está funcionando é a funcao final do codigo, eu cheguei a deletar ela por completo e o codigo continua funcionando. E sempre com o efeito de fogo. local area = createCombatArea(AREA_SQUARE1X1) local initialArrowEffect = CONST_ANI_FIRE local meteorAttackEffect = CONST_ANI_LARGEROCK local numberOfAttacks = 3 local attackInterval = 1000 -- Intervalo de 1000 milissegundos (1 segundo) entre os ataques function onCastSpell(cid, var) local target = getCreatureTarget(cid) local playerPos = getCreaturePosition(cid) -- Envia a flecha inicial do jogador para o alvo doSendDistanceShoot(playerPos, {x = playerPos.x - math.random(4, 6), y = playerPos.y - 5, z = playerPos.z}, initialArrowEffect) -- Limita a `numberOfAttacks` meteoros caindo aleatoriamente for x = 1, numberOfAttacks do addEvent(furyAttackTarget, x * attackInterval, cid, target, {x = getCreaturePosition(target).x + math.random(-1, 1), y = getCreaturePosition(target).y + math.random(-1, 1), z = getCreaturePosition(target).z}) end end function furyAttackTarget(cid, target, pos) if isCreature(cid) and isCreature(target) then local areaPos = {x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z} doSendDistanceShoot({x = getCreaturePosition(target).x - math.random(4, 6), y = getCreaturePosition(target).y - 5, z = getCreaturePosition(target).z}, areaPos, meteorAttackEffect) doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, areaPos, area, (-(getPlayerLevel(cid) * getPlayerMagLevel(cid)) / 5) + 50, (-(getPlayerLevel(cid) * getPlayerMagLevel(cid)) / 5) - 50, CONST_ME_EXPLOSIONHIT) end end
-
[AJUDA] Summon que explode
Poise... Pessoal estou pensando em alterar então. Fazer uma magia que cria um objeto e explode depois de 3 segundos. Vai ter que ser assim até achar outra solução.
-
[AJUDA] Summon que explode
É por magia. Poisé to tentando pensar algo que faça isso!
-
[AJUDA] Summon que explode
Caramba mano! Essa eu não sabia. Vou pensar em algo aqui. Muito obrigado por esclarecer. É impossível um monstro dar dano em outro? Esse meu summon seria imovel e não da dano. A unica coisa é que quando ele morre ele explodiria. Poderia fazer o player criar um monstro normal. Ia dar dano no player junto, mas não sei se é possivel dar dano em monstros dessa forma.
-
[AJUDA] Summon que explode
Valeu pessoal. Mas ainda não ta funcionando, o summon morre e não acontece nadinha. Talvez eu crie uma magia que crie um objeto, e depois de alguns segundos exploda.
-
NPC - Por Storage / Vocation
Puts pior que não deu. O NPC nao respondeu ao Hi agora.
-
[AJUDA] Summon que explode
Puts pior que não adiantou. Quando summono ele morre e não aparece nada, e como monstro normal ele chega a explodir, mas não causa dano. Não consigo imaginar o que possa ser.
-
[AJUDA] Summon que explode
Obrigado pela resposta. Mas ainda nada. O monstro barrel aparece efeito e explode, mas quando ele é summon não ta explodindo. Imagino que teria que trocar if isMonster para algo que identifique summon
-
[AJUDA] Summon que explode
Estou querendo fazer um summon que explode quando morre. Só estou conseguindo fazer monstro explodir e summon não aparece nada. Ja mudei para if isSummon(cid) mas nada. local explosion = createConditionObject(CONDITION_FIRE) setConditionParam(explosion, CONDITION_PARAM_DELAYED, 1) local damageTable = { {4, -3}, -- Quantidade / dano {9, -2}, {20, -1} } for i = 1, #damageTable do local t = damageTable[i] addDamageCondition(explosion, t[1], 1000, t[2]) -- tempo end local arr = { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } local area = createCombatArea(arr) function onDeath(cid) if isMonster(cid) then doAreaCombatHealth(cid, 1, getThingPos(cid), area, -1, -30, 5) doAreaCombatCondition(cid, getThingPos(cid), area, explosion, 255) doSendMagicEffect(getThingPos(cid), 2) end return true end
-
NPC - Por Storage / Vocation
Quero criar um NPC que verifica o storage ou vocation do player, se tiver a storage abre a loja A, do contrario abre a B. Onde está o erro do código? local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid, 10036) == 1 then local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook') shopModule:addBuyableItem({'magic lightwand'}, 2163, 100, 'magic lightwand') else local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Magia - League of Legends Gangplank
Queria solicitar duas magias que nem do personagem gangplank do league of legends. 1) Criar um barrio no chão que exploda em dano em área depois de alguns segundos. (Alternativo, será que da pra criar um summon que fica imovel, e quando ele morrer ele exploda e de o dano em área?) 2) Dano em área de pedras caindo, 3 vezes, e que cause lentidão.
-
[Ajuda] Magia Controlavel
Eu tenho esse script que cria walls de pedra controlando pelo ctrl. Eu quero deixar essa mesma função de controlar mas com uma magia que tire dano. --<Script by Jhon992>-- local stonesId = {8633,8634,8635,8636} -- ids dos diferente tipos de stones. local timeRemove = 10 -- tempo para dumir as pedras em segundos. function createObject(cid, position, stonesPosition) if (isPlayer(cid)) then if getPlayerLookDir(cid) == 0 then positions = {x=position.x, y=position.y-1, z=position.z} elseif getPlayerLookDir(cid) == 1 then positions = {x=position.x+1, y=position.y, z=position.z} elseif getPlayerLookDir(cid) == 2 then positions = {x=position.x, y=position.y+1, z=position.z} elseif getPlayerLookDir(cid) == 3 then positions = {x=position.x-1, y=position.y, z=position.z} end if isWalkable(positions) then createStone(stonesPosition, positions, stonesId[math.random(1,#stonesId)], cid) addEvent(createObject, 500, cid, positions, stonesPosition) else addEvent(removeStones, timeRemove*1000, stonesPosition) end end end function createStone(stonesPosition, positions, stone, cid) doCreateItem(stone, 1, positions) stonesPosition[(#stonesPosition)+1] = {x=positions.x, y=positions.y, z=positions.z, stackpos=1} end function removeStones(stonesPosition) for i=1, #stonesPosition do for o=1, 2 do stonesPosition[i] = {x=stonesPosition[i].x, y=stonesPosition[i].y, z=stonesPosition[i].z, stackpos=o} if isInArray(stonesId, getThingfromPos(stonesPosition[i]).itemid) then doRemoveItem(getThingfromPos(stonesPosition[i]).uid) end end end end function isWalkable(pos, creature, pz, proj) -- nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid, var) local stonesPosition = {} local position = getPlayerPosition(cid) createObject(cid, position, stonesPosition) return true end
-
NPC de barco que checa Addon
Esse codigo nao esta funcionando. O que tem de errado? local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if not player:isPlayer() then return false end if msgcontains(msg, "sail") then if player:hasOutfit(153) and player:hasOutfit(157) then npcHandler:say("Voce não pode, voce é da classe X.", cid) return false end if player:removeMoney(50) then npcHandler:say("Good luck.", cid) npcHandler:releaseFocus(cid) player:teleportTo(Position(144, 1252, 6)) end end return true end npcHandler:setMessage(MESSAGE_GREET, 'Olá, com meu barco você pode {sail} para x.') npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)NPC Barco
Onde ta o sistema do Ghost Ship dele? Queria por no meu ot
-
Creature Script [Ajuda]
Olá tudo bom. Eu estou tentado criar um script que ao matar um monstro teleporte imediatamente o player para outro lugar, e ao mesmo tempo mude a classe, e outfit do player. Esta bem errado por enquanto, e eu criei um teleporte (mas quero fazer automatico) por enquanto está assim: local config = { ["Boss"] = { posiTeleporte = {x = 96, y = 1153, z = 7, stackpos = 254}, -- Posição em que o teleporte aparecerá. posiToTeleporte = {x = 96, y = 1142, z = 7}, -- Posição onde será teleportado. time = 60, -- Tempo em que o teleporte irá desaparecer 60 segundos. life = 185, -- Life ao rebornar mana = 40, -- Mana ao rebornar level = 8, -- Level ao rebornar exp = 4200, -- exp que fica voc = 18, -- Voc ao rebornar cap = 450, storage = 30023 } } function removeTeleporte(tp) local teleporte = getTileItemById(tp.posiTeleporte, 5023) if teleporte then doRemoveItem(teleporte.uid, 1) doSendMagicEffect(tp.posiTeleporte, CONST_ME_POFF) end end function onDeath(cid) local teleport = config[getCreatureName(cid)] if teleport then doCreateTeleport(5023, teleport.posiToTeleporte, teleport.posiTeleporte) addEvent(removeTeleporte, teleport.time*1000, teleport) else if getPlayerStorageValue(cid, 10040) < 1 then doCreatureSetStorage(cid, config.storage, -1) setPlayerStorageValue(cid, 10040, 1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid,25,"boss outfit unlocked.") broadcastMessage("The player "..getCreatureName(cid).." became a new class") doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `vocation` = "..config.voc..", `level` = "..config.level..", `experience` = "..config.exp..", `health` = "..config.life..", `healthmax` = "..config.life..", `mana` = "..config.mana..", `manamax` = "..config.mana..", `cap` = "..config.cap.." WHERE `id` = "..player_id) else npcHandler:say("You are already an new class.", cid) end end return true end
-
[Spell] Mark of the Assassin
Aqui também nao aumentou
-
[REQUEST] TRANSFORM ON KILL
Ola tudo bom?! Eu quero fazer com que quando o monstro X for derrotado o player muda a outfit para o monstro X de forma permanente e que mudasse de classe. É possível? -------------------------------------------------------------------------------------- Exemplo: Player mata minotauro. O player vira um minotauro (outfit) e muda de classe para minotauro. -------------------------------------------------------------------------------------- Dúvida: É possivel travar outfit por classe? Eu queria que o player nao mudasse de outfit que fosse fixo, mas por classe.
-
(Resolvido)Summon subir de level com o player
Teria como aumentar o ataque dele também por esse script? E esse script já vale para todos os summons?
-
[Script] Boss por X Kills de Monsters
Fala pessoal! Eu quero fazer um script que ao matar 1000 dragons ou dragon lords, apareça um Boss na area X. E não quero que possa acumular, o script como ta se eu matar 3000 dragons o boss aparece acumulado 3 vezes. Eu quero que só possa aparecer outro depois que ele morrer. SCRIPT ATUAL: local t = { ["Dragon"] = {1003, "Demodras", 1000, l = { [1] = {x = 248, y = 1323, z = 11}, -- ["Nome do monstro"] = {Storage, NOME DO MONSTRO, QNT NECESSARIA PARA NASCER O BOSS, l = POSIÇÕES} }} ------------------------------ } function onDeath(cid, corpse, deathList) local killer = deathList[1] if not isMonster(cid) or not isPlayer(killer) then return true end local a = t[getCreatureName(cid)] if a then if getGlobalStorageValue(a[1]) >= a[3] then doCreateMonster(a[2], a.l[math.random(#a.l)]) setGlobalStorageValue(a[1], 0) doBroadcastMessage("O monstro ".. a[2] .." nasceu!", 20) else setGlobalStorageValue(a[1], getGlobalStorageValue(a[1]) + 1) end end return true end
-
(Resolvido)NPC REBORN
Pefeito Vodkart! Muito grato pela ajuda funcionou direitinho! obs: Caramba cara eu botei uma linha embaixo da outra e não achei onde tava o erro! Onde vc tinha errado?
-
(Resolvido)NPC REBORN
Deu um erro na distro: [8/10/2020 11:24:25] sqlite3_prepare_v2(): SQLITE ERROR: no such column: exp (UPDATE "players" SET "vocation" = 15, "level" = 8, "exp" = 4200, "health" = 185, "healthmax" = 185, "mana" = 40, "manamax" = 40 WHERE "id" = 28)
-
(Resolvido)NPC REBORN
hmmmm! Interessante sugestão! Cara eu não entendo muito, mas como que faria isso? Sem problemas em kickar o player.
-
(Resolvido)NPC REBORN
Pessoal meu código deu problema novamente. O que esta acontecendo é o seguinte. Quando o NPC reborna, o player fica com a vida total igual a (LVL*HP por Level) + Uma vida fake. Essa vida fake é a que aparece na configuração do código (nesse caso 185). Então um personagem que ganha 15 de hp por lvl e fizer o reborn para level 8, ele vai ficar com 105(15x7)+185 = 290 de hp, porém o 185 é fake. Se o player se curar, ou tomar dano ele perde esses 185 pra sempre, e fica com 105 de hp definitivo. Minha dúvida no script é como fazer o HP rebornado ser fixo. Eu quero que quando rebornado ele seja lvl 8 com exatos 185/40 hp/mana e que de para healar, tomar dano, e morrer sem que de bug na vida. obs: lembrando que tudo inclui a mana também. CÓDIGO: local config = { item = 2150, -- ID do item necessario para rebornar count = 0, -- Count do item a cima life = 185, -- Life ao rebornar mana = 40, -- Mana ao rebornar level = 8, -- Level ao rebornar voc = 15, -- Voc ao rebornar storage = 30023 } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'Inquisitor')) or (msgcontains(msg, "yes")) then selfSay('Are you sure you want to be {reborn} as a Inquisitor?!', cid) return TRUE end if (msgcontains(msg, 'reborn')) then setCreatureMaxHealth(cid, config.life) if getCreatureHealth(cid) > config.life then doCreatureAddHealth(cid, -(getCreatureHealth(cid) - config.life)) else doCreatureAddHealth(cid, config.life) end setCreatureMaxMana(cid, config.mana) if getCreatureMana(cid) > config.mana then doCreatureAddMana(cid, -(getCreatureMana(cid) - config.mana)) else doCreatureAddMana(cid, config.mana) end doPlayerSetVocation(cid, config.voc) doCreatureSetStorage(cid, config.storage, -1) setPlayerStorageValue(cid, 10037,1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid,25,"Inquisitor outfit unlocked.") doPlayerAddLevel(cid, (-getPlayerLevel(cid)), 1) doPlayerAddLevel(cid, 1, 1) selfSay('Congratulations, you are now a Inquisitor!', cid) broadcastMessage("The player "..getCreatureName(cid).." became a Inquisitor") return TRUE else selfSay("Oh! Então traga para mim {".. config.count .." ".. getItemInfo(config.item).name .."}", cid) return TRUE end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
[Ajuda] Sistema de Autoloot!
Ola pessoal. Eu quero fazer uma modificação no sistema de autoloot que encontrei. O gold vai direto para o banco, mas eu quero que ele só va direto para a BP do player. Aqui é o código que eu tenho: -- 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 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