Ir para conteúdo

Wise

Membro
  • Registro em

  • Última visita

Tudo que Wise postou

  1. @falling Apesar de ter partes semelhantes, o que você quer não convém muito com o propósito desse tópico. E além do mais, ele já foi resolvido. Crie o seu próprio tópico, amigo, e nele informe sobre o pedido.
  2. subnivel.lua (data/creaturescripts/scripts): function onKill(cid, target) local b = {'Ghazbaran', 'Morgaroth', 'Orshabaal'} -- bosses local subnivel = 98765 -- storage for i = 1, #b do if getCreatureName(target):lower() == b[i]:lower() then if getPlayerStorageValue(cid, subnivel) < 0 then return setPlayerStorageValue(cid, subnivel, 1) and true end setPlayerStorageValue(cid, subnivel, getPlayerStorageValue(cid, subnivel) + 1) end end return true end Tag - creaturescritps.xml (data/creaturescripts): <event type="kill" name="SubNivel" event="script" value="subnivel.lua"/> Registre o creature event em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "SubNivel") subniveldoor.lua (data/actions/scripts): function onUse(cid, item, fromPos, toPos) local subnivel = 3 -- nivel local stor = 98765 -- subnivel storage if getPlayerStorageValue(cid, stor) >= subnivel then doTeleportThing(cid, toPos) doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) else doPlayerSendCancel(cid, 'Você precisa ter SubNível '..subnivel) doSendMagicEffect(fromPos, CONST_ME_POFF) end return true end Tag - actions.xml (data/actions): <action actionid="ACTIONID" script="subniveldoor.lua"/>
  3. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Procure pelo arquivo das potions nas actions do seu servidor (data/actions/scripts) e poste os códigos do arquivo aqui. Se não encontrar, procure os IDs das potions nas tags do arquivo actions.xml e você poderá identificar o diretório e nome do script.
  4. Fiz simples, sem o efeito constante durante a double experience. Veja se te agrada. local rate = {2, 30} -- {exp, time} ~ time in minutes local stor = 43210 -- storage function NormalExp(cid) if isPlayer(cid) then doPlayerSetRate(cid, SKILL__LEVEL, 1) setPlayerStorageValue(cid, stor, -1) doCreatureSay(cid, 'NORMAL EXPERIENCE..', TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Effect of the double experience potion over and now you\'re with normal experience again.') end return true end function onUse(cid, item, fromPos, toPos) if getPlayerStorageValue(cid, stor) < 1 then setPlayerStorageValue(cid, stor, 1) doPlayerSetRate(cid, SKILL__LEVEL, rate[1]) addEvent(NormalExp, rate[2] * 60 * 1000, cid) doSendMagicEffect(toPos, CONST_ME_GIFT_WRAPS) doCreatureSay(cid, 'DOUBLE EXPERIENCE!', TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Now you have '..rate[2]..' minutes of double experience.') doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, 'You are already with double experience.') end return true end Onde está o resto da função potion?
  5. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Desconheço sobre servidores derivados, mas provavelmente é um action script. Então procure pelo script (data/actions/scripts), veja através da tag (procurando pelo ID do item que você usa como "vara de pesca", ou o que quer que seja) e poste aqui.
  6. Retornando false ao callback onDeath, irá fazer com que o corpse do creature ID não seja criado.
  7. @ricksi2012 Amigo, eu não entendi qual a sua dificuldade nisso. Escolha qualquer item que te agrade e aplique o ID na tag, fim.
  8. function isOnSameFloor(fromPos, toPos) return fromPos.z == toPos.z and true or false end function isEven(arg) return arg % 2 == 0 and true or false end function getMiddlePos(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local middle = {x = 0, y = 0, z = 0} middle.x = isEven(fromPos.x + toPos.x) and (fromPos.x + toPos.x)/2 or math.floor((fromPos.x + toPos.x)/2) + 1 middle.y = isEven(fromPos.y + toPos.y) and (fromPos.y + toPos.y)/2 or math.floor((fromPos.y + toPos.y)/2) + 1 middle.z = fromPos.z or toPos.z return middle end function getDistanceRadius(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local distance = getDistanceBetween(fromPos, toPos) return isEven(distance) and (distance/2) or math.floor(distance/2) + 1 end function clearArea(middlePos, rangex, rangey) local final = {x=1126, y=1152, z=7} -- Posição onde será teleportado quando acabar o tempo for i = -rangex, rangex do for j = -rangey, rangey do pos = {x = middlePos.x + i, y = middlePos.y + j, z = middlePos.z} creature = getTopCreature(pos).uid if isMonster(creature) then doSendMagicEffect(getThingPos(creature), 14) doRemoveCreature(creature) elseif isPlayer(creature) then doSendMagicEffect(getThingPos(creature), 10) doTeleportThing(creature, final) end end end setGlobalStorageValue(sto, -1) return true end local t = { lvl = 100, entrada = { {x = 1125, y = 1152, z = 7} -- pos players }, saida = { {x = 1125, y = 1153, z = 8} -- pos para onde eles irão }, monstros = { {{x = 1121, y = 1153, z = 8}, "Demon"} -- defina pos dos montros e nomes } } function onUse(cid, item, fromPosition, itemEx, toPosition) local configure = { fromPos = {x=1121, y=1150, z=8}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=1129, y=1156, z=8}, -- posição inferior direita do mapa, da area em que esta mapeado a area. boss = "Demon" -- Aqui você bota o nome do monstro que você quer remover } local config = { position = {x=1126, y=1152, z=7}, -- Contagem position1 = {x=1121, y=1150, z=8}, -- Contagem position2 = {x=1121, y=1156, z=8}, -- Contagem position3 = {x=1129, y=1150, z=8}, -- Contagem position4 = {x=1129, y=1156, z=8}, -- Contagem fromPosition = {x=1121, y=1150, z=8}, toPosition = {x=1129, y=1156, z=8}, id = 1498, time = 1 -- tempo que o teleport ira sumir em minutos } local time = 60 local sto = 5973 local check = {} for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or isPlayer(x) and getPlayerLevel(x) < t.lvl) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Não tem 5 jogadores para quest ou os jogadores nos sqms não tem o level mínimo para a quest.") return true end if getGlobalStorageValue(sto) == 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Annihilaton está bloqueada. Aguarde até que seja liberada.") return true end table.insert(check, x) end for _, summon in pairs(t.monstros) do local creature = getTopCreature(summon[1]).uid doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doTeleportThing(tid, t.saida[i], false) doSendMagicEffect(t.saida[i], 10) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end for i = 1,time do formula = time - 1*i addEvent(doSendAnimatedText, i*1000, config.position, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position1, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position2, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position3, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position4, formula, TEXTCOLOR_RED) end setGlobalStorageValue(sto, 1) local rx = getDistanceRadius(configure.fromPos, configure.toPos) addEvent(clearArea, config.time * 60 * 1000, getMiddlePos(configure.fromPos, configure.toPos), rx, rx) return true end
  9. Sem problemas, meu caro. Abraços ;]
  10. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Já que os textos exibidos serão os mesmos, simplifique: local pos = { {x = 409, y = 805, z = 7}, {x = 344, y = 738, z = 7}, {x = 650, y = 844, z = 7}, {x = 757, y = 826, z = 7}, {x = 1017, y = 709, z = 6}, {x = 1041, y = 560, z = 6}, {x = 800, y = 554, z = 6}, {x = 793, y = 709, z = 7}, {x = 796, y = 428, z = 6}, {x = 790, y = 357, z = 6}, {x = 547, y = 218, z = 7}, {x = 520, y = 182, z = 7} } function onThink(cid, interval, lastExecution) for i = 1, #pos do doSendMagicEffect(pos[i], math.random(CONST_ME_DRAWBLOOD, CONST_ME_LAST)) doSendAnimatedText(pos[i], 'Trainers', math.random(0, 255)) end return true end
  11. E como é esse "vip"? Já há algum sistema que faça o uso de storages pra determinar um creature ID vip no seu servidor, ou é por premium account? Especifique.
  12. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Não. Olha, calculei alguns valores, veja se te agrada: <?xml version="1.0" encoding="UTF-8"?> <groups> <group id="1" name="Player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" /> <group id="2" name="Tutor" flags="137455730688" access="0" maxdepotitems="0" maxvipentries="200" /> <group id="3" name="Admin" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" /> </groups>
  13. Wise postou uma resposta no tópico em Suporte & Pedidos
    O mais importante você já tem. Agora apenas continue, você se aperfeiçoa conforme estuda e pratica.
  14. Detesto refazer um script a partir de códigos imensos de outra pessoa. Então eu apenas apliquei a tabulação e algumas funções (um pouco modificadas) da New Library v. 1.2 de @xWhiteWolf. function isOnSameFloor(fromPos, toPos) return fromPos.z == toPos.z and true or false end function isEven(arg) return arg % 2 == 0 and true or false end function getMiddlePos(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local middle = {x = 0, y = 0, z = 0} middle.x = isEven(fromPos.x + toPos.x) and (fromPos.x + toPos.x)/2 or math.floor((fromPos.x + toPos.x)/2) + 1 middle.y = isEven(fromPos.y + toPos.y) and (fromPos.y + toPos.y)/2 or math.floor((fromPos.y + toPos.y)/2) + 1 middle.z = fromPos.z or toPos.z return middle end function getDistanceRadius(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local distance = getDistanceBetween(fromPos, toPos) return isEven(distance) and (distance/2) or math.floor(distance/2) + 1 end function clearArea(middlePos, rangex, rangey) local final = {x=1126, y=1152, z=7} -- Posição onde será teleportado quando acabar o tempo for i = -rangex, rangex do for j = -rangey, rangey do pos = {x = middlePos.x + i, y = middlePos.y + j, z = middlePos.z} creature = getTopCreature(pos).uid if isMonster(creature) then doSendMagicEffect(getThingPos(creature), 14) doRemoveCreature(creature) elseif isPlayer(creature) then doSendMagicEffect(getThingPos(creature), 10) doTeleportThing(creature, final) end end end setGlobalStorageValue(sto, -1) return true end local t = { lvl = 100, entrada = { {x = 1125, y = 1152, z = 7} -- pos players }, saida = { {x = 1125, y = 1153, z = 8} -- pos para onde eles irão }, monstros = { {{x = 1121, y = 1153, z = 8}, "Demon"} -- defina pos dos montros e nomes } } function onUse(cid, item, fromPosition, itemEx, toPosition) local configure = { fromPos = {x=1121, y=1150, z=8}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=1129, y=1156, z=8}, -- posição inferior direita do mapa, da area em que esta mapeado a area. boss = "Demon" -- Aqui você bota o nome do monstro que você quer remover } local config = { position = {x=1126, y=1152, z=7}, -- Contagem position1 = {x=1121, y=1150, z=8}, -- Contagem position2 = {x=1121, y=1156, z=8}, -- Contagem position3 = {x=1129, y=1150, z=8}, -- Contagem position4 = {x=1129, y=1156, z=8}, -- Contagem fromPosition = {x=1121, y=1150, z=8}, toPosition = {x=1129, y=1156, z=8}, id = 1498, time = 1 -- tempo que o teleport ira sumir em minutos } local time = 60 local sto = 5973 local check = {} for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Não tem 5 jogadores para quest.") return true end if getGlobalStorageValue(sto) == 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Annihilaton está bloqueada. Aguarde até que seja liberada.") return true end table.insert(check, x) end for _, summon in pairs(t.monstros) do local creature = getTopCreature(summon[1]).uid doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doTeleportThing(tid, t.saida[i], false) doSendMagicEffect(t.saida[i], 10) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end for i = 1,time do formula = time - 1*i addEvent(doSendAnimatedText, i*1000, config.position, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position1, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position2, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position3, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position4, formula, TEXTCOLOR_RED) end setGlobalStorageValue(sto, 1) local rx = getDistanceRadius(configure.fromPos, configure.toPos) addEvent(clearArea, config.time * 60 * 1000, getMiddlePos(configure.fromPos, configure.toPos), rx, rx) return true end
  15. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Bem lembrado. A função doSendAnimatedText foi retirada na versão 8.7 se não me engano.
  16. Provavelmente essas vocações "epic" devem ter a promotion level como sendo 2. Então.. autopromotion.lua (data/creaturescripts/scripts): function onThink(cid) if getPlayerPremiumDays(cid) > 0 then if getPlayerPromotionLevel(cid) == 2 then return true end doPlayerSetPromotionLevel(cid, 2) else if getPlayerPromotionLevel(cid) == 1 then return true end doPlayerSetPromotionLevel(cid, 1) end return true end Tag - creaturescripts.xml (data/creaturescripts): <event type="think" name="AutoPromotion" event="script" value="autopromotion.lua"/> Registre o creature evente em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "AutoPromotion")
  17. Não sei dizer os valores exatos, mas você pode calcular alterando os parâmetros que compõem a função que seta a fórmula/valores do combat: setCombatFormula(combat, type, mina, minb, maxa, maxb) Corrigi os valores da fórmula Acredito que para um servidor global, seria adequado (veja se te agrada, senão, vá alterando os valores até): setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)
  18. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Ops! Falha minha, esqueci dos parâmetros da função rs local positions = { ["Treiners"] = {x = 409, y = 805, z = 7}, ["Treiners"] = {x = 344, y = 738, z = 7}, ["Treiners"] = {x = 650, y = 844, z = 7}, ["Treiners"] = {x = 757, y = 826, z = 7}, ["Treiners"] = {x = 1017, y = 709, z = 6}, ["Treiners"] = {x = 1041, y = 560, z = 6}, ["Treiners"] = {x = 800, y = 554, z = 6}, ["Treiners"] = {x = 793, y = 709, z = 7}, ["Treiners"] = {x = 796, y = 428, z = 6}, ["Treiners"] = {x = 790, y = 357, z = 6}, ["Treiners"] = {x = 547, y = 218, z = 7}, ["Treiners"] = {x = 520, y = 182, z = 7} } function onThink(cid, interval, lastExecution) for text, pos in pairs(positions) do doSendMagicEffect(pos, math.random(CONST_ME_DRAWBLOOD, CONST_ME_LAST)) doSendAnimatedText(pos, text, math.random(0, 255)) end return true end
  19. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Você declarou ao for, uma variável dentro de uma tabela inexistente. E aplicou à função doSendMagicEffect uma variável que também não foi declarada. Tente: local positions = { ["Treiners"] = {x = 409, y = 805, z = 7}, ["Treiners"] = {x = 344, y = 738, z = 7}, ["Treiners"] = {x = 650, y = 844, z = 7}, ["Treiners"] = {x = 757, y = 826, z = 7}, ["Treiners"] = {x = 1017, y = 709, z = 6}, ["Treiners"] = {x = 1041, y = 560, z = 6}, ["Treiners"] = {x = 800, y = 554, z = 6}, ["Treiners"] = {x = 793, y = 709, z = 7}, ["Treiners"] = {x = 796, y = 428, z = 6}, ["Treiners"] = {x = 790, y = 357, z = 6}, ["Treiners"] = {x = 547, y = 218, z = 7}, ["Treiners"] = {x = 520, y = 182, z = 7} } function onThink(cid, interval, lastExecution) for text, pos in pairs(positions) do doSendMagicEffect(pos, math.random(CONST_ME_DRAWBLOOD, CONST_ME_LAST)) doSendAnimatedText(pos, text, math.random(0, 255)) end return true end
  20. Não havia lido. Apenas adicione o atributo do tipo preventDrop com valor positivo/true (1) à tag do item.
  21. off.lua (data/talkactions/scripts): local stor = 54321 function ariseText(cid) local time = 2 -- seconds to repeat the function local text = 'ausente' if isPlayer(cid) then doSendAnimatedText(getCreaturePosition(cid), text, math.random(0, 255)) if getPlayerStorageValue(cid, stor) > 0 then addEvent(ariseText, time * 1000, cid) end end return true end function onSay(cid) if getPlayerStorageValue(cid, stor) < 1 then setPlayerStorageValue(cid, stor, 1) doCreatureSetNoMove(cid, true) ariseText(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'O modo ausente está ativado.') else doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, stor, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'O modo ausente está desativado.') end return true end Tag - talkactions.xml (data/talkactions): <talkaction words="!off" event="script" value="off.lua"/> offlogout.lua (data/creaturescripts/scripts): function onLogout(cid) local stor = 54321 if getPlayerStorageValue(cid, stor) > 0 then return doPlayerSendCancel(cid, 'Você não pode fazer logout com o modo ausente ativado.') and false end return true end Tag - creaturescripts.xml (data/creaturescripts): <event type="logout" name="OffLogout" event="script" value="offlogout.lua"/>
  22. Observe que os erros foram: [...] Cannot open.. / Cannot load script.. / No such file or directory.. [...] Ou seja, você não deve ter configurado corretamente o diretório ou nome do arquivo Lua, já que não é possível abri-lo/carregá-lo/encontrá-lo. Verifique a tag e o nome dado aos arquivos, refaça os processos e se tiver o mesmo resultado, informe as tags aqui.
  23. Basta alterar o parâmetro da tag da vocação desejada, onde está needpremium, mude para o valor 1. needpremium="1"
  24. Bem interessante, gostei da ideologia do evento em si. Dá pra gerar vários outros sistemas a partir desses códigos, com certeza contribuirá muito. Não necessariamente, TFS 1.0 também executa essas funções. Só que nos códigos acima, o parâmetro referente ao creature ID (cid) foi definido para como sendo player, basta alterar ;]
  25. idletile.lua (data/creaturescripts/scripts): function onThink(cid, interval) local kicktime = 10 local tileactionid = 54321 local idletime = getPlayerIdleTime(cid) + interval if getTileThingByPos(getCreaturePosition(cid)).actionid == tileactionid then if getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE) then return true end doPlayerSetIdleTime(cid, idletime) if idletime > kicktime * 60 * 1000 then doRemoveCreature(cid) end end return true end Tag - creaturescripts.xml (data/creaturescripts): <event type="think" name="IdleTile" event="script" value="idletile.lua"/> Registre o creature event em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "IdleTile") Adicione o action ID (declarado na variável local tileactionid do script, que como exemplo foi 54321) ao tile que você deseja.

Informação Importante

Confirmação de Termo