Postado Fevereiro 7, 2018 7 anos queria fazer um pedido de uma spell a vocês que o player sai andando sozinho e com um effect seguindo ele com a velocidade aumentada e podendo controlar ele somente com a tecla CTRL+ TECLAS DIRECIONAIS, por 20 segundos
Postado Fevereiro 7, 2018 7 anos tenta assim: -- dash as it was in avaOT by Night Wolf local damage = 20 -- dano que toma qnd bate em algum obstáculo local speed = 910 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onWalk(cid) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), 14) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid) end return true end Creditos: Night Wolf Projeto Nto Myth " Eu to disposto a lutar e que se foda todo mundo que duvida que eu vou tocar o terror na porra toda! "
Postado Fevereiro 7, 2018 7 anos Autor 7 minutos atrás, Hokograma disse: tenta assim: -- dash as it was in avaOT by Night Wolf local damage = 20 -- dano que toma qnd bate em algum obstáculo local speed = 910 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onWalk(cid) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), 14) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid) end return true end Creditos: Night Wolf Muito Obrigado, +REP 4 horas atrás, Hokograma disse: tenta assim: -- dash as it was in avaOT by Night Wolf local damage = 20 -- dano que toma qnd bate em algum obstáculo local speed = 910 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onWalk(cid) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), 14) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), 31) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid) end return true end Creditos: Night Wolf Tive um problema eu fiz a spell com um effect de fogo, funcionou normal, mas eu copiei e colei a spell em outra pasta com outro nome e mudei o effect para terra, mas quando eu uso essa spell em vez de mudar o effect ele fica com o effect de fogo, já verifiquei a pasta onde se encontra a spell no xml
Postado Fevereiro 7, 2018 7 anos -- dash as it was in avaOT by Night Wolf local damage = 20 -- dano que toma qnd bate em algum obstáculo local speed = 910 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local effect = x local effectondamage = y local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 local function onWalk(cid,effect,effectonDamage) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), effect) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), effectonDamage) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), effectonDamage) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid, effect,effectondamage) end return true end Te ajudei ?? Que tal fazer uma contribuição ?
Postado Fevereiro 7, 2018 7 anos Autor 5 minutos atrás, DboExplorer disse: -- dash as it was in avaOT by Night Wolf local damage = 20 -- dano que toma qnd bate em algum obstáculo local speed = 910 -- velocidade do player ao usar o dash (vai de 0 a mil) local pzprotect = true -- nao deixa entrar em pz com a spell local distance = 15 -- quantos sqms anda local effect = x local effectondamage = y local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 local function onWalk(cid,effect,effectonDamage) if isCreature(cid) then local poslook = getCreatureLookPosition(cid) poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE if isWalkable(poslook, false, false, pzprotect) then if not isCreature(getThingfromPos(poslook).uid) then doMoveCreature(cid, getPlayerLookDirection(cid)) doSendMagicEffect(getPlayerPosition(cid), effect) else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), effectonDamage) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end else doCreatureAddHealth(cid, -damage) doSendMagicEffect(getPlayerPosition(cid), effectonDamage) doSendAnimatedText(getPlayerPosition(cid), "-"..damage , 180) end end return true end function onCastSpell(cid, var) for i = 0, distance do addEvent(onWalk, (1001- math.min(speed, 1000)) *i, cid, effect,effectondamage) end return true end continua bugando ele funciona normal, mas se eu duplicar o .lua e mudar o effect como se fosse outra magia e como se ela pegasse o effect da primeira, tem como por uma condição ai pra mim? tipo se for vocation 3 or 4 effect = 58 se for vocation 7 or 8 effect = 6 ?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.