Ir para conteúdo

Zazeros

Membro
  • Registro em

  • Última visita

Tudo que Zazeros postou

  1. 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
  2. @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
  3. 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.
  4. @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.
  5. 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é?
  6. 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.
  7. 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.
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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?
  13. 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?
  14. 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
  15. @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).
  16. 0.4 Bom dia galera, eu preciso de ajuda em um npc de task. Ele é bem simples, você fala as palavras, ele te da a storage, no creaturescripts pega a storage e conta os monstros na tabela, ai ele te da a storage maior e quando voltar pro npc, ele te da a recompensa. Até ai funciona 100%, o problema é que eu queria colocar pra esse npc dar 2 tasks, quando o player terminar uma, ele pode pegar outra com o mesmo npc. (Lembrando que se eu fizer 2 npcs, funciona normal, mas eu queria fazer em um só) local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local quest = 845710 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) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then npcHandler:say("OK2", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then npcHandler:say("OK3", cid) setPlayerStorageValue(cid, quest, 2) setPlayerStorageValue(cid, 12672, 1) talkState[talkUser] = 0 elseif msgcontains(msg, "quest1") then local str = getPlayerStorageValue(cid, quest) if(str < 2) then npcHandler:say("OK1", cid) talkState[talkUser] = 1 return true elseif(str == 2) then npcHandler:say("OK4", cid) elseif(str == 3) then npcHandler:say("Finish", cid) setPlayerStorageValue(cid, quest, 4) setPlayerStorageValue(cid, 555140, 4) elseif(str == 4) then npcHandler:say("Over", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) local keywordHandler2 = keywordHandler:new() local npcHandler2 = npcHandler:new(keywordHandler2) NpcSystem.parseParameters(npcHandler2) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg2) npcHandler:onCreatureSay(cid, type, msg2) end function onThink() npcHandler:onThink() end local talkState2 = {} local quest2 = 685740 function creatureSayCallback2(cid, type, msg2) local talkUser2 = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false elseif msgcontains(msg2, "yes") and talkState2[talkUser2] == 1 then npcHandler:say("sim2", cid) talkState2[talkUser2] = 2 elseif msgcontains(msg2, "yes") and talkState2[talkUser2] == 2 then npcHandler:say("Sim3", cid) setPlayerStorageValue(cid, quest2, 2) talkState2[talkUser2] = 0 elseif msgcontains(msg2, "quest2") then local str2 = getPlayerStorageValue(cid, 555140) if(str2 == 1) then local stro = getPlayerStorageValue(cid, quest2) if(stro < 2) then npcHandler:say("Sim", cid) talkState2[talkUser2] = 1 return true elseif(stro == 2) then npcHandler:say("Sim4", cid) elseif(stro == 3) then npcHandler:say("Sim5!", cid) setPlayerStorageValue(cid, quest2, 4) elseif(stro == 4) then npcHandler:say("Over2", cid) end talkState2[talkUser2] = 0 else npcHandler:say("Nop", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback2) npcHandler:addModule(FocusModule:new()) Eu tentei fazer isso, que foi colocar 2x o script dele da task e mudar algumas coisas, colocando um "2" na frente. O problema é que ele só reconhece a segunda task, ou seja, a "quest2". Se falar "quest1", ele não diz nada e não da nem um erro no console. Alguém sabe como colocar 2 tasks nesse npc? Obrigado.
  17. @Vodkart Era isso mesmo que faltava, vlw
  18. 0.4 Boa tarde galera. Não sou scripter então não faço ideia se existe um jeito fácil de checar isso ou não, mas eu preciso achar um jeito. O pedido deve ser simples, se tem algum jeito de checar pra ver se o atacante do player está vivo. Por exemplo um script de reflect system, se o monstro morrer mas deixa o player em poison e ele usar o reflect system, vai ficar retornando erro na distro dizendo que a criatura não foi achada. Obrigado
  19. Bom, quem quiser, o script está ai: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) function onGetFormulaValues(cid, level, maglevel) local min = (level / 3) + (maglevel * 0.8) + 1 local max = (level / 2) + (maglevel * 1.5) + 5 return -min, -max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var, pos) chance = math.random(1,100) if chance < 15 then setPlayerStorageValue(cid, 17131, os.time() + 5) doSendAnimatedText(getThingPos(cid), "TEST", 35) doSendMagicEffect(getPlayerPosition(cid), 12) end return doCombat(cid, combat, var) end
  20. Boa tarde povo, eu queria ajuda pra fazer o seguinte: O player lança uma magia normal, por exemplo EXORI FRIGO, e ele tem 15%, quando soltar a magia, de ganhar uma storage que dure 5 segundos. Depois dos 5 seg, ele perde a storage. Se for possivel, quando ele ganhar a storage, aparecer uma palavra em cima dele e um efeito, obrigado. Se ficou confuso, pergunte que eu explico melhor. Script do Exori frigo: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) function onGetFormulaValues(cid, level, maglevel) local min = (level / 3) + (maglevel * 0.8) + 1 local max = (level / 2) + (maglevel * 1.5) + 5 return -min, -max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
  21. @Naze Cara, não importa onde seria a verificação. Pode ser no Hi, pode ser no meio, pode ser na ultima fala antes de pegar a quest. Eu só queria que o NPC não desse a quest se o player não tivesse uma storage E desse a quest se ele tivesse a storage. Eu vou conseguir testar só mais tarde o que você mandou, ai aviso Edit: Cara, não usei o seu script, mas eu vi que faltava um "=" onde ele checava storage, obrigado por isso
  22. Só tirar as duas partes, @Pisces, mas eu mando sim! local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local quest = 11475 local reward = 70000 local markTable = { -- {markPos = Coordenadas da marcação, markType = Tipo de marcação, markDescription = Descrição da marcação} {markPos = {x = , y = , z = }, markType = MAPMARK_SWORD, markDescription = ""} } 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 func_addMark = doPlayerAddMapMark if(not func_addMark) then func_addMark = doAddMapMark end if(msgcontains(msg, "location")) then for mark, x in pairs(markTable) do func_addMark(cid, x.markPos, x.markType, x.markDescription ~= nil and x.markDescription or "") end selfSay("", cid) end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false elseif msgcontains(msg, "") and talkState[talkUser] == 1 then npcHandler:say("", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "") and talkState[talkUser] == 2 then npcHandler:say("", cid) setPlayerStorageValue(cid, quest, 2) talkState[talkUser] = 0 elseif msgcontains(msg, "") then local str = getPlayerStorageValue(cid, quest) if(str < 2) then npcHandler:say("", cid) talkState[talkUser] = 1 return true elseif(str == 2) then npcHandler:say("", cid) elseif(str == 3) then npcHandler:say("", cid) setPlayerStorageValue(cid, quest, 4) elseif(str == 4) then npcHandler:say("", cid) talkState[talkUser] = 0 end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  23. 0.4 Boa tarde povo, eu gostaria de uma ajuda num script que eu tenho sobre NPC. Esse script faz o npc dar uma task pro player quando ele fala as palavras certas, e ele funciona 100%, porém, eu gostaria de algo a mais (e tentei fazer sozinho, mas não sirvo pra essas coisas) Eu gostaria que o Npc checasse se o player tivesse X storage, se ele tiver, o player poderá pegar a quest com o npc. Se o player não tiver X storage, o npc vai falar pra ele que ele não é confiável ou algo assim, aqui está a script do NPC (por favor, se for possivel, use ela como base): local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local quest = 11475 local reward = 70000 local markTable = { -- {markPos = Coordenadas da marcação, markType = Tipo de marcação, markDescription = Descrição da marcação} {markPos = {x = , y = , z = }, markType = MAPMARK_SWORD, markDescription = ""} } 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 func_addMark = doPlayerAddMapMark if(not func_addMark) then func_addMark = doAddMapMark end if(msgcontains(msg, "location")) then for mark, x in pairs(markTable) do func_addMark(cid, x.markPos, x.markType, x.markDescription ~= nil and x.markDescription or "") end selfSay("", cid) end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false elseif msgcontains(msg, "") and talkState[talkUser] == 1 then npcHandler:say("", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "") and talkState[talkUser] == 2 then if(getPlayerStorageValue(cid,11476) < 4) then <!-- A storage que o npc reconhece, pra dar ou não a quest pro player --> npcHandler:say("", cid) setPlayerStorageValue(cid, quest, 2) talkState[talkUser] = 0 else npcHandler:say('', cid) <!-- Msg que ele vai falar pro player que não tiver a storage (SEM DAR A QUEST) --> end elseif msgcontains(msg, "") then local str = getPlayerStorageValue(cid, quest) if(str < 2) then npcHandler:say("", cid) talkState[talkUser] = 1 return true elseif(str == 2) then npcHandler:say("", cid) elseif(str == 3) then npcHandler:say("", cid) setPlayerStorageValue(cid, quest, 4) elseif(str == 4) then npcHandler:say("", cid) talkState[talkUser] = 0 end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Eu tentei fazer por conta própria, literalmente na tentativa e erro, botando aquela linha do storage em todo o lugar, mas sem sucesso. No lugar em que está agora, o npc ignora completamente essa parte e da a quest pro player mesmo se ele não tiver a storage.
  24. @pergher Cara, se tu quiser mais simples, põe pros Trainers healar a mana do alvo, só pegar um bicho que bate na mana e trocar o valor pra positivo, ai vai curar a mana do player
  25. @Tottin Mas o script iria somar com o def da arma tbm, não?

Informação Importante

Confirmação de Termo