Histórico de Curtidas
-
Matheus Chanavat deu reputação a Movie em [TFS 1.X] Online Bonus SystemOlá a todos, e estou de volta pra postar alguns conteúdos...
Fui atrás de um online bonus system para tfs 1.3 e não achei e portanto decidi fazer o meu, com a ajuda do @vankk.
================================================================================================================
Testado em TFS 1.3 na versão 8.60.
================================================================================================================
================================================================================================================
No seu banco de dados, execute a seguinte query
ALTER TABLE `players` ADD `online_time` int(11) NOT NULL DEFAULT 0 ================================================================================================================
O próximo passo é apenas para quem gostaria de que, a cada server save, o número seja zerado!
================================================================================================================
Em globalevents/scripts/startup.lua, após o inicio da função onStartup() adicione o seguinte código
db.query("UPDATE `players` SET `online_time` = 0") ================================================================================================================
Agora crie um arquivo chamado onlinebonus.lua em creaturescripts/scripts com isso dentro
local event = {} local function addOnlineToken(playerId) local player = Player(playerId) if not player then return false end if player:getIp() == 0 then event[player:getId()] = nil return false end player:addOnlineTime(1) player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você ganhou 1 online token por permanecer online por 1 hora sem deslogar.") player:addItem(12543, 1) event[player:getId()] = addEvent(addOnlineToken, 60 * 60 * 1000, player:getId()) end function onLogin(player) player:registerEvent("OnlineBonus") player:registerEvent("OnlineBonusLogout") if event[player:getId()] == nil then event[player:getId()] = addEvent(addOnlineToken, 60 * 60 * 1000, player:getId()) end return true end function onLogout(player) if event[player:getId()] then event[player:getId()] = nil end return true end -- <event type="login" name="OnlineBonus" script="onlineBonus.lua" /> -- <event type="logout" name="OnlineBonusLogout" script="onlineBonus.lua" /> A tag XML está no fim desse código.
================================================================================================================
Agora, na pasta lib, crie um arquivo chamado onlineTime.lua e coloque isso dentro
function Player.getOnlineTime(self) local resultId = db.storeQuery(string.format('SELECT online_time FROM `players` WHERE `id` = %d', self:getGuid())) if not resultId then return 0 end local value = result.getNumber(resultId, "online_time") result.free(resultId) return value end function Player.addOnlineTime(self, amount) db.query(string.format("UPDATE `players` SET `online_time` = `online_time` + %d WHERE `id` = %d", amount, self:getGuid())) end Não esqueça de registrar essa lib no lib.lua.
================================================================================================================
Agora, na pasta talkactions/scripts, crie um arquivo chamado onlinebonus.lua com o seguinte código dentro:
function onSay(player, words, param) local skill = player:getOnlineTime(player) local message = "--------[+]------- [Online Bonus System] -------[+]--------\n\nGanhe um online token a cada hora que você passa online sem deslogar.\n\n---------------------------------------------------\n Total\n Desde o server save você já ganhou " .. skill .. " online tokens." doPlayerPopupFYI(player, message) end -- <talkaction words="!onlinebonus" script="onlineBonus.lua"/> A tag XML está no fim desse código.
================================================================================================================
O usuário irá receber um item a cada hora online sem deslogar.
O item está no código de creaturescripts com o id 12543, que pode ser alterado para qualquer item que seja agrupável.
================================================================================================================
É isso por hoje.
-
Matheus Chanavat deu reputação a luanluciano93 em [TFS 1.2] Tibia 8.60 Windows 64bits Compilação.https://github.com/otland/forgottenserver/wiki/Compiling
-
Matheus Chanavat deu reputação a luanluciano93 em Ladder BUG [TFS 1.2}Acabei de testar e não existe esse erro na source mais atual do TFS: https://github.com/otland/forgottenserver
-
Matheus Chanavat deu reputação a Rayo em Teleport Tile [TFS 1.2]Da uma olhada neste tutorial da otland:
https://otland.net/threads/tfs-1-2-teleport-pad-system-rewrite.245784/
-
Matheus Chanavat deu reputação a DdJs em Hydra's Deep Cave | 8.60Hydra's Deep Cave
Version: 8.60
Download:
Type: .Rar
Size: 45KB
Position(s): [X: 1045 Y: 1008 Z: 8]
File password: tibiaking
Scan:
Images:
-
Matheus Chanavat deu reputação a DdJs em Heroes Ruins | Cave Hunt | 8.60Heroes Ruins
Version: 8.60
Download:
Type: .Rar
Size: 28KB
Position(s): [X: 1029 Y: 1016 Z: 8]
File password: tibiaking
Scan:
Images:
-
Matheus Chanavat deu reputação a DdJs em Earth & Water Elemental's Caves | 8.60Earth & Water Elemental's Caves
Version: 8.60
Download:
Type: .Rar
Size: 1.86MB
Position(s): [X: 1024 Y: 1030 Z: 9]
File password: tibiaking
Scan:
Images:
-
Matheus Chanavat deu reputação a King Laker em (Resolvido)[PEDIDO] Homestone TFS 1.2@Matheus Chanavat não sei se tem a ver mano mas o meu script tava certinho então, tenta ver se não tem nda a ver com o waittime ta 20.0 tenta por 20,0
sua tfs é 0.4?
-
Matheus Chanavat deu reputação a King Laker em (Resolvido)[PEDIDO] Homestone TFS 1.2troca essas linhas por essas
Remover:
remover = false
local waittime = 20
Colocar:
remover = false ,
local waittime = 20.0
no remover vc tirou a virgula e no waittime vc tirou o 0 e o ponto
-
Matheus Chanavat deu reputação a King Laker em (Resolvido)[PEDIDO] Homestone TFS 1.2@Matheus Chanavat da algum erro na distro? ontem eu testei e foi td bem
-
Matheus Chanavat deu reputação a King Laker em (Resolvido)[PEDIDO] Homestone TFS 1.2@Matheus Chanavat
Creditos >>
@Fir3z por 90% do script
e
@Vodkart e pela parte do exhaust que me forneceu um tempo atras em outra script
e eu por fazer tudo isso funcionar junto
-
Matheus Chanavat deu reputação a kiinho em [SCRIPT] Quest Para Vocação {RESOLVIDO}Substitui o script por esse
-
Matheus Chanavat recebeu reputação de kiinho em [SCRIPT] Quest Para Vocação {RESOLVIDO}[Dúvida sanada]
Valeu parceiro, deu certinho, e você explicando passo a passo não tinha como errar ! valeu mesmo ?
Obrigado @FlavioHulk pela ajuda !
Créditos pro @kiinho , o ultimo script funcionou perfeitamente.
-
Matheus Chanavat deu reputação a kiinho em [SCRIPT] Quest Para Vocação {RESOLVIDO}@Matheus Chanavat
Crie um arquivo NOMEARQUIVO.lua e cole o script dentro
Dentro do arquivo xml coloque
-
Matheus Chanavat deu reputação a FlavioHulk em [SCRIPT] Quest Para Vocação {RESOLVIDO}local config = { vocation = {2, 5} -- Colocar os ids das vocações } function onUse(cid, item, fromPosition, itemEx, toPosition) if not table.contains(config.vocation, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Você não tem a vocação permitida.") doSendMagicEffect(toPosition, CONST_ME_POFF) return true end doPlayerAddItem(cid, 2376) -- Id do prêmio doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ganhou tal item...") return true end Obs.: Não manjo bem de 0.4, sem objeto orientado é tenso haha
-
Matheus Chanavat deu reputação a Vodkart em [8.6] Teleport System!Descrição do Arquivo
*Sobre o Sistema*
Resolvi postar este sistema por ser simples, já que estou desenvolvendo sistemas para guild e focar em evento de PVP para comércio aqui no TibiaKing, sem mais deslongas;
O sistema é simples, basta você ativar um comando e você será teleportado para o local depois de "X" segundos, como mostra na imagem!
Exemplo do uso de comando:
!tp templo
!tp depot
!tp baiak city
-----
Função que leva você para as houses! Pode ser sua house ou a house que seu amigo te invitou!
!tp casa,1
ou
!tp house,1
*Features*
[+] O Jogador que ativar o comando e entrar em combate, automaticamente o teleport é desativado!
[+] Fácil configuração!
[+] Você pode configurar para que determinados locais sejam acessados só por premium account!
[+] Nova função que fará que você seja levado para sua house ou house de amigos que tenham te invitado... e também irá mostrar a lista de houses disponíveis para ir!
*Versão Testada*
Versão Tibia 8.6
TFS 0.3.6
TFS 0.4
*Código*
tp_system.lua
--[[ Teleport System Desenvolvido por Vodkart Exclusivo TibiaKing Versão : 1.0 ]]-- --[[ Configuração ]]-- local time = 5 -- tempo que demora para ser teleportado local premium_teleport_houses = true -- se para teleportar para as houses precisa ser premium local teleports = { -- ["nome do lugar"] que poderá ir ["depot"] = {pos = {x=129, y=54, z=6}, premium = false}, -- posição que irá e se precisa de premium para ir! ["templo"] = {pos = {x=160, y=54, z=7}, premium = false}, ["arena"] = {pos = {x=125, y=351, z=9}, premium = false}, ["baiak city"] = {pos = {x=1028, y=1034, z=7}, premium = false} } --[[ Functions ]]-- function doTeleportWithDelay(cid, pos, delay) -- by vodkart if not isCreature(cid) then return LUA_ERROR end if delay > 0 then if getCreatureCondition(cid, CONDITION_INFIGHT) then setPlayerStorageValue(cid, 548745, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} O teletransporte foi desativado pois você entrou em estado de combate.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} "..delay.." segundos para se teletransportar.") addEvent(doTeleportWithDelay, 1000, cid, pos, delay-1) else doTeleportThing(cid, pos) doSendMagicEffect(getPlayerPosition(cid), 10) end end function getHouseInvite(cid) -- by vodkart local t = {} local qry = db.getResult("SELECT `house_id`,`list` FROM `house_lists`;") if (qry:getID() ~= -1) then repeat local lista = qry:getDataString("list") if string.find(lista, getCreatureName(cid)) then local id = qry:getDataInt("house_id") if not isInArray(t, id) then t[#t+1] = id end end until not qry:next() qry:free() end return t end function onSay(cid, words, param) local z = string.explode(param:lower(), ",") if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Este comando só pode ser usado fora de combate.") return true elseif getPlayerStorageValue(cid, 548745) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} aguarde, você está em processo de teletransporte.") return true end if z[1] == "casa" or z[1] == "house" then local t,invite,str = {},getHouseInvite(cid),'{Teleport} As casas disponíveis para você se teletransportar são:\n' if premium_teleport_houses == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você precisa ser premium account para teleportar para houses.") return true end if getHouseByPlayerGUID(getPlayerGUID(cid)) ~= nil then t[#t+1] = getHouseByPlayerGUID(getPlayerGUID(cid)) end if #invite ~= 0 then for i = 1,#invite do t[#t+1] = invite[i] end end if #t == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} você não tem nenhuma house para ir.") return true end if not tonumber(z[2]) or tonumber(z[2]) > #t then for i = 1, table.maxn(t) do local h = getHouseInfo(t[i]) local hname, htown = getHouseName(t[i]),getTownName(h.town) str = str .. i .. ') '..hname..' [' .. htown..']' str = i ~= table.maxn(t) and str .. ', ' or str .. '.' end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Você deve especificar uma das casas para se teletransportar usando !tp house,numeroDoIndice") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, getHouseEntry(t[tonumber(z[2])]), time) return true end if not teleports[z[1]] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, este lugar não existe, lugares disponíveis: house, depot, templo, arena, baiak city.") return true elseif teleports[z[1]].premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Desculpe, você precisa ser premium para ir para este lugar.") return true end setPlayerStorageValue(cid, 548745, os.time()+time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "{Teleport} Ativado.") doTeleportWithDelay(cid, teleports[z[1]].pos, time) return true end
TAG
<talkaction words="!tp;/tp" script="tp_system.lua"/>