Sistema TFS 1.X [revscript] Trade Offline TFS 1.3+
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Rodrigo Querobim
Salve rapaziada eu tenho o server canary open source e quando implementei os bosses atuais começou dar este erro, nem mexi nessa linha que esta dando os erros, alguem sabe me dizer oq pode ser?
-
By Tofames
Hi,
Para devolver o que recebi aqui, colocarei para si um sistema de transformação a trabalhar na TFS 1.X.
(Testei em 1.4.2)
MUDANÇA DE SOURCE NECESSÁRIA PARA O BOM FUNCIONAMENTO!
Havia algo dentro do código TFS (e provavelmente outras distros) que não estava funcionando corretamente e depois que eu informei, eles se fundiram em tfs principais, então já está dentro do TFS 1.5, mas não está em versões mais antigas.
Trata-se de refrescar a velocidade do jogador após a transformação, se você não tiver isso, então sua velocidade do vocations.xml baseSpeed não é refrescada.
Você precisa adicionar isto às sources:
https://github.com/otland/forgottenserver/pull/4215/files
se você não tem acesso às sources, eu tenho um meio de contornar isso, mas não vou inundar este posto, então escreva em pv.
Créditos:
Erexo (guião original)
Itutorial (TFS 1.X),
Tofame (alteração: talkaction --> spell; source mudanças; correções do scripts)
transform system.mp4
no final do global.lua:
--[[ voc = from vocation newVoc = to vocation looktype = new outfit revertLooktype = current outfit level = lvl needed to transform rage = soul needed to transform (you can disable it, just type 0) kiToTrans = mana to transform addHp = maxHp added when you transform addKi = maxMana added effectOn = magic effect when you use transform aura = magic effect when you have current transform (can be disabled, just type 0). type nil in this version constant = if transform is constant (when it is, player dont lose transform/outfit and maxHp/Mana, and cannot use revert) --]] exhaust_transform = {} -- [1-8] naruto, transform = { [1] = {voc = 1, newVoc = 2, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 50, addHealth = 450, addMana = 450, effect = 76, aura = nil, constant = false}, [2] = {voc = 2, newVoc = 3, from_looktype = 3, looktype = 4, level = 100, rage = 0, mana = 50, addHealth = 500, addMana = 500, effect = 76, aura = nil, constant = false}, [3] = {voc = 3, newVoc = 4, from_looktype = 4, looktype = 5, level = 150, rage = 0, mana = 50, addHealth = 650, addMana = 650, effect = 76, aura = nil, constant = false}, [4] = {voc = 4, newVoc = 5, from_looktype = 5, looktype = 6, level = 200, rage = 0, mana = 50, addHealth = 800, addMana = 800, effect = 76, aura = nil, constant = false}, [5] = {voc = 5, newVoc = 6, from_looktype = 6, looktype = 7, level = 250, rage = 0, mana = 50, addHealth = 900, addMana = 900, effect = 76, aura = nil, constant = false}, [6] = {voc = 6, newVoc = 7, from_looktype = 7, looktype = 8, level = 300, rage = 0, mana = 50, addHealth = 1000, addMana = 1000, effect = 76, aura = nil, constant = false}, [7] = {voc = 7, newVoc = 8, from_looktype = 8, looktype = 9, level = 400, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false}, [8] = {voc = 8, newVoc = 9, from_looktype = 9, looktype = 10, level = 500, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false} -- end naruto transforms } spells/scripts/revert.lua
local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local pid = player:getId() local TRANS = transform[player:getVocation():getId() - 1] -- - [player:getVocation():getId() - 4] domyslnie, should be -1. if not TRANS then player:sendCancelMessage("You cannot revert.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.from_looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end exhaust_transform[pid] = 1 player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth) player:setMaxMana(player:getMaxMana() - TRANS.addMana) player:setVocation(TRANS.voc) player:save() return combat:execute(player, variant) end spells/scripts/transform.lua
local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local effectPosition = Position(player:getPosition().x, player:getPosition().y, player:getPosition().z) local pid = player:getId() local TRANS = transform[player:getVocation():getId()] if not TRANS then player:sendCancelMessage("You cannot transform.") return false end if TRANS.effect == 76 then effectPosition = Position(player:getPosition().x + 2, player:getPosition().y, player:getPosition().z) end if player:getLevel() < TRANS.level then player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") return false end if player:getSoul() < TRANS.rage then player:sendCancelMessage("You need "..TRANS.rage.." to transform.") return false end if player:getMana() < TRANS.mana then player:sendCancelMessage("You need "..TRANS.mana.." to transform.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end player:addSoul(-TRANS.rage) player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth) player:setMaxMana(player:getMaxMana() + TRANS.addMana) effectPosition:sendMagicEffect(TRANS.effect) player:setVocation(TRANS.newVoc) player:save() return combat:execute(player, variant) end spells.xml:
<instant group="support" spellid="175" name="Revert" words="revert" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="revert.lua" /> <instant group="support" spellid="175" name="Transform" words="transform" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="transform.lua" />
As coisas abaixo são opcionais, adicione-as se você quiser ter aura. Se você não estiver usando, deixe a aura = nil em global.lua
Também observei que isso poderia causar atrasos/screen freeze, por isso não recomendo o uso de aura.
globalevents.xml adicionar linha:
<globalevent name="TransformEffects" interval="2000" script="TransformEffects.lua"/> TransformEffects.lua (data/globalevents/scripts/TransformEffects.lua):
function onThink(interval) for _, player in pairs(Game.getPlayers()) do if player then TRANS = transform[player:getVocation():getId()] if TRANS then if TRANS.aura ~= nil then player:getPosition():sendMagicEffect(TRANS.aura) end end end end return true end
edit:
só consigo falar um pouco de espanhol e muito bem em inglês, por isso uso DEEPL para falar portugês.
-
By luanluciano93
Olá pessoal, estou desenvolvendo esse sistema vip para TFS 1.x, se precisarem de alguma função nova é só comentar, criei para usar em um servidor meu e resolvi postar, bom proveito a todos.
É só ir no arquivo data/lib/core/player.lua e adicionar esse código no começo do script:
-- ALTER TABLE `accounts` ADD `vip_time` BIGINT(20) NOT NULL DEFAULT 0; -- player:getVipTime() function Player.getVipTime(self) local resultId = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '".. self:getAccountId() .."';") local time = resultId ~= false and result.getNumber(resultId, "vip_time") or 0 result.free(resultId) return time end -- player:isVip() function Player.isVip(self) return self:getVipTime() > os.time() and true or false end -- player:addVipDays(days) function Player.addVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVipDays(days) function Player.removeVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:setVipDays(days) function Player.setVipDays(self, days) return db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVip() function Player.removeVip(self) db.query("UPDATE `accounts` SET `vip_time` = '0' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:sendVipDaysMessage() function Player.sendVipDaysMessage(self) if self:isVip() then local vipTime = self:getVipTime() - os.time() local vipDays = 1 + (math.floor(vipTime / 86400)) return self:getVipTime() ~= false and self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have '.. vipDays .. ' vip day(s) in your account.') end end -- player:checkVipLogin() function Player.checkVipLogin(self) if self:getVipTime() > 0 and not self:isVip() then return self:removeVip() and self:teleportTo(self:getTown():getTemplePosition()) end end
As funções são:
• player:getVipTime() - Retorna o valor da tabela vip_time (igual esta na database).
• player:isVip() - Retorna se o player é vip ou não.
• player:addVipDays(days) - Usa-se em algum script para para adicionar dias de vip ao player (parâmetro de entrada "days").
• player:removeVipDays(days) - Usa-se em algum script para para remover dias de vip do player (parâmetro de entrada "days").
• player:setVipDays(days) - Usa-se em algum script para para mudar os dias de vip do player (parâmetro de entrada "days").
• player:removeVip() - Usa-se em algum script para para remover todo tempo de vip do player.
• player:sendVipDaysMessage() - Retorna uma mensagem no player mostrando os dias de vip que ainda restam ao player.
• player:checkVipLogin() - Checa se a vip do player acabou, se sim teleporta ele para o templo.
Qualquer dúvida ou erro/bug poste aqui.
-
By deivaoo
Eai galera, blz?
Bom, vim trazer pra vcs a versão 1.0 do mod de pokedex que eu desenvolvi mês passado visando aprendizado no mundo de OTC, com o objetivo também de mostrar que o otclient é flexível suficiente para se fazer muitas coisas sem a necessidade das sources tanto do servidor quanto do client...
Para aqueles que não conhecem, vejam o Show Off desse trabalho.
Eu fiz essa versão com o objetivo de não fazer alterações no servidor... Ou seja, tem apenas edições no OTC.
Atualizações:
1. Adicionado um pack com 276 imagens de pokemons (16,1MB);
2. Pokemons shiny tem a exibição da imagem de pokemons normais (para alterar, basta remover
a linha 75 do arquivo game_pokedex.lua, na pasta modules/game_pokedex de seu client);
3. Pokedex fecha ao se deslogar do char com ela aberta [créditos a @Soulviling pela ideia];
Bom, sem mais delongas;
Instalação fácil:
Passo 1. Faça o download do arquivo RAR (download no final do tópico);
Passo 2. Copie a pasta modules pro seu client;
Passo 3. "Deseja substituir?" [X]Sim [ ]Não
Passo 4. Só vai até o passo 3;
Bom, segue uma imagem ATUALIZADA
Download e Scan
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.