Tudo que JEAN JR postou
-
(Resolvido)SCRIPT EFEITO EM TOP LEVEL (TEMPO REAL)
Pessoal estou com este script que solta uma Mensagem de Efeito no TOP level do servidor, porem a parte de onAdvanced não está funcionando. No caso essa parte deveria funcionar da seguinte forma: Outro player upa e fica com essa mensagem de TOP LEVEL e do antigo TOP LEVEL some, porem ela só funciona quando o atual TOP LEVEL desloga e loga novamente. E eu queria que esse script funcionasse em tempo real. Esse código é do @Bruno Minervino <event type="login" name="TopEffect" event="script" value="topeffect.lua"/> <event type="advance" name="CheckTop" event="script" value="topeffect.lua"/> --[[ Script by Bruno Minervino para o Tibia King Caso for postar, colocar os créditos ]] local config = { tempo = 2, --tempo em segundos mensagem = { texto = "[*KING*]", --não use mais de 9 caracteres efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText }, efeito = 30, --efeito da função doSendMagicEffect globalstr = 121221 -- uma global storage qualquer q esteje vazia } --[[ Não mexa em nada abaixo ]] --local topPlayer = getGlobalStorageValue(config.globalstr) > 0 and getGlobalStorageValue(config.globalstr) or 0 function onLogin(cid) local query = db.getResult("SELECT `id`, `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then local pid = query:getDataString("id") local name = query:getDataString("name") if getPlayerName(cid) == name then if topPlayer ~= getPlayerID(cid) then topPlayer = getPlayerID(cid) end setGlobalStorageValue(config.globalstr, pid) doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22) doSetMonsterOutfit(cid, 102) TopEffect(cid) end end registerCreatureEvent(cid, "CheckTop") return true end function onAdvance(cid, skill, oldlevel, newlevel) if skill == 8 then local query = db.getResult("SELECT `id`, `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then local level = tonumber(query:getDataString("level")) if level < newlevel and topPlayer ~= getPlayerID(cid) then doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22) topPlayer = getPlayerID(cid) doSaveServer() setGlobalStorageValue(config.globalstr, getPlayerID(cid)) doSetMonsterOutfit(cid, 102) TopEffect(cid) end end end return true end function TopEffect(cid) if not isPlayer(cid) then return true end if topPlayer == getPlayerID(cid) then doSendAnimatedText(getCreaturePosition(cid), config.mensagem.texto, config.mensagem.efeito) doSendMagicEffect(getCreaturePosition(cid), config.efeito) addEvent(TopEffect, config.tempo * 1000, cid) end end function getPlayerNameById(id) local query = db.getResult("SELECT `name` FROM `players` WHERE `id` = " .. db.escapeString(id)) if query:getID() ~= -1 then return query:getDataString("name") end return 0 end function getPlayerIdByName(name) local query = db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(name)) if query:getID() ~= -1 then return tonumber(query:getDataString("id")) end return 0 end function getPlayerID(cid) return getPlayerIdByName(getPlayerName(cid)) end
-
NPC DE VOCAÇÃO TIBIA DBO
Ainda não entendi como coloca Outfit, mas oque você pode fazer que é bem mais prático é dar um logout no cara quando ele for teleportado, assim quando ele logar novamente, ele já vai estar com tal outfit. Melhor do que setar uma por uma haha. Testa esse código ai, adicionei apenas um comando que kicka o PLAYER, e quando ele logar novamente ele já loga com o outifit. local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local pos = {x=99, y=188, z=7} function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Hey!.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) if getPlayerVocation(cid) == 0 then msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 5 then selfSay('Olá, Escolha sua Vocacao: Goku, Vegeta, Piccolo, C17, Gohan, Trunks, Cell, Freeza, Majin Boo, Broly, C18, Uub, Goten, Chibi Trunks, Cooler, Dende, Tsuful, Bardock, Kuririn, Pan, Kaio, Videl, Janemba, Tenshinhan, Jenk, Raditz, C16, Turles, Bulma, Shenron.') talk_start = 1 elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 5 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! ????????.') elseif focus == cid then talk_start = os.clock() elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 5 then selfSay('Good bye, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 elseif(msgcontains(msg, 'goku') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar um Goku ?') talk_start = 2 idVocacao = 1 elseif(msgcontains(msg, 'vegeta') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Vegeta ?') talk_start = 2 idVocacao = 17 elseif(msgcontains(msg, 'piccolo') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Piccolo ?') talk_start = 2 idVocacao = 32 elseif(msgcontains(msg, 'c17') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C17 ?') talk_start = 2 idVocacao = 45 elseif(msgcontains(msg, 'gohan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Gohan ?') talk_start = 2 idVocacao = 57 elseif(msgcontains(msg, 'trunks') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Trunks ?') talk_start = 2 idVocacao = 71 elseif(msgcontains(msg, 'cell') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Cell ?') talk_start = 2 idVocacao = 83 elseif(msgcontains(msg, 'freeza') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Freeza ?') talk_start = 2 idVocacao = 95 elseif(msgcontains(msg, 'majin boo') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Majin Boo ?') talk_start = 2 idVocacao = 111 elseif(msgcontains(msg, 'broly') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Broly ?') talk_start = 2 idVocacao = 127 elseif(msgcontains(msg, 'c18') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C18 ?') talk_start = 2 idVocacao = 140 elseif(msgcontains(msg, 'uub') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Uub ?') talk_start = 2 idVocacao = 152 elseif(msgcontains(msg, 'goten') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Goten ?') talk_start = 2 idVocacao = 164 elseif(msgcontains(msg, 'chibi trunks') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Chibi Trunks ?') talk_start = 2 idVocacao = 178 elseif(msgcontains(msg, 'cooler') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Cooler ?') talk_start = 2 idVocacao = 192 elseif(msgcontains(msg, 'dende') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Dende ?') talk_start = 2 idVocacao = 206 elseif(msgcontains(msg, 'tsuful') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Tsuful ?') talk_start = 2 idVocacao = 218 elseif(msgcontains(msg, 'bardock') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Bardock ?') talk_start = 2 idVocacao = 230 elseif(msgcontains(msg, 'kuririn') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Kuririn ?') talk_start = 2 idVocacao = 244 elseif(msgcontains(msg, 'pan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Pan ?') talk_start = 2 idVocacao = 256 elseif(msgcontains(msg, 'kaio') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Kaio ?') talk_start = 2 idVocacao = 268 elseif(msgcontains(msg, 'videl') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Videl ?') talk_start = 2 idVocacao = 280 elseif(msgcontains(msg, 'janemba') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Janemba ?') talk_start = 2 idVocacao = 292 elseif(msgcontains(msg, 'tenshinhan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Tenshinhan ?') talk_start = 2 idVocacao = 304 elseif(msgcontains(msg, 'jenk') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Jenk ?') talk_start = 2 idVocacao = 316 elseif(msgcontains(msg, 'raditz') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Raditz ?') talk_start = 2 idVocacao = 328 elseif(msgcontains(msg, 'c16') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C16 ?') talk_start = 2 idVocacao = 340 elseif(msgcontains(msg, 'turles') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Turles ?') talk_start = 2 idVocacao = 352 elseif(msgcontains(msg, 'bulma') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Bulma ?') talk_start = 2 idVocacao = 364 elseif(msgcontains(msg, 'shenron') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Shenron ?') talk_start = 2 idVocacao = 376 elseif(msgcontains(msg, 'yes') and talk_start == 2) then doPlayerSetVocation(cid, idVocacao) doTeleportThing(cid, pos) talk_start = 0 doRemoveCreature(cid) end else doTeleportThing(cid, pos) end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 6 then selfSay('Good bye then.') focus = 0 end end end
-
[AJUDA] spells por groups
Groups são os grupos de spells/runas é oque diferencia se ela é de attack, heal ou utilitário. E depois da virgula se nao me engano é o exausted. Icon eu nao sei
-
[AJUDA] spells por groups
Manda o script completo pra gente poder entender manin
-
(Resolvido)TOWN ID
UP! @KotZletY se tiver como dar um HELP kk Pessoal, depois de muito tentar, consegui HAHA no caso oque está fazendo o player voltar para o TOWN ID 1 toda hora que iniciava o servidor era isso ai. Estou deixando a resposta para outros que estiverem com o mesmo problema. É uma query que fazia um UPDATE pra TOWNID voltar pra 1. O arquivo está em data/globalevents/scripts/start.lua
-
NPC DE VOCAÇÃO TIBIA DBO
Eai Galera do TK, tranquilo ? Hoje uma pessoa do TibiaKing me procurou pedindo ajuda com Account Manager no TIBIA DBO pelo motivo de não ter dinheiro para hospedar o site, porem no TIBIA DBO pelo que pesquisei ele não tem Account Manager e não dá pra criar por conta de algumas Sources que não tem, e realmente no OT DBO dele dava BUG ao tentar criar por Account Manager (Que eu mesmo criei por conta de não ter). Mas vamos ao que Interessa. Acabei fazendo o NPC Yaman (do começo do jogo) de NPC de escolha de Vocação, e quero disponibilizar pra quem estiver com o mesmo problema e não tenha site. 1º Vai na pasta data/npc/scripts/ e abre a Script do NPC Yaman; 2º Copie o código abaixo e cole lá; 3º Salve, abra o jogo e desfrute. OBS: O player sempre quando morre volta para o mesmo lugar, então coloquei uma validação de que se o Player já estiver com uma vocação ele apenas vai ser teleportado para a city. local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local pos = {x=99, y=188, z=7} function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Hey!.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) if getPlayerVocation(cid) == 0 then msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 5 then selfSay('Olá, Escolha sua Vocacao: Goku, Vegeta, Piccolo, C17, Gohan, Trunks, Cell, Freeza, Majin Boo, Broly, C18, Uub, Goten, Chibi Trunks, Cooler, Dende, Tsuful, Bardock, Kuririn, Pan, Kaio, Videl, Janemba, Tenshinhan, Jenk, Raditz, C16, Turles, Bulma, Shenron.') talk_start = 1 elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 5 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! ????????.') elseif focus == cid then talk_start = os.clock() elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 5 then selfSay('Good bye, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 elseif(msgcontains(msg, 'goku') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar um Goku ?') talk_start = 2 idVocacao = 1 elseif(msgcontains(msg, 'vegeta') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Vegeta ?') talk_start = 2 idVocacao = 17 elseif(msgcontains(msg, 'piccolo') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Piccolo ?') talk_start = 2 idVocacao = 32 elseif(msgcontains(msg, 'c17') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C17 ?') talk_start = 2 idVocacao = 45 elseif(msgcontains(msg, 'gohan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Gohan ?') talk_start = 2 idVocacao = 57 elseif(msgcontains(msg, 'trunks') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Trunks ?') talk_start = 2 idVocacao = 71 elseif(msgcontains(msg, 'cell') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Cell ?') talk_start = 2 idVocacao = 83 elseif(msgcontains(msg, 'freeza') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Freeza ?') talk_start = 2 idVocacao = 95 elseif(msgcontains(msg, 'majin boo') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Majin Boo ?') talk_start = 2 idVocacao = 111 elseif(msgcontains(msg, 'broly') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Broly ?') talk_start = 2 idVocacao = 127 elseif(msgcontains(msg, 'c18') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C18 ?') talk_start = 2 idVocacao = 140 elseif(msgcontains(msg, 'uub') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Uub ?') talk_start = 2 idVocacao = 152 elseif(msgcontains(msg, 'goten') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Goten ?') talk_start = 2 idVocacao = 164 elseif(msgcontains(msg, 'chibi trunks') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Chibi Trunks ?') talk_start = 2 idVocacao = 178 elseif(msgcontains(msg, 'cooler') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Cooler ?') talk_start = 2 idVocacao = 192 elseif(msgcontains(msg, 'dende') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Dende ?') talk_start = 2 idVocacao = 206 elseif(msgcontains(msg, 'tsuful') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Tsuful ?') talk_start = 2 idVocacao = 218 elseif(msgcontains(msg, 'bardock') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Bardock ?') talk_start = 2 idVocacao = 230 elseif(msgcontains(msg, 'kuririn') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Kuririn ?') talk_start = 2 idVocacao = 244 elseif(msgcontains(msg, 'pan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Pan ?') talk_start = 2 idVocacao = 256 elseif(msgcontains(msg, 'kaio') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Kaio ?') talk_start = 2 idVocacao = 268 elseif(msgcontains(msg, 'videl') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Videl ?') talk_start = 2 idVocacao = 280 elseif(msgcontains(msg, 'janemba') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Janemba ?') talk_start = 2 idVocacao = 292 elseif(msgcontains(msg, 'tenshinhan') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Tenshinhan ?') talk_start = 2 idVocacao = 304 elseif(msgcontains(msg, 'jenk') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Jenk ?') talk_start = 2 idVocacao = 316 elseif(msgcontains(msg, 'raditz') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Raditz ?') talk_start = 2 idVocacao = 328 elseif(msgcontains(msg, 'c16') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar C16 ?') talk_start = 2 idVocacao = 340 elseif(msgcontains(msg, 'turles') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Turles ?') talk_start = 2 idVocacao = 352 elseif(msgcontains(msg, 'bulma') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Bulma ?') talk_start = 2 idVocacao = 364 elseif(msgcontains(msg, 'shenron') and talk_start == 1) then selfSay('Voce Deseja Realmente se tornar Shenron ?') talk_start = 2 idVocacao = 376 elseif(msgcontains(msg, 'yes') and talk_start == 2) then doPlayerSetVocation(cid, idVocacao) doTeleportThing(cid, pos) talk_start = 0 end else doTeleportThing(cid, pos) end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 6 then selfSay('Good bye then.') focus = 0 end end end
-
(Resolvido)TOWN ID
BOA NOITE PESSOAL DO TIBIA KING. ESTOU COM UM PROBLEMA NO MEU SERVIDOR QUE É: O PLAYER ESTAVA NASCENDO COM O TOWN ID 1, QUE NÃO TEM NO MEU SERVIDOR (REMERES), ENTÃO MUDEI PRA TOWN ID (2). ELE NASCE COM TOWN ID (2) QUANDO EU CRIO, POREM QUANDO EU REINICIO O SERVIDOR, TODOS OS PLAYERS NO BANCO DE DADOS VOLTAM PARA TOWN ID (1). JÁ MUDEI OS SAMPLES ? SIM JÁ MUDEI NO CONFIG.PHP ? SIM JÁ MUDEI NO CONFIG.LUA ? SIM ME AJUDEM SE PRECISAREM DE ALGUMA PASTA ME FALA QUE EU MANDO.
-
ERRO AO COMPILAR NO DEV-C++
Quero aprender a compilar para se caso eu queira fazer alterações nas sources futuramente.
-
ERRO AO COMPILAR NO DEV-C++
Dá o mesmo erro man, só que em outra pasta ;/
-
ERRO AO COMPILAR NO DEV-C++
Galera, estou com um problema ao tentar compilar no Dev-C++ Peguei o tutorial do @Natanael Beckman DEV-C COMPILANDO TFS NO WINDOWS E peguei primeiro as Sources do @Fir3element TFS 0.4 - SOURCES Depois peguei as Sources do @Matk TFS 0.4 - SOURCES E os dois deu o erro abaixo.
- Atacar e usar runa ao mesmo tempo
-
(Resolvido)Atacar Magia em Player Apenas
Então mano, ja tinha testado assim, porem não funcionou. Vlw mano, funcionou direitinho, eu tava colocando (if target == isPlayer and isCreature then) só faltava o isPlayer(target) haha, muito obrigado mesmo. REP+
-
(Resolvido)Atacar Magia em Player Apenas
UP
-
(Resolvido)Atacar Magia em Player Apenas
Galera do TK só de boas? Estou com esse código abaixo e estou tentando por ele pra atacar apenas player e não montros, alguém poderia me ajudar? Explicando um pouco o código: Oque ele faz é trocar de lugar com o Target, porem quero que funcione apenas com Target=PLAYER function onCastSpell(cid, var) local jogadorpos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local monsterpos = getCreaturePosition(target) if target == isMonster or isCreature then doTeleportThing(cid,monsterpos) doTeleportThing(target,jogadorpos) doSendMagicEffect(jogadorpos, 65) doSendMagicEffect(monsterpos, 65) else doPlayerSendTextMessage(cid,20,'It is not possible to use on creatures.') end end