Tudo que Skydrowz postou
-
Como abrir server sem usar CD ?
Você pode usar todos os comandos juntos... cd usr/tfs && ./tfs Nisso ele já abre o servidor.
-
COMO LIBERAR ACESSOS QUESTS
Você pode adicionar as storages necessárias nos personagens ao irem pra main, por exemplo, no NPC Oracle. Exemplo: local missions = { WotE = { [1] = {stg = Storage.WrathoftheEmperor.Questline, value = 29}, [2] = {stg = Storage.WrathoftheEmperor.Mission01, value = 3}, [3] = {stg = Storage.WrathoftheEmperor.Mission02, value = 3}, [4] = {stg = Storage.WrathoftheEmperor.Mission03, value = 3}, [5] = {stg = Storage.WrathoftheEmperor.Mission04, value = 3}, [6] = {stg = Storage.WrathoftheEmperor.Mission05, value = 3}, [7] = {stg = Storage.WrathoftheEmperor.Mission06, value = 4}, [8] = {stg = Storage.WrathoftheEmperor.Mission07, value = 6}, [9] = {stg = Storage.WrathoftheEmperor.Mission08, value = 2}, [10] = {stg = Storage.WrathoftheEmperor.Mission09, value = 2}, }, } for _, wrath in pairs(missions.WotE) do local storage = wrath.stg local valor = wrath.value player:setStorageValue(storage, valor) end
-
AutoGold Exchange
Não seria melhor criar a função em player.lua? Assim, quando o player puxar os gold coins para a backpack, a função seria usada.
-
[PEDIDO] Npc teleporte
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) local reviveId = -- Id do revive local potionId = -- Id da potion local nextPosition = Position(-- Position pra onde ele vai ser teleportar) if npcHandler.topic[cid] == 0 then if msgcontains(msg, 'yes') then if player:getItemCount(reviveId) < 1 and player:getItemCount(potionId) < 1 then player:teleportTo(nextPosition) player:getPosition():sendMagicEffet(CONST_ME_TELEPORT) else npcHandler:say("Desculpe, não posso o teleportar se houver potions dentro de sua backpack." , cid) end end end return true end npcHandler:setMessage(MESSAGE_GREET, 'Olá posso lhe levar para o torneio PVP semanal. Deseja ir?') npcHandler:setMessage(MESSAGE_FAREWELL, 'See you later, |PLAYERNAME|.') npcHandler:setMessage(MESSAGE_WALKAWAY, 'See you later, |PLAYERNAME|.') npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Nem sei se funciona pra pokémon, só sei que tava sem ter o que fazer. Se for mais de uma potion, tem que fazer uma tabela.
-
[PEDIDO] Hp / Mp por porcentagem
Em tfs/src/protocolgame.cpp, procurar por: void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) E substituir essa linha por este código: void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) { msg->put<char>(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { float f_h_percent = (float) player->getHealth() / player->getPlayerInfo(PLAYERINFO_MAXHEALTH); uint16_t h_percent = f_h_percent * 100; msg->put<uint16_t>(h_percent); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp msg->put<uint32_t>(0x7FFFFFFF); else msg->put<uint32_t>(experience); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { float f_m_percent = (float) player->getPlayerInfo(PLAYERINFO_MANA) / (float) player->getPlayerInfo(PLAYERINFO_MAXMANA); uint16_t m_percent = f_m_percent * 100; msg->put<uint16_t>(m_percent); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->put<uint16_t>(player->getStaminaMinutes()); } Depois é só compilar. Só copiei do tópico do cara aí.
-
(Resolvido)effect e shoteffect nas wand
Esse é o seu yellow.lua? function onUseWeapon(creature, var) min, max = 360, 420 target = getCreatureTarget(creature) if target ~= 0 then doSendDistanceShoot(getThingPos(creature), getThingPos(target), sh) addEvent(doAreaCombatHealth, 100, creature, dmg, getThingPos(target), 0, -min, -max, ef) end return 1 end Tenta assim.
-
Duvida ao editar ITEM // Movements/ Items.xml
<item fromid="16103" toid="16104" article="a" name="mathmaster shield"> <attribute key="weight" value="314" /> <attribute key="description" value="It's an Emblem of Wisdom." /> <attribute key="weaponType" value="shield" /> <attribute key="defense" value="39" /> <attribute key="magiclevelpoints" value="3" /> <attribute key="showattributes" value="1" /> </item>
-
Duvida ao editar ITEM // Movements/ Items.xml
<movevent type="Equip" itemid="16103" slot="shield" event="function" value="onEquipItem"> <vocation id="3"/> <vocation id="2"/> </movevent> <movevent type="DeEquip" itemid="16104" slot="shield" event="function" value="onDeEquipItem"/>
-
[Correção] Erro Npc
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 talkState = {} local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 6527 -- id da sua moeda vip local t = { [12396] = {price = 400}, [12575] = {price = 400}, [7440] = {price = 200}, [7443] = {price = 400}, [8981] = {price = 1000}, [5468] = {price = 250}, [2156] = {price = 200}, [2153] = {price = 400}, [2154] = {price = 600}, [2155] = {price = 800}, [2346] = {price = 200} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("Here are you.", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE')) then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe')) then doSetGameState(GAMESTATE_SHUTDOWN) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você não pode fechar um elseif com end, e sim o if ao qual o elseif pertence. Abraços.
-
Transferência de Points entre Players
É sim. Criando uma talkaction que subtraia da tabela saldo do primeiro jogador e adicione a quantidade ao saldo do segundo jogador.
-
[GlobalEvents] Perfect Zombie Event 100% automatico
Adaptado para a 1.X e funcionando perfeitamente(depois de algumas correções). Ótimo evento!
-
[Dúvida] Registro em item
Acabei de ver a versão do TFS, hahaha. Usa o do Vodkart.
-
(Resolvido)[Statues] Morar na cidade.
Por nada. Se precisar de ajuda com a tabela, só dar um toque!
-
(Resolvido)[Statues] Morar na cidade.
function onUse(player, item) local townId = 4 local townName = Town(townId):getName() if player:getTown():getId() == townId then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você já é morador desta cidade.") return false else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Parabéns! Você agora é morador de " .. townName .. ".") player:setTown(townId) player:getPosition():sendMagicEffect(CONST_ME_YELLOW_RINGS) end return true end Agora vai. Desculpa, é que não tô testando. Tô fazendo de cabeça. xD São só erros de função mesmo. Sempre esqueço algumas...
-
(Resolvido)[Statues] Morar na cidade.
Havia atualizado o código. Dá uma olhada de novo lá. Mudei em: local townName = Town(townId):getName() Acho que você pegou o código antes da edição ?
-
(Resolvido)[Statues] Morar na cidade.
O config seria uma tabela local antes da função. Caso você queira usar a tabela, vai ter que alterar um pouquinho o código. Mas é muito melhor mesmo. Sobre o erro, é só trocar town por Town. Acabei me confundindo olhando as funções no Luascripts. xD function onUse(player, item) local townId = 4 local townName = Town(townId):getName() if player:getTown() == townId then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você já é morador desta cidade.") return false else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Parabéns! Você agora é morador de " .. townName .. ".") player:setTown(townId) player:sendMagicEffect(CONST_ME_YELLOW_RINGS) end return true end @Maste Havia outro erro sim, acabei de corrigir. Pode testar agora.
-
(Resolvido)[Statues] Morar na cidade.
local config = { estatuas = { [1] = {townId = X, positionEstatua = Position(X), townName = "X"}, [2] = {townId = Y, positionEstatua = Position(Y), townName = "Y"} } } A ideia é fazer o código por posições. Se a estátua estiver na posição X, significa que aquela estátua é a estátua de número 1 na Tabela. Deu pra entender?
-
(Resolvido)[Statues] Morar na cidade.
function onUse(cid, item, frompos, item2, topos) local townid = 4 ---- id da town if isPlayer(cid) == TRUE then doPlayerSendTextMessage(cid,22,"Agora voce e morador da cidade " .. getTownName(townId) .. ".") -------- msg que o player ira receber doPlayerSetTown(cid,townid) return true end Bom, vamos lá. Sobre esse código. O script tem callback de variáveis que nunca vão ser usadas, então podem ser removidas, ficando assim: Ah, e o erro aqui é que o @Cricket não fechou o if. function onUse(cid, item) local townid = 4 ---- id da town if isPlayer(cid) == TRUE then doPlayerSendTextMessage(cid,22,"Agora voce e morador da cidade " .. getTownName(townId) .. ".") -------- msg que o player ira receber doPlayerSetTown(cid,townid) end return true end Não sei qual TFS você está usando, mas vou adaptar o código ao meu TFS e corrigir os erros que esse cara cometeu. function onUse(player, item) local townId = 4 local townName = town:getName(townId) if player:getTown() == townId then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você já é morador desta cidade.") return false else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Parabéns! Você agora é morador de " .. townName .. ".") player:setTown(townId) player:sendMagicEffect(CONST_ME_YELLOW_RINGS) end return true end Apenas corrigi os erros e acrescentei algumas coisas, mas se você pretende usar o mesmo script em outras estátuas, recomendo que use uma tabela. Caso contrário, você vai ter que criar vários scripts com o mesmo código, apenas mudando o townId.
-
Obscure ot Server
Achei os mapas bem fracos. Dá pra melhorar bastante.
-
(Resolvido)[NPC Barco] Não viaja.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start 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 -- OTServ event handling functions end -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'cidada'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Cidada em troca de 100 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 100, destination = {x=414, y=1154, z=6} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 100, destination = {x=414, y=1154, z=6} }) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'cidade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Cidade em troca de 150 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=205, y=1069, z=6} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=205, y=1069, z=6} }) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'cidadi'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Cidadi em troca de 200 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 200, destination = {x=1003, y=799, z=6} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 200, destination = {x=1003, y=799, z=6} }) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'civade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Civade em troca de 150 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=676, y=1407, z=6} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=676, y=1407, z=6} }) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'cidadu'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Cidadu em troca de 200 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 200, destination = {x=1063, y=1062, z=6} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 200, destination = {x=1063, y=1062, z=6} }) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'cidado'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você deseja ir para Cidado em troca de 150 gps?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=504, y=652, z=7} }) travelNode:addChildKeyword({'sim'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=504, y=652, z=7} }) -- Makes sure the npc reacts when you say hi, bye etc. npcHandler:addModule(FocusModule:new()) Já tentou assim? Geralmente keywords são escritos sem caixa alta.
-
[OTserver/Site] Do que preciso.
Em relação ao otserver minha dúvida é: (1) Qual é melhor: Dedicado ou VPS? VPS. Na VPS você continua tendo várias opções de gerenciamento por um preço acessível. O dedicado, além de caro, é melhor para projetos maiores. Não que seu otserver não vá fazer sucesso, mas hoje em dia não se usa mais dedicados para otservers, ou pelo menos é o que eu acho. (2) Qual a melhor empresa para contratar o serviço? Isso vai de opinião. Não sei se é permitido fazer uso do nomes de empresas de host aqui no fórum do TK, mas você pode pesquisar sobre os serviços de VPS disponíveis e em seguida ver se os usuários aprovaram ou não. Em relação ao site minha dúvida é: (1) Como crio um nome domínio para um site Gesior? Não precisa ser 'para um site Gesior'. Basta ser um domínio qualquer. Vários sites fazem vendas de domínios, basta pesquisar. Exemplo: tem uma que aparece nas propagandas do YouTube toda hora(inclusive é a que uso hoje em dia). (2) Como consigo deixar o site online 24 horas? Apenas instale o seu site dentro da VPS.
-
(Resolvido)[NPC Barco] Não viaja.
Então você tá por aqui, né Maste? Hahaha. Posta o script aí que te ajudo a resolver.
-
NPC que vende BP
Pensarei sobre. Up.
-
(Resolvido)Hospedar site tibia
Hahahhahah, é o Ed Sheeran xD
-
(Resolvido)Hospedar site tibia
Em suma, acho que já resolvi sua dúvida xD