
Tudo que xWhiteWolf postou
-
[AJUDA] Creaturescript
no script do monstro vc adicionou os dois events? e colocou pra registrar os dois eventos no login.lua? Os scripts estão certinhos pelo que eu olhei, o erro deve ser em uma das coisas que eu citei anteriormente. Outra coisa, não entendi esse Storage que vc fez, ele tá chamando algum valor pra Primeira e Segunda Arvore ou você salvou o valor do storage numa string?
-
(Resolvido)[AJUDA] Ganhar addon com X item no inventário.
coloca o comando pra setar o outfit igual eu te falei a uma página atrás rs.
- Corpo do Player não fica no chão
-
[TALKACTION]Remove itens nao funciona.
o meu funciona 100%, experimenta trocar function onSay(cid, words, param, channel) local toPos = getCreatureLookPosition(cid) if(isInArray({"full", "all"}, param:lower())) then doCleanTile(toPos, false) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end local amount = 1 param = tonumber(param) if(param) then amount = param end toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_FIELD tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end toPos.stackpos = STACKPOS_TOP_CREATURE tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then doRemoveCreature(tmp.uid) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end for i = 5, 1, -1 do toPos.stackpos = i tmp = getThingFromPos(toPos) if(tmp.uid ~= 0) then if(isCreature(tmp.uid)) then doRemoveCreature(tmp.uid) else doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount)) end doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) return true end end doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end lembra que esse comando remove coisas e precisa ter acesso 4 pra usar.
-
Como botar uma vocation vip? no meu server de narutibia
cria as vocações vip no seu vocations.xml e no script de dar vip vc coloca pra dar a vocation vip referente à vocação atual do player. Se for knight vira Vip Knight e assim por diante.. dai vc coloca no creaturescripts\login.lua que se o player não for vip a vocação dele tem que voltar a ser a de antes. Fim
-
(Resolvido)Quest com Tempo
os.time é pra contar o tempo em segundos desde 1 de janeiro de 1970. Quando vc usa a função os.time ele retorna o valor de tempo que se passou desde 1 de janeiro de 1970. O ideal é utilizar os.date que tem um critério um pouco mais legal dependendo da variável indicadora que vc utilizar. Mas não tem nada a ver com oque vc pediu aí. Pra fazer algo com tempo vc usa o addEvent e ele funciona mais ou menos assim: Observe um script que utiliza addEvent que jajá eu explico function onUse(cid, item, frompos, item2, topos) local tempo = 8000 local wall1 = {x=612, y=345, z=7, stackpos=1} local pos1 = getThingfromPos(wall1) local wall2 = {x=653, y=345, z=7, stackpos=1} local pos2 = getThingfromPos(wall2) local monster1 = {x=615, y=345, z=7, stackpos=1} local posmonster1 = getThingfromPos(monster1) local monster3 = {x=654, y=345, z=7, stackpos=1} local idparede = 9788 local alavanca = {x=610, y=344, z=7, stackpos=1} local alavancapos = getThingfromPos(alavanca) function wait1(wall1) doCreateItem(idparede,1,wall1) end function wait2(wall2) doCreateItem(idparede,1,wall2) end function wait3(alavanca) doTransformItem(item.uid,1946) end if item.uid == 7777 and item.itemid == 1945 then if pos1.itemid ~= 0 and pos2.itemid ~= 0 then doRemoveItem(pos1.uid,5) doSendMagicEffect(pos1,12) doRemoveItem(pos2.uid,5) doSendMagicEffect(pos2,12) doCreateMonster("Juggernaut",monster1) doSendMagicEffect(monster1,13) doPlayerSendTextMessage(cid,25, "You have ".. tempo/1000 .." seconds to finish the quest") addEvent(wait1,tempo,wall1) addEvent(wait2,tempo,wall2) addEvent(wait3,tempo,alavanca) else doPlayerSendCancel(cid,"You can't start the quest twice.") end elseif item.uid == 7777 and item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) for x = monster1.x, monster3.x do for y = monster1.y, monster3.y do for z = monster1.z, monster3.z do local mob = getTopCreature({x=x, y=y, z=z}).uid if mob ~= 0 and isMonster(mob) then doRemoveCreature(mob) else doPlayerSendCancel(cid,"Sorry, not possible.") end end end return true end end return true end addEvent(wait1,tempo,wall1) ele faz o evento chamado wait1 dali a um tempo igual a tempo (no começo do script eu falei que tempo era 8 segundos) e na posição wall1. function wait1(wall1) doCreateItem(idparede,1,wall1) end a função wait1 cria um item de idparede na posição wall1. Então essa quest nada mais faz doque criar uma parede que impede a passagem dali a 8 segundos. Seguindo essa lógica da pra fazer a quest que você quer. Só criar uma função que pega o valor de tempo = 0 e adiciona 1 até o valor de tempo final, dai você coloca addEvent (função X, tempo*1000 executar determinada função em tempo*1000 mas se o tempo muda então ele vai ficar executando a função de X em X segundos de acordo com o valor de tempo. Para tempo = 1 será 1 segundo, para tempo = 2 será dali a 2 segundos e assim por diante. AGORA SOBRE A OUTRA DÚVIDA Para colocar tempo nos storages vc só tem que fazer isso daqui local daysvalue = 7 * 24 * 60 * 60 time = os.time() + daysvalue setPlayerStorageValue(cid, 13340, time) perceba que ele usa os.time, então o script é basicamente isso daqui: tempo que storage vai ficar: 7 dias (7*24*60*60) tempo = segundos desde 1 de janeiro de 1970 até agora + 7 dias dar storage pro player 13340 durante tempo. Espero ter ajudado, qualquer dúvida dá uma pesquisada ou me manda PM
-
Scripts De Alavancas Preciso De Ajudas
function onUse(cid, item, frompos, item2, topos) local topos = {x=612, y=345, z=7, stackpos=1} -- POSIÇÃO Q VAI TELEPORTAR local itemid = 7465 -- ID DO ITEM QUE GANHA local storage = 50011 if item.uid == 7777 and item.itemid == 1945 then if getPlayerStorageValue(cid,storage) == -1 then doTeleportThing(cid, topos) doSendMagicEffect(cid,13) doPlayerAddItem(cid,itemid,1) doPlayerSendTextMessage(cid,25, "You have found a ".. getItemNameById(itemid) ..".") setPlayerStorageValue(cid,storage,1) else doPlayerSendCancel(cid,"You can't do this quest twice.") end end return true end nao testei mas deve funcionar
-
(Resolvido)[Ajuda] Checa se há player entre coordenadas.
eu faria assim (não testei e isso é só um exemplo) só to dando a ideia de outro modo que não vá retornar um valor nil for x = from.x, to.x do for y = from.y, to.y do for z = from.z, to.z do local mob = getTopCreature({x=x, y=y, z=z}).uid if mob ~= 0 and isPlayer(mob) then doBroadcastMessage("Temos intrusos e o item nao foi criado!") addEvent(ReAtive, check * 1000) else doCreateItem(corpse, 1, pos) doBroadcastMessage("Item adicionado com sucesso!") end end end return true end
-
Sistema Vip usando Premium Account
to sem tempo pra testar mas é bem provável que funcione function onSay(cid, words, param) -- configs local access = 1 local days = 30 -- end configs local player = getPlayerByName(param) local pid = getPlayerByNameWildcard(param) if(not pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end if param ~= "" then if getPlayerGroupId(cid) >= access then doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adcionados ".. days .." dias de VIP no seu character.") doPlayerAddPremiumDays(player, days) local quantity = math.floor(getPlayerPremiumDays(player)) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somente jogadores com acesso maior que "..access.." podem adcionar vips.") end end end se der algum erro, experimenta remover essa parte aqui: local pid = getPlayerByNameWildcard(param) if(not pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end
-
(Resolvido)[AJUDA] Ganhar addon com X item no inventário.
local outfitvip = { lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 1 } só isso cara, o lookAddons é a quantidade de addons que vai adicionar, vc tb pode editar as cores da roupa do outfit a seu critério. Addon 1 = o primeiro, addon 2 = o segundo, addon 3 = ambos primeiro e segundo
-
Preciso de uma Script .
vc pode utilizar uma storage pra isso, fazer uma talkaction pra chegar sua quantidade de pontos e uma quest que chega o valor do storage (que no caso seria a quantidade de pontos necessárias) Só fica esperto que o numero padrão de storage é -1, dai vc teria que colocar no creaturescripts\login.lua que se o storage X for igual a -1, ele passe a ser 0. Dai por natureza todo player teria 0 pontos, e você pode dar os pontos por comandos, por quests, por tasks, por tempo online ou pelo que você preferir
-
(Resolvido)[AJUDA] Ganhar addon com X item no inventário.
esse comando que vc utilizou apenas adiciona o outfit pro player, não muda o outfit dele.. pra mudar sozinho vc pode usar do jeito que o adriano mostrou, por conditions OU você pode usar a função doSetCreatureOutfit(cid, outfit, tempo) que tem em alguns TFS
- Outfit Script
-
(Resolvido)Experience rune
eu descobri ontem a noite que os donos dos tópicos podem fechar os mesmos: http://www.tibiaking.com/forum/topic/30233-sistema-de-t%C3%B3picos-resolvidos/
-
(Resolvido)Experience rune
peguei isso na lib do meu server.. aqui funcionou normal a cor verde, o problema foi que o docreature say tá saindo do lado do numero de exp então fica bem zoado, sugiro que vc troque doCreatureSay(cid, text, 14) por isso daqui: doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, text) e sobre a cor sair preta.. eu não testei, mas não tem porque não sair da cor que eu coloquei lá, a menos que seu server não tenha definido na lib oque é a TEXTCOLOR_GREEN. doSendAnimatedText(pos, "+"..exp , TEXTCOLOR_GREEN) tenta substituir seguindo essa tabela aqui que eu peguei na lib do meu server TEXTCOLOR_BLUE = 5 TEXTCOLOR_GREEN = 18 TEXTCOLOR_TEAL = 35 TEXTCOLOR_LIGHTGREEN = 66 TEXTCOLOR_DARKBROWN = 78 TEXTCOLOR_LIGHTBLUE = 89 TEXTCOLOR_DARKPURPLE = 112 TEXTCOLOR_BROWN = 120 TEXTCOLOR_GREY = 129 TEXTCOLOR_DARKRED = 144 TEXTCOLOR_DARKPINK = 152 TEXTCOLOR_PURPLE = 154 TEXTCOLOR_DARKORANGE = 156 TEXTCOLOR_RED = 180 TEXTCOLOR_PINK = 190 TEXTCOLOR_ORANGE = 192 TEXTCOLOR_DARKYELLOW = 205 TEXTCOLOR_YELLOW = 210 TEXTCOLOR_WHITE = 215 TEXTCOLOR_NONE = 255 ficando assim: doSendAnimatedText(pos, "+"..exp , 18) se quiser o white coloca 215 no lugar do 18. Testa assim
-
(Resolvido)Experience rune
esqueci de declarar oque era o "pos" local pos = getPlayerPosition(cid) ficando assim: local exp = 500000 -- Quanto de experience o player irá ganhar?!local exhaust = 1 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local text = "Congratulations, you gained "..exp.." points of experience." local storage = 9811 -- Não mexa aqui. function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) local pos = getPlayerPosition(cid) doSendAnimatedText(pos, "+"..exp , TEXTCOLOR_GREEN) doCreatureSay(cid, text, 14) doSendMagicEffect(getCreaturePosition(cid), 5) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end return TRUE end
-
NPC QUE VENDE PREMMY APENAS
eu to muito ocupado essa semana kk me desculpa fazer as coisas correndo assim, tenta agora 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 talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'hi') and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I sell premiums.') if msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then selfSay('Do you want to buy 7 days of premium for 7k?') talkState[talkUser] = 1 elseif talkState[talkUser] = 1 then if msgcontains(msg, 'yes') then if pay(cid,7000) then selfSay('/premium '.. creatureGetName(cid) ..', 7') selfSay('You have 7 days of premium more!') else selfSay('Sorry, you do not have enough money.') end end talkState[talkUser] = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') talkState[talkUser] = 0 end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Experience rune
adiciona isso embaixo de doPlayerAddExp(cid,exp) doSendAnimatedText(pos, "+"..exp , TEXTCOLOR_GREEN)
-
[Dúvida] autoloot distro error
tem uma parte do script local name = getItemName(item.uid):lower() só que getItemName não existe ~.~ o certo seria getItemNameById.
-
NPC QUE VENDE PREMMY APENAS
vê se agora tá certinho do jeito que vc queria 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'hi') and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I sell premiums.') if msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then selfSay('Do you want to buy 7 days of premium for 7k?') talkState[talkUser] = 1 elseif talkState[talkUser] = 1 then if msgcontains(msg, 'yes') then if pay(cid,7000) then selfSay('/premium '.. creatureGetName(cid) ..', 7') selfSay('You have 7 days of premium more!') else selfSay('Sorry, you do not have enough money.') end end talkState[talkUser] = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') talkState[talkUser] = 0 end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) eu to sem server pra testar então desculpa qualquer bug, npc não é minha área kk
-
NPC QUE VENDE PREMMY APENAS
you're welcome local focus = 0 local talk_start = 0 local target = 0 local days = 0 function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') 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) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I sell premiums.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then selfSay('Do you want to buy 7 days of premium for 7k?') talk_state = 1 elseif talk_state == 1 then if msgcontains(msg, 'yes') then if pay(cid,7000) then selfSay('/premium '.. creatureGetName(cid) ..', 7') selfSay('You have 7 days of premium more!') else selfSay('Sorry, you do not have enough money.') end end talk_state = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end
-
PORTA + STORAGE
tem duas formas: pega um script disso e coloca o not na frente kkkk if not GetPlayerStorageValue (cid, 1947, 1) ou muda o valor do storage pra 0: daí só entra quem tiver o storage 0, quem tiver o storage 1 não vai entrar. if GetPlayerStorageValue (cid, 1947, 0)
-
Logout ou Login desmontar automaticamente!
eu não peguei a época do tibia que chegou na montaria, como funciona esse sistema? Me dá pelo menos uma explicada em como funciona o sistema que eu já vou saber te dizer em que pasta ele tá.. ativa quando clica em algo, quando fala alguma coisa?
- Vip ao dar look
-
(Resolvido)[Talkactions] Remove Frags - Erro No Distro
eu tava tentando ajudar, mas fica dificil ensinar sem ter aprendido :/ o script é seu e eu achava que vc não entrava mais aqui então nem fui te procurar pra pedir ajuda. Faz 6 anos que eu não jogo tibia e a ultima vez que eu scriptei foi na versão 8.1 se não me engano. Desde então tudo mudou, funções, jeito de scriptar, e até os erros no console. Pra alguém que tava "aposentado" até que eu ajudei bastante esse fórum.. dá um desconto aí vodk