Ir para conteúdo

L3K0T

Membro
  • Registro em

  • Última visita

Tudo que L3K0T postou

  1. L3K0T postou uma resposta no tópico em Suporte Tibia OTServer
    precisa ver se seu servidor tem onmoveitems, caso nao tiver... tera que alterar na source
  2. -- Cassino System by LucasHere function onUse(cid, item, frompos, item2, topos) pos1 = {x=256, y=344, z=7, stackpos=1} -- posição que vai criar os itens pos2 = {x=257, y=344, z=7, stackpos=1} pos3 = {x=258, y=344, z=7, stackpos=1} local config = { moneyneed = 2000, -- amount of VIP coins needed to play } local premios = { [2189] = 1, [6529] = 1, [2546] = 1, [2352] = 1, [2545] = 1, [8851] = 1, [7424] = 1, [7735] = 1, [8293] = 1, [7450] = 1, [8931] = 1, [8856] = 1 } function additem(cid, premios) local playerName = getPlayerName(cid) -- Get the player's name for itemId, quantity in pairs(premios) do doPlayerAddItem(cid, itemId, quantity) end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, playerName .. " apostou no cassino e ganhou todos os itens.") end if item.itemid == 1945 and getPlayerItemCount(cid, 11192) < config.moneyneed then doPlayerSendCancel(cid, "Desculpe, você não tem moedas VIP suficientes para jogar!") return true end if item.itemid == 1945 then doTransformItem(item.uid, 1946) doPlayerRemoveItem(cid, 11192, config.moneyneed) local premioItems = premios addEvent(doCreateItem, 0, premioItems, pos1) addEvent(doCreateItem, 1000, premioItems, pos2) addEvent(doCreateItem, 2000, premioItems, pos3) addEvent(additem, 2000, cid, premioItems) return true end local item0 = getThingfromPos(pos1) local item1 = getThingfromPos(pos2) local item2 = getThingfromPos(pos3) if item.itemid == 1946 then doTransformItem(item.uid, 1945) if item0.itemid ~= 0 then doRemoveItem(item0.uid, 1) end if item1.itemid ~= 0 then doRemoveItem(item1.uid, 1) end if item2.itemid ~= 0 then doRemoveItem(item2.uid, 1) end else doTransformItem(item.uid, 1945) end return true end
  3. function onSay(cid, words, param) if getPlayerLevel(cid) == 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then if doPlayerRemoveMoney(cid, 0) == TRUE then local bp = doPlayerAddItem(cid, 5805, 1) doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1) else doCreatureSay(cid, "Item grátis", TALKTYPE_ORANGE_1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end else doCreatureSay(cid, "Você não atende aos requisitos para comprar o item.", TALKTYPE_ORANGE_1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end
  4. function onSay(cid, words, param) -- Configurações gerais local config = { needPa = true, -- Necessita ser uma conta premium? needPz = true, -- Precisa estar em uma área de proteção (Protection Zone)? battle = true, -- Precisa estar fora de combate para resetar? withe = false, -- Jogadores com PK "Branco" podem resetar? red = false, -- Jogadores com PK "Vermelho" podem resetar? tp = false, -- Teleportar para o templo após o reset? look = true, -- Mostrar o reset no status do jogador? addLimite = true, -- Ativar limite de resets? setClasse = false, -- Mudar a vocação do jogador ao resetar? storage = 54676, -- Valor de armazenamento para contagem de resets } -- Configurações específicas para o reset local resetStatus = { lvl = 717217, -- Nível necessário para resetar lvlreset = 150, -- Nível que o jogador terá após o reset limite = 100, -- Máximo de resets permitidos newClasse = 0, -- Nova vocação após o reset (0 significa que não muda) tempo = 0, -- Tempo em segundos antes do reset acontecer } local player = getPlayerGUID(cid) -- Obtém o GUID (identificador único) do jogador local resets = getPlayerStorageValue(cid, config.storage) -- Obtém o número de resets do jogador local needLvl = "Você precisa de " .. resetStatus.lvl - getPlayerLevel(cid) .. " níveis para resetar." local msg = "~~[Reset: " .. resets .. "]~~ Sucesso ao resetar! Você será desconectado em " .. resetStatus.tempo .. " segundos." -- Verificações de condições antes do reset if not isPremium(cid) and config.needPa then doPlayerSendTextMessage(cid, 22, "Você precisa ser uma conta Premium para resetar.") elseif config.needPz and not getTilePzInfo(getCreaturePosition(cid)) then doPlayerSendTextMessage(cid, 22, "Você precisa estar em uma área de proteção para resetar.") elseif config.addLimite and resets == resetStatus.limite then doPlayerSendTextMessage(cid, 22, "Você já atingiu o limite de resets permitidos.") elseif not config.withe and getCreatureSkullType(cid) == SKULL_WHITE then doPlayerSendTextMessage(cid, 22, "Você está com PK 'Branco', por isso não pode resetar.") elseif not config.red and getCreatureSkullType(cid) == SKULL_RED then doPlayerSendTextMessage(cid, 22, "Você está com PK 'Vermelho', por isso não pode resetar.") elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, 22, "Você precisa estar fora de combate para resetar.") elseif getPlayerLevel(cid) < resetStatus.lvl then doPlayerSendCancel(cid, needLvl) else -- Função para realizar o reset local function performReset() resets = getPlayerStorageValue(cid, config.storage) + 1 setPlayerStorageValue(cid, config.storage, resets) if config.tp then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end if config.setClasse then doPlayerSetVocation(cid, resetStatus.newClasse) end doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = " .. resetStatus.lvlreset .. ", `experience` = 0 WHERE `id` = " .. player) db.executeQuery("UPDATE `players` SET `description` = ' [Reset " .. resets .. "]' WHERE `players`.`id` = " .. player) if config.look then db.executeQuery("UPDATE `players` SET `description` = ' [Reset " .. resets .. "]' WHERE `players`.`id` = " .. player) else db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = " .. player) end doPlayerPopupFYI(cid, msg) end -- Adiciona um evento para realizar o reset após um determinado tempo addEvent(performReset, resetStatus.tempo * 1000) end return true end
  5. se o monstro não cai no chão precisa verificar os onkill e ondead no xml do cresturescript.xml desativa eles e testa! Alguma formula usada com onstatschange está errada por isso resulta no erro, tem certeza que desativou os onstatschanges? nao pulo nenhum? olho na lib funções novas com onstatschange? procura na lib onstatschanges se acha manda aqui o da lib ctrl+F
  6. Remove os script 1 por 1 que contém onstatschange no xml do cresturescripts, inclusive de eventos, é um deles que está dando esse erro... e testa sem ele, depois mata um monstro e vê se some. Aquele que vc excluir da tag xml sumir, ai vc manda aqui
  7. testa esse onstatschange pois creio que no seu esteja "getCreaturePos" que não existe no seu server, então mudei para "getCreaturePosition" function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then if isCreature(attacker) and isCreature(cid) then local attackerPosition = getCreaturePosition(attacker) if attackerPosition then local playerLvlCrit = getPlayerStorageValue(attacker, LVL_CRIT_STORAGE) if playerLvlCrit ~= -1 then local critThreshold = playerLvlCrit * 3 local randomValue = math.random(0, 1000) if critThreshold >= randomValue then local boostedDamage = math.ceil(value * (MULTIPLIER - 1)) doTargetCombatHealth(attacker, cid, combat, -boostedDamage, -boostedDamage, boostedDamage) doSendAnimatedText(attackerPosition, "+BOOSTER", 1000) return false end end else end end end return true end
  8. L3K0T postou uma resposta no tópico em Suporte Tibia OTServer
    Opções de contatos está no final do fórum.
  9. Precisa estar certinho todos iguais, porque se no item editor estiver carga 1 e no xml do server carga 5, quem manda é o item editor, não terá efeito se eu n me engano
  10. Vc pode pegar esse mesmo script e botar em weapons e sentar o script pelo xml em weapons
  11. Já tentou ver pelo item editor se está como carga correta?
  12. O erro está vindo do login.lua que esta em cresturescripts, precisamos do script pra resolver esse erro
  13. local LVL_CRIT_STORAGE = 48904 local MULTIPLIER = 1.001 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then if isPlayer(attacker) and isCreature(cid) then local playerLvlCrit = getPlayerStorageValue(attacker, LVL_CRIT_STORAGE) local critThreshold = playerLvlCrit * 3 local randomValue = math.random(0, 1000) if critThreshold >= randomValue then local boostedDamage = math.ceil(value * (MULTIPLIER - 1)) -- Subtrair 1 para obter o valor percentual doTargetCombatHealth(attacker, cid, combat, -boostedDamage, -boostedDamage, boostedDamage) -- Verifique se o atacante é uma criatura antes de obter sua posição if isCreature(attacker) then doSendAnimatedText(getCreaturePos(attacker), "+BOOSTER", 1000) end return false end end end return true end
  14. Procure por um script em cresturescripts que utilize funções de ataque ou statschange, recomendo dar uma olhada no arquivo XML dentro do diretório cresturescripts.
  15. L3K0T postou uma resposta no tópico em Layouts
    Reinstala o site.
  16. O erro "Thing not found" está relacionado à função luaGetThingPosition, o que indica que o servidor não consegue encontrar um objeto ou criatura específica durante a execução do script.
  17. -- Import required modules and libraries domodlib('arenaFunctions') local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- Initialize conversation states as local variables local focus = 0 local talk_start = 0 local TS = 0 -- Function to check if a string contains another string (case-insensitive) local function msgcontains(txt, str) return string.find(string.lower(txt), string.lower(str)) end -- Function to handle player saying something to the NPC function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) then selfSay('Hello ' .. getCreatureName(cid) .. ', do you want to fight in the arena?') focus = cid talk_start = os.clock() TS = 1 elseif msgcontains(msg, 'hi') and focus ~= cid then selfSay('I\'m busy.') elseif TS == 1 then if msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena') then local myArenaLevel = 3 -- Replace this with the appropriate storage value for your system local enterArena = myArenaLevelIs(cid) if getPlayerStorageValue(cid, myArenaLevel) < 3 then if getPlayerLevel(cid) >= enterArena.RLV then if getPlayerMoney(cid) >= enterArena.RC then setPlayerStorageValue(cid, talkNPC, 1) doPlayerRemoveMoney(cid, enterArena.RC) selfSay("Now you can face the... " .. enterArena.LN .. " level!") else selfSay("You don't have " .. enterArena.RC .. " gold! Come back when you are ready!") end else selfSay("You don't have level " .. enterArena.RLV .. " yet! Come back when you are ready!") end else selfSay("Cancel[6]") -- Note: Ensure the 'Cancel' table is defined in the arenaFunctions module. end elseif msgcontains(msg, 'no') then selfSay("Bye two!") else selfSay("Sorry, I didn't understand. Do you want to fight in the arena?") end focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS elseif msgcontains(msg, 'bye') then selfSay("Bye three!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end return true end -- Function to handle NPC behavior on think function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Bye four.') end focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end end -- Set the appropriate callback and add the FocusModule npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSay) npcHandler:addModule(FocusModule:new())
  18. -- Import required modules and libraries domodlib('arenaFunctions') local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- Initialize conversation states as local variables local focus = 0 local talk_start = 0 local TS = 0 -- Function to check if a string contains another string (case-insensitive) local function msgcontains(txt, str) return string.find(string.lower(txt), string.lower(str)) end -- Function to handle player saying something to the NPC function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) then selfSay('Hello ' .. getCreatureName(cid) .. ', do you want to fight in the arena?') focus = cid talk_start = os.clock() TS = 1 elseif msgcontains(msg, 'hi') and focus ~= cid then selfSay('I\'m busy.') elseif TS == 1 and (msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena')) then local myArenaLevel = 3 -- Replace this with the appropriate storage value for your system local enterArena = myArenaLevelIs(cid) if getPlayerStorageValue(cid, myArenaLevel) < 3 then if getPlayerLevel(cid) >= enterArena.RLV then if getPlayerMoney(cid) >= enterArena.RC then setPlayerStorageValue(cid, talkNPC, 1) doPlayerRemoveMoney(cid, enterArena.RC) selfSay("Now you can face the... " .. enterArena.LN .. " level!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS else selfSay("You don't have " .. enterArena.RC .. " gold! Come back when you are ready!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end else selfSay("You don't have level " .. enterArena.RLV .. " yet! Come back when you are ready!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end else selfSay("Cancel[6]") -- Note: Ensure the 'Cancel' table is defined in the arenaFunctions module. focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end elseif TS == 1 and msgcontains(msg, 'no') then selfSay("Bye two!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS elseif msgcontains(msg, 'bye') then selfSay("Bye three!") focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end return true end -- Function to handle NPC behavior on think function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Bye four.') end focus = 0 -- Reset conversation state: focus talk_start = 0 -- Reset conversation state: talk_start TS = 0 -- Reset conversation state: TS end end -- Set the appropriate callback and add the FocusModule npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSay) npcHandler:addModule(FocusModule:new())
  19. function onStartup() local result_guilds = db.getResult("SELECT `id`, `creationdata` FROM `guilds` ORDER by `creationdata` ASC;") local days = 30 * 3600 * 24 local nowtime = os.time() if (result_guilds and result_guilds:getID() ~= -1) then while (true) do local id = result_guilds:getDataInt("id") local date = result_guilds:getDataInt("creationdata") local time = nowtime - date local duedate = time - days if duedate >= 0 then local columnExists = db.isColumn("players", "guild_id") if columnExists then local result_countplayersguild = db.getResult("SELECT COUNT(*) AS player_count FROM `players` WHERE `guild_id` = " .. id .. ";") if (result_countplayersguild) then local manyplayers = result_countplayersguild:getDataInt("player_count") result_countplayersguild:free() if manyplayers < 10 then db.executeQuery("DELETE FROM `guild_invite` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_kills` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_ranks` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_storage` WHERE `guild_id` = " .. id .. ";") db.executeQuery("DELETE FROM `guild_wars` WHERE `guild_id` = " .. id .. ";") end end end end if not (result_guilds:next()) then break end end result_guilds:free() end end
  20. bool Player::canWalkthrough(const Creature* creature) const { if (creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if (!player) return false; // Verifica se o jogador atual e o outro jogador estão em uma área de proteção (PZ) e impede a passagem. bool thisPlayerInPZ = getTile()->hasFlag(TILESTATE_PROTECTIONZONE); bool otherPlayerInPZ = player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE); if (thisPlayerInPZ && otherPlayerInPZ) return false; // Restante do código... // (Mantenha as outras verificações que você deseja manter para permitir a passagem em outras situações) return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }
  21. -- Import required modules and libraries domodlib('arenaFunctions') local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} -- Function to reset conversation states local function resetTalkState() focus = 0 talk_start = 0 TS = 0 end -- Function to check if a string contains another string (case-insensitive) local function msgcontains(txt, str) return string.find(string.lower(txt), string.lower(str)) end -- Function to handle player saying something to the NPC function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) then selfSay('Hello ' .. getCreatureName(cid) .. ', do you want to fight in the arena?') focus = cid talk_start = os.clock() TS = 1 elseif msgcontains(msg, 'hi') and focus ~= cid then selfSay('I\'m busy.') elseif TS == 1 and (msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena')) then local myArenaLevel = 3 -- Replace this with the appropriate storage value for your system local enterArena = myArenaLevelIs(cid) if getPlayerStorageValue(cid, myArenaLevel) < 3 then if getPlayerLevel(cid) >= enterArena.RLV then if getPlayerMoney(cid) >= enterArena.RC then setPlayerStorageValue(cid, talkNPC, 1) doPlayerRemoveMoney(cid, enterArena.RC) selfSay("Now you can face the... " .. enterArena.LN .. " level!") resetTalkState() else selfSay("You don't have " .. enterArena.RC .. " gold! Come back when you are ready!") resetTalkState() end else selfSay("You don't have level " .. enterArena.RLV .. " yet! Come back when you are ready!") resetTalkState() end else selfSay("Cancel[6]") -- Note: Ensure the 'Cancel' table is defined in the arenaFunctions module. resetTalkState() end elseif TS == 1 and msgcontains(msg, 'no') then selfSay("Bye two!") resetTalkState() elseif msgcontains(msg, 'bye') then selfSay("Bye three!") resetTalkState() end return true end -- Function to handle NPC behavior on think function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Bye four.') end resetTalkState() end end -- Set the appropriate callback and add the FocusModule npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSay) npcHandler:addModule(FocusModule:new())
  22. Manda seu login.lua o account mannager fica lá, pode ter sido removido
  23. O rme converte

Informação Importante

Confirmação de Termo