Ir para conteúdo

Holograma

Campones
  • Total de itens

    90
  • Registro em

  • Última visita

  • Dias Ganhos

    5

Tudo que Holograma postou

  1. é 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
  2. é pra ser um top 10? solta o script ai que eu adapto pra vc
  3. 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
  4. 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.
  5. creio que até da, mas a unica maneira seria re-configurando a source e compilando novamente
  6. 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
  7. 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
  8. 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.
  9. 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.
  10. 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
  11. solta o script ai que eu edito meu nobre
  12. 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])) -- Enviar mensagem com a contagem dos itens que faltam 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) return true end
  13. Identifique o código responsável pelo efeito de Hypnosis ou Sleep e poste aqui pra correção
  14. -- Função para exibir o nome do local function displayLocationName(player, locationName) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você entrou em: " .. locationName) end -- Função para verificar a entrada em um local específico function checkLocationEntry(player) local playerPosition = player:getPosition() local locationName = getTileInfo(playerPosition.x, playerPosition.y, playerPosition.z).name displayLocationName(player, locationName) end -- Função para verificar a saída de um local específico function checkLocationExit(player) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você saiu do local.") end -- Evento de movimento do jogador function onPlayerMove(player, fromPosition, toPosition) local fromTile = Tile(fromPosition) local toTile = Tile(toPosition) if fromTile and toTile then local fromLocation = fromTile:getPosition() local toLocation = toTile:getPosition() -- Verifica se o jogador entrou em uma nova posição if fromLocation ~= toLocation then checkLocationEntry(player) end end end -- Registra o evento de movimento do jogador function onPlayerMoveEvent(event, player, fromPosition, toPosition) onPlayerMove(player, fromPosition, toPosition) end -- Registra o evento de movimento do jogador registerCreatureEvent(cid, "PlayerMove", "onPlayerMoveEvent") Neste exemplo: A função displayLocationName é responsável por exibir o nome do local para o jogador. Aqui, estamos enviando uma mensagem azul para o console do jogador informando o nome do local em que ele entrou. A função checkLocationEntry verifica se o jogador entrou em um local específico e chama a função displayLocationName para exibir o nome desse local. A função checkLocationExit pode ser usada para realizar ações quando o jogador sai de um local específico. O evento onPlayerMove é acionado sempre que o jogador se move de uma posição para outra. Aqui, verificamos se o jogador entrou em um novo local e chamamos a função checkLocationEntry para exibir o nome do local.
  15. O erro indica que está tentando criar uma textura com dimensões de 2158x1080, enquanto o tamanho máximo permitido para uma textura é 2048x2048. Redimensione a textura para que suas dimensões não excedam o limite máximo de 2048x2048. Você pode usar ferramentas de edição de imagem como o Photoshop, GIMP ou qualquer outra ferramenta de sua preferência para fazer isso.
  16. o erro está relacionado a uma tabela chamada 'nto.guilds_ggn' que não está sendo encontrada no banco de dados. CREATE TABLE nto.guilds_ggn ( id INT AUTO_INCREMENT PRIMARY KEY, nome VARCHAR(255), descricao TEXT, criado_em TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
  17. ok, vamos lá 1.Erro no script youdead.lua: [16/04/2024 03:41:17] [Error - CreatureScript Interface] [16/04/2024 03:41:17] data/creaturescripts/scripts/youdead.lua:onPrepareDeath [16/04/2024 03:41:17] Description: [16/04/2024 03:41:18] (luaGetCreatureMaster) Creature not found [16/04/2024 03:41:18] [Error - CreatureScript Interface] [16/04/2024 03:41:18] data/creaturescripts/scripts/youdead.lua:onPrepareDeath [16/04/2024 03:41:19] Description: [16/04/2024 03:41:19] (luaGetCreatureName) Creature not found [16/04/2024 03:41:19] > Broadcasted message: "O Jogador Fogao [level: 699553] Acaba de Morrer Para false.". Parece que há uma tentativa de obter o nome da criatura que matou o jogador (lastHitKiller). No entanto, o sistema não conseguiu encontrar essa criatura. Isso pode acontecer se o jogador for morto por um evento ou condição do jogo em vez de uma criatura específica. Você pode precisar adicionar verificações adicionais para garantir que lastHitKiller seja uma criatura válida antes de tentar obter seu nome e mestre. 2.Erro no script deathchannel.lua: [16/04/2024 03:41:23] [Error - CreatureScript Interface] [16/04/2024 03:41:23] data/creaturescripts/scripts/deathchannel.lua:onDeath [16/04/2024 03:41:23] Description: [16/04/2024 03:41:24] data/creaturescripts/scripts/deathchannel.lua:7: attempt to perform arithmetic on a boolean value [16/04/2024 03:41:24] stack traceback: [16/04/2024 03:41:24] data/creaturescripts/scripts/deathchannel.lua:7: in function <data/creaturescripts/scripts/deathchannel.lua:5> Parece que há um erro na linha 7 do script deathchannel.lua, onde uma operação aritmética está sendo tentada em um valor booleano. Isso geralmente ocorre quando você tenta realizar uma operação matemática em uma variável que não contém um valor numérico. Você precisará verificar o código na linha 7 do deathchannel.lua e garantir que todas as variáveis estejam definidas corretamente antes de tentar realizar operações matemáticas. 3.Erro XML: XML: [16/04/2024 06:52:01] [Error - CreatureEvent::executeCombat] Call stack overflow. Parece que houve um estouro de pilha (stack overflow) em um evento de combate. Isso geralmente acontece quando há muitas chamadas recursivas ou aninhadas que excedem a capacidade da pilha de execução. Você precisará investigar o evento de combate especificado e verificar se há alguma lógica recursiva ou aninhada que precisa ser otimizada para evitar estouro de pilha. 1. Para o script youdead.lua, vamos adicionar verificações adicionais para garantir que lastHitKiller seja uma criatura válida antes de tentar obter seu nome e mestre. Também vamos corrigir a mensagem de broadcast para exibir o nome do jogador que matou corretamente. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if lastHitKiller and isCreature(lastHitKiller) then local killerName = getCreatureName(lastHitKiller) if not isPlayer(lastHitKiller) and not isPlayer(getCreatureMaster(lastHitKiller)) then doBroadcastMessage("O jogador " .. getCreatureName(cid) .. " [level: " .. getPlayerLevel(cid) .. "] acabou de morrer para " .. tostring(killerName) .. ".", MESSAGE_STATUS_CONSOLE_RED) end end end return true end 2.Para o script deathchannel.lua, vamos corrigir a operação aritmética na linha 7 para garantir que todas as variáveis estejam definidas corretamente antes de tentar realizar operações matemáticas. function onDeath(cid, corpse, deathList) local target = deathList[1] if target and isCreature(target) then local targetStorage = getCreatureStorage(target, storage) if targetStorage then doCreatureSetStorage(target, storage, targetStorage + 1) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getCreatureStorage(cid, storage), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_O, 0xF) for _, frag in ipairs(frags) do if targetStorage == frag then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF) end local cidStorage = getCreatureStorage(cid, storage) if cidStorage and cidStorage >= frag then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), cidStorage + 1), TALKTYPE_CHANNEL_RN, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end end return false end
  18. <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Characters Market System" version="1.0" author="LuckOake" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="market"><![CDATA[ price = 27112 owner = 27113 level = 30 -- Level min of character.-- min_price = 100 -- Price min of character-- max_price = 1000000 -- Price maximum of character-- function doTransferCharacter(cid, accId) return db.executeQuery("UPDATE `players` SET `account_id` = "..accId.." WHERE `id` = "..getPlayerGUIDByName(cid).."") end function doOfflinePlayerAddMoney(guid, money) return db.executeQuery("UPDATE `players` SET `balance` = `balance` + '"..money.."' WHERE `id` = '"..getPlayerGUIDByName(guid).."';") end function setOfflinePlayerStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (".. getPlayerGUIDByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `player_storage` SET `value` = ".. value .." WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") end end function getOfflinePlayerStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = '".. getPlayerGUIDByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end ret = result:getDataInt("value") result:free() return ret end function getOfflinePlayerValue(name, value) local result, ret = db.getResult("SELECT `"..value.."` FROM `players` WHERE `id` = "..getPlayerGUIDByName(name)..";") ret = result:getDataInt(value) result:free() return ret end function isCharacterForSale(name) if not getOfflinePlayerStorageValue(name, "price") or getOfflinePlayerStorageValue(name, "price") < 1 then return false else return true end end ]]></config> ------------------------------------------------------------------------------------ <talkaction words="!character" event="buffer"><![CDATA[ domodlib('market') local t = string.explode(param, ",") if t[1] == "sell" then if not t[3] or not tonumber(t[3]) or t[4] or tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name and the price.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is already for sale.") return true elseif getPlayerGUIDByName(t[2]) == getPlayerGUID(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You cannot sell yourself.") return true elseif getPlayerByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The character must be offline to be sold.") return true elseif getOfflinePlayerValue(t[2], "level") < level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your character can't be sold until it has level "..level..".") return true elseif tonumber(t[3]) < min_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the minimum price for selling a character is "..min_price..".") return true elseif tonumber(t[3]) > max_price then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, but the maximum price for selling a character is "..max_price..".") return true end setOfflinePlayerStorageValue(t[2], "price", t[3]) setOfflinePlayerStorageValue(t[2], "owner", getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" is now for sale for the price of "'..t[3]..'" gold coins.') elseif t[1] == "buy" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif not playerExists(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character doesn't exist.") return true elseif getPlayerAccountId(cid) == getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't buy your own character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true elseif not doPlayerRemoveMoney(cid, getOfflinePlayerStorageValue(t[2], "price")) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Not enough money. This character's price is "..getOfflinePlayerStorageValue(t[2], "price").." gold coins.") return true end if not getPlayerByGUID(getOfflinePlayerStorageValue(t[2], "owner")) then doOfflinePlayerAddMoney(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], "owner")), getOfflinePlayerStorageValue(t[2], "price")) setOfflinePlayerStorageValue(getPlayerNameByGUID(getOfflinePlayerStorageValue(t[2], "owner")), 41792, getPlayerGUIDByName(t[2])) else doPlayerAddMoney(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], "owner")), getOfflinePlayerStorageValue(t[2], "price")) doPlayerSendTextMessage(getPlayerByGUID(getOfflinePlayerStorageValue(t[2], "owner")), MESSAGE_STATUS_CONSOLE_BLUE, 'Your character "'..t[2]..'" has been sold for the price of '..getOfflinePlayerStorageValue(t[2], "price")..' gold coins.') end doTransferCharacter(t[2], getPlayerAccountId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You bought the character "'..t[2]..'" for the price of '..getOfflinePlayerStorageValue(t[2], "price")..' gold coins.') setOfflinePlayerStorageValue(t[2], "owner", -1) setOfflinePlayerStorageValue(t[2], "price", -1) return true elseif t[1] == "remove" then if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Incorrect Params. Specify the character name.") return true elseif getPlayerAccountId(cid) ~= getAccountIdByName(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is not your character.") return true elseif not isCharacterForSale(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This character is not for sale.") return true end setOfflinePlayerStorageValue(t[2], "price", -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You removed the character "'..t[2]..'" from the Characters Market.') return true elseif t[1] == "list" then local result = db.getResult("SELECT `name` FROM `players`") if result:getID() == -1 then return true end local msg = "Characters for Sale:\n\n" while true do local name = result:getDataString("name") if isCharacterForSale(name) then local sex = getOfflinePlayerValue(name, "sex") == 1 and "Male" or "Female" msg = ""..msg.." - ".. name .." (Level: "..getOfflinePlayerValue(name, "level").." / Vocation: "..getVocationInfo(getOfflinePlayerValue(name, "vocation")).name.." / Sex: "..sex.." / Owner: "..getPlayerNameByGUID(getOfflinePlayerStorageValue(name, "owner"))..") [Price: "..getOfflinePlayerStorageValue(name, "price").."] \n" end if not result:next() then break end end doPlayerPopupFYI(cid, msg) return true elseif not t[1] or t[1] ~= "buy" or t[1] ~= "sell" or t[1] ~= "remove" or t[1] ~= "list" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect params. You can only 'buy' or 'sell' a character, 'remove' it from the Characters Market or see the 'list' of characters for sale.") return true end return true ]]></talkaction> ------------------------------------------------------------------------------------ <event type="login" name="MarketLogin" event="script"><![CDATA[ function onLogin(cid) domodlib('market') if getPlayerStorageValue(cid, "price") > 0 then return false elseif getPlayerStorageValue(cid, 41792) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold the character "..getPlayerNameByGUID(getPlayerStorageValue(cid, 41792))..". The money is in your bank account.") setPlayerStorageValue(cid, 41792, -1) end return true end ]]></event> </mod> Nesta correção, eu substituí os valores de price e owner nas chamadas de função getOfflinePlayerStorageValue dentro da função isCharacterForSale para que eles sejam passados como strings em vez de variáveis não declaradas. Isso deve resolver o erro de concatenação de valores nulos que você estava enfrentando.
  19. local outfit = {lookType = 3} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_TICKS, 33000) -- 33 segundos de efeito de velocidade setConditionFormula(condition, 0.3, -24, 0.3, -24) setCombatCondition(combat, condition) function onCastSpell(cid, var) doCreatureChangeOutfit(cid, outfit) addEvent(resetOutfit, 33000, cid, outfit) -- Resetar a outfit após 33 segundos return doCombat(cid, combat, var) end function resetOutfit(cid, oldOutfit) doCreatureChangeOutfit(cid, oldOutfit) end
  20. parece que essas opções estão definidas no array $config['donate']['offers']. Vou ajudar você a remover essas entradas desse array. Aqui está a parte do código modificada: $valid_methods = array_diff($config['paymentsMethods'], [false]); $payment_id = 1; foreach ($valid_methods as $methodName => $status) { $showName = ""; switch ($methodName) { case "mercadoPago": $showName = "Mercado Pago"; break; case "transfer": $showName = "Bank Transfer"; break; case "picpay": $showName = "PicPay"; break; default: break; } $main_content .= ' <div class="PMCID_Icon_Container" id="PMCID_Icon_Container_' . $payment_id . '"> <div class="PMCID_Icon" id="PMCID_Icon_' . $payment_id . '" style="background-image:url(' . $layout_name . '/images//payment/pmcid_icon_normal.png);" onclick="ChangePMC(' . $payment_id . ');" onmouseover="MouseOverPMCID(' . $payment_id . ');" onmouseout="MouseOutPMCID(' . $payment_id . ');"> <div class="PermanentDeactivated PMCID_Deactivated_ByChoice" id="PMCID_NotAllowed_' . $payment_id . '" style="display: none;"> <span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Payment Method Info:\', \'<p>The payment method is not allowed for the selected service!</p>\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();"> <div class="PMCID_Deactivated" style="background-image: url(' . $layout_name . '/images/payment/pmcid_deactivated.png);"></div> </span> </div> <div class="PMCID_Icon_Selected" id="PMCID_Icon_Selected_' . $payment_id . '"></div> <div class="PMCID_Icon_Over" id="PMCID_Icon_Over_' . $payment_id . '"></div> <span style="position: absolute; left: 125px; top: 53px; z-index: 99;"><span style="margin-left: 5px; position: absolute; margin-top: 2px;"><a href="../common/help.php?subtopic=Field_PaymentMethodCategory_Option_' . $payment_id . '_Comment" target="_blank"><span class="HelperDivIndicator" onmouseover="ActivateHelperDiv($(this), \'Information:\', \'This method is ' . ($showName == '' ? ucfirst($methodName) : ucfirst($showName)) . '.\', \'\');" onmouseout="$(\'#HelperDivContainer\').hide();"><img style="border:0px;" src="' . $layout_name . '/images/global/content/info.gif"></span></a></span></span> <img class="PMCID_CP_Icon" src="' . $layout_name . '/images/payment/' . strtolower($methodName) . '.gif"> <div class="PMCID_CP_Label"> <input type="radio" id="PMCID_' . $payment_id . '" name="PMCID" value="' . $payment_id . '" style="display: none;"> <label for="PMCID_' . $payment_id . '">' . ($showName == '' ? ucfirst($methodName) : ucfirst($showName)) . '</label> </div> </div> </div> '; $payment_id++; }
  21. function onUse(cid, item, frompos, item2, topos) if item.uid == 1624 then if getPlayerStorageValue(cid, 1624) == -1 then if getPlayerLevel(cid) >= 0 then local espacoSuficiente = true -- Adiciona as mochilas de ID 10518 ao inventário do jogador for i = 1, 42 do if not doPlayerAddItem(cid, 10518, 1) then espacoSuficiente = false break end end -- Se houver espaço suficiente, adiciona as moedas às mochilas if espacoSuficiente then for i = 1, 42 do local backpack = doCreateItemEx(10518, 1) if backpack ~= 0 then for j = 1, 100 do doAddContainerItem(backpack, 2159, 1000) end doPlayerAddItemEx(cid, backpack, false) else espacoSuficiente = false break end end -- Se tudo ocorreu bem, informa ao jogador que ele recebeu o prêmio if espacoSuficiente then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns! Você ganhou um prêmio.") setPlayerStorageValue(cid, 1624, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem espaço suficiente para as mochilas.") end else -- Se o jogador não tiver espaço suficiente, envia uma mensagem em green doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce nao tem espaço suficiente.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa ser level 0 para usar.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já pegou o bônus.") end end return true end
  22. function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1624 then if getPlayerStorageValue(cid, 1624) == -1 then if getPlayerLevel(cid) >= 717217 then local espacoSuficiente = true for i = 1, 42 do local backpack = doCreateItemEx(10518, 1) if backpack ~= 0 then for j = 1, 100 do doAddContainerItem(backpack, 2159, 1000) end if not doPlayerAddItemEx(cid, backpack, false) then espacoSuficiente = false doRemoveItem(backpack) break end else espacoSuficiente = false break end end if espacoSuficiente then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns! Você ganhou um prêmio.") setPlayerStorageValue(cid, 1624, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem espaço suficiente para as mochilas.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ser nível 717217 para usar.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já recebeu o bônus.") end end return true end
  23. poderia falar qual erro aparece no console? function onUse(cid, item, frompos, item2, topos) if item.uid == 1624 then if getPlayerStorageValue(cid, 1624) == -1 then if getPlayerLevel(cid) >= 0 then -- Verifica se o jogador tem espaço suficiente no inventário para as mochilas local enoughSpace = true for i = 1, 42 do if not doPlayerAddItem(cid, 10518, 1) then enoughSpace = false break end end if enoughSpace then -- Adiciona 1000 moedas (ID 2159) dentro de uma mochila (ID 10518) e repete 42 vezes for i = 1, 42 do local backpack = doCreateItemEx(10518, 1) if backpack ~= 0 then for j = 1, 100 do doAddContainerItem(backpack, 2159, 1) end doPlayerAddItemEx(cid, backpack, false) else enoughSpace = false break end end end if enoughSpace then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabéns! Você ganhou um prêmio.") else -- Não há espaço suficiente, então cai no chão com dinheiro dentro local townID = 1 -- Altere isso para o ID da cidade desejada (1 para DexSoft) local tile = getTownTemplePosition(townID) local container = doCreateItemEx(10518, 1) for i = 1, 100 do doAddContainerItem(container, 2159, 1) end doTeleportThing(container, tile, false) doSendMagicEffect(tile, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tinha espaço suficiente, a mochila foi enviada para o depot.") end setPlayerStorageValue(cid, 1624, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa ser level 0 para usar.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já pegou o bônus.") end end return true end
  24. local lvldodge = 48903 local percent = 0.1 -- Porcentagem padrão de reflexão de dano local storageID = 10001 -- ID do storage para controlar a habilidade de reflexão function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS and isCreature(attacker) then if (getPlayerStorageValue(cid, lvldodge) * 3) >= math.random(0, 1000) then local reflectValue = math.ceil(value * percent) doCreatureAddHealth(attacker, -reflectValue) doSendAnimatedText(getCreaturePos(cid), "Reflected!", 6) -- Incrementar o storage para indicar que a habilidade foi usada setPlayerStorageValue(cid, storageID, 1) return false end end return true end -- Adicionando o evento ao XML local eventXML = [=[<event type="statschange" name="ReflectStone" event="script" value="reflectStone.lua"/>]=] local file = io.open('data/creaturescripts/creaturescripts.xml', 'a') if file then file:write(eventXML) file:close() else print("Erro ao abrir o arquivo creaturescripts.xml") end -- Registro do evento no login.lua local loginScript = [=[registerCreatureEvent(cid, "ReflectStone")]=] local loginFile = io.open('data/creaturescripts/login.lua', 'a') if loginFile then loginFile:write(loginScript) loginFile:close() else print("Erro ao abrir o arquivo login.lua") end
  25. local ballcatch = { -- Definições das bolas de captura } function onUse(cid, item, frompos, item3, topos) local item2 = getTopCorpse(topos) if item2 == null then return true end local owner = getItemAttribute(item2.uid, "corpseowner") local pOwner = getPlayerByName(owner) if not pOwner or not isCreature(pOwner) or not isPlayer(pOwner) then doPlayerSendCancel(cid, "Erro: Jogador não encontrado.") return true end if getPlayerStorageValue(cid, 55006) >= 1 then doPlayerSendCancel(cid, "Você não pode capturar nenhum Pokémon enquanto estiver em um duelo.") return true end -- Restante do seu código aqui... return true end function getPlayerSorte() local ballS if math.random(1, 200) >= 199 then ballS = math.random(250, 450) else ballS = math.random(1, 35) end return ballS end function getPlayerSorteInNormal() local ballS if math.random(1, 100) >= 95 then ballS = math.random(250, 450) else ballS = math.random(1, 35) end return ballS end function getBallsRate(name, id) if pokes[name] then if isInArray(ballcatch[id].type, pokes[name].type) or isInArray(ballcatch[id].type, pokes[name].type2) or isInArray(ballcatch[id].pokes, name) then return 12 end end return 8 end vê se resolve, caso nao for o suficiente eu verifico o outro script
  • Quem Está Navegando   0 membros estão online

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