Ir para conteúdo

Zazeros

Membro
  • Registro em

  • Última visita

  1. Lobodu reagiu a uma resposta no tópico: Tp para citizens
  2. Zazeros reagiu a uma resposta no tópico: Madara está de volta!
  3. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    @Lobodu Cara, eu não sei mexer em 12.6, mas posso te dar uma ideia de como fazer isso. Pegue um script de tp qualquer que tu tenha ai (ou pega da net) e põe uma restrição de storage. Se o player ter tal storage, ele é teleportado, se não, aparece uma msg falando que não pode. Ai quando ele chegar na cidade, põe pra ele ganhar essa storage Desculpe não poder ajudar mais Boa sorte
  4. @Bruce Pereira Cara, tu quer que não possa ser usado em monstro, ou que só conserte o erro do console? Se for a segunda opção, testa isso: local function voltar(cid, pos, target) local storage = 666 setPlayerStorageValue(target, storage, getPlayerStorageValue(target, storage) == -1 ) doCreatureSetNoMove(target, getPlayerStorageValue(target, storage) == 1 and false) end function onCastSpell(cid, var) local stor = 099 local waittime = 10 if exhaustion.check(cid, stor) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Aguarde " .. exhaustion.get(cid, stor) .. " segundos para usar Ittouryuu: Daishinkan.") return false end local sayP = 'O Player foi Preso durante 4 segundos.' local sayT = 'Voce foi Preso durante 4 segundos.Aguarde e voce voltara a se mover.' local pos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local postarget = getCreaturePosition(target) doPlayerSendTextMessage(cid, 27, sayP) if isMonster(target) == true then return true else doPlayerSendTextMessage(target, 27, sayT) end doCreatureSetNoMove(target, true) local postarget = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(postarget, 273) addEvent(voltar, 4*1000, cid, pos, target) exhaustion.set(cid, stor, waittime) return true end
  5. 0.4 Boa noite povo. O titulo pode parecer confuso (pq eu tbm to, bastante) Resumindo, eu não sei mexer com o i (não sei nem se pode colocar outra letra, provável) e to tentando fazer o seguinte: O player pisa num sqm, a roupa dele troca. Enquanto ele estiver com a roupa, ele fica tomando dano por segundo durante um determinado tempo (Aqui entra o i) "for i = 0, 10000, 1500 do" , e quando ele sai do sqm, a roupa dele volta como estava e ele para de tomar dano, até ai, 100%, fácil. O problema é que, se ele voltar pro sqm e aquele outro i não acabou, ele vai continuar dando dano, e ele vai receber um novo i, dando mais dano ainda. Se ele ficar andando, vai multiplicando e talz. O que eu queria é o seguinte, cancelar esse i quando ele sair do sqm, ou seja, trocar de outfit para o que ele tava antes. Segue o script: for i = 0, 10000, 1500 do addEvent(function(cid) if not isPlayer(cid) then return end if getCreatureOutfit(cid).lookType == 475 then local percent = {min = 0, max = 0} local damage = math.ceil((math.random(percent.min, percent.max) * 0.01) * getCreatureMaxHealth(cid)) doSendAnimatedText(getThingPos(cid), '' .. damage, TEXTCOLOR_ORANGE) doCreatureAddHealth(cid, - damage) doSendMagicEffect(getThingPos(cid), 15) else return true end end, i, cid) end E aqui é quando ele sai do sqm: if not(hasCondition(cid, CONDITION_OUTFIT) and not getCreatureOutfit(cid).lookType == outfit.lookType) then doRemoveCondition(cid, CONDITION_OUTFIT) else end Nesse ultimo eu queria que ele cancelasse esse i e o quanto de hits que falta para acabar. Eu sei que deve ter ficado confuso pra kct, mas pergunte que eu tento explicar melhor. Obrigado.
  6. Orientalz reagiu a uma resposta no tópico: Quest Spell
  7. Zazeros reagiu a uma resposta no tópico: (Resolvido)Spellbook com descrição
  8. @Rabit Cara, quando o erro fala isso: "No such file or directory" significa que ele nos talkations;xml você colocou um nome diferente do arquivo lua que você editou. Se o talkaction você botou no nome de "dodge", em data/talkactions/scripts/ você tem que botar o mesmo nome no arquivo Lua. O seu LOGIN tbm do creaturescript ta com problema, alguma função não ta fechada, e você não vai querer erro no creaturescript. Posta o seu data/creaturescripts/scripts/login.lua aqui fazendo o favor, e muda o nome do arquivo em talkaction para o certo.
  9. Zazeros reagiu a uma resposta no tópico: (Resolvido)Script Action Boss
  10. Zazeros reagiu a uma resposta no tópico: [NPC] Daily Task com 4 opções diarias.
  11. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    Só trocar: if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then por: if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) <= 3 then Ou seja, se o alvo estiver a 3 sqm ou menos, ele solta a magia. Mais uma coisa, em spells.xml, tua magia está needtarget="1" né?
  12. Capitao wyz reagiu a uma resposta no tópico: [AJUDA] SPELL
  13. Capitao wyz reagiu a uma resposta no tópico: [AJUDA] SPELL
  14. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    @Capitao wyz Só dar um curtir que já ta pago Eu tive que improvisar um tiquin. Em baixo de: function onCastSpell(cid, var) Eu coloquei isso: if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then Ou seja, ele pega a distancia do player e a distancia do alvo, se for == 1 ele solta a spell, se não for == 1, ou seja, estiver distante do alvo, ele vai mandar uma msg de erro e um efeito, que estão na linha 95 e 96: doPlayerSendCancel(cid, "Creature is not recheable.") doSendMagicEffect(getPlayerPosition(cid), 2) Se quiser mudar a msg que aparece quando estiver distante, o efeito ou a própria distancia, só alterar essas partes.
  15. NeGoGaBe reagiu a uma resposta no tópico: Npc de task simples
  16. NeGoGaBe reagiu a uma resposta no tópico: Npc de task simples
  17. Ah sim, eu conheço esse. Vlw mano, mas eu queria fazer daquele jeito mais simples mesmo. Esse se fizer mais de 1 acho que da erro tbm.
  18. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    local quant_hit = 4 -- quantidade de hits que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(cid).x+i, y=getCreaturePosition(cid).y+j, z=getCreaturePosition(cid).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(cid).x+px, y=getCreaturePosition(cid).y+py, z=getCreaturePosition(cid).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end else doPlayerSendCancel(cid, "Creature is not recheable.") doSendMagicEffect(getPlayerPosition(cid), 2) end end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end local quant_hit = 4 -- quantidade de hit's que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(cid).x+i, y=getCreaturePosition(cid).y+j, z=getCreaturePosition(cid).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(cid).x+px, y=getCreaturePosition(cid).y+py, z=getCreaturePosition(cid).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end else doPlayerSendCancel(cid, "Creature is not recheable.") doSendMagicEffect(getPlayerPosition(cid), 2) end end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end EU pensava que a magia era asism, de atacar de longe, malz
  19. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    Hehe, falta de atenção minha, mas agr deve ir. local quant_hit = 4 -- quantidade de hits que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(cid).x+i, y=getCreaturePosition(cid).y+j, z=getCreaturePosition(cid).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(cid).x+px, y=getCreaturePosition(cid).y+py, z=getCreaturePosition(cid).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) <= 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end
  20. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    Sempre foi no target, mas o cara fez uma gambiarrinha. Vê se agr vai local quant_hit = 4 -- quantidade de hits que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(cid).x+i, y=getCreaturePosition(cid).y+j, z=getCreaturePosition(cid).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(cid).x+px, y=getCreaturePosition(cid).y+py, z=getCreaturePosition(cid).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) <= 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z} end if positions ~= nil and isWalkable(positions) then doTeleportThing(target, positions) end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end
  21. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    local quant_hit = 4 -- quantidade de hit's que ira dar no target local timeHit = 0.5 -- segundos de diferença para cada hit local quant_sqm = 1 -- sqms que ira empurrar o target local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo. local playerEffect241 = 191 -- efeito no player. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target > 0 then local position_target = nil local cont = 0 for i=-1, 1 do for j=-1,1 do position_target = {x=getCreaturePosition(target).x+i, y=getCreaturePosition(target).y+j, z=getCreaturePosition(target).z} if isWalkable(position_target) then cont = cont+1 break end end if cont > 0 then break end position_target = nil end local px = math.random(-1,1) local py = 0 if px == -1 or px == 1 then py = 0 elseif px == 0 then local n = {1,-1} py = n[math.random(1,#n)] end local poscentral = {x=getCreaturePosition(target).x+px, y=getCreaturePosition(target).y+py, z=getCreaturePosition(target).z} if isWalkable(poscentral) then position_target = poscentral end if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) <= 1 then position_target = getCreaturePosition(cid) end local pos = position_target posTile1 = {{x=pos.x,y=pos.y,z=pos.z,stackpos=1}, 7524} -- embaixo do player posTile2 = {{x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}, 7520} posTile3 = {{x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}, 7523} posTile4 = {{x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}, 7526} posTile5 = {{x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}, 7500} posTile6 = {{x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}, 7501} posTile7 = {{x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}, 7525} posTile8 = {{x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}, 7522} posTile9 = {{x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}, 7521} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8,posTile9} if position_target ~= nil then local tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(sendEffect241, tempo, cid, target) tempo = tempo + 500 end tempo = 0 while (tempo ~= quant_hit*(timeHit*1000)) do addEvent(hitTarget, tempo, cid, target) tempo = tempo + (timeHit*1000) end local temp = tempo while (tempo ~= temp+quant_sqm*(sqmTime*1000)) do addEvent(empurrarTarget, tempo, cid, target, tempo, posAll) tempo = tempo + (sqmTime*1000) end local mana_hit = (getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + 300) doCreatureAddMana(target, -mana_hit) for o=1, #posAll do doCreateItem(posAll[o][2], 1, posAll[o][1]) end return true else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end else doPlayerSendCancel(cid, "Você precisa de um target!") end end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function hitTarget(cid, target) if isCreature(target) and isPlayer(cid) then local effect241 = 9 -- efeito do hit na creatura. doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit(cid), -getHit(cid), effect241) end end function getHit(cid) local hit = getPlayerLevel(cid)*2 + getPlayerMagLevel(cid)*2 + math.random(650,750) return hit end function empurrarTarget(cid, target, tempo, posAll) if not isCreature(target) then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end if isCreature(target) and isPlayer(cid) then local positions = nil if getPlayerLookDir(cid) == 0 then positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 1 then positions = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 2 then positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z} elseif getPlayerLookDir(cid) == 3 then positions = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z} end if positions ~= nil and isWalkable(positions) then doTeleportThing(target, positions) end local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000 if tempo == tp then for k=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[k][1].x,y=posAll[k][1].y,z=posAll[k][1].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == posAll[k][2] then doRemoveItem(removeTile.uid) end end end end end end function sendEffect241(cid, target) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if isCreature(target) and isPlayer(cid) then doSendMagicEffect(position1, playerEffect241) end end Veja se é assim, porque meu servidor é normal e esses itens que cria fica tudo bugado aqui
  22. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    @Capitao wyz Alem de teleportar, a spell da um slow gigantesco nos players, quer que tira tbm?
  23. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    @Capitao wyz Ela você diz o player né? Você não quer que o player pule no target?
  24. Zazeros reagiu a uma resposta no tópico: Check de monstro em uma area
  25. Zazeros postou uma resposta no tópico em Suporte Tibia OTServer
    @Vodkart Cara, eu testei o primeiro script que tu fez e não funciona pra mim a parte de remover o monstro. Ele fica summonando até dar 8 e ai fica dando erro que não tme mais espaço. tfs 0.4
  26. @Garoto Prodigio Cara, eu não sei se entendi muito bem. O player fala !missao e ai ele vai ganhar uma quest pra fazer ou vai mostrar todas as quests que estão em aberto? Se for a segunda opção, porque não usa o quests.xml? Ai o player clica no client mesmo e vê quais estão em aberto, já que quando termina lá, a quest fica em verde (Útil tbm para mostrar quais quests o player já completou).

Informação Importante

Confirmação de Termo