Tudo que williamcgv postou
-
[Pedido] Efeito
-O sistema funciona perfeitamente o único problema é: Erro: Quando reinicio o server ou seja fecho e abro dinovo, o efeito "top!" some/desaparece do char. Obs: depois de reiniciar o server e upar 1 level no char top do server o efeito "top!" volta para o char. Solução:Eu quero que o efeito "top!" fique permanente no char mesmo fechando e abrindo o server, mas claro só o top level do server como está na script. creaturescript/scripts: <event type="login" name="TopEffect" event="script" value="topeffect.lua"/> <event type="advance" name="CheckTop" event="script" value="topeffect.lua"/> creaturescripts/scripts/topeffect: local config = { tempo = 3, --tempo em segundos mensagem = { texto = "TOP!", --não use mais de 9 caracteres efeito = TEXTCOLOR_DARKRED --efeito para a função doSendAnimatedText }, efeito = 35, --efeito da função doSendMagicEffect globalstr = 5111 -- 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) 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) .. ") alcançou o primeiro lugar no rank nível e foi adicionado a animação TOP! em seu personagem.", 20) topPlayer = getPlayerID(cid) setGlobalStorageValue(config.globalstr, getPlayerID(cid)) 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) 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 Espero que alguém ajude, agradeço!
- TopLevel Effect
-
Summon System
Não entendi aonde colocar isso. Explica com mais detalhes fazendo favor?
-
Summon System
não funcionou já tentei!
-
item que de 30 dias de premium & adicionar vip no nick
e para paracer todos os chars?
-
Summon System
Não funcionou manow é porque o local maxDistance = 2 é distancia do player até o monstro que foi sumunado. Exemplo: Entrei no teletransporte! Erro! Solução!
-
Npc
funcionou certinho obrigado! se puder ajudar nesse aqui também agradeço mais. http://www.tibiaking.com/forum/topic/56105-summon-system/#entry329670
-
Summon System
Eu tenho um sistema de summon que invoca um monstro após usar um item "X". ERRO: Quando subo e desço andares por exemplo de dimensão = z:5 para z:8 ou vice versa, o pet desaparece ou seja quando sobe ou desce mais de 2 andares rápido eles desaparecem, também quando entra em teleporte que é levado para uma distancia maior, eles desaparece mas depende da distancia já testei e no máximo de 34~35 sqm que o pet segue e mais que isso eles desaparecem após entrar no teleporte. Obs.Desaparece/somem ~ só criando outro denovo. SOLUÇÃO: Quero que o summon que foi invocado fica permanente no jogo seguindo o dono por onde for, entrando em teleporte de longa distancia e subindo e descendo andares rápidos ou seja o pet fique infinito é claro que só desaparece se relogar o char (personagem). Deu para entender + ou - como eu desejo? Data\globalevents: <globalevent name="Summon" interval="0" event="script" value="summon.lua"/> Data\globalevents\scripts: function onThink(interval, lastExecution, thinkInterval) local maxDistance = 8 for _, pid in pairs(getPlayersOnline()) do local summons = getCreatureSummons(pid) if #summons ~= 0 then for _, sid in pairs (summons) do if getThingPos(sid).z ~= getThingPos(pid).z or getDistanceBetween(getThingPos(sid), getThingPos(pid)) > maxDistance then doTeleportThing(sid, getThingPos(pid), false) doSendMagicEffect(getThingPos(sid), 10) end end end end return true end Espero que alguém me ajude. Necessito muito disso, agradeço!
-
Npc
zipter?
-
Npc
mano era isso que eu queria para fechar só faltou essa parte: Obrigado, aqui estão suas gemas. se for 1 gema tinha que ser: Obrigado, aqui estão suas gema.
-
Npc
que? não entendeu a explicação que quero? apenas que o npc mande mensagem pra confirmar se quer trocar o trofeu entendeu?
-
Npc
O script funciona normalmente, porém estou com um erro nas mensagem espero que ajudem! PROBLEMA: MENSAGEM DO NPC: Ao falar hi/trofeus/ouro~prata~bronze , o "npc" não fala se tem certeza que quer confirmar a troca do troféu pelo item, ou seja ele já faz a troca após escreve a opção de troféu (ouro/prata/bronze). Exemplo: #Player: Hi #NPC: Ola Fulano. Seja Bem-Vindo a Sala de Trocas. Eu coleciono {trofeus} de ouro, prata e bronze. E para garantir que todos troquem comigo, eu retribuo dando gemas aleatorias. #Player: troféu #NPC: Acho que você pretende trocar algum troféu por gemas. Qual troféu você pretende trocar comigo: {ouro}, {prata} ou {bronze} #Player: bronze #NPC: Obrigado, aqui estão sua gemas. #Player: prata #NPC: Obrigado, aqui estão suas gemas. #Player: ouro #NPC: Obrigado, aqui estão suas gemas. SOLUÇÃO: 1º MENSAGEM DO NPC: O certo é que mande uma mensagem de confirmação após escolher o tipo de troféu (bronze/prata/ouro) Exemplo: #Player: Hi #NPC: Ola Fulano. Seja Bem-Vindo a Sala de Trocas. Eu coleciono {trofeus} de ouro, prata e bronze. E para garantir que todos troquem comigo, eu retribuo dando gemas aleatorias. #Player: troféu #NPC: Acho que você pretende trocar algum troféu por gemas. Qual troféu você pretende trocar comigo: {ouro}, {prata} ou {bronze} #Player: bronze #NPC: Você tem certeza que quer trocar 1 troféu de bronze por 1 gema aleatória? #Player: sim #NPC: Obrigado, aqui estão sua gema. < AS MENSAGEM QUE EU QUERO #Player: prata #NPC: Você tem certeza que quer trocar 1 troféu de prata por 2 gemas aleatória? < QUE APAREÇA AO FALAR #Player: sim #NPC: Obrigado, aqui estão suas gemas. < O TIPO DE TROFÉU ! #Player: ouro #NPC: Você tem certeza que quer trocar 1 troféu de ouro por 3 gemas aleatória? #Player: sim #NPC: Obrigado, aqui estão suas gemas. _____________________________________________________________________________________________________ Data/npc/scripts: 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 function thinkCallback(cid) local rand = math.random(1,100) if rand == 10 then selfSay('Troque o seu troféu aqui.') -- msg que vai sair do npc end if rand == 11 then selfSay ('Só entendo português, diga oi.') end if rand == 12 then selfSay ('Oi! Troco gemas por trofeús!') end return true end function greetCallback(cid) return true end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local trophy = { ["ouro"] = {3, 5805}, --{Quantidade de items aleatórios, ID do troféu}, ["prata"] = {2, 5806}, ["bronze"] = {1, 5807}, } local items = {2154, 2156, 2158} if msgcontains(msg, "trophy") or msgcontains(msg, "trofeu") then selfSay("Acho que você pretende trocar algum troféu por gemas. Qual troféu você pretende trocar comigo: {ouro}, {prata} ou {bronze}?", cid) talkState[talkUser] = 1 return true elseif talkState[talkUser] == 1 then if trophy[msg:lower()] then local trofeu = trophy[msg:lower()] local id = trofeu[2] if getPlayerItemCount(cid, id) > 0 then for i = 1, trofeu[1] do doPlayerAddItem(cid, items[math.random(#items)], 1) end doPlayerRemoveItem(cid, id, 1) selfSay("Obrigado, aqui estão suas gemas.", cid) talkState[talkUser] = 0 return true else selfSay("Você não possui este troféu.", cid) talkState[talkUser] = 0 return true end else selfSay("Este troféu não existe.", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new())
-
zombie event
-Uso um sistema de event zombie e funciona perfeitamente, mas queria que a mensagem aparece de acordo com a quantidade. ERRO: Um novo zumbi apareceu! Agora temos: "1 zumbis" no evento! Um novo zumbi apareceu! Agora temos: "2 zumbis" no evento! Um novo zumbi apareceu! Agora temos: "3 zumbis" no evento! -------------------------------------------------------------------------------- SOLUÇÃO: Um novo zumbi apareceu! Agora temos: "1 zumbi" no evento! Um novo zumbi apareceu! Agora temos: "2 zumbis" no evento! Um novo zumbi apareceu! Agora temos: "3 zumbis" no evento! -------------------------------------------------------------------------------- Assim e diante... É isso que eu queria no caso 1 "zumbi" invés de aparece "1 zumbis" na script. deu para entender +ou- ? agradeço quem puder ajudar! Data\actions\scripts\zombie: local config = { playerCount = 2001, -- Global storage for counting the players left/entered in the event zombieCount = 2002, -- Global storage for counting the zombies in the event teleportActionId = 2000, -- Action id of the teleport needed for the movement script teleportPosition = {x = 1143, y = 1054, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 1152, y = 1028, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 1, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 5, -- Seconds between each spawn of zombie zombieName = "Event zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 3, -- Players needed before the zombies can spawn. walls = {x = 1189, y = 1044, z = 7, stackpos = 1}, -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 1136, y = 1022, z = 7}, -- top left cornor of the playground toPosition = {x = 1163, y = 1040, z = 7}, -- bottom right cornor of the playground } function onThink() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: O evento 'Zumbi' começará em 2 minutos. O portal será fechado quando o evento começar.", MESSAGE_STATUS_CONSOLE_BLUE) doRemoveItem(getThingFromPos(config.walls).uid, 1) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) print(getGlobalStorageValue(2001)) end function startEvent() local get = getThingfromPos(config.teleportPosition) if get.itemid == config.teleportId then doRemoveItem(get.uid, 1) doCreateItem(9486, 1, config.walls) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: Boa sorte no evento 'Zumbi' jogadores. O portal foi fechado! E o primeiro zumbi aparecerá em 5 segundos.", MESSAGE_STATUS_CONSOLE_BLUE) doCreateItem(9486, 1, config.walls) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doBroadcastMessage(getPlayers.uid, "EVENTO ZUMBI MENSAGEM: O primeiro zumbie vai aparecer em " .. config.timeBetweenSpawns .. " segundos. Boa sorte!", MESSAGE_STATUS_CONSOLE_BLUE) end end end end else doBroadcastMessage("EVENTO ZUMBI MENSAGEM: O evento 'Zumbi' não pode ser iniciado pelo pequeno número de jogadores participando. No mínimo " .. config.playersNeededToStartEvent .. " jogadores é necessário!", MESSAGE_STATUS_CONSOLE_ORANGE) doCreateItem(9486, 1, config.walls) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: Um novo zumbi apareceu! Agora temos: " .. getGlobalStorageValue(config.zombieCount) .. " zumbis no evento!", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end
-
Book
passa link de um para ot 8.6 tem algum outro modo não?
-
Book
....
-
Tile teletransporte
Eu uso essa script funciona normal mas ... local pos = {x = 1226, y = 800, z = 7} function onStepIn(cid, item, position, fromPosition) if getPlayerAccess(cid) then doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), 37) end return true end Quando um monstro passa em cima do piso ele da esse erro no distro: [21/04/2015 18:20:07] [Error - MoveEvents Interface] [21/04/2015 18:20:07] data/movements/scripts/anihi4.lua:onStepIn [21/04/2015 18:20:07] Description: [21/04/2015 18:20:07] (internalGetPlayerInfo) Player not found when requesting player info #1
-
(Resolvido)mensagem na script
da um help lá http://www.tibiaking.com/forum/topic/55835-destroy-field/
-
Destroy Field
Eu uso uma script na minha Destroy fire rune, e funcionar perfeitamente... o único problema é que queria que tira-se os fogo,energy,poison,grav atrás das parede exemplo: ANTES DEPOIS ____________________________________ ___________________________________________________ EU PAREDE FOGO EU PAREDE FOGO o II xxx o II /|\ II xx /|\ usei a runa II /\ II x /\ II Data\actions\scripts\tools\destroyfield: UNREMOVABLE_FIELDS = {1497, 1498, 1499, 1505, 1506, 1507, 1508, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 11094, 11095} local function doRemoveField(cid, pos) local field = getTileItemByType(pos, ITEM_TYPE_MAGICFIELD) if(not isInArray(UNREMOVABLE_FIELDS, field.itemid)) then doSendMagicEffect(pos, CONST_ME_POFF) end doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return false end function onCastSpell(cid, var) local pos = variantToPosition(var) if(pos.x == CONTAINER_POSITION) then pos = getThingPos(cid) end if(pos.x ~= 0 and pos.y ~= 0) then return doRemoveField(cid, pos) end doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return false end Entedeu? agradeço quem ajudar!
-
(Resolvido)mensagem na script
meeu voce é foda funcionou muiito obrigado pela ajuda pode mover o tópico tu é show!
-
(Resolvido)mensagem na script
Está dando esse erro no distro e a mensagem não aparece no jogo. [21/04/2015 13:51:51] [Error - Action Interface] [21/04/2015 13:51:51] In a timer event called from: [21/04/2015 13:51:51] data/actions/scripts/one/fusao/alavanca.lua:onUse [21/04/2015 13:51:51] Description: [21/04/2015 13:51:51] data/lib/050-function.lua:222: attempt to index a boolean value [21/04/2015 13:51:51] stack traceback: [21/04/2015 13:51:51] data/lib/050-function.lua:222: in function 'getItemNameById' [21/04/2015 13:51:51] data/actions/scripts/one/fusao/alavanca.lua:136: in function <data/actions/scripts/one/fusao/alavanca.lua:119>
-
(Resolvido)mensagem na script
...
-
NPC que troca um item por um item aleatório
obrigado primeiro problema resolvido! já o segundo cara ele ta repetindo as frases desse npc aqui : <npc name="Donna" script="data/npc/scripts/info.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="136" head="132" body="79" legs="97" feet="132" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Para comprar a promotion diga {!promotion}. Para ver as magias novas diga {!spells}. Para checar o ranking diga {!rank}. Para mudar de sexo diga {!sex}. Para sair dos trainers diga {!sair}. Para ver os status do seu personagem diga {!charinfo}."/> </parameters> </npc> 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 function thinkCallback(cid) local rand = math.random(1,100) if rand == 1 then selfSay('Olá Bem-Vindo ao One Finity Server.') -- msg que vai sair do npc end if rand == 2 then selfSay ('Só entendo português, diga oi.') end if rand == 3 then selfSay ('Para saber novos comandos, fale comigo!') end return true end function greetCallback(cid) return true end npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new())
-
NPC que troca um item por um item aleatório
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 function thinkCallback(cid) local rand = math.random(1,100) if rand == 2 then selfSay('Olá! Venda suas pedras aqui!') -- msg que vai sair do npc end if rand == 1 then selfSay ('Só entendo português, diga oi.') end if rand == 3 then selfSay ('Posso te ajudar?') end return true end function greetCallback(cid) return true end local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'Holy Pet'}, 8298, 0, 'pedra refinadora nivel 1') shopModule:addBuyableItem({'Fire Pet'}, 8299, 0, 'pedra refinadora nivel 2') shopModule:addBuyableItem({'Ice Pet'}, 8301, 0, 'pedra refinadora nivel 3') shopModule:addBuyableItem({'Terra Pet'}, 8302, 0, 'pedra refinadora nivel 4') shopModule:addBuyableItem({'Energy Pet'}, 8303, 0, 'pedra refinadora nivel 5') npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new()) não sei que tem de errado! E voltando no primeiro problema. Para finalizar tem como ajeitar isso: selfSay("Você tem certeza que quer receber "..trophy[msg:lower()][1].." gemas aleatória por um troféu de "..msg:lower().."?", cid) Se eu trocar um troféu de bronze na gema no caso receberia só "1 gema" e a mensagem diz "gemas aleatória" Obs: ou seja não faria sentido 1 está no plural entende? Só quero que quando fale bronze a mensagem apareça assim: Você tem certeza que quer receber 1 gema aleatória por um troféu de bronze.
-
NPC que troca um item por um item aleatório
porra muito obrigado lesk ajudo d+ se possível ajudar no 2 problema agradeceria mais ainda!
-
NPC que troca um item por um item aleatório
as mensagem está aparecendo, só que o NPC não está trocando o troféu pela gema... pf arruma ae! está dando esse erro: [12/01/2015 16:14:15] [Error - Npc interface] [12/01/2015 16:14:15] data/npc/scripts/trofeu.lua:onCreatureSay [12/01/2015 16:14:15] Description: [12/01/2015 16:14:15] data/npc/scripts/trofeu.lua:39: attempt to index local 'trofeu' (a nil value) [12/01/2015 16:14:15] stack traceback: [12/01/2015 16:14:15] data/npc/scripts/trofeu.lua:39: in function 'callback' [12/01/2015 16:14:16] data/lib/npchandler.lua:390: in function 'onCreatureSay' [12/01/2015 16:14:16] data/npc/scripts/trofeu.lua:7: in function <data/npc/scripts/trofeu.lua:7>