Postado Fevereiro 15, 2020 5 anos Em 12/12/2018 em 15:27, Lyu disse: Boa tarde, só com adaptação, pois 0.4 são vários estados LUA. Teria como adaptar para TFS 0.4?
Postado Junho 6, 2023 1 ano alguem conseguiu pra tfs 0.4? corrija: Enfim, vi que ia ser difícil alguém disponibilizar, já que já faz muito tempo que estão querendo... conseguir editar uma base que encontrei. Boa utilização! <talkaction words="/cast;!cast" event="script" value="cast.lua"/> function onSay(cid, words, param, channel) local tmp = param:explode(" ") if not tmp[1] then return doShowTextDialog(cid, 6579, "[Parâmetros necessários]\n[Parameters needed]\n\n----------------\n [Cast System Parameters]:\n\n!cast on\n!cast off\n!cast pass\n!cast ban\n!cast unban\n!cast bans\n!cast mute\n!cast unmute\n!cast mutes\n!cast viewers\n!cast status\n!cast update") end local castActivated = getPlayerStorageValue(cid, 5521) -- Verifica se o cast já foi ativado local passwordSet = getPlayerStorageValue(cid, 5522) -- Verifica se a senha já foi definida if tmp[1] == "on" then if castActivated == 1 then -- Mensagem de cast já ativado doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O cast já está ativado. The cast is already activated.") else -- Inicia a transmissão doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "A transmissão foi iniciada. Cast has started.") doPlayerSetCastState(cid, true) doPlayerSave(cid) local rates = getPlayerRates(cid) doPlayerSetRate(cid, SKILL__LEVEL, getExperienceStage(cid, rates[SKILL__LEVEL]) + 0.5) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você habilitou o seu cast e está obtendo +5% de experiência em monstros. You have enabled your cast stream and are getting +5% monsters experience.") setPlayerStorageValue(cid, 5521, 1) -- Define a storage value como 1 para indicar que o cast foi ativado end elseif getPlayerCast(cid).status == false then return doPlayerSendCancel(cid, "Your cast has to be running for this action.") elseif tmp[1] == "off" then -- Verifica se o jogador está na zona de proteção if hasCondition(cid, CONDITION_INFIGHT) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Você não pode usar esse comando quando estiver em uma batalha. You cannot use this command when in battle.") end -- Encerra a transmissão doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast has ended.") doPlayerSetCastState(cid, false) doPlayerSave(cid) setPlayerStorageValue(cid, 5521, -1) -- Define a storage value como 0 para indicar que o cast foi desativado addEvent(doRemoveCreature, 1, cid) elseif isInArray({"pass", "password", "p"}, tmp[1]) then local rates = getPlayerRates(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou uma senha ao seu cast. Utilize-o sem senha para ganhar um bônus de +5% de experiência ao derrotar monstros.") if passwordSet == 1 then return doShowTextDialog(cid, 6579, "Você já definiu uma senha:\n" .. tmp[2].. "\n\nYou have already set a password:\n" .. tmp[2]) end if not tmp[2] then return doShowTextDialog(cid, 6579, "Você precisa definir uma senha, exemplo: !cast password warzone23\n\nYou need to set a password,\nexample: !cast password warzone23") end local password = table.concat(tmp, " ", 2) getPlayerCast(cid, password) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Senha definida com sucesso. Password set successfully: " .. tmp[2]) doPlayerSetRate(cid, SKILL__LEVEL, getExperienceStage(cid, rates[SKILL__LEVEL]) - 0.1) setPlayerStorageValue(cid, 5522, 1) -- Define a storage value como 1 para indicar que a senha foi definida elseif isInArray({"desc", "description", "d"}, tmp[1]) then local d = param:gsub(tmp[1]..(tmp[2] and " " or ""), "") if not d or d:len() == 0 then return doPlayerSendCancel(cid, "You need to specify a description.") end if d:len() > 50 then return doPlayerSendCancel(cid, "The description is too long. (Max.: 50 letters)") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast description was set to: ") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, d) doPlayerSetCastDescription(cid, d) elseif tmp[1] == "ban" then if not tmp[2] then return doPlayerSendCancel(cid, "Specify a spectator that you want to ban.") end if doPlayerAddCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been banned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be banned.") end elseif tmp[1] == "unban" then if not tmp[2] then return doPlayerSendCancel(cid, "Specify the person you want to unban.") end if doPlayerRemoveCastBan(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unbanned.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unbanned.") end elseif param == "bans" then local t = getCastBans(cid) local text = "Cast Bans:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No bans." end doShowTextDialog(cid, 5958, text) elseif tmp[1] == "mute" then if not tmp[2] then return doPlayerSendCancel(cid, "Specify a spectator that you want to mute.") end if doPlayerAddCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been muted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be muted.") end elseif tmp[1] == "unmute" then if not tmp[2] then return doPlayerSendCancel(cid, "Specify the person you want to unmute.") end if doPlayerRemoveCastMute(cid, tmp[2]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unmuted.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unmuted.") end elseif param == "mutes" then local t = getCastMutes(cid) local text = "Cast Mutes:\n\n" for k, v in pairs(t) do text = text .. "*" .. v.name .. "\n" end if text == "Cast Bans:\n\n" then text = text .. "No mutes." end doShowTextDialog(cid, 5958, text) elseif param == "viewers" then local t = getCastViewers(cid) local text, count = "Cast Viewers:\n#Viewers: |COUNT|\n\n", 0 for _, v in pairs(t) do count = count + 1 text = text .. "*" .. v.name .."\n" end if text == "Cast Viewers:\n#Viewers: |COUNT|\n\n" then text = "Cast Viewers:\n\nNo viewers." end text = text:gsub("|COUNT|", count) doShowTextDialog(cid, 5958, text) elseif param == "status" then local t, c = getCastViewers(cid), getPlayerCast(cid) local count = 0 for _, v in pairs(t) do count = count + 1 end doShowTextDialog(cid, 5958, "Cast Status:\n\n*Viewers:\n " .. count .. "\n*Description:\n "..(c.description == "" and "Not set" or c.description).."\n*Password:\n " .. (c.password == "" and "Not set" or "Set - '"..c.password.."'")) elseif param == "update" then if getPlayerStorageValue(cid, 656544) > os.time() then return doPlayerSendCancel(cid, "You used this command lately. Wait: " .. (getPlayerStorageValue(cid, 656544)-os.time()) .. " sec.") end doPlayerSave(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The cast settings have been updated.") doPlayerSetStorageValue(cid, 656544, os.time()+60) end return true end data\creaturescripts\scripts\login.lua adicione em algum lugar as storage pra ser removida ao entrar no servidor, ou ao deslogar com o cast aberto: doPlayerSetStorageValue(cid, 5521, -1) -- Define a storage value como -1 para indicar que o cast foi desativado doPlayerSetStorageValue(cid, 5522, -1) -- Define a storage value como -1 para indicar que a senha do cast ja foi alterada
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.