Tudo que FeeTads postou
-
(Resolvido)Error while saving player
usa esse comando no seu SQL, dentro da tabela SET GLOBAL sql_mode=''; vai resetar o "cache" necessário usar sempre que reiniciar a maquina. fora que tu usa TFS 0.3 maior tristeza mano, indico vc procurar a TFS 1.3 downgrade do Nekiro, ou uma OTX 2 do reason, a OTX2 é atualizada e compativel com os scripts de tfs0.3 e 0.4, já TFS 1.x os scripts são diferentes. OTX 2.x by reason TFS 1.x by Nekiro
-
Aura System por level atingido
só mudar pra onLogin E advanceSkill sua source é TFS1.x? tenta assim: local config_aurea = { effect = 4; -- efeito que vai ficar girando no player effect_health = 162; -- efeito qnd curar o player level_use = { -- level que vai ser usado (min/max) min = 100, max = 600, } ; health = 10; -- tanto que vai curar por time configurado pos_aurea = { -- não mexa [1] = {x = 0, y = -1}; [2] = {x = 1, y = -1}; [3] = {x = 1, y = 0}; [4] = {x = 1, y = 1}; [5] = {x = 0, y = 1}; [6] = {x = -1, y = 1}; [7] = {x = -1, y = 0}; [8] = {x = -1, y = -1}; }; storage_pos = 1547637649; -- não mexa e nem repita esse valor em outro script!! storage = 165477963; -- não mexa e nem repita esse valor em outro script!! tempo_aurea = 100; -- tempo da aurea para passar em cada posição } local function calculePosAurea(player_uid) local player = Player(player_uid) if(not(player))then return(nil) end if(player:getStorageValue(config_aurea.storage) <= 0)then return(nil) end if(player:getStorageValue(config_aurea.storage_pos) >= 8)then player:setStorageValue(config_aurea.storage_pos, 0) end player:setStorageValue(config_aurea.storage_pos, player:getStorageValue(config_aurea.storage_pos) + 1) return(player:getStorageValue(config_aurea.storage_pos)) end local function posAurea(player_uid) local player = Player(player_uid) if(not(player))then return(nil) end if(player:getStorageValue(config_aurea.storage) <= 0)then return(nil) end local pos_x = player:getPosition().x local pos_y = player:getPosition().y local pos_z = player:getPosition().z local aa = calculePosAurea(player_uid) local pos = Position(pos_x + config_aurea.pos_aurea[aa].x, pos_y + config_aurea.pos_aurea[aa].y, pos_z) if(not(pos))then return(nil) end return(pos) end local function aurea(player_uid) local player = Player(player_uid) if(not(player))then return(nil) end if(player:getStorageValue(config_aurea.storage) <= 0)then return(nil) end player:addHealth(config_aurea.health) player:getPosition():sendMagicEffect(config_aurea.effect_health) local position = posAurea(player_uid) position:sendMagicEffect(config_aurea.effect) addEvent(aurea, config_aurea.tempo_aurea, player_uid) end function onLogin(player) if(player:getLevel() >= config_aurea.level_use.min) then player:setStorageValue(config_aurea.storage, 1) player:setStorageValue(config_aurea.storage_pos, 0) aurea(player.uid) end return(true) end function onAdvance(player, skill, oldLevel, newLevel) if(skill == SKILL__EXPERIENCE) then return true end if(skill == SKILL__LEVEL) then if player:getLevel() >= 100 then player:setStorageValue(config_aurea.storage, 1) player:setStorageValue(config_aurea.storage_pos, 0) aurea(player.uid) end end return true end
-
erro no utito tempo
o próprio utito tempo é um condition, não há como usar 2 conditions juntos mesmo, a melhor maneira de fazer isso, é AddSkill no Equip e DeEquip exemplo: local skill_pally = SKILL_DISTANCE local skill_mage = SKILL__MAGIC local skill_ek1 = SKILL_SWORD local skill_ek2 = SKILL_CLUB local skill_ek3 = SKILL_AXE local amount = 5 function onEquip(cid, item, slot) local vocation = getPlayerVocation(cid) if vocation > 4 then vocation = vocation - 4 end if vocation == 1 or vocation == 2 then doPlayerAddSkill(cid, skill_mage, amount, true) --"skill" = nome da skill, "amount" = quantidade elseif vocation == 3 then doPlayerAddSkill(cid, skill_pally, amount, true) elseif vocation == 4 then doPlayerAddSkill(cid, skill_ek1, amount, true) doPlayerAddSkill(cid, skill_ek2, amount, true) doPlayerAddSkill(cid, skill_ek3, amount, true) end return true end function onDeEquip(cid, item, slot) local vocation = getPlayerVocation(cid) if vocation > 4 then vocation = vocation - 4 end if vocation == 1 or vocation == 2 then doPlayerAddSkill(cid, skill_mage, -amount, true) --"skill" = nome da skill, "amount" = quantidade / (-amount) retira a quantidade elseif vocation == 3 then doPlayerAddSkill(cid, skill_pally, -amount, true) elseif vocation == 4 then doPlayerAddSkill(cid, skill_ek1, -amount, true) doPlayerAddSkill(cid, skill_ek2, -amount, true) doPlayerAddSkill(cid, skill_ek3, -amount, true) end return true end
-
(Resolvido)Servidor travando sempre que upa level ou skill
muito provavelmente é algum creatureScript, dando save ou globalSave sempre que alguém upa, e normalmente esses saves são pesados pq manda pra DB, eu indicaria vc fazer uma busca completa nos teus arquivos por "doSaveServer" ou "doSavePlayer" e ver aonde tanto que chama essa função, e retirar/comentar, e dar reload pra ver se para
-
Erro no cast ot 8.6
elseif(isInArray({'on', 'yes', 'enable'}, t[1])) then data.broadcast = true doPlayerSetSpectators(cid, data) db.executeQuery("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your cast stream.") ali no espaço entre "doPlayerSetSpectators" embaixo vc coloca doPlayerOpenChannel(cid, 65535) ficando assim elseif(isInArray({'on', 'yes', 'enable'}, t[1])) then data.broadcast = true doPlayerSetSpectators(cid, data) doPlayerOpenChannel(cid, 65535) db.executeQuery("UPDATE `players` SET `broadcasting` = 1 WHERE `id` = " .. getPlayerGUID(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled your cast stream.")
-
Erro no cast ot 8.6
tenta colocar doPlayerOpenChannel(cid, 65535) no lugar de doPlayerOpenPrivateChannel(cid) la no mods pra ver
-
Erro no cast ot 8.6
tu criou o privateChannel la no channels.xml? XML > channels.xml <channel id="65535" name="Private Chat Channel"/>
-
(Resolvido)Rank militar, como colocar efeito no rank com mais frags?
é possivel mas caso vc queira pro servidor todo, ou TOP 100 por exemplo, pode ser meio chatinho de fazer, mas é +/- assim local delay = 5000 --Intervalo de tempo entre o efeito, em milésimos de segundo. 5000 = 5s local access = 3 -- 3 é acesso de GM+ local i = 1 -- não mexer local p_name = {} -- nome dos players com mais frag local effect = { [1] = 15, --15 é o efeito [2] = 12, --12 é o efeito [3] = 10, --10 é o efeito } local function checkFrags(cid) if not isPlayer(cid) then return true end -- caso não seja player sai fora if getPlayerAccess(cid) >= access then return true end -- se for GM+ sai fora if isCreature(cid) then -- caso esteja online, continua na função local result = db.getResult('SELECT * FROM players WHERE deleted = 0 AND group_id = 1 AND online = 1 AND account_id != 1 ORDER BY frags DESC LIMIT 3') -- LIMIT 3 = TOP 3 APENAS, CASO QUEIRA QUE PEGUE MAIS PLAYERS, AUMENTAR O NUMERO, CASO QUEIRA QUE PEGUE EM TODOS (NÃO RECOMENDO) TIRAR O "LIMIT 3" if result:getID() ~= -1 then while (true) do p_name[i] = tostring(result:getDataString('name')) i = i + 1 if not(result:next()) then break end end result:free() end for j = 1, 3 do --3 é o tamanho do LIMIT caso vc queira que pegue todos os players online, trocar o 3 pra #getPlayersOnline() if getPlayerName(cid) == p_name[j] then sendEffect(cid, j) break end end end return true end local function sendEffect(cid, n_efeito) if isCreature(cid) then doSendMagicEffect(getCreaturePosition(cid), effect[n_efeito]) addEvent(sendEffect, delay, cid, n_efeito) end return true end function onLogin(cid) checkFrags(cid) return true end
-
Erro no cast ot 8.6
tenta modificar o script da sua source pelo que mandei, e verifica se existe a acc de cast tudo certinho
-
Erro no cast ot 8.6
verifica se existe essa função na sua source, essa é uma função do luascript.cpp caso não exista, va em luascript.cpp procure por: doPlayerOpenChannel ou doCreatureChannelSay e adicione abaixo isso: //doPlayerOpenPrivateChannel(cid) lua_register(m_luaState, "doPlayerOpenPrivateChannel", LuaInterface::luaDoPlayerOpenPrivateChannel); depois procure novamente por doPlayerOpenChannel ou doCreatureChannelSay vai achar uma função +/- assim: int32_t LuaInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint16_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); if(env->getPlayerByUID(cid)) { lua_pushboolean(L, g_game.playerOpenChannel(cid, channelId)); return 1; } errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } ADICIONE ABAIXO DELA isso: int32_t LuaInterface::luaDoPlayerOpenPrivateChannel(lua_State* L) { //doPlayerOpenPrivateChannel(cid) uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); if(env->getPlayerByUID(cid)) { lua_pushboolean(L, g_game.playerCreatePrivateChannel(cid)); return 1; } errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } depois abra o luascript.h procure por luaDoPlayerOpenChannel vai ser algo tipo: static int32_t luaDoPlayerOpenChannel(lua_State* L); e ADICIONE ABAIXO: static int32_t luaDoPlayerOpenPrivateChannel(lua_State* L); após isso, RECOMPILE SUA SOURCE, e REABRA SEU OT com o novo arquivo que foi compilado e teste.
-
Suporte com NPC de Guild
ta falando um "(" antes do CID, a própria distro listou o que precisa e a linha coloca assim: function onCreatureSay(cid, type, msg) cname = creatureGetGuildLeadername(cid) você pode resolver a maioria dos erros apenas lendo ou traduzindo o que a distro diz pra você, exemplo: normalmente esse erro mostra você fechando um parênteses sem abri-lo, o que quebra a função toda "guild.lua:53" > significa que vc tem um erro no arquivo guild.lua na linha 53 < isso deixa muito fácil achar o erro fora que esse script que vc ta usando, é BEEEEEEEEMM antigo, atualmente os scripts são bem mais otimizados.. pode ser que você nem tenha as funções listadas nesse script, eu indicaria vc tentar modifica-lo pros scripts de NPC atuais
-
(Resolvido)tile que remove storage
coloca assim: e coloca a tag no xml assim por exemplo data > movement > movements.xml <movevent type="StepIn" actionid="56780" event="script" value="removeStorage.lua"/> ai cria o arquivo data > movements > scripst > removeStorage.lua e coloca isso dentro local storages = {1234, 12345, 123456, 1234567} -- Aqui você adiciona as storages a serem verificadas e removidas caso o player venha a telas. function onStepIn(cid, item) for i= 1, #storages do setPlayerStorageValue(cid, storages[i], 0) end return true end ai coloca no chão o action ID 56780 se a storage do seu bau checar -1, coloca no logar do 0 o -1 setPlayerStorageValue(cid, storages[i], -1)
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
boa, funcionou?
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
elseif isInArray({"espada","troca","trocar"}, msg) then -- mensagem do player if getPlayerStorageValue(cid, storageAceitar) == 1 then local lista = '' for i=1, #itemid do lista = lista..itemid[i].count..' - '..getItemNameById(itemid[i].item) if i+1 <= #itemid then lista = lista..', ' end end -- selfSay("Voce aceita me pagar {"..lista.."} pela espada?", cid) -- msg do NPC selfSay("Voce aceita me pagar 10KK pela espada?", cid) -- msg do NPC talkState[talkUser] = 2 só trocar aquela parte por essa. mas tipo, o player vai falar espada e ele vai querer só 10kk, ai depois vai pedir outros items? lembrando, depois que alterar RECRIE o NPC
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
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:lower()) end function onThink() npcHandler:onThink() end local talkState = {} -- function de tempo //NÃO MEXER local function getTimeString(self) local format = { {'dia', self / 60 / 60 / 24}, {'hora', self / 60 / 60 % 24}, {'minuto', self / 60 % 60}, {'segundo', self % 60} } local out = {} for k, t in ipairs(format) do local v = math.floor(t[2]) if(v > 0) then table.insert(out, (k < #format and (#out > 0 and ', ' or '') or ' e ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or '')) end end local ret = table.concat(out) if ret:len() < 16 and ret:find('segundo') then local a, b = ret:find(' e ') ret = ret:sub(b+1) end return ret end local itemid = { -- id dos items necessários pra troca [1] = {item = 8976, count = 1}, [2] = {item = 2350, count = 1}, [3] = {item = 2160, count = 1000}, } local save_items = 0 -- variavel apenas pra salvar a quantidade de items //nao mexer local tempo_de_espera = 1 -- em minutos local storage = 58458711 -- storage //se não souber, não mexer local storageAceitar = 58458712 local item_trocado = 10313 -- id do item que vira após a troca local trocar_mais_de_uma_vez = false -- o player pode trocar varias vezes esse 4 items por 1? //true pode trocar mais de 1x //false só troca uma vez function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if isInArray({"espada", "itens", "lista"}, msg) then local lista = '' for i=1, #itemid do lista = lista..itemid[i].count..' - '..getItemNameById(itemid[i].item) if i+1 <= #itemid then lista = lista..', ' end end selfSay("Onde voce encontrou esta espada quebrada? com ela posso fazer uma poderosa espada, mais vc vai precisar trazer 30 pieces of iron, 30 silver broochs, 1o golden mugs, 1 demonic essence e 10kk. Aceita?", cid) talkState[talkUser] = 10 elseif isInArray({"yes", "aceito", "sim"}, msg) and talkState[talkUser] == 10 then selfSay("Otimo, me traga o que te pedi: 30 pieces of iron, 30 silver broochs, 10 golden mugs, 1 demonic essence e 10kk.", cid) setPlayerStorageValue(cid, storageAceitar, 1) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) elseif isInArray({"espada","troca","trocar"}, msg) then -- mensagem do player if getPlayerStorageValue(cid, storageAceitar) == 1 then local lista = '' for i=1, #itemid do lista = lista..itemid[i].count..' - '..getItemNameById(itemid[i].item) if i+1 <= #itemid then lista = lista..', ' end end selfSay("Voce aceita me pagar {"..lista.."} pela espada?", cid) -- msg do NPC talkState[talkUser] = 2 else selfSay("Primeiro gostaria de ver a {lista} de itens para me trazer?", cid) talkState[talkUser] = 11 end elseif isInArray({"no","não","bye","not"}, msg) and talkState[talkUser] == 11 then selfSay("OK, Bye!", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) elseif isInArray({"sim","quero","yes","yeah"}, msg) and talkState[talkUser] == 11 then local lista = '' for i=1, #itemid do lista = lista..itemid[i].count..' - '..getItemNameById(itemid[i].item) if i+1 <= #itemid then lista = lista..', ' end end selfSay("A lista de items são: {"..lista.."}", cid) selfSay("Você {aceita} pegar esses items?", cid) talkState[talkUser] = 10 elseif isInArray({"sim","quero","yes","yeah"}, msg) and talkState[talkUser] == 2 then if trocar_mais_de_uma_vez == false and getPlayerStorageValue(cid, storage) ~= -1 then selfSay("Desculpe, voce ja fez sua troca!", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) return true end for i=1, #itemid do -- for pra fazer a contagem dos items if getPlayerItemCount(cid, itemid[i].item) >= itemid[i].count then -- caso o player tenha o item save_items = save_items + 1 -- salva na variavel end end if save_items >= #itemid then -- se tiver todos os items necessários selfSay("Otimo! vai levar 9 horas ate que a espada fique pronta, volte aqui em "..getTimeString(tempo_de_espera*60)..".", cid) -- manda a mensagem setPlayerStorageValue(cid, storage, os.time() + (tempo_de_espera*60)) -- seta a storage pra 60 minutos for i=1, #itemid do doPlayerRemoveItem(cid, itemid[i].item, itemid[i].count) -- remove os items do player end else selfSay("Desculpe, mas o senhor nao me trouxe os itens necessarios!", cid) -- mensagem caso não tenha os items necessários talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end elseif isInArray({"no","não","nao","not"}, msg) and talkState[talkUser] == 2 then -- caso o player não queira trocar, só da tchau selfSay("Tudo bem então, Bye!", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) elseif isInArray({"receber","receber item"}, msg) then -- caso o player digite "receber" if (getPlayerStorageValue(cid, storage) - os.time() <= 0 and getPlayerStorageValue(cid, storage) ~= 0 and getPlayerStorageValue(cid, storage) ~= -1) then -- checa se já passou [tempo de espera], e não é 0 local new_item = doCreateItemEx(item_trocado, 1) local receive = doPlayerAddItemEx(cid, new_item) if receive == RETURNVALUE_NOERROR then -- caso o player tenha slot na bp, etc.. selfSay("Sua espada esta pronta, aqui esta!", cid) -- msg do NPC setPlayerStorageValue(cid, storage, 0) -- seta a storage do player pra 0 talkState[talkUser] = 0 npcHandler:releaseFocus(cid) else selfSay("Sua espada esta pronta, deixe espaço em sua mochila!", cid) -- caso não consiga entregar o item só pede pra deixar espaço talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end elseif getPlayerStorageValue(cid, storage) - os.time() > 0 then selfSay("Sua espada ainda {nao esta pronta}, volte em "..getTimeString((getPlayerStorageValue(cid, storage)-os.time()))..".", cid) -- caso ainda não esteja pronto o item talkState[talkUser] = 0 npcHandler:releaseFocus(cid) elseif getPlayerStorageValue(cid, storage) == 0 then selfSay("Desculpe, mas o senhor nao me trouxe os itens necessarios!", cid) -- caso ainda não esteja pronto o item talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) @Strikerzerah trocar a fala de 10kk por selfSay("Voce aceita me pagar {"..lista.."} pela espada?", cid) coloca o script acima, e reabre o ot ou recria o NPC, sempre que editar script de NPC´, é necessário recria-lo
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
sim, pra receber não precisa dos items na BP, precisa ter os items na hora de aceitar a missão. a não ser que vc modificou e tirou, me manda seu script como ta em spoiler pf
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
não entendi, aonde esta faltando?
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
faz um videozinho pf, com um char que não fez a troca ainda, e explica o passo a passo
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
ele só consome os items, caso vc tenha a quantidade que ele pediu, se não ele só diz que não tem a quantidade necessária
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
ele ja diz quando não tem os items vc precisa alterar aki em cima deu 1 minuto pq precisa alterar la, e o tempo precisa ser em minutos 9h em minutos = 9*60
-
(Resolvido)NPC que troca varios itens por x item em determinado tempo
nessa parte coloca assim: elseif isInArray({"receber","receber item"}, msg) then -- caso o player digite "receber" if (getPlayerStorageValue(cid, storage) - os.time() <= 0 and getPlayerStorageValue(cid, storage) ~= 0 and getPlayerStorageValue(cid, storage) ~= -1) then -- checa se já passou [tempo de espera], e não é 0
-
Erro de status
coloca a key nos items assim: <attribute key="showattributes" value="1" /> e creio que isso não funciona como protect elemental mano <attribute key="elemental protection fire" value="3" /> <attribute key="elemental protection holy" value="3" /> <attribute key="elemental protection earth" value="3" /> <attribute key="elemental protection death" value="3" /> tenta achar algum item que tem protection elemental pra colocar.
-
Global Loot (Adicionar drop em todos os monsters onDeath)
ter tem.... porém teria que instanciar esse script em todos os monstros do servidor, oq não faz muito sentido, sendo que vc pode já adicionar o loot ao XML do servidor. o mais facil seria vc criar uma função onKill e instanciar no player ao logar, que sempre que ele matar tem chance de add o item ao player, mais facil, porém pode ser que bugue.
-
BONUS ao USAR CLIENTE PROPRIO DO OT
precisa fazer essa checagem na source, de qual tipo de client ele ta logando, isso é um trampo meio dificil, vai precisa de algum que saiba mexer muito bem com client-source
-
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: tile_store (SELECT "house_id", "data" FROM "tile_store" WHERE "world_id" = 0)
Não encontrou spawn.xml (isso eh literalmente o spawn de todos os monstros e NPC's), house.xml (todas as houses do ot), e não encontrou na DataBase do servidor a tabela "tile_store", bom basicamente esse OT ta zuado, principalmente em DB e datapack, ou seja 90% do ot.