Ir para conteúdo
  • Cadastre-se

Posts Recomendados

  Em 01/06/2016 em 14:39, Yamborghini disse:

Galera do TibiaKing, esse sistema não é de autoria minha. Só estou trazendo esse sistema de outro Fórum.

Acho que vai ajudar muito aos OT-ADMIN de poketibia, então Rep+ ai

 

Olá! O sistema funciona com Poketibia e Tibia! Vamos deixar de enrolação e adicionar o sistema!

Lembrando também que funciona com tfs 0.3.6 e tfs 0.4! Não testei com tfs 1.x mas acho que não funciona.

 

Vá em creaturescripts.xml e adicione isso:

<event type="kill" name="KillTask" event="script" value="task.lua"/>

No login.lua adiciona isso com os demais:

 

registerCreatureEvent(cid, "KillTask")

Agora crie um arquivo chamado task.lua e adicione isso:

 

local tasksss = {
   [1] = {name = "Blastoise",  sto = 10212, count = 3, time_sto = 5457, time = 1*24*60*60, sto_count = 14129, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
   [2] = {name = "Charizard",  sto = 10213, count = 5, time_sto = 5458, time = 1*24*60*60, sto_count = 14130, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
}

function onKill(cid, target)
        for _, t in ipairs(tasksss) do
            local total_count = t.count
            local m_sto = t.sto
            local count_sto = t.sto_count
            if getPlayerStorageValue(cid, m_sto) ~= -1 then
                if getCreatureName(target) == t.name then
                	if (total_count - getPlayerStorageValue(cid, count_sto)) == 1 then
                		setPlayerStorageValue(cid, count_sto, getPlayerStorageValue(cid, count_sto) + 1)
                    	doPlayerSendTextMessage(cid, 20, "You are killed ".. getPlayerStorageValue(cid, count_sto) .." " .. t.name .. " and finished the task!")
                    	return true
                    elseif (total_count - getPlayerStorageValue(cid, count_sto)) >= 1 then
                        setPlayerStorageValue(cid, count_sto, getPlayerStorageValue(cid, count_sto) + 1)
                        doPlayerSendTextMessage(cid, 20, "You are killed ".. getPlayerStorageValue(cid, count_sto) .." of ".. total_count .." " .. t.name .. " kills to finish the task.")
                        return true
                    end
                end
            end
        end
    return true
end

Agora vá em npc/scripts e crie um arquivo chamado task.lua e adicione isso:

 

local tasksss = {
   [1] = {name = "Blastoise",  sto = 10212, count = 3, time_sto = 5457, time = 1*24*60*60, sto_count = 14129, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
   [2] = {name = "Charizard",  sto = 10213, count = 5, time_sto = 5458, time = 1*24*60*60, sto_count = 14130, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
}

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
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    value = -1
    for i = 1, #tasksss do
        if msgcontains(msg, tasksss[i].name) and not value ~= -1 then
            value = i
        end
    end
    if value == -1 then
        selfSay('I don\'t have a this task!', cid)
        talkState[talkUser] = 0
        return true
    end
    local configss = tasksss[value]
    local name = configss.name
    local m_sto = configss.sto
    local time_sto = configss.time_sto
    local count_sto = configss.sto_count
    local total_count = configss.count
    local rest = total_count - getPlayerStorageValue(cid, count_sto)
        if getPlayerStorageValue(cid, time_sto) < os.time() then -- verifica se o player ainda está no prazo
            if getPlayerStorageValue(cid, m_sto) <= 0 then -- verifica se o player não pegou está task
                selfSay('Ready! Now you need kill a '.. total_count .. ' '.. name .. '!', cid)
                setPlayerStorageValue(cid, m_sto, 1)
                setPlayerStorageValue(cid, total_count, 0)
                talkState[talkUser] = 0               
            else
                if rest <= 0 then -- Verifica se o player matou todos os monstros nescessários
                    doPlayerAddItem(cid, configss.rewardid, configss.rewardcount)
                    setPlayerStorageValue(cid, count_sto, 0) 
                    setPlayerStorageValue(cid, m_sto, -1) 
                    setPlayerStorageValue(cid, time_sto, os.time() + configss.time)
                    doPlayerAddExperience(cid, configss.rewardexp)
                    doSendAnimatedText(getCreaturePosition(cid), configss.rewardexp, 215)
                    selfSay(configss.text, cid) 
                    talkState[talkUser] = 0
                else
                    selfSay('You need to kill '..rest..' '..name..' to gain a reward.', cid)
                    talkState[talkUser] = 0
                end
            end
        else
            selfSay('You already did this task, player. Wait '..math.ceil((getPlayerStorageValue(cid, time_sto) - os.time())/(60*60))..' hours to do it again.', cid)
            talkState[talkUser] = 0
        end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Pronto, agora volte para a pasta npc e crie um novo arquivo .xml chamado de Task e adicione isso lá:

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Npc Nome" script="task.lua" walkinterval="350000" floorchange="0" speed="0">
	<health now="150" max="150"/>
	<look type="369" head="91" body="102" legs="83" feet="0"/>
	<parameters>
			<parameter key="message_greet" value="You want gain a task of {Blastoise}?"/>
	</parameters>
</npc>

Pronto, agora o sistema de task está funcionando, e para adicionar um novo monstro pra fazer a task? Basta editar a tabela, mas não esqueça que tem que atualizar a tabela nos 2 scripts .lua !!

 

local tasksss = {
   [1] = {name = "Blastoise",  sto = 10212, count = 3, time_sto = 5457, time = 1*24*60*60, sto_count = 14129, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
   [2] = {name = "Charizard",  sto = 10213, count = 5, time_sto = 5458, time = 1*24*60*60, sto_count = 14130, money = 100, rewardid = 7621, rewardcount = 100, rewardexp = 10000,  text = "Congratulations! You finished this task. In 24h, you will be able to do it again."},
}

Para configurar siga as seguintes instruções:

  Mostrar conteúdo oculto

 

Créditos pelo Sistema: 

Criador: @miguel223

Drazyn1291 -- Editou e reformulou muita coisa!

 

Expand   Mostrar mais  

[16/01/2020 14:04:38] [Error - LuaScriptInterface::loadFile] data/npc/scripts/task.lua:1: unexpected symbol near 'ï'
[16/01/2020 14:04:38] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/task.lua
[16/01/2020 14:04:38] data/npc/scripts/task.lua:1: unexpected symbol near 'ï'

 

 

5a510dabc5375_20228663_336082076822153_8453189641140183581_n-Cpia-Cpia.jpg.ae93894455bf828fc6901b29d7395cd9.jpg

https://www.facebook.com/groups/659018184245665/

5a510e4f9a582_20228663_336082076822153_8453189641140183581_n-Cpia-Cpia.jpg.fa86c37be79982f1cc8ff619015ddd1b.jpg

https://www.facebook.com/profile.php?id=133706320308745

 

Link para o post
Compartilhar em outros sites
  • 7 months later...
  • Respostas 6
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Galera do TibiaKing, esse sistema não é de autoria minha. Só estou trazendo esse sistema de outro Fórum. Acho que vai ajudar muito aos OT-ADMIN de poketibia, então Rep+ ai   Olá! O sistema funciona com Poketibia e Tibia! Vamos deixar de enrolação e adicionar o sistema! Lembrando também que funciona com tfs 0.3.6 e tfs 0.4! Não testei com tfs 1.x mas acho que não funciona.   Vá em creaturescripts.xml e adicione isso: <event type="kill" name="Kill

Deixei explícito que peguei de outro fórum!

Muito bom, uma dúvida

Se eu quisesse fazer com que mais de um monstro contabilizasse a task, como eu faria isso?

Tipo gostaria de uma task mas queria incluir vários monstros de um só tipo, ai o player poderia matar qualquer um deles e iria contar junto a task

Link para o post
Compartilhar em outros sites

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 danielzin021
      alguém sabe como implementa isso no serv e se tem como?
    • Por Maniaco
      Salve TibiaKing!!! TFS 0.4 . 8.60
       
      Estou implementando o Sistema do @WooX de Cave Exlusiva

      Link:
       
      Porem estou com um problema seguindo o tutorial completo dele acabo tendo um retorno de erro na Distro! E ja que o mesmo nao entra no forum deis de 14/01! Venho solicitar ajuda de vocês!
      Caso alguem tenha o Discord Dele Favor me Passe  
      Vamos lá!
      Erro:
       
      Script :
       
      Lib
       
       
      Print Rme:
       
       
      Lembrando que nao esta funcionando em geral, Acrédito que eu tenha pulado algo ou deixado passar despercebido!
      Espero que alguem consiga me ajudar vlw!
    • Por Denker
      O Player será teletransportado para o TC, após sair do TradeCenter o player retornará á cidade de origem, ex:

      Saffon > TC , o player retornará a saffron.

      ---------------------------------------------------------------------------------------------------------------------

      Em Data/Movements/Scripts, crie um arquivo.lua e coloque dentro:

       
      -- Developed by: Denker local configs = { tps = { -- Teleport para o TC através de um TP (Item) especifico no chão [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50000}, -- Pallet [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50001}, -- Viridian [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50002}, -- Pewter [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50003}, -- Cerulean [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50004}, -- Saffron [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50005}, -- Celadon [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50006}, -- Vermilion [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50007}, -- Fuchsia [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50008}, -- Cinnabar }, -- LOCALIZAÇÕES localizacaoPallet = {x= 0, y= 0, z= 0}, localizacaoViridian = {x= 0, y= 0, z= 0}, localizacaoPewter = {x= 0, y= 0, z= 0}, localizacaoCerulean = {x= 0, y= 0, z= 0}, localizacaoSaffron = {x= 0, y= 0, z= 0}, localizacaoCeladon = {x= 0, y= 0, z= 0}, localizacaoVermilion = {x= 0, y= 0, z= 0}, localizacaoFuchsia = {x= 0, y= 0, z= 0}, localizacaoCinnabar = {x= 0, y= 0, z= 0} } function onStepIn(cid, item, position, fromPosition) local tp = configs.tps[item.itemid] if tp then doTeleportThing(cid, tp.pos) setPlayerStorageValue(cid, tp.storage, 1) return true end -- Verificação que irá teletransportar o player de acordo com a city que ele estava antes if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50000) == 1 then doTeleportThing(cid, configs.localizacaoPallet) setPlayerStorageValue(cid, 50000, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Pallet") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50001) == 1 then doTeleportThing(cid, configs.localizacaoViridian) setPlayerStorageValue(cid, 50001, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Viridian") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50002) == 1 then doTeleportThing(cid, configs.localizacaoPewter) setPlayerStorageValue(cid, 50002, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Pewter") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50003) == 1 then doTeleportThing(cid, configs.localizacaoCerulean) setPlayerStorageValue(cid, 50003, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Cerulean") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50004) == 1 then doTeleportThing(cid, configs.localizacaoSaffron) setPlayerStorageValue(cid, 50004, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Saffron") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50005) == 1 then doTeleportThing(cid, configs.localizacaoCeladon) setPlayerStorageValue(cid, 50005, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Celadon") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50006) == 1 then doTeleportThing(cid, configs.localizacaoVermilion) setPlayerStorageValue(cid, 50006, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Vermilion") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50007) == 1 then doTeleportThing(cid, configs.localizacaoFuchsia) setPlayerStorageValue(cid, 50007, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Fuchsia") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50008) == 1 then doTeleportThing(cid, configs.localizacaoCinnabar) setPlayerStorageValue(cid, 50008, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Cinnabar") return true end end OBS: O item ID da verificação de volta, será igual para todas as verificações.

      Em Data/Movements/Movements.xml, coloque dentro:

       
      <movevent type="StepIn" itemid="ID" event="script" value="arquivo.lua"/>  

    • Por Denker
      Ao clicar em um baú o player receberá o pokémon, ao ser teleportado para a cidade inicial ele ganhará um kit.
      OBS: Script desenvolvido para Ot's aonde  não há opção de escolha para cidade inicial, sempre será a mesma.
       
      Em Data/Actions/Script, crie um arquivo.lua e coloque:
       
      -- Developed by: Denker local configs = { position = {x = , y = , z = }, -- Localização que o player será teletransportado level = 8, -- Level minimo item = { [1] = {id = , count = }, -- Item que será entregue [2] = {id = , count = }, }, pokemons = { [] = "Charmander", -- Pokémons a se escolher e os ID item que será correspondente a cada poke [] = "Bulbasaur", [] = "Squitler", } } function onUse(cid, item) local first_Pokemon = configs.pokemons[item.itemid] if getPlayerLevel(cid) >= configs.level then for i = 1, #configs.item do doPlayerAddItem(cid, configs.item[1].id, configs.item[1].count) end addPokeToPlayer(cid, first_Pokemon,nil,"normal") doTeleportThing(cid, configs.position) doPlayerSetTown(cid,ID) -- Seta a cidade inicial no player doPlayerSendTextMessage(cid, 27, "Você pegou "..first_Pokemon.." como seu primeiro pokémon, boa sorte em sua jornada") -- Mensagem enviada após pegar escolher o pokémon else doPlayerSendTextMessage(cid, 27, "Você não pode pegar este Pokémon") -- Mensagem caso o player não tenha o requisito end return true end
      Em Data/Action/action.xml, coloque:

       
      <action itemid="ItemID" event="script" value="arquivo.lua"/>  

    • Por Denker
      Basicamente é o uso de um item que troca a outfit do player de acordo com o genêro e acrescenta speed.

      Em Data/Actions/Scripts, crie um arquivo.lua e coloque:

       
      -- Developed by: Denker local configs = { Speed = Value , -- Speed que será adicionada e removida Outfit = { [ItemID] = {looktype_male = Sprite , -- LOOKTYPE MASCULINO looktype_female = Sprite , -- LOOKTYPE FEMININO }, } } function onUse(cid, item, frompos, itemEx, topos) local change_Outfit = configs.Outfit[item.itemid] if getPlayerStorageValue(cid, 32011) == 1 then doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -configs.Speed) setPlayerStorageValue(cid, 32011, 0) return true end if getPlayerSex(cid) == 1 then -- Male doChangeSpeed(cid, configs.Speed) doSetCreatureOutfit(cid,{lookType = change_Outfit.looktype_male},-1) setPlayerStorageValue(cid, 32011, 1) elseif getPlayerSex(cid) == 0 then -- Female doChangeSpeed(cid, configs.Speed) doSetCreatureOutfit(cid,{lookType = change_Outfit.looktype_female},-1) setPlayerStorageValue(cid, 32011, 1) end return true end  
      Em Data/Actions/action.xml, adicione:

       
      <action itemid="ItemID" event="script" value="arquivo.lua"  

  • Estatísticas dos Fóruns

    96843
    Tópicos
    519604
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo