Ir para conteúdo

Holograma

Campones
  • Total de itens

    95
  • Registro em

  • Última visita

  • Dias Ganhos

    6

Holograma venceu a última vez em Abril 25

Holograma had the most liked content!

Sobre Holograma

Perfil

  • Gênero
    Masculino

Informações

  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    OT-Admin

Últimos Visitantes

1165 visualizações

Holograma's Achievements

  1. O erro que você está vendo parece indicar que há uma tentativa de concatenar um valor nulo em algum lugar do seu código. Mais especificamente, o erro está na linha 26 do seu código, na função !character. Nessa linha, você está tentando verificar se o primeiro elemento da tabela t não é "buy", "sell", "remove", ou "list". Parece que há um erro de lógica aqui. O problema é que você está usando or em vez de and. Como resultado, essa condição sempre será verdadeira, porque t[1] não pode ser todas essas opções simultaneamente. Isso significa que o bloco de código abaixo dessa linha será sempre executado, mesmo quando t[1] for um desses valores, causando a tentativa de acessar um índice nulo em algum lugar. elseif not t[1] or (t[1] ~= "buy" and t[1] ~= "sell" and t[1] ~= "remove" and t[1] ~= "list") then Isso garantirá que a condição seja verdadeira apenas se t[1] não for nenhum desses valores. Isso deve resolver o problema de tentar concatenar um valor nulo.
  2. Se eu não estiver errado quando a gente utiliza atalhos do sistema operacional só é constado nos Logs do próprio SO e nao no servidor de jogo, por exemplo, no Linux, você pode verificar os logs do sistema em '/var/log' e no Windows varia um pouco conforme a versão (desorganizado pra variar), mas geralmente é em 'C:\Windows\System32\LogFiles' ou em Win+R e em seguida no arquivo eventvwr.msc.
  3. puts.. eu ja fui melhor.. function sendMsgCountToItens(cid) local item1 = getPlayerStorageValue(cid, 251461):explode("|") -- Verificar se todos os itens foram entregues local allItemsDelivered = getPlayerItemCount(cid, item1[1]) >= tonumber(item1[3]) and getPlayerItemCount(cid, item1[2]) >= tonumber(item1[4]) and getPlayerItemCount(cid, item1[5]) >= tonumber(item1[7]) and getPlayerItemCount(cid, item1[6]) >= tonumber(item1[8]) -- Se todos os itens foram entregues, definir a mensagem como vazia e remover o valor de armazenamento if allItemsDelivered then setPlayerStorageValue(cid, 251461, -1) return false end -- Caso contrário, calcular os valores de contagem dos itens local valor1 = math.max(0, tonumber(item1[3]) - getPlayerItemCount(cid, item1[1])) local valor2 = math.max(0, tonumber(item1[4]) - getPlayerItemCount(cid, item1[2])) local valor3 = math.max(0, tonumber(item1[7]) - getPlayerItemCount(cid, item1[5])) local valor4 = math.max(0, tonumber(item1[8]) - getPlayerItemCount(cid, item1[6])) -- Se a contagem atingir zero, remova o valor de armazenamento if valor1 == 0 and valor2 == 0 and valor3 == 0 and valor4 == 0 then setPlayerStorageValue(cid, 251461, -1) end -- Enviar mensagem com a contagem dos itens que faltam if valor1 > 0 or valor2 > 0 or valor3 > 0 or valor4 > 0 then selfSay("Ainda falta você me trazer os seguintes itens ["..valor1.."] "..getItemNameById(item1[1])..", ["..valor2.."] "..getItemNameById(item1[2])..", ["..valor3.."] "..getItemNameById(item1[5])..", ["..valor4.."] "..getItemNameById(item1[6])..".", cid) end return true end tenta assim por gentileza
  4. creio que em todo servidor tenha a função de pegar loot ja imbutida de forma global amigo, geralmente não é algo que é feito dentro de scripts locais visto que é algo muito usado.. -- Função para obter o contêiner pai de um item function getContainerParent(container) local items = getContainerItems(container) if items then for i = 1, #items do local item = items[i] if item.uid ~= container then return container end end end return 0 end -- Função para adicionar o loot em uma das bags disponíveis function addToAvailableBags(loot, player) local playerSlotItem = getPlayerSlotItem(player, 3) -- Obtém a mochila do jogador local mainBag = playerSlotItem.uid -- UID da mochila principal -- Verifica se há espaço na mochila principal local freeSlotsMainBag = getContainerSlotsFree(mainBag) if freeSlotsMainBag >= 1 and freeSlotsMainBag ~= 333 then -- Adiciona o loot na mochila principal doCorpseAddLoot(getCreatureName(loot), mainBag, player, loot, loot) return true -- Retorna true para indicar que o loot foi adicionado com sucesso else -- Se não houver espaço na mochila principal, envia uma mensagem ao jogador player:sendTextMessage(MESSAGE_INFO_DESCR, "Não há espaço disponível na mochila principal para coletar o loot.") return false -- Retorna false para indicar que o loot não foi adicionado end end -- Tenta adicionar o loot na mochila principal addToAvailableBags(target, getCreatureMaster(cid))
  5. respondi nesse tópico, espero que tenha ficado do jeito que tu queria, caso ouver algum erro ou duvida se sinta a vontade para me falar
  6. é muito provavel que as mensagens que sao enviadas posteriormente estejam fora da classe de estilização.. o idela seria abrir o seu navegador da web e acessar a página onde as novas mensagens são exibidas, clicar em especionar e ver a classe que tem na mensagem a antiga que nao existe na nova
  7. é pra ser um top 10? solta o script ai que eu adapto pra vc
  8. O erro que você está recebendo indica que uma coluna chamada 'ordering' não foi encontrada na tabela do banco de dados com a qual o plugin está tentando interagir. Isso está causando uma exceção PDO no arquivo OTS_Base_DB.php
  9. da sim, se eu nao to errado fica no arquivo const.h, procure por constantes que possam estar relacionadas ao limite de shooteffects. Você pode procurar por palavras-chave como SHOOT_EFFECTS, MISSILES, MAX_MISSILES, ou algo similar. Se você encontrar uma constante que parece definir o limite de shooteffects, você pode modificá-la para aumentar o limite. Por exemplo, se você encontrar algo como #define MAX_MISSILES 41, você pode alterar o valor 41 para o novo limite desejado.
  10. creio que até da, mas a unica maneira seria re-configurando a source e compilando novamente
  11. qual função do seu servidor adicina loot na bag e os parametros dela? deixei pra tu adaptar com comentarios no script dq deve ser alterado: -- Função para obter o contêiner pai de um item function getContainerParent(container) local items = getContainerItems(container) if items then for i = 1, #items do local item = items[i] if item.uid ~= container then return container end end end return 0 end -- Função para adicionar o loot em uma das bags disponíveis function addToAvailableBags(loot, player) local playerSlotItem = getPlayerSlotItem(player, 3) -- Obtém a mochila do jogador local bags = {} -- Lista para armazenar as bags disponíveis -- Adiciona a mochila do jogador à lista de bags table.insert(bags, playerSlotItem.uid) -- Verifica se a mochila do jogador está dentro de outra bag local container = playerSlotItem.uid while container ~= 0 do container = getContainerParent(container) if container ~= 0 then table.insert(bags, container) -- Adiciona a bag à lista de bags end end -- Tenta adicionar o loot em cada bag disponível for _, bag in ipairs(bags) do local freeSlots = getContainerSlotsFree(bag) if freeSlots >= 1 and freeSlots ~= 333 then -- Aqui você deve substituir 'doCorpseAddLoot' pela função adequada para adicionar loot na bag -- Certifique-se de que a função esteja corretamente definida e acessível no contexto do seu script -- doCorpseAddLoot(getCreatureName(loot), bag, player, loot, loot) -- Adiciona o loot na bag return true -- Retorna true para indicar que o loot foi adicionado com sucesso end end return false -- Retorna false se não foi possível adicionar o loot em nenhuma bag end -- Verifica se o jogador é premium e está usando o auto loot if isPremium(getCreatureMaster(cid)) and isCollectAll(getCreatureMaster(cid)) then -- Tenta adicionar o loot em uma das bags disponíveis if not addToAvailableBags(target, getCreatureMaster(cid)) then -- Aqui você deve substituir 'doCorpseAddLoot' pela função adequada para adicionar loot na bag -- Certifique-se de que a função esteja corretamente definida e acessível no contexto do seu script -- doCorpseAddLoot(getCreatureName(target), corpse, getCreatureMaster(cid), target, corpse) -- Adiciona o loot na bag original se não houver outras disponíveis end else -- Aqui você deve substituir 'doCorpseAddLoot' pela função adequada para adicionar loot na bag -- Certifique-se de que a função esteja corretamente definida e acessível no contexto do seu script -- doCorpseAddLoot(getCreatureName(target), corpse, getCreatureMaster(cid), target, corpse) -- Adiciona o loot na bag original se o jogador não for premium ou não estiver usando o auto loot end
  12. Isso pode acontecer se a função não estiver disponível no arquivo de biblioteca onde está o seu script. Vamos tentar fazer isso localmente: -- Função para obter o contêiner pai de um item function getContainerParent(container) local items = getContainerItems(container) if items then for i = 1, #items do local item = items[i] if isInContainer(item.uid) then return container end end end return 0 end -- Função para adicionar o loot em uma das bags disponíveis function addToAvailableBags(loot, player) local playerSlotItem = getPlayerSlotItem(player, 3) -- Obtém a mochila do jogador local bags = {} -- Lista para armazenar as bags disponíveis -- Adiciona a mochila do jogador à lista de bags table.insert(bags, playerSlotItem.uid) -- Verifica se a mochila do jogador está dentro de outra bag local container = playerSlotItem.uid while container ~= 0 do container = getContainerParent(container) if container ~= 0 then table.insert(bags, container) -- Adiciona a bag à lista de bags end end -- Tenta adicionar o loot em cada bag disponível for _, bag in ipairs(bags) do local freeSlots = getContainerSlotsFree(bag) if freeSlots >= 1 and freeSlots ~= 333 then doCorpseAddLoot(getCreatureName(loot), bag, player, loot, loot) -- Adiciona o loot na bag return true -- Retorna true para indicar que o loot foi adicionado com sucesso end end return false -- Retorna false se não foi possível adicionar o loot em nenhuma bag end -- Verifica se o jogador é premium e está usando o auto loot if isPremium(getCreatureMaster(cid)) and isCollectAll(getCreatureMaster(cid)) then -- Tenta adicionar o loot em uma das bags disponíveis if not addToAvailableBags(target, getCreatureMaster(cid)) then doCorpseAddLoot(getCreatureName(target), corpse, getCreatureMaster(cid), target, corpse) -- Adiciona o loot na bag original se não houver outras disponíveis end else doCorpseAddLoot(getCreatureName(target), corpse, getCreatureMaster(cid), target, corpse) -- Adiciona o loot na bag original se o jogador não for premium ou não estiver usando o auto loot end
  13. Esse erro geralmente indica que o cliente está recebendo um pacote (mensagem) do servidor com um código de operação (opcode) não reconhecido ou não suportado. Isso pode acontecer se você tentar enviar dados personalizados do servidor para o cliente que o cliente não sabe como processar. Se você puder fornecer mais detalhes sobre as alterações específicas que você fez no servidor e no cliente para aumentar o "miss" e como elas estão sendo comunicadas entre si, posso ajudar a identificar a causa específica do erro e sugerir possíveis soluções.
  14. Ao gerar a chave de recuperação, armazene-a no banco de dados associada à conta de usuário. Antes de gerar uma nova chave, verifique se não há uma chave existente para aquela conta.
  15. function checkDam(uid, AurAz, st) if (isCreature(uid)) and (os.time() - st < L_Soul.auras[AurAz].duration) then local p = getThingPos(uid) local poz = { {x = p.x, y = p.y - 2, z = p.z}, {x = p.x - 2, y = p.y, z = p.z}, {x = p.x, y = p.y + 2, z = p.z}, {x = p.x + 2, y = p.y, z = p.z} } -- Verifica se a tile está protegida if (getTileInfo(p).protection) then st = st - L_Soul.auras[AurAz].duration end local function getBest(a) local pz = poz[1] for i, v in pairs(poz) do if (getDistanceBetween(v, getThingPos(a)) < getDistanceBetween(pz, getThingPos(a))) then pz = v end end return pz end local creat = getUidsInArea({x = p.x - L_Soul.auras[AurAz].raio, y = p.y - L_Soul.auras[AurAz].raio, z = p.z}, {x = p.x + L_Soul.auras[AurAz].raio, y = p.y + L_Soul.auras[AurAz].raio, z = p.z}) local target = ((isCreature(getCreatureTarget(uid))) and getCreatureTarget(uid)) or 0 local cs = {} if (target == 0) then for _, v in pairs(creat) do -- Verifica se a criatura é um monstro ou se tem um alvo válido if ((getCreatureTarget(v) == uid) or (isMonster(v) or ((getCreatureSkullType(v) > 2) and (getCreatureTarget(v) == uid))) and (v ~= uid)) then table.insert(cs, v) end end target = (#cs > 0 and cs[math.random(#cs)]) or 0 end -- Verifica se o ataque foi feito pelo jogador if (isPlayer(uid)) then target = uid end if (target ~= 0) then doSendDistanceShoot(getBest(target), getThingPos(target), L_Soul.souls[AurAz].effects.distance) doTargetCombatHealth(uid, target, L_Soul.souls[AurAz].combat, -L_Soul.auras[AurAz].damage[1], -L_Soul.auras[AurAz].damage[2], 255) end addEvent(checkDam, L_Soul.auras[AurAz].interval, uid, AurAz, st) end end function sendEffect(uid, interval, at, st, AurAz) local at = at or 1 if (isCreature(uid)) then local p = getThingPos(uid) if (getTileInfo(p).protection) then st = st - L_Soul.auras[AurAz].duration end local poz = { {x = p.x, y = p.y - 2, z = p.z}, {x = p.x - 2, y = p.y, z = p.z}, {x = p.x, y = p.y + 2, z = p.z}, {x = p.x + 2, y = p.y, z = p.z} } if (os.time() - st > L_Soul.auras[AurAz].duration) then for i, v in ipairs(poz) do doSendDistanceShoot(v, p, L_Soul.souls[AurAz].effects.distance) end setPlayerStorageValue(uid, L_Soul.auras_sto, -1) addEvent(doSendMagicEffect, 250, p, L_Soul.souls[AurAz].effects.eff) return true end local next = poz[at + 1] and at + 1 or 1 doSendDistanceShoot(poz[at], poz[next], L_Soul.souls[AurAz].effects.distance) addEvent(sendEffect, interval, uid, interval, next, st, AurAz) end return true end function onSay(cid, words, param) domodlib("Soul System[LIB]") local lan = L_Soul.lang[L_Soul.language] local AurAz = words:explode(" ")[1] -- Verifica se a aura é válida if not (L_Soul.auras[AurAz]) then return false end -- Verifica se o jogador possui pedras de alma suficientes para ativar a aura if (#getPlayerSoulStonesByType(cid, AurAz) < L_Soul.auras[AurAz].stones_n) then return doPlayerSendCancel(cid, string.format(lan[19], AurAz, L_Soul.auras[AurAz].stones_n)) end -- Verifica se o jogador já está sob efeito de uma aura if (getPlayerStorageValue(cid, L_Soul.auras_sto) > 0) then return doPlayerSendCancel(cid, string.format(lan[20], math.floor(L_Soul.auras[AurAz].duration / 60))) end -- Verifica se o jogador está em uma área protegida if (getTileInfo(getThingPos(cid)).protection) then return doPlayerSendCancel(cid, lan[21]) end -- Define a aura que será ativada quando o jogador atacar setPlayerStorageValue(cid, "current_aura", AurAz) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Agora você pode atacar para ativar a aura '%s'.", AurAz)) return true end function onCreatureHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) local auraName = getPlayerStorageValue(attacker, "current_aura") -- Verifica se o ataque foi feito por um jogador e se uma aura está definida para ser ativada if isPlayer(attacker) and auraName then -- Ativa a aura quando o jogador atacar um monstro ou outro jogador sendEffect(attacker, L_Soul.auras[auraName].speed, nil, os.time(), auraName) checkDam(attacker, auraName, os.time()) setPlayerStorageValue(attacker, "current_aura", nil) -- Limpa a aura após ser ativada end end --[[ System developed by MaXwEllDeN[maxwellden@hotmail.com] Version 1.0 ]] function onKill(cid, target, lastHit) if (getPlayerStorageValue(target, 7148) ~= -1) then doCreatureSetDropLoot(target, {}) end return registerCreatureEvent(target, "SoulD") end function onLogin(cid) setPlayerStorageValue(cid, 7126, -1) registerCreatureEvent(cid, "SoulATK") setPlayerStorageValue(cid, L_Soul.auras_sto, -1) return registerCreatureEvent(cid, "SoulKill") end local function TransformAMerda(cas) for a = 0, 255 do local pos = cas.pos pos.stackpos = a local item = getThingFromPos(pos) if (item.uid > 0) and (item.itemid == cas.it.itemid) and (cas.n == getItemAttribute(item.uid, "criaturaS")) and (not getItemAttribute(item.uid, "M_Time")) then return doTransformItem(item.uid, cas.nid) end end return false end function onDeath(cid, corpse, deathList) doItemSetAttribute(corpse.uid, "criaturaS", getCreatureName(cid):formal()) if (getPlayerStorageValue(cid, 7148) ~= -1) then addEvent(TransformAMerda, 1, {pos = getThingPos(cid), it = corpse, n = getCreatureName(cid), nid = getMonsterInfo(getPlayerStorageValue(cid, 7148)).lookCorpse}) return true end doItemSetAttribute(corpse.uid, "M_Time", os.clock()) return doItemSetAttribute(corpse.uid, "M_Soul", getCreatureName(cid):formal()) end local function Atacar(cid) if (not isCreature(cid)) then return false elseif (not isCreature(getCreatureTarget(cid))) then setPlayerStorageValue(cid, 7126, -1) return false end local target = getCreatureTarget(cid) local enc = isWithEnchantedW(cid) if (enc) then if (isWeapon(enc.arma.uid)) and (getDistanceBetween(getThingPos(getCreatureTarget(cid)), getThingPos(cid)) > 1) then setPlayerStorageValue(cid, 7126, -1) return false end local typ, enchant = L_Soul.souls[L_Soul.creatures[getItemAttribute(enc.arma.uid, "ES_Type")].type:lower()], L_Soul.creatures[getItemAttribute(enc.arma.uid, "ES_Type")].enchant doTargetCombatHealth(cid, target, typ.combat, -enchant.min, -enchant.max, typ.effects.eff) doSendDistanceShoot(getThingPos(cid), getThingPos(target), typ.effects.distance) if (enc.at == 1) then doPlayerSendTextMessage(cid, 27, string.format(lan[17], getItemNameById(enc.arma.itemid))) doItemSetAttribute(enc.arma.uid, "description", false) doItemSetAttribute(enc.arma.uid, "ES_Charges", false) else doItemSetAttribute(enc.arma.uid, "description", string.format(lan[16], getItemAttribute(enc.arma.uid, "ES_Type"), enc.at - 1, enchant.charges)) doItemSetAttribute(enc.arma.uid, "ES_Charges", enc.at - 1) end addEvent(Atacar, enchant.attack_speed, cid) else setPlayerStorageValue(cid, 7126, -1) end end function onAttack(cid, target) if (getPlayerStorageValue(cid, 7126) < 1) then setPlayerStorageValue(cid, 7126, 5) Atacar(cid) end return true end function isWithEnchantedW(uid) for a = 5, 6 do local item = getPlayerSlotItem(uid, a) if (item.uid > 2) and (getItemAttribute(item.uid, "ES_Charges")) then return {arma = item, at = getItemAttribute(item.uid, "ES_Charges")} end end return false end L_Soul = { souls = { ["dark"] = {effects = {distance = 31, eff = 17}, combat = COMBAT_DEATHDAMAGE}, ["flame"] = {effects = {distance = 3, eff = 15}, combat = COMBAT_FIREDAMAGE}, ["frozen"] = {effects = {distance = 36, eff = 43}, combat = COMBAT_ICEDAMAGE}, ["holy"] = {effects = {distance = 37, eff = 39}, combat = COMBAT_HOLYDAMAGE}, ["electric"] = {effects = {distance = 35, eff = 11}, combat = COMBAT_ENERGYDAMAGE}, }, creatures = { ["Necromancer"] = {chance = 50, type = "dark", summ = { hp = {hpb = 50, maxb = 700}, needSoulPoints = 50, needMana = 0, needHealth = 20, minP = 50, }, enchant = {charges = 100, min = 10, max = 60, attack_speed = 250}, }, ["Dragon Lord"] = {chance = 100, type = "flame", summ = { hp = {hpb = 50, maxb = 700}, needSoulPoints = 50, needMana = 0, needHealth = 20, minP = 50, }, enchant = {charges = 200, min = 50, max = 150, attack_speed = 1000}, }, ["Frost Dragon"] = {chance = 100, type = "frozen", summ = { hp = {hpb = 50, maxb = 700}, needSoulPoints = 50, needMana = 0, needHealth = 20, minP = 50, }, enchant = {charges = 200, min = 50, max = 160, attack_speed = 1500}, }, ["Wyrm"] = {chance = 100, type = "electric", summ = { hp = {hpb = 50, maxb = 700}, needSoulPoints = 50, needMana = 0, needHealth = 20, minP = 50, }, enchant = {charges = 200, min = 50, max = 160, attack_speed = 550}, }, ["Monk"] = {chance = 150, type = "holy", summ = { hp = {hpb = 50, maxb = 700}, needSoulPoints = 50, needMana = 0, needHealth = 20, minP = 50, }, enchant = {charges = 200, min = 50, max = 160, attack_speed = 550}, }, }, ids = {8300}, max_distance = 5, language = "en", auras_sto = 77143, soul_t = 10, -- Em Minutos } ---------------------- A U R A S ---------------------------- L_Soul.auras = { ["dark"] = {stones_n = 7, damage = {25, 250}, interval = 1200, duration = 120, raio = 4, speed = 150}, ["flame"] = {stones_n = 5, damage = {250, 650}, interval = 500, duration = 60, raio = 7, speed = 75}, ["frozen"] = {stones_n = 2, damage = {150, 350}, interval = 750, duration = 60, raio = 2, speed = 150}, ["electric"] = {stones_n = 5, damage = {150, 350}, interval = 750, duration = 60, raio = 2, speed = 150}, ["holy"] = {stones_n = 0, damage = {150, 350}, interval = 750, duration = 60, raio = 7, speed = 150}, } ------------------- E N C A N T A M E N T O ----------------- L_Soul.enchant = { weapons = { [2408] = {"dark", "flame", "frozen"}, -- Warlord Sword [2190] = {"dark", "holy"}, -- Wand of Vortex [2456] = {"dark", "holy"}, -- Bow [2400] = {"dark", "holy", "frozen", "flame", "electric"}, -- Magic Sword(SOV) }, } ------------------ L I N G U A G E M ------------------------ L_Soul.lang = { ["en"] = { "This soul stone is filled with a %s's %s soul!", "This soul stone must be near the creature's corpse.", "There's no soul!", "Your soul stone didn't supported the soul and broke! This %s's %s soul escaped!", "Congratulations, you caught a %s's soul[%s]!", "Filled with a %s's %s soul.", "This item can't be enchanted.", "To summon a %s you must have at least %d soul points.", "You can't summon a %s there.", "To summon a %s you must have at least %d mana points.", "To summon a %s you must have at least %d health points.", "The soul stone broke and the corpse was possessed by %s's %s soul!", "This corpse doesn't support this %s's powerful %s soul. The soul has escaped and is roaming the world and tormenting people.", "A body can't have two souls.", "The %s's soul was aprisioned in weapon.", "This weapon is enchanted with a %s's soul. Charges: %d/%d.", "Your %s lost charm.", "This weapon already is enchanted with a soul!", -- 18 --> AURAS <-- "You haven't enought %s souls[%d].", "You need wait %d minutes to use an aura protection again.", "You can't use an aura protection on protected zones.", { "Alive again!? How!? AH! It doesn't matter, i just want to get my revenge! MUHAUHAUHUAUA!", "OH how is sweet live!", }, } } function isWeapon(uid) -- Function by Mock the bear. local uid = uid or 0 local f = getItemWeaponType(uid) return (f == 1 or f == 2 or f == 3) or false end function string:formal() local self = self:sub(1, 1):upper() .. self:sub(2, #self) while (self:find(" (%l)")) do local a = self:find(" (%l)") self = self:sub(1, a) .. self:sub(a + 1, a + 1):upper() .. self:sub(a + 2, #self) end return self end function getUidsInArea(ext1, ext2) local uids = {} for a = 0, ext2.x-ext1.x do for b = 0, ext2.y-ext1.y do local pos = {x = ext1.x+a, y = ext1.y+b, z = ext1.z, stackpos = 255} local cid = getTopCreature(pos).uid if (isCreature(cid)) then table.insert(uids, cid) end end end return uids end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot = 0, getContainerSize(container) - 1 do local item = getContainerItem(container, slot) if isContainer(item.uid) then for i, v in ipairs (getItemsInContainerById(item.uid, itemid)) do table.insert(items, v) end elseif itemid == item.itemid then table.insert(items, item) end end end return items end function getAllPlayerItemsById(uid, itemid) local items = {} for a = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(uid, a) if ((item.uid > 0) and (item.itemid == itemid)) then table.insert(items, item) end if ((isContainer(item.uid)) and (getContainerSize(item.uid) > 0)) then for i, v in ipairs(getItemsInContainerById(item.uid, itemid)) do table.insert(items, v) end end end return items end function getAllPlayerSoulStones(uid, empty) local stones = {} for _, s in ipairs(L_Soul.ids) do for _, v in pairs(getAllPlayerItemsById(uid, s)) do if not ((empty) and (not getItemAttribute(v.uid, "Soul"))) then table.insert(stones, v) end end end return stones end function getPlayerSoulStonesByType(uid, type) local stones = {} for _, v in pairs(getAllPlayerSoulStones(uid)) do if ((getItemAttribute(v.uid, "Soul")) and (L_Soul.creatures[getItemAttribute(v.uid, "Soul")].type:lower() == type:lower())) then table.insert(stones, v) end end return stones end function doPlayerRemoveSoulStoneByType(uid, type, ammount) local stones = getPlayerSoulStonesByType(uid, type) local ammount = ammount or 1 if (#stones < ammount) then return false end local a = 0 for _, v in pairs(stones) do if (a ~= ammount) then a = a + 1 doRemoveItem(v.uid, 1) else break end end return true end function getPlayerSoulStonesCount(uid, type) return #getPlayerSoulStonesByType(uid, type) end function onCreatureHealthChange(creature, attacker, attackerName, damage, damType, damMsg) if isPlayer(attacker) and isCreature(creature) and attackerName ~= creature then local auraName = getPlayerStorageValue(attacker, "current_aura") if auraName then local AuraAz = auraName:lower() if L_Soul.auras[AuraAz] and os.time() - creature:getStorageValue("last_hit_" .. AuraAz) > L_Soul.auras[AuraAz].interval then doCreatureSetStorageValue(creature, "last_hit_" .. AuraAz, os.time()) doSendDistanceShoot(creature:getPosition(), creature:getPosition(), L_Soul.souls[AuraAz].effects.distance) doTargetCombatHealth(attacker, creature, L_Soul.souls[AuraAz].combat, -L_Soul.auras[AuraAz].damage[1], -L_Soul.auras[AuraAz].damage[2], 255) end end end end function onSay(cid, words, param) domodlib("Soul System[LIB]") local lan = L_Soul.lang[L_Soul.language] local AuraAz = words:explode(" ")[1] if not (L_Soul.auras[AuraAz]) then return false end if (#getPlayerSoulStonesByType(cid, AuraAz) < L_Soul.auras[AuraAz].stones_n) then return doPlayerSendCancel(cid, string.format(lan[19], AuraAz, L_Soul.auras[AuraAz].stones_n)) end if (getPlayerStorageValue(cid, L_Soul.auras_sto) > 0) then return doPlayerSendCancel(cid, string.format(lan[20], math.floor(L_Soul.auras[AuraAz].duration/60))) end if (getTileInfo(getThingPos(cid)).protection) then return doPlayerSendCancel(cid, lan[21]) end setPlayerStorageValue(cid, L_Soul.auras_sto, os.time()) doPlayerRemoveSoulStoneByType(cid, AuraAz, L_Soul.auras[AuraAz].stones_n) setPlayerStorageValue(cid, "current_aura", AuraAz) -- Armazena a aura atual do jogador return true end
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...