Tudo que L3K0T postou
-
(Resolvido)ITEM SÓ PODE SER CONSUMIDO 1X POR PLAYER. [BUG]
local config = { lifeGain = 5.5, lifeGainMax = 8, manaGain = 5.5, manaGainMax = 8, exhaustionSeconds = 0.9, effectChar = 212, itemExhaustion = 10 -- adicione o tempo de espera em segundos aqui } function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, config.itemExhaustion) then local timeLeft = exhaustion.get(cid, config.itemExhaustion) if timeLeft > 0 then doPlayerSendCancel(cid, "You are exhausted. You need to wait " .. timeLeft .. " seconds before using this item again.") return true end end doRemoveItem(item.uid, 1) local health = getCreatureMaxHealth(cid) * (config.lifeGain/100) local mana = getCreatureMaxMana(cid) * (config.manaGain/100) local healthmax = getCreatureMaxHealth(cid) * (config.lifeGainMax/100) local manamax = getCreatureMaxMana(cid) * (config.manaGainMax/100) doCreatureAddHealth(cid, math.random(health, healthmax)) doCreatureAddMana(cid, math.random(mana, manamax)) doSendMagicEffect(getPlayerPosition(cid), config.effectChar) exhaustion.set(cid, config.itemExhaustion, config.exhaustionSeconds) return true end
-
(Resolvido)ITEM SÓ PODE SER CONSUMIDO 1X POR PLAYER. [BUG]
Vc quer usar semprea cada certo tempo, agora entendi amigo local config = { lifeGain = 5.5, lifeGainMax = 8, manaGain = 5.5, manaGainMax = 8, exhaustionSeconds = 0.9, effectChar = 212 } function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, item.itemid) then local timeLeft = exhaustion.get(cid, item.itemid) if timeLeft > 0 then doPlayerSendCancel(cid, "You are exhausted. You need to wait " .. timeLeft .. " seconds before using this item again.") return true end end doRemoveItem(item.uid, 1) local health = getCreatureMaxHealth(cid) * (config.lifeGain/100) local mana = getCreatureMaxMana(cid) * (config.manaGain/100) local healthmax = getCreatureMaxHealth(cid) * (config.lifeGainMax/100) local manamax = getCreatureMaxMana(cid) * (config.manaGainMax/100) doCreatureAddHealth(cid, math.random(health, healthmax)) doCreatureAddMana(cid, math.random(mana, manamax)) doSendMagicEffect(getPlayerPosition(cid), config.effectChar) exhaustion.set(cid, item.itemid, config.exhaustionSeconds) return true end
-
Player chega vida a 0 e nao morre e nao cai o corpo e nao vai para o templo...
Tente: *creatureevets o creturescript <event type="death" name="Death" script="death.lua"/> function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local position = player:getPosition() corpse = Game.createItem(CORPSE_ID, 1, position) if corpse then corpse:setAttribute(ITEM_ATTRIBUTE_CORPSEOWNER, player:getName()) else print("Failed to create corpse for player ".. player:getName() ..".") return false end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.") player:changeSpeed(-player:getSpeed()) addEvent(sendToTemple, 5000, player:getId()) return true end function sendToTemple(playerId) local player = Player(playerId) if not player then return end local corpse = player:getCorpse() if not corpse then return end corpse:remove() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been sent to the temple.") player:teleportTo(TemplePosition) end function onLogin(player) local corpse = player:getCorpse() if corpse then corpse:remove() end return true end
-
FALA TIME, ESSE SCRIPT ELE NÃO DÁ NENHUM ERRO NO CONSOLE, POIS NÃO LIBERA A ACTION DESCRITA
local config = { minLevel = 200, -- Nível mínimo para adquirir a gema. gems = {2154, 2155, 2156, 2158}, -- IDs das gemas storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008}, interval = 600, -- Intervalo dos efeitos colors = { [5] = {182, 213}, -- Druida [6] = {215, 215}, -- Sorcerer [7] = {89, 89}, -- Paladin [8] = {210, 210}, -- Knight [9] = {182, 213}, -- Druida majestoso [10] = {215, 215}, -- Feiticeiro supremo [11] = {89, 89}, -- Paladino Senhor [12] = {210, 210}, -- Cavaleiro monstro }, effects = {"' . ,", ". ' ,", "` . ,", ", ' ."}, -- Efeitos das gemas } function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not player then return false end if getPlayerLevel(cid) < config.minLevel then player:sendCancelMessage("Você precisa ser nível " .. config.minLevel .. " para adquirir a gema espiritual.") return true end local vocation = player:getVocation() local vocationId = vocation:getId() local vocationName = vocation:getName() if not config.vocations[vocationId] then player:sendCancelMessage("Você já adquiriu sua gema espiritual.") return true end if not isInArray(config.gems, item.itemid) then return false end local storageValue = config.storage[vocationId] if getPlayerStorageValue(cid, storageValue) > 0 then player:sendCancelMessage("Você já adquiriu a gema espiritual para essa vocação.") return true end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você adquiriu a gema espiritual e atualizou sua vocação para " .. Vocation(config.vocations[vocationId]):getName() .. ".") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:setVocation(Vocation(config.vocations[vocationId])) player:addItem(item.itemid, -1) setPlayerStorageValue(cid, storageValue, os.time()) addEvent(sendGemEffect, config.interval, cid, vocationId) return true end function sendGemEffect(cid, vocationId) local player = Player(cid) if not player or getPlayerStorageValue(cid, config.storage[vocationId]) == 0 then return false end local color = config.colors[vocationId][math.random(#config.colors[vocationId])] local effect = config.effects[math.random(#config.effects)] player:getPosition():sendAnimatedText(effect, color) addEvent(sendGemEffect, config.interval, cid, vocationId) end function removeAllGemEffects(cid) for i = 1, #config.storage do setPlayerStorageValue(cid, config.storage[i], 0) end local player = Player(cid) if player then player:removeCondition(CONDITION_INFIGHT) player:removeCondition(CONDITION_OUTFIT) player:removeCondition(CONDITION_FIRE) player:removeCondition(CONDITION_ENERGY) player:removeCondition(CONDITION_POISON) player:removeCondition(CONDITION_DRUNK) player:removeCondition(CONDITION_DROWN) player:removeCondition(CONDITION_FREEZING) player:removeCondition(CONDITION_DAZZLED) player:removeCondition(CONDITION_CURSED) end return true end function isGemActivated(cid) local playerVocation = getPlayerVocation(cid) if playerVocation ~= 0 and getPlayerStorageValue(cid, config.storage[playerVocation]) > 0 then return true end return false end
-
Action Remover Teleport
Ai está local config = { teleportId = 27723, days = { ["Tuesday"] = {Position(998, 996, 7), Position(1487, 308, 13)}, -- Morshabaal - monday-Segunda, tuesday-Terça, wednesday-Quarta, thursday-Quinta, friday-Sexta, saturday-Sabado and sunday-Domingo }, bossPosition = Position(1507, 309, 14), bossName = "Gaz'haragoth", spawnTime = '18:43:00' } local Gazharagoth = GlobalEvent("Gazharagoth") local function removeTeleport(item) if item and item:getId() == config.teleportId and item:isTeleport() then item:remove() end end function Gazharagoth.onTime(interval) local day = config.days[os.date("%A")] if day then Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_GAME_HIGHLIGHT) Game.broadcastMessage(config.bossName .. ' In revenge for my brother death, I will devastate this continent!', MESSAGE_EVENT_ADVANCE) local item = Game.createItem(config.teleportId, 1, day[1]) if item then if not item:isTeleport() then item:remove() return false end item:setDestination(day[2]) addEvent(removeTeleport, 300000, item) -- remove o teleport depois de 5 minutos (300000 ms) end addEvent(function() Game.createMonster(config.bossName, config.bossPosition, false, true) end, 5000) end return true end Gazharagoth:time(config.spawnTime) Gazharagoth:register()
-
alguem poderia me ajudar modifica esse script, obs: ele ja funciona no meu server so queria muda recompensa dele!
Ve se te ajuda 😉 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local requiredLevel = 400 -- Level necessário para entrar na Akatsuki local requiredItemId = 9693 -- ID do item necessário para entrar na Akatsuki local requiredItemQuantity = 10 -- Quantidade do item necessário para entrar na Akatsuki local bonusFist = 10 -- Bônus de mana para adicionar ao jogador ao entrar na Akatsuki local bonusMl = 10 -- Bônus de life para adicionar ao jogador ao entrar na Akatsuki function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'akatsuki') then if getPlayerVocation(cid) ~= config then if getPlayerStorageValue(cid, 2345678) == -1 and getPlayerStorageValue(cid, 2345679) == -1 then if getPlayerLevel(cid) >= requiredLevel then selfSay('Você deseja entrar para a Akatsuki?', cid) talkState[talkUser] = 1 else selfSay('Você não possui level suficiente '..requiredLevel..'.', cid) end else selfSay('Você já faz parte de uma aliança!', cid) end else selfSay('Não preciso de você agora!', cid) end end if talkState[talkUser] == 1 and msgcontains(msg, 'yes') then selfSay('Para provar sua lealdade, você deve trazer '..requiredItemQuantity..' {corações}.', cid) talkState[talkUser] = 2 end if talkState[talkUser] == 2 and msgcontains(msg, 'corações') then if getPlayerItemCount(cid, requiredItemId) >= requiredItemQuantity then setPlayerStorageValue(cid, 2345678, 1) doPlayerRemoveItem(cid, requiredItemId, requiredItemQuantity) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + bonusMl * 100) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + bonusFist * 20) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) setPlayerStorageValue(cid, 89745, 5) selfSay('Bem-vindo à Aliança Akatsuki!', cid) talkState[talkUser] = 0 else selfSay('Não adianta me enganar, você não tem '..requiredItemQuantity..' corações, volte quando tiver.', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)ITEM SÓ PODE SER CONSUMIDO 1X POR PLAYER. [BUG]
local config = { lifeGain = 5.5, lifeGainMax = 8, manaGain = 5.5, manaGainMax = 8, exhaustionSeconds = 0.9, effectChar = 212, storageUse = 34538 } function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, config.storageUse) then local timeLeft = exhaustion.get(cid, config.storageUse) if timeLeft > 0 then doPlayerSendCancel(cid, "You are exhausted. You need to wait " .. timeLeft .. " seconds before using this item again.") return true end end doRemoveItem(item.uid, 1) local health = getCreatureMaxHealth(cid) * (config.lifeGain/100) local mana = getCreatureMaxMana(cid) * (config.manaGain/100) local healthmax = getCreatureMaxHealth(cid) * (config.lifeGainMax/100) local manamax = getCreatureMaxMana(cid) * (config.manaGainMax/100) doCreatureAddHealth(cid, math.random(health, healthmax)) doCreatureAddMana(cid, math.random(mana, manamax)) doSendMagicEffect(getPlayerPosition(cid), config.effectChar) exhaustion.set(cid, config.storageUse, config.exhaustionSeconds) return true end
-
erro Setting gamestate to: GAME_STATE_INIT
O erro "GAME_STAT_INT" é um erro de código que indica que um valor inválido está sendo usado em uma função que espera um número inteiro. Para resolver esse problema, é necessário verificar o código do seu comando e garantir que todos os valores usados sejam do tipo inteiro. Além disso, verifique se todas as variáveis usadas no comando são definidas e inicializadas corretamente.
-
`Erro move1.lua poketibia (status negativo)
function doStun2(cid, cd, eff, check, spell) if not isCreature(cid) or isDead(cid) then return true end local stg = conds["Stun"] local pokemons = {"Mew", "Mewtwo", "Raikou", "Entei", "Suicune", "Sparker", "Drummy", "Bone Kabutops", "Big Porygon", "Moltres", "Articuno", "Zapdos", "Cloned Charizard", "Cloned Blastoise", "Cloned Venusaur", "Clone Blastoise", "Clone Charizard", "Clone Venusaur", "Mini Zapdos", "Mini Moltres", "Mini Articuno", "Demon", "Fire Devil", "Meta Mewtwo", "Lugia", "Giant Tentacruel", "Celebi", "Ho-Oh", "Tico Mia", "Dark Gengar"} if isInArray(pokemons, getCreatureName(cid)) then return true end if not canDoMiss(cid, spell) then return true end if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then setPlayerStorageValue(cid, stg, cd) return true end if not check and getPlayerStorageValue(cid, stg) >= 1 then setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1) else setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd) end local a = getPlayerStorageValue(cid, stg) if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then local item = getPlayerSlotItem(getCreatureMaster(cid), 😎 doItemSetAttribute(item.uid, "stun", a) doItemSetAttribute(item.uid, "stunEff", eff) doItemSetAttribute(item.uid, "stunSpell", spell) end if a <= -1 then doRemoveCondition(cid, CONDITION_PARALYZE) if not isSleeping(cid) and not isParalyze(cid) and not isFrozen(cid) then addEvent(doRegainSpeed, 50, cid) end setPlayerStorageValue(cid, stg, -1) return true end if getCreatureCondition(cid, CONDITION_PARALYZE) == false then doAddCondition(cid, paralizeArea2) end doSendMagicEffect(getThingPos(cid), eff) addEvent(doStun2, 1000, cid, -1, eff, a, spell) end
-
ERROR NA HORA DE COMPIALAR LINUX
Esse erro é causado porque o compilador não consegue encontrar o cabeçalho "boost::unordered_set". Isso pode acontecer porque o boost não está instalado corretamente no sistema ou o compilador não está configurado corretamente para encontrá-lo. Para resolver esse problema, você pode tentar as seguintes soluções: Instale o Boost no sistema: Você pode tentar instalar o Boost novamente no sistema e garantir que esteja instalado corretamente. Dependendo do seu sistema operacional, você pode usar um gerenciador de pacotes como o apt-get, yum ou brew para instalar o Boost. Verifique a configuração do compilador: Verifique se o compilador está configurado corretamente para encontrar o Boost. Você pode precisar adicionar o caminho do Boost ao caminho de inclusão do compilador. Por exemplo, no Linux, você pode adicionar o caminho "/usr/include/boost" usando a opção "-I" na linha de comando do compilador. Atualize a versão do Boost: O erro também pode ocorrer devido à versão desatualizada do Boost. Verifique se você está usando a versão mais recente do Boost disponível para o seu sistema. Verifique se o cabeçalho está presente: Você também pode verificar se o cabeçalho "boost/unordered_set.hpp" está presente no diretório de inclusão do Boost. Se não estiver presente, pode ser necessário reinstalar o Boost ou atualizar para a versão mais recente.
-
Spell buff que reduz todo dano tomado em 50% durante 2 segundos
<spell name="Spell" words="exura sio" level="50" mana="100" soul="2" cooldown="20" group="healing" premium="no"> <description>Reduces damage taken by 50% for 2 seconds.</description> <targetconditions /> <effect self="1" /> <events /> </spell> function onCastSpell(creature, var) -- Definir a duração e o alcance da habilidade local duration = 2 -- duração da habilidade em segundos local radius = 10 -- raio de alcance da habilidade em células -- Definir o percentual de dano reduzido local damageReduction = 0.5 -- 50% de redução de dano -- Variável para controlar se a habilidade está ativa local spellActive = false -- Reduzir o dano recebido pelo jogador em 50% creature:addDamageReduction(damageReduction) -- Criar animações e efeitos visuais para mostrar que a habilidade está ativa creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) -- Esperar o tempo de duração da habilidade addEvent(function() -- Voltar ao percentual normal de dano recebido creature:addDamageReduction(-damageReduction) -- Remover animações e efeitos visuais da habilidade creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) end, duration * 1000) return true end
-
(Resolvido)Change Name Scroll
É porque estou pelo celular entao unica forma pra ajudar o pessoal do forum é usando ele e outra coisa, nao estou aqui pra competir conhecimento, também você nao tem autoridade em me dizer oque fazer ou nao fazer, estou apenas ajudando... enfim faça o seu e eu faço o meu, vamos evitar transtornos e manter o forum saudavel para todos.
-
(Resolvido)[EXP-FOOD] Com os IDs ai em baixo
function onUse(cid, item, fromPosition, itemEx, toPosition) local foodExp = { [6542] = 5000, [6543] = 10000, [6544] = 15000, [6545] = 20000, [2328] = 25000, [6541] = 30000, [12599] = 40000, [8300] = 50000, } local expGain = foodExp[item.itemid] or 0 -- Pega a quantidade de exp correspondente à comida, ou 0 se não existir if expGain > 0 then doPlayerAddExp(cid, expGain) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SOUND_YELLOW) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string.format("Você comeu %s e recebeu %d de experiência!", Item(item.itemid):getName(), expGain)) -- Adiciona um efeito aleatório estilo Baiak local baiakEffects = {CONST_ME_ENERGYAREA, CONST_ME_FIREAREA, CONST_ME_POISONAREA, CONST_ME_EXPLOSIONAREA} local effect = baiakEffects[math.random(#baiakEffects)] doSendMagicEffect(getCreaturePosition(cid), effect) -- Remove o efeito depois de 3 segundos addEvent(doSendMagicEffect, 3000, getCreaturePosition(cid), CONST_ME_NONE) end return true end
-
Show Off - Mapa DBO Legacy
Tá show! Parabéns
-
(Resolvido)[EXP-FOOD] Com os IDs ai em baixo
Vê se esse te ajuda function onUse(cid, item, fromPosition, itemEx, toPosition) local playerExp = getPlayerExperience(cid) local expGain = 100 -- Quantidade de experiência que o jogador receberá ao usar o XP Food. Você pode ajustar esse valor conforme necessário. doRemoveItem(item.uid, 1) -- Remove o XP Food após o uso. doPlayerAddExperience(cid, expGain) -- Adiciona a experiência ganha pelo jogador. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você recebeu " .. expGain .. " de experiência usando o XP Food.") return true end Esse arquivos não pega pq nao esta o num formato correto, precisa converter as letras deles no notepad++ copie os q funcionam e pega os script dele e joga no outro arquivo NOVO.lua
-
BANK SYSTEM
Para permitir que os jogadores usem o dinheiro em seu banco para comprar itens de NPCs, você precisará modificar o arquivo modules/shop/shop.lua. Vamos supor que você tenha uma tabela player_data que armazena as informações do banco do jogador. Primeiro, você precisará adicionar uma nova função que verifica se o jogador tem dinheiro suficiente no banco para comprar um item. Adicione este código ao final do arquivo shop.lua: function getPlayerBankBalance(cid) local resultId = db.storeQuery("SELECT `balance` FROM `player_data` WHERE `id` = " .. getPlayerGUID(cid)) if resultId == false then return false end local balance = result.getNumber(resultId, "balance") result.free(resultId) return balance end function getPlayerBankBalanceString(cid) local balance = getPlayerBankBalance(cid) if balance == false then return "Not available" else return formatNumber(balance) .. " gold coins" end end function doPlayerWithdrawFromBank(cid, amount) if amount <= 0 then return false end local balance = getPlayerBankBalance(cid) if balance == false or balance < amount then return false end db.query("UPDATE `player_data` SET `balance` = `balance` - " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid)) doPlayerAddMoney(cid, amount) return true end Agora, você precisará modificar a função onBuy para permitir que o jogador compre o item usando o dinheiro do banco. Aqui está o código modificado: function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks) local cost = getItemPrice(item.itemid) * amount if(getPlayerMoney(cid) + getPlayerBalance(cid) < cost) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have enough money.") end if(inBackpacks) then local container = doPlayerAddItem(cid, 2000, 1) if(container == 0) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any container to put the item.") end doAddContainerItem(container, item.itemid, amount) item = container else doPlayerAddItem(cid, item.itemid, amount) end doPlayerRemoveMoney(cid, cost - getPlayerBalance(cid)) doPlayerRemoveBalance(cid, math.min(cost, getPlayerBalance(cid))) doSendAnimatedText(getThingPos(cid), "$-"..cost, TEXTCOLOR_ORANGE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought ".. amount .." ".. getItemNameById(item.itemid) .." for ".. cost .." gold.") return true end Agora que você identificou onde o dinheiro do jogador está sendo verificado, você pode fazer a seguinte modificação: Antes: if getPlayerMoney(cid) < item.price then npcHandler:say('Desculpe, você não tem dinheiro suficiente.', cid) return false end Depois: if getPlayerMoney(cid) + getPlayerBalance(cid) < item.price then npcHandler:say('Desculpe, você não tem dinheiro suficiente.', cid) return false end
-
(Resolvido)Change Name Scroll
O problema do seu script é que ele remove o jogador do jogo antes de atualizar o nome no banco de dados, o que causa o desaparecimento do personagem. Além disso, você precisa especificar o novo nome que o jogador deseja usar. Aqui está uma versão atualizada function onUse(cid, item, frompos, item2, topos) if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then local playerName = getPlayerName(cid) local oldName, guid = getCreatureName(cid), getPlayerGUID(cid) db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. os.time() .. ");") doRemoveItem(item.uid, 1) doRemoveCreature(cid) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your name has been changed successfully!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only use this item inside protection zone!") end end
-
erro comando !comprar tfs 0.3.6
Só com o tempo if(param == "super divine sword") then if getPlayerItemCount(cid, 9971) >= 60 then local bag = doPlayerAddItem(cid, 1997, 1) local new_item = doAddContainerItem(bag, 8980, 1) doItemSetAttribute(new_item, "description", "Este item pode ser adquirido através do shopping. Adquirido dia " .. os.date("%d/%m/%Y - %X") .." por ".. getPlayerName(cid) ..". Serial: ".. getPlayerGUID(cid) ..".") doPlayerRemoveItem(cid, 9971, 60) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você comprou um super divine sword com sucesso.") setPlayerStorageValue(cid, 11548, os.time() + 30) return true else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.") return true end end
-
NPC TROCA X ITENS POR OUTRO ITEM
Espero que tenha ajudado, não testei. --[[ Trading System NPC Script by L3K0T Released at TibiaKing.com - https://tibiaking.com/profile/76262-l3k0t/ --]] local items = { {from = 8976, count = 5}, {from = 8978, count = 5}, {to = 8980, count = 1}, {from = 4863, count = 1}, {to = 4864, count = 1}, {from = 5894, count = 10}, {from = 5898, count = 10}, {to = 5904, count = 1}, } local talkState = {} local function onTrade(cid, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10) local hasMatch = false for i = 1, #items do local from = items[i].from local to = items[i].to local count = items[i].count if from and item1.itemid == from and item1.type == 100 and item1.uid > 65535 and item1.count >= count then if to then doPlayerRemoveItem(cid, from, count) doPlayerAddItem(cid, to, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You traded " .. count .. " " .. getItemNameById(from) .. " for 1 " .. getItemNameById(to) .. ".") hasMatch = true end end end if not hasMatch then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, I don't know what to do with these items.") end talkState[cid] = 0 return true end function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "trade") or msgcontains(msg, "troca") then talkState[cid] = 1 npcHandler:say("What do you want to trade?", cid) end return true end function onThink() npcHandler:onThink() end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSay) npcHandler:setCallback(CALLBACK_ONTRADEREQUEST, onTrade) npcHandler:addModule(FocusModule:new())
-
Bug Exaust Npc
Cadê o script do npc
-
Ajuda auto restart
#!/bin/bash while true; do ./theotxserver > data/logs/output.log 2>&1 & PID=$! echo $PID > theotxserver.pid wait $PID sleep 5 echo "Restarting server..." >> data/logs/output.log done de tbm a ppermissão ao arqhuivo para pular essa mensagem de y/n do tfs e do restart. chmod +x nomedoarquivo.sh
-
[AJUDA] Erro no Script Trap.lua
Correção não testei. function onStepIn(cid, item, pos) if (table.contains(TRAP_OFF, item.itemid) == true) then if (isPlayer(cid) == true) then doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -50, -100, CONST_ME_NONE) doTransformItem(item.uid, item.itemid + 1) end elseif (item.itemid == 2579) then if (isPlayer(cid) ~= true) then doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -15, -30, CONST_ME_NONE) doTransformItem(item.uid, item.itemid - 1) end end return true end function onStepOut(cid, item, pos) doTransformItem(item.uid, item.itemid - 1) return true end function onRemoveItem(item, tile, pos) if (getDistanceBetween(getThingPos(item.uid), pos) > 0) then doTransformItem(item.uid, item.itemid - 1) doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF) end return true end function onAddItem(item, tileitem, pos) doTransformItem(item.uid, item.itemid - 1) doSendMagicEffect(pos, CONST_ME_POFF) return true end Versão mais otimizada function onStepIn(cid, item, pos) if isInArray(TRAP_OFF, item.itemid) then if isPlayer(cid) then doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -50, -100, CONST_ME_NONE) doTransformItem(item.uid, item.itemid + 1) end elseif item.itemid == 2579 then if not isPlayer(cid) then doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -15, -30, CONST_ME_NONE) doTransformItem(item.uid, item.itemid - 1) end end return true end function onStepOut(cid, item, pos) doTransformItem(item.uid, item.itemid - 1) return true end function onRemoveItem(item, tile, pos) if getDistanceBetween(getThingPos(item.uid), pos) > 0 then doTransformItem(item.uid, item.itemid - 1) doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF) end return true end function onAddItem(item, tileitem, pos) doTransformItem(item.uid, item.itemid - 1) doSendMagicEffect(pos, CONST_ME_POFF) return true end
-
Bug Npc Trade Potion enough capacity
Cadê o npc É proibido dar up pelo comentário, isso pode gerar advertência, use sempre o botão "UP" se vc for o dono do tópico.
- Base PokeWish + Pokelight
-
(Resolvido)[EXP-FOOD] Com os IDs ai em baixo
Já está na versão 0.4 function onUse(cid, item, fromPosition, itemEx, toPosition) local foodExp = { [6542] = 5000, [6543] = 10000, [6544] = 15000, [6545] = 20000, [2328] = 25000, [6541] = 30000, [12599] = 40000, [8300] = 50000, } local expGain = foodExp[item.itemid] or 0 -- Pega a quantidade de exp correspondente à comida, ou 0 se não existir if expGain > 0 then doPlayerAddExp(cid, expGain) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SOUND_YELLOW) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string.format("Você comeu %s e recebeu %d de experiência!", getItemName(item.itemid), expGain)) -- Adiciona um efeito aleatório estilo Baiak local baiakEffects = {CONST_ME_ENERGYAREA, CONST_ME_FIREAREA, CONST_ME_POISONAREA, CONST_ME_EXPLOSIONAREA} local effect = baiakEffects[math.random(#baiakEffects)] doSendMagicEffect(getCreaturePosition(cid), effect) -- Remove o efeito depois de 3 segundos addEvent(doSendMagicEffect, 3000, getCreaturePosition(cid), CONST_ME_NONE) end return true end ADM não ganha exp '-' testa em personagens de players.