Ir para conteúdo

Lurk

Membro
  • Registro em

  • Última visita

Tudo que Lurk postou

  1. caraca tava esperando por isso, vlw demais man teria as paginas p znote?
  2. @Doidodepeda @Doidodepeda só trocar a mensagem que aparece
  3. @Quatroqueijos poe isso no fim da sua lib function timeString(timeDiff,english) -- créditos: Killua local dateFormat = {} if english then dateFormat = { {"day", timeDiff / 60 / 60 / 24}, {"hour", timeDiff / 60 / 60 % 24}, {"minute", timeDiff / 60 % 60}, {"second", timeDiff % 60} } else dateFormat = { {"dia", timeDiff / 60 / 60 / 24}, {"hora", timeDiff / 60 / 60 % 24}, {"minuto", timeDiff / 60 % 60}, {"segundo", timeDiff % 60} } end local out = {} for k, t in ipairs(dateFormat) do local v = math.floor(t[2]) if(v > 0) then table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' e ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or '')) end end return table.concat(out) end
  4. @diarmaint assim local vocacoes = {1, 2 , 3, 4} -- vocacoes que podem ganhar essa skin function onUse(cid, item) if getPlayerStorageValue(cid, 11140) < 1 and isInArray(vocacoes, getPlayerVocation(cid)) then setPlayerStorageValue(cid, 11140, 1) doPlayerSendCancel(cid, "Voce já ganhou essa skin!.") doSendMagicEffect(getPlayerPosition(cid), 5) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você recebeu a skin!.") doRemoveItem(item.uid, 1) elseif getPlayerStorageValue(cid, 11140) == 1 then doPlayerSendCancel(cid, "Voce já tem essa skin.") else doPlayerSendCancel(cid, "Sua vocacao nao pode ganhar essa skin.") end return true end
  5. @Samuel Cstr lol ngm é obrigado a responder, isso aqui n eh trabalho de ngm n, n eh um forum cheio de profissional prontamente esperando suas duvidas p te responder de graça isso aqui é hobby, quem te ajuda ajuda pq quer, tirou tempo do dia p isso, compartilhou conhecimento de graça outra, pode te chocar mas pode ter gente que n sabe, todo dia entra gente nova no forum e gente da antiga vai embora, segue coma vida, esquece do tibia muita gente aqui é muito mal acostumado tipo vc
  6. @LeoTK eu sei como não afetar quem é da guild e quem esta em party mas não sei como aplicar o efeito com magia em área teria que criar uma condition customizada, talvez um membro mais experiente do fórum possa ajudar...
  7. Fiz essa spell a pedido de um usuário do fórum e logo depois outro usuário pediu uma versão onde o target do player afetado pela magia ficasse bloqueado por um tempo configurável, gostei da ideia e decidi postar em forma de tópico. Primeiro de tudo você vai precisar dessa função feita/disponibilizada pelo @WooX (não se esqueçam de passar no tópico dele e agradecer) Em data/spells.xml adicione <instant name="Cancel Enemy Target" words="Cancel Enemy Target" lvl="12" mana="20" range="3" blockwalls="1" needtarget="1" exhaustion="2000" needlearn="0" event="script" value="canceltargetlurk.lua"> <vocation id="1"/> <vocation id="2"/> </instant> em data/spells/scripts crie um arquivo chamado canceltargetlurk.lua e coloque isso dentro --[[ Made by Moira (Lurk on TibiaKing) NÃO REMOVA OS CRÉDITOS ]]-- local storage = 234512 -- tenha certeza de estar usando um numero que ainda não esteja em uso no seu servidor local tempo = 50 -- tempo em segundos para usar a magia novamente local tempo_block = 5 -- quanto tempo o player afetado pela magia vai ficar sem poder atacar OUTRO PLAYER local templo_cannot_be_blocked = 50 -- tempo em que o target vai ficar invuneravel a spell caso já tenha sido afetado por ela local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if isPlayer(target) and getPlayerStorageValue(cid, storage) < os.time() and getPlayerStorageValue(target, 234514) < os.time() then doPlayerTargetCreature(target, target) setPlayerStorageValue(target, 234513, tempo_block + os.time()) setPlayerStorageValue(target, 234514, templo_cannot_be_blocked + os.time()) setPlayerStorageValue(cid, storage, tempo + os.time()) return doCombat(cid, combat, var) elseif getPlayerStorageValue(target, 234514) > os.time() then doPlayerSendCancel(cid, "This player has been affect by this spell recently, you must wait ".. getPlayerStorageValue(target, 234514) - os.time() .." to block his attacks again.") return false elseif getPlayerStorageValue(cid, storage) > os.time() then doPlayerSendCancel(cid, "You must wait ".. getPlayerStorageValue(cid, storage) - os.time() .." seconds to use this spell again.") else doPlayerSendCancel(cid, "You may only cast this spell on players.") end return false end agora em data/creaturescripts.xml adicione <event type="attack" name="lurkBlockTarget" event="script" value="canceltargetlurk.lua"/> em data/creaturescripts/scripts crie um arquivo chamado canceltargetlurk.lua e cole isso dentro --[[ Made by Moira (Lurk on TibiaKing) NÃO REMOVA OS CRÉDITOS ]]-- function onAttack(cid, target) if getPlayerStorageValue(cid, 234513) > os.time() and isPlayer(target) then return doPlayerSendCancel(cid, "You're under effect of the cancel target spell, you must wait".. getPlayerStorageValue(cid, 234513) - os.time() .." seconds to attack again.") and false end return true end por ultimo, abre o arquivo login.lua que está na pasta data/creaturescripts/scripts e adicione isso ANTES DO ULTIMO RETURN TRUE registerCreatureEvent(cid, "lurkBlockTarget") Se você quer só E SOMENTE SÓ cancelar o target do inimigo uma unica vez, basta utilizar essa versão da spell --[[ Made by Moira (Lurk on TibiaKing) NÃO REMOVA OS CRÉDITOS ]]-- local storage = 234512 -- tenha certeza de estar usando um numero que ainda não esteja em uso no seu servidor local tempo = 50 -- tempo em segundos para usar a magia novamente local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if isPlayer(target) and getPlayerStorageValue(cid, storage) < os.time() then doPlayerTargetCreature(target, target) setPlayerStorageValue(cid, storage, tempo + os.time()) return doCombat(cid, combat, var) elseif getPlayerStorageValue(cid, storage) > os.time() then doPlayerSendCancel(cid, "You must wait ".. getPlayerStorageValue(cid, storage) - os.time() .." seconds to use this spell again.") else doPlayerSendCancel(cid, "You may only cast this spell on players.") end return false end Créditos: Eu pela spell e creaturescript @WooX pela criação da função se gostou, rep+ aqui e no post do @WooX pela função : p
  8. @diarmaint editei minha primeira resposta do tópico aqui, olha lá @RicK Sanchez @BangxD atualizem tb @leozincorsair atualizei dnv atualizado dnv, acessa aqui https://tibiaking.com/forums/topic/100214-spell-que-bloqueia-o-target-do-player/ @diarmaint @RicK Sanchez @BangxD
  9. se alguém quiser um exemplo do que da pra fazer com esse código, aqui uma magia que cancela o target do seu target
  10. @diarmaint cara acho que vc ta usando tfs 1.x, certo? esse código é p tfs 0.4 ou vc ta sem a função na source ou sei lá, testei aqui e funfou certinho, o do cara ali funfou tb
  11. @RicK Sanchez disponha
  12. atualiza aqui pfvr?
  13. @BangxD @RicK Sanchez acabei de testar aqui, em spells.xml troca por isso aqui <instant name="Cancel Enemy Target" words="Cancel Enemy Target" lvl="12" mana="20" range="3" blockwalls="1" needtarget="1" exhaustion="2000" needlearn="0" event="script" value="canceltarget.lua"> </instant>
  14. @BangxD comentei no seu tópico, da uma olhada lá
  15. @BangxD EDITADO: versão mais trabalhada
  16. cara, nem tinha visto q vc tinha postado duplicado... https://tibiaking.com/forums/topic/100212-countdown-horário-dos-próximos-eventos/
  17. Peço desculpas caso esteja postando na área errada, por favor movam o tópico. Isso é um tutorial O script já existe na base que o @WooX postou aqui mas quando tentei passar pro meu sv 0.4 ficava dando debug dai eu desisti na época. Dai eu tava tentando ajudar nesse tópico, tentei mais uma vez e consegui fazer funcionar. Exemplo de como fica ingame Vamos a instalação em data/globalevents/scripts crie um arquivo chamado eventcheck.lua e cole isso dentro local EventsListalist = { {time = "01:00", name = "Snowball Event"}, {time = "02:00", name = "DesertWar Event"}, {time = "03:00", name = "Capture The Flag"}, {time = "04:00", name = "FireStorm Event"}, {time = "09:00", name = "Defend The Tower"}, {time = "10:00", name = "Snowball Event"}, {time = "11:00", name = "DesertWar Event"}, {time = "12:00", name = "Capture The Flag"}, {time = "13:00", name = "FireStorm Event"}, {time = "15:00", name = "Battlefield Event"}, {time = "16:00", name = "Defend The Tower"}, {time = "17:00", name = "Snowball Event"}, {time = "18:00", name = "DesertWar Event",}, {time = "19:00", name = "Capture The Flag",}, {time = "20:00", name = "FireStorm Event"}, {time = "21:00", name = "Real Castle"}, {time = "22:00", name = "Battlefield Event"}, {time = "23:00", name = "Defend The Tower"} } local position = {x = 129, y = 58, z = 7} -- posição do mapa onde o efeito vai sair function onThink(interval, lastExecution) local people = getPlayersOnline() if #people == 0 then return true end local Count = 0 for _, t in ipairs(EventsListalist) do local eventTime = hourToNumber(t.time) local realTime = hourToNumber(os.date("%H:%M:%S")) if eventTime >= realTime then doCreatureSay(people[1], "Proximo evento as {"..t.time.."h} "..t.name..", faltam "..timeString(eventTime - realTime)..".", TALKTYPE_ORANGE_1, false, 0, position) -- não use acentos aqui ou eles serão alterados por simbolos ingame return true end Count = Count + 1 end return true end Em data/globalevents/globalevents.xml adicione <globalevent name="eventos" interval="10000" event="script" value="eventcheck.lua"/> Depois adicione no fim de data/lib/050-function.lua function hourToNumber(str) -- By Killua local hour = (tonumber(str:sub(1,2))*3600) + (tonumber(str:sub(4,5)) * 60) if #str > 5 then hour = hour + tonumber(str:sub(7,8)) end return hour end function timeString(timeDiff,english) -- créditos: Killua local dateFormat = {} if english then dateFormat = { {"day", timeDiff / 60 / 60 / 24}, {"hour", timeDiff / 60 / 60 % 24}, {"minute", timeDiff / 60 % 60}, {"second", timeDiff % 60} } else dateFormat = { {"dia", timeDiff / 60 / 60 / 24}, {"hora", timeDiff / 60 / 60 % 24}, {"minuto", timeDiff / 60 % 60}, {"segundo", timeDiff % 60} } end local out = {} for k, t in ipairs(dateFormat) do local v = math.floor(t[2]) if(v > 0) then table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' e ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or '')) end end return table.concat(out) end Créditos: @WooX que postou a base onde eu peguei o script Aparentemente o Killua que criou a função hourToNumber Seja lá quem criou o script, tem o nome de um tal "Henrique" no arquivo original, talvez tenha sido ele E eu por algumas pequenas alterações pra fazer o script funcionar em tfs 0.4 CASO VOCÊ QUEIRA O MESMO SISTEMA PARA OTX 2 PROVAVELMENTE O DA BASE POSTADO PELO WOOX VAI FUNCIONAR desde que você adicione o hourToNumber na lib
  18. @Doidodepeda https://tibiaking.com/forums/topic/100212-countdown-horário-dos-próximos-eventos/
  19. @Movie @Mor3nao @diarmaint não sei exatamente como tratar os arrays em tfs 1.3, mas se for parecido com o 0.4 daria p fazer local vocations_allowed = {1, 2, 3, 4} if creature:isPlayer() and isInArray(vocations_allowed, (creature:getVocation():getClientId())) then
  20. @Movie @Mor3nao @diarmaint acho q da p simplesmente fazer um if creature:isPlayer() and (creature:getVocation():getClientId()) >= 1 then q deve funfar pra todas
  21. @Lisbeky não testei e fiz um combinado do seu script com esse do vodkart https://tibiaking.com/forums/topic/89379-resolvido-monstro-virando-outro-com-de-vida/?do=findComment&comment=490911 troca todo seu script por esse e ve o que acontece local monstro = "Demon" -- Monstro que irá ser invocado function onUse(cid, item, fromPosition, itemEx, toPosition) if (item.itemid == 2193 and item.actionid == 100) then thing = getThingFromPos(toPosition) if isMonster(thing.uid) and getCreatureName(thing.uid) == "Phanta" then doCreatureSay(thing.uid, "Prepare! The worst has yet to come!", TALKTYPE_ORANGE_1) addEvent(doCreateMonster, 3000, monstro, getCreaturePosition(thing.uid)) addEvent(doRemoveCreature, 3000, thing.uid) doRemoveItem(item.uid, 1) end end end
  22. @Thony D. Serv deixa assim local cfg = { life = 20000, storage = 9999, tempo = 1 -- em segundos } function onCast(cid, target) local master = getCreatureMaster(cid) if exhaustion.check(master, cfg.storage) == false then local pos = getCreaturePosition(master) local pos2 = getCreaturePosition(target) doCreatureAddHealth(master, cfg.life) doCreatureAddMana(master, cfg.life) doSendAnimatedText(pos2, "Absorve", TEXTCOLOR_BLUE) exhaustion.set(master, cfg.storage,cfg.tempo*7) doSendMagicEffect(pos, 12) else -- exhaustion.set(master, cfg.storage,0) doPlayerSendTextMessage(master, MESSAGE_STATUS_WARNING, "Sua Mana E Seu Hp Encheram 20k Proximo Buff em " ..exhaustion.get(master, cfg.storage).." segundos.") end return true end
  23. Lurk postou uma resposta no tópico em Suporte OTServer Derivados
    @raicont use this script then function onUse(cid, item, fromPosition, itemEx, toPosition) local daysvalue = 1 * 24 * 60 * 60 local daily = getPlayerStorageValue(cid, 13541) local rewards = { { item = 12832, count = 1 }, { item = 2160, count = 100 }, { item = 12227, count = 1 }, { item = 12331, count = 1 }, { item = 12618, count = 5 }, { item = 12242, count = 1 }, { item = 2145, count = 1 } } if (daily == -1) then daily = 0 end if getPlayerStorageValue(cid, 13540) - os.time() <= 0 and getPlayerLevel(cid) >= 300 and isPremium(cid) then local random = math.random(1, #rewards) doPlayerAddItem(cid, rewards[random].item, rewards[random].count) time = os.time() + daysvalue setPlayerStorageValue(cid, 13540, time) setPlayerStorageValue(cid, 13541, daily+1) local daily = getPlayerStorageValue(cid, 13541) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.") elseif getPlayerLevel(cid) < 300 or not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must be at least level 300 AND have premium account to do this quest.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".") end return true end

Informação Importante

Confirmação de Termo