Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Hello,
remaker script for tfs 1.x.

 

talkactions.xml

	<talkaction words="!ownbp" script="ownbp.lua"/>

ownbp.lua

local config = {
	cost = 1000, -- Cost (GP)
	ownTime = 24 * 60 * 60 * 1000, -- Time (24 horas)
	backpackId = 2000
}

function onSay(player, words, param)
    local playerID = player:getGuid()
    local owner = (playerID + 100)
    local ownerName = player:getName()
    local function noOwner(o)
        o:removeAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
        o:setActionId(0)
    end
    if (player:removeMoney(config.cost) == true) then
        local backpack = doPlayerAddItem(player:getId(), config.backpackId, 1)
        if (backpack ~= nil) then
            doSetItemSpecialDescription(backpack, ownerName..' owns this container.')
            doSetItemActionId(backpack, owner)
            addEvent(noOwner, 1000 * config.ownTime, backpack)
        end
    else
        doPlayerSendCancel(cid, "You do not have the amount of GP ("..config.cost..").")
    end
end

 

 

actions.xml

	<action itemid="2000" script="ownbp.lua"/>
ownbp.lua
	function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
	    local playerID = cid:getGuid() -- getPlayerGUID(cid)
	    local owner = (item.actionid - 100)
	    if (owner > 0) then
	        if (owner ~= playerID) then
	            doPlayerSendCancel(cid, "You aren\'t owner of this container.")
	            return TRUE
	        end
	    end
	end

 
Editado por HeberPcL
Ajustes post (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 2 weeks later...

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por amoxicilina
      Olá Kings, venho aqui trazer uma TalkAction pra você comprar premium account, sei que pode ser algo meio inútil por existir a store.
      Então vamos script:
       
       
    • Por Erimyth
      Fala galerinha eu estava e um amigo meu me pediu um script de health e mana por talkaction por MSN, fiz ele e resolvi postar-lo aqui no TK para a galera usar-lo.

      Vá em data > talkactions > talkactions.xml e adicione a seguinte tag:

      <talkaction words="!buyhealth;!buymana" event="script" value="buylife.lua">
      Agora vá até a pasta scripts dentro de talkactions, crie um arquivo chamado buylife.lua com isto dentro:
      -- [( Script created by Matheus for TibiaKing.com )] -- function onSay(cid, words, param) local health = 1000 -- Vida que será adicionada ao player após ele usar o comando! local mana = 1000 -- Mana que será adicionada ao player após ele usar o comando! local cost = 10000 -- Preço para você comprar mana ou health! if (words == "!buymana") then if (doPlayerRemoveMoney(cid, cost) == TRUE) then doCreatureAddMana(cid, mana) doSendMagicEffect(getCreaturePosition(cid), 12) else doPlayerSendCancel(cid, "Sorry, you need "..cost.." gold coins to buy mana.") return TRUE end elseif (words == "!buyhealth") then if (doPlayerRemoveMoney(cid, cost) == TRUE) then doCreatureAddHealth(cid, health) doSendMagicEffect(getCreaturePosition(cid), 12) else doPlayerSendCancel(cid, "Sorry, you need "..cost.." gold coins to buy mana.") end return TRUE end end
      Prontinho, espero que gostem, é um script bem simples mas pode ser útil para alguns.  
        Você gostou deste conteúdo!? Este conteúdo te ajudou!? Isso será realmente útil pra você!? Então, se possível, faça uma doação (de qualquer valor) que estará me ajudando também!  
    • Por Sarah Wesker
      >> Only TFS 1.X+ <<
      Oi tudo bem, espero que bem.
      Hoje, apenas começando o ano novo, quero dar-lhe um Firestorm event que eu criei com muito amor para você.
      Atualmente, há muitos eventos semelhantes, mas espero que você dê uma chance ao meu Firestorm event.
       
      Em seguida, vou explicar rapidamente como usar o Firestorm event.
      (( Passo 1 ))
      Crie um novo arquivo.lua na pasta: ( data/lib/ ) com o nome ( fire_storm.lua )
      Copie e cole o código no arquivo fire_storm.lua
      --[[ * Fire Storm Event * Evento creado por Sarah Wesker Dia 31 de Diciembre del 2018 a las 12:30 a.m. Version compatible con TFS 1.x+ ]]-- local DEBUG_ON = true local RELOAD_LIB_ON = true local SHOW_COPYRIGHT = true if RELOAD_LIB_ON or not FSE then if not FSE then print([[>>> The Firestorm Event lib loading...]]) end ---@Fire Storm Event FSE = {} ---@Room Properties FSE.room = {} FSE.room.from = Position(3095, 1847, 8) FSE.room.rangeX = 33 FSE.room.rangeY = 31 ---@Temple Position FSE.getTemplePosition = Position(3191, 1809, 7) ---@Attack Properties FSE.attackSignalEffect = CONST_ME_HITBYFIRE FSE.attackEffect = CONST_ME_FIREAREA FSE.attackDistEffect = CONST_ANI_FIRE ---@Player Counts FSE.players = {} FSE.players.min = 2 FSE.players.max = 30 FSE.players.win = 1 -- always less than FSE.players.min ---@Timers in seconds FSE.timer = {} FSE.timer.removeTp = 20 FSE.timer.checking = 2 FSE.timer.signal = {} FSE.timer.signal.min = 0.1 FSE.timer.signal.max = 0.5 FSE.timer.events = {} ---@Game Dificulty FSE.dificulty = {} FSE.dificulty.attacks = 30 FSE.dificulty.increment = 1 FSE.dificulty.D_attacks = FSE.dificulty.attacks FSE.dificulty.D_increment = FSE.dificulty.increment ---@Teleport Properties FSE.teleport = {} FSE.teleport.itemid = 1387 FSE.teleport.position = Position(3187, 1816, 7) FSE.teleport.destination = Position(3111, 1863, 8) FSE.teleport.actionid = 64500 -- movement script aid FSE.status = [[Stoped]] FSE.rewardContainerName = [[Firestorm Reward]] FSE.rewardContainerID = 2596 FSE.rewards = { -- { id = xxxx, count = 1 to 100 } { id = 2160, count = 100 }, { id = 2160, count = 100 } } function FSE:removeTp(seconds) local teleport = FSE.teleport.position:getTile():getItemById(FSE.teleport.itemid) if teleport then teleport:remove() FSE.teleport.position:sendMagicEffect(CONST_ME_POFF) end FSE:CheckControl() end function FSE:Init() if FSE.status == [[Stoped]] then FSE.status = [[Waiting]] local teleport = Game.createItem(FSE.teleport.itemid, 1, FSE.teleport.position) if not teleport then FSE:Stoped() return DEBUG_ON and print([[The Firestorm Event teleport could not be created.]]) else teleport:setActionId(FSE.teleport.actionid) end addEvent(FSE.removeTp, FSE.timer.removeTp * 1000) Game.broadcastMessage(string.format([[The Firestorm Event has been activated, waiting for participants, You have %s to enter.]], getStringTimeEnglish(FSE.timer.removeTp))) else return DEBUG_ON and print([[The Firestorm Event is trying to start, but an active instance already exists.]]) end end function FSE:Stoped(players, causeMessage, forceStoped) FSE.status = [[Stoped]] for index, eventID in pairs(FSE.timer.events) do stopEvent(eventID) end FSE.timer.events = {} for index, player in pairs(players) do player:teleportTo(FSE.getTemplePosition, false) end FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) if forceStoped then Game.broadcastMessage([[The Firestorm Event was forced to close.]]) elseif causeMessage then Game.broadcastMessage(causeMessage) end FSE.dificulty.attacks = FSE.dificulty.D_attacks FSE.dificulty.increment = FSE.dificulty.D_increment return true end function FSE:Started(startMessage) FSE.status = [[Started]] if startMessage then Game.broadcastMessage(startMessage) end FSE:CheckControl() end function FSE:AddEvent(eventID) table.insert(FSE.timer.events, eventID) return eventID end local function getWinNames(players) local names = [[]] for index, player in pairs(players) do names = string.format([[%s%s%s]], names, player:getName(), next(players, index) == nil and '.' or [[, ]]) end return names end function FSE:CheckControl() if FSE.status == [[Stoped]] then -- Break Control elseif FSE.status == [[Waiting]] then local players = FSE:GetPlayers() if #players < FSE.players.min then FSE:Stoped(players, [[The Firestorm Event could not be started because there are not enough participants.]]) else FSE:Started() end elseif FSE.status == [[Started]] then local players = FSE:GetPlayers() if #players <= FSE.players.win then if #players == 0 then FSE:Stoped(players, [[The Firestorm Event has ended.]]) else FSE:Stoped(players, string.format([[The Firestorm Event has ended, the winners are: %s]], getWinNames(players))) FSE:SendRewardToPlayers(players) end FSE:AllRightReserve() -- only credits you can remove if want. else for index = 1, FSE.dificulty.attacks do addEvent(FSE.AttackSignal, math.random(FSE.timer.signal.min * 1000, FSE.timer.signal.max * 1000)) end FSE.dificulty.attacks = FSE.dificulty.attacks + FSE.dificulty.increment FSE:AddEvent(addEvent(FSE.CheckControl, FSE.timer.checking * 1000)) end end end function FSE:GetPlayers() local spectators = Game.getSpectators(FSE.room.from, false, true, 1, FSE.room.rangeX, 1, FSE.room.rangeY) local players = {} if spectators and #spectators > 0 then for index, player in pairs(spectators) do if not player:getGroup():getAccess() then players[#players + 1] = player end end end return players end local function getRewardNames(items) local names = [[]] for index, item in pairs(items) do local it = ItemType(item.id) names = string.format([[%s%u %s%s]], names, item.count, it:getName(), next(items, index) == nil and '.' or [[, ]]) end return names end function FSE:SendRewardToPlayers(players) for index, player in pairs(players) do local depotChest = player:getDepotChest(0, true) if depotChest then local rewardContainer = Game.createItem(FSE.rewardContainerID, 1) if rewardContainer then rewardContainer:setName(FSE.rewardContainerName) local rewardNames = getRewardNames(FSE.rewards) for index2, item in pairs(FSE.rewards) do rewardContainer:addItem(item.id, item.count) end if depotChest:addItemEx(rewardContainer, INDEX_WHEREEVER, FLAG_NOLIMIT) then player:sendTextMessage(MESSAGE_INFO_DESCR, string.format([[You have received on your depot chest: %s]], rewardNames)) end end end end end function FSE:GetRandomTile() local foundTile = Tile(FSE.room.from + Position(math.random(0, FSE.room.rangeX), math.random(0, FSE.room.rangeY), 0)) while not foundTile or not foundTile:getGround() or foundTile:hasProperty(CONST_PROP_BLOCKSOLID) do foundTile = Tile(FSE.room.from + Position(math.random(0, FSE.room.rangeX), math.random(0, FSE.room.rangeY), 0)) end return foundTile end function FSE:AttackSignal() local foundTile = FSE:GetRandomTile() if not foundTile then return DEBUG_ON and print([[Not tile could be found in the Firestorm Event area.]]) end local position = foundTile:getPosition() position:sendMagicEffect(FSE.attackSignalEffect) return addEvent(FSE.AttackTile, 500, self, { x = position.x, y = position.y, z = position.z }) end function FSE:AttackTile(tpos) local position = Position(tpos) local creatures = position:getTile():getCreatures() local fromposdist = (position-Position(5, 5, 0)) fromposdist:sendDistanceEffect(position, FSE.attackDistEffect) position:sendMagicEffect(FSE.attackEffect) if creatures and #creatures > 0 then for index, creature in pairs(creatures) do local player = creature:getPlayer() if player and not player:getGroup():getAccess() then position:sendMagicEffect(CONST_ME_POFF) player:teleportTo(FSE.getTemplePosition, false) FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) Game.broadcastMessage(string.format([[The player %s has been eliminated from the Firestorm Event.]], player:getName())) end end end end function FSE:AllRightReserve() return SHOW_COPYRIGHT and print([[The Firestorm Event has ended, all rights reserved for Sarah Wesker.]]) end if type(FSE) == [[table]] then print([[>>> The Firestorm Event lib has successfully loaded.]]) end end (( Passo 2 ))
      Abra o arquivo ( data/lib/lib.lua ) e adicione esta linha:
      dofile('data/lib/fire_storm.lua')  (( Passo 3 ))
      Abra o arquivo ( data/movements/movements.xml ) e adicione esta linha:
      <movevent event="StepIn" actionid="64500" script="fire_storm.lua" /> (( Passo 4 ))
      Vá para a pasta ( data/movements/scripts ) e crie um novo arquivo.lua ( fire_storm.lua )
      Copie e cole o seguinte código nesse novo arquivo.lua
      function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player then if #FSE:GetPlayers() >= FSE.players.max then player:teleportTo(FSE.getTemplePosition, false) FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) else player:teleportTo(FSE.teleport.destination, false) FSE.teleport.destination:sendMagicEffect(CONST_ME_TELEPORT) if not player:getGroup():getAccess() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, [[Welcome to the Firestorm Event, you have to survive the rain of fire to win.]]) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, [[Welcome, administrators can only participate as spectators.]]) end end else creature:teleportTo(fromPosition, false) end return true end (( Passo 5 ))
      Faça o evento começar em um determinado horário!
      Você abre o arquivo ( data/globalevents/globalevents.xml ) e adicione esta linha:
      <globalevent name="Firestorm Event" time="12:00:00" script="fire_strom.lua" /> (( Passo 6 ))
      Crie um novo arquivo.lua dentro da pasta ( data/globalevents/scripts/ ) -> ( fire_storm.lua )
      e adicione este código dentro desse arquivo:
      function onTime(interval) FSE:Init() return true end (( The End ))
      Aproveite
       
      (( Others ))
      FSE:Init() | Para iniciar o evento.
      FSE:Stoped() | Para parar o evento.
       
      (( REF IMAGES ))
      | https://prnt.sc/m2a6ov |
      | https://prnt.sc/m2a6gf |
      | https://prnt.sc/m2a7t5 |
       
    • Por Danihcv
      Bom galera, faz tempo que não posto um tutorial, então resolvi trazer esse, que apesar de ser simples tem utilidade pra algumas pessoas.
       
      Esse é um sistema que eu criei pra fazer com que o god possa alterar a visão dele pra como se fosse sempre dia ou pra visão de players normais.

      1°)Como funciona:
          Quando o GOD entrar no server, ele já vai estar com a visão de "sempre dia". Se ele quiser ver que nem os players normais, basta falar /light. Se ele quiser voltar a ver "sempre dia" basta falar novamente /light
       
      2°)Instalando o sistema:
       
         Primeiramente vá em data\creaturescripts e adicione essa tag ao arquivo creaturescripts.xml:
      <event type="login" name="GodLight" event="script" value="godLight.lua"/>    Agora va em data\creaturescripts\scripts abra o arquivo login.lua e adicione isso antes do ultimo return true:
      registerCreatureEvent(cid, "GodLight")    Agora ainda na pasta data\creaturescripts\scripts crie um arquivo chamado godLight.lua e coloque isso dentro:



       
       
         Agora va na pasta data\talkactions e adicione essa tag ao arquivo talkactions.xml:
      <talkaction words="/light" event="script" access="5" value="godLight.lua"/>    Agora va na pasta data\talkactions\scripts e crie um arquivo chamado godLight.lua e coloque isso dentro:



       
      Pronto! Seu sistema está instalado.
       
      Se vc quiser que qualquer pessoa possa usar esse sistema, basta fazer o seguinte:



       
      E ao invés de colocar a tag (que está aí em cima) em talkactions.xml, coloque essa:
      <talkaction words="/light" event="script" value="godLight.lua"/>
       
       
      E isso é tudo, pessoal!
      Um sistema simples mas que pra alguns tem bastante utilidade. Em breve trarei novos tutoriais! Se tiverem alguma sugestão, podem mandar por pm.
    • Por CaduGTX
      Olá, eu e um amigo fizemos esse script para limpar as casas automaticamente, era um script pessoal mas resolvi postar.
      O Script foi feito em revscript, se for usar da forma antiga, terá que adaptar.

      Basta adicionar um arquivo lua na sua pasta de talkactions:
       
      local function doCheckHouses() local registros = db.storeQuery( "SELECT `houses`.`owner`, `houses`.`id` FROM `houses`,`players` WHERE `houses`.`owner` != 0 AND `houses`.`owner` = `players`.`id`;") if registros ~= false then local count = 0 repeat count = count + 1 local owner = result.getNumber(registros, "owner") local houseId = result.getNumber(registros, "id") local house = House(houseId) if house and (owner > 0) then print(house:getName()) house:setOwnerGuid(0) end until not result.next(registros) result.free(registros) end print('Houses Cleaned') return true end local limparhouse = TalkAction("/limparhouse") function limparhouse.onSay(player, words, param) if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then player:sendCancelMessage("Only admins can use this command.") return true end addEvent(doCheckHouses, 10 * 1000) player:sendCancelMessage("Cleaning houses.") return true end limparhouse:separator(" ") limparhouse:register()  
      Para usar é bem simples, basta usar o comando /limparhouse, e dentro de alguns instantes todas as casas serão limpas.

      Creditos:
      -CaduGTX
      -JameesDavid
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo