Ir para conteúdo

Zazeros

Membro
  • Registro em

  • Última visita

Solutions

  1. Zazeros's post in [Pedido] Modificar esse spell para não atacar monstro. was marked as the answer   
    @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  
  2. Zazeros's post in Tp para citizens was marked as the answer   
    @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
  3. Zazeros's post in [AJUDA] SPELL was marked as the answer   
    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
  4. Zazeros's post in [AJUDA] SPELL was marked as the answer   
    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
  5. Zazeros's post in critical e dodge was marked as the answer   
    @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.
  6. Zazeros's post in (Resolvido)Spell com CHANCE de dar storage was marked as the answer   
    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  
  7. Zazeros's post in (Resolvido)slot system was marked as the answer   
    @bellatrikz Tenta assim:
    ---Script by mock the bear! local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{} for i=1,100 do ---Carrega as conditions --- HP conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i) setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50) --MANA conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPERCENT, 100+i) setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51) --Magic level conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICLEVELPERCENT, 100+i) setConditionParam(conditionML[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52) --club axe sword conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_CLUBPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_SWORDPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_AXEPERCENT, 100+i) setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53) --- shield conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i) setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54) --- dist conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i) setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF, true) setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55) end function getSlotType(n) --By mock the bear if not n then return false end if n:match('%[(.+)%]') then n = n:match('%[(.+)%]') if n == '?' then return 0,n else return n:match('(.-)%.([+-])(%d+)%%') end else return false end end local function loadSet(cid) local t = {} for slot=1,9 do t[slot] = '' local s = getPlayerSlotItem(cid,slot).uid if s ~= 0 then t[slot] = getItemName(s) end end return t end function isInArray2(arr,var) -- Because in some servers it return 1 and 0 and others true and false for i,b in pairs(arr) do if var == b then return true end end return false end function check2(cid,i) if i == 5 or i == 6 then if isInArray({'head','necklace','backpack','body','legs','feet','ring'},getItemValue(getPlayerSlotItem(cid,i).itemid,'slotType') or '') then return false end end return true end function chk(cid,f) if not isPlayer(cid) then return end local t = loadSet(cid) for i=1,#f do if f[i] ~= t[i] then equip(cid,nil,slot) break end end addEvent(chk,2000,cid,t) end items = { ---- Only to get attr: slotType because getItemName dont return it -.-' _VERSION='1.0 By mock', XML_DIR='data/items/items.xml', } do local ia = os.clock() io.write('Loading items') local i = io.open(items.XML_DIR,'r') local u = i:read(-1) i:close() local u = u:match('<items>(.+)</items>') for mi,id,mid,name,data,me in u:gmatch('<(%a-)%s*id%s*=%s*"(%d+)"%s*(.-)%s*name%s*=%s*"(.-)"%s*>(.-)</(%a*)>') do if mi == 'item' and me == 'item' then local td = {name=name,id=id,type=1} for key,value in data:gmatch('<attribute key="(.-)" value="(.-)"/>') do td[key] = value end for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end for mi,id,mid,name,data in u:gmatch('<(%a-)%s*id%s*=%s*"(%d*)"%s*(.-)%s*name%s*=%s*"(%a+)"%s*/>') do if mi == 'item' then local td = {name=name,id=id,type=2} for key,value in mid:gmatch('(.-)="(.-)"') do td[key] = value end items[tonumber(id)] = td items[name] = td end end io.write('[done '..os.clock()-ia..']\n') end function getItemValue(item,value) return items[item] and items[item][value] end function equip(cid,item,slot) --By mock the bear local HP = getCreatureHealth(cid) local MP = getCreatureMana(cid) local t = {} if item then local mm,sinal,qto = getSlotType(getItemName(item.uid)) t[mm] = tonumber(qto) end for i=1,9 do -- Not on slot 10 > arrow if i ~= slot then if getPlayerSlotItem(cid,i).itemid ~= 0 then local aab = getPlayerSlotItem(cid,i).uid if aab and check2(cid,i) then for _ in getItemName(aab):gmatch('(%[.-%])') do local mm,sinal,qto2 = getSlotType(_) if mm then if not t[mm] then t[mm] = 0 end t[mm] = t[mm]+tonumber(qto2) t[mm] = t[mm] > 100 and 100 or t[mm] end end end end end end local fu = 0 local ca = {} local s = '' for sl,n in pairs(t) do fu = fu+1 s = s..''..n..'% more of '..sl..'\n' if sl == 'hp' then doAddCondition(cid,conditionHP[tonumber(n)]) doCreatureAddHealth(cid,HP-getCreatureHealth(cid)) ca[50] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'mp' then doAddCondition(cid,conditionMP[tonumber(n)]) doCreatureAddMana(cid,HP-getCreatureMana(cid)) ca[51] = 1 doPlayerSendTutorial(cid,19) elseif sl == 'ml' then doAddCondition(cid,conditionML[tonumber(n)]) ca[52] = 1 elseif sl == 'cas' then doAddCondition(cid,conditionCLUB[tonumber(n)]) ca[53] = 1 elseif sl == 'shield' then doAddCondition(cid,conditionSHI[tonumber(n)]) ca[54] = 1 elseif sl == 'dist' then doAddCondition(cid,conditionDIST[tonumber(n)]) ca[55] = 1 end end if fu > 0 then addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s) for i=50,55 do if not ca[i] then doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end else for i=50,55 do doRemoveCondition(cid,CONDITION_ATTRIBUTES,i) end end return true end function onLogin(cid) ---Script by mock the bear! equip(cid,nil,slot) addEvent(chk,2000,cid,loadSet(cid)) -- Here we check! return TRUE end  
  8. Zazeros's post in (Resolvido)Condição em spell was marked as the answer   
    @Icaro Simoes Cara, no Spells.xml, onde voce coloca o nome das magias, o gasto de mana e talz, em magia que precisa de arma pra gastar, vai estar escrito:
    needweapon="1" Ou seja, se precisa estar usando a arma pra gastar a magia, deixa 1, se não precisar, coloque 0.
  9. Zazeros's post in (Resolvido)RESPAW COM PLAYER NA TELA was marked as the answer   
    @JEAN JR Cara, não é mais fácil um script que summona um monstro quando da um certo tempo? Como se fosse script de invasão, mas com 1 monstro só, ou quantos você quiser

Informação Importante

Confirmação de Termo