Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 07/29/23 em todas áreas

  1. Erro em minhas Quests TFS 1.3

    SkyZy reagiu a Mateus Robeerto por uma resposta no tópico

    1 ponto
    local config = { [2005] = { name = "arcane staff", rewards = {{id = 2453, count = 1},}, storage = {active = true, key = 2001,}, effectWin = 31,}, [2006] = { name = "the avenger", rewards = {{id = 6528, count = 1},}, storage = {active = true, key = 2001,}, effectWin = 30,}, [2007] = { name = "arbalest", rewards = {{id = 5803, count = 1},}, storage = {active = true, key = 2001,}, effectWin = 29,}, [2008] = { name = "backpack of holding", rewards = {{id = 2365, count = 1},}, storage = {active = true, key = 2002,}, effectWin = 30,}, [2009] = { name = "infernal bolts", rewards = {{id = 6529, count = 100},}, storage = {active = true, key = 2003,}, effectWin = 30,}, [2010] = { name = "stuffed dragon", rewards = {{id = 5791, count = 1},}, storage = {active = true, key = 2004,}, effectWin = 29,}, [2011] = { name = "frozen starlight", rewards = {{id = 2361, count = 1},}, storage = {active = true, key = 2005,}, effectWin = 31,}, [2012] = { name = "pair of soft boots", rewards = {{id = 6132, count = 1},}, storage = {active = true, key = 2006,}, effectWin = 31,}, messageWin = {win = "You have found a %s.",}, messageDone = {done = "It is empty.",}, } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local choose = config[item.uid] if not choose then print("Error: Invalid item UID or missing configuration.") return false end if choose.storage.active and player:getStorageValue(choose.storage.key) >= 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, config.messageDone.done) return true end for i = 1, #choose.rewards do player:addItem(choose.rewards[i].id, choose.rewards[i].count) player:setStorageValue(choose.storage.key, 1) player:sendTextMessage(MESSAGE_INFO_DESCR, config.messageWin.win:format(choose.name)) player:getPosition():sendMagicEffect(choose.effectWin) end return true end
  2. Bug no NPC Halvar (Arena Svargrond)

    specail reagiu a L3K0T por uma resposta no tópico

    1 ponto
    -- 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())
  3. Bug no NPC Halvar (Arena Svargrond)

    specail reagiu a L3K0T por uma resposta no tópico

    1 ponto
    -- 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())
  4. [TFS 1.2] Teleport tile por level

    jeisonribas reagiu a lango rullez por uma resposta no tópico

    1 ponto
    Bom como via muita gente "nem tanta" com dúvidas, problemas etc.. Resolvi criar esse tópico para acabar com os seus problemas ! ---------------------------------------------------------------------------------------//----------------------------------------------------------------------------------------------- Bom então vamos lá ! ------------------------------------//-------------------------------------- Pasta do seu servidor --> Data --> movements --> scripts Agora crie um arquivo .lua Renomeie com o nome de sua preferencia ! Ps: Tem que ser obrigatoriamente .LUA Bom no meu caso coloquei "TileLevel" E então cole este script dentro: ------------------------------------------------------------------------------//------------------------------------------------------------------------------------------- {´~.~´} Legenda Vermelho: Level do player que irá poder passar no Teleport/tiler Dourado: Posição de onde desejar colocar Teleport/tiler -------------------------------------------------------------------------------------------//----------------------------------------------------------------------------------------------- Agora salve o arquivo! -----------------------------------------------------------------//----------------------------------------------------------------------- Agora vamos para Segunda Parte ! Me acompanhe ! ---------------------------------------------------------------------------------------------------//--------------------------------------------------------------------------------------------------- Vamos em: Pasta do seu servidor --> Data --> Movements.xml Agora adicione o seguinte código/tag: {´~.~´} Legenda Roxo: É o nome do arquivo.lua que você criou na pasta Scripts Azul: É o level do player, tem que estar igual no script acima. Obs: Caso queria colocar level 100 é só mudar parte 250 para 100 isso vale mesma coisa na "PS" que acabei de explica embaixo \/ -----------------------------------//------------------------------------------ Ps:No Remeres Editor coloque no tile o actionID: 1250 ou level da sua preferencia. Quer level 100? então no tile coloque "1100" Bom espero que ajudem a todos ! Créditos @vankk pelo script, que ele postou individualmente em um tópico, sem muitos detalhes. A TAG E AS DEMAIS COISAS FEITO POR MIM !
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo