Postado Maio 13, 2018 7 anos Ola Galera, Bom minha dúvida é bem simples, gostaria de saber como colocar um efeito nessa Spell entretanto tem 2 condições:1- O foco é por um efeito que saia no Target "Alvo" (Efeito !z 56). Feito isso já está ótimo, duvida resolvida!!2- Se possível colocar o efeito do "!x 4 " e manter o efeito do "!z 56". function onCastSpell(cid, var) local tempo = 5 local target = getCreatureTarget(cid) local position = getPlayerPosition(cid) doCreatureSetNoMove(target, true) setPlayerStorageValue(cid, 5421, os.time()+tempo) movePlayer(position, target, cid) return true end function movePlayer(position, target, cid) if isCreature(target) and isPlayer(cid) then local pos = getCreaturePosition(target) if getPlayerPosition(cid).x ~= position.x then pos = {x = getCreaturePosition(target).x+(getPlayerPosition(cid).x +(- 1 * position.x)), y = getCreaturePosition(target).y, z = getCreaturePosition(target).z} elseif getPlayerPosition(cid).y ~= position.y then pos = {x = getCreaturePosition(target).x, y = getCreaturePosition(target).y+(getPlayerPosition(cid).y +(- 1 * position.y)), z = getCreaturePosition(target).z} end if isWalkable(pos) then doTeleportThing(target, pos) end if (getPlayerStorageValue(cid, 5421) - os.time()) > 0 then addEvent(movePlayer, 100, getPlayerPosition(cid), target, cid) else doPlayerSendTextMessage(cid, 22, "Voce perdeu o controle.") doCreatureSetNoMove(target, false) end end end function isWalkable(pos, creature, pz, proj) -- nord 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 Desde já Grato!
Postado Maio 13, 2018 7 anos Solução function onCastSpell(cid, var) local tempo = 5 local target = getCreatureTarget(cid) local position = getPlayerPosition(cid) doCreatureSetNoMove(target, true) setPlayerStorageValue(cid, 5421, os.time()+tempo) movePlayer(position, target, cid) local distance = 4 local effect = 56 addEvent(doSendMagicEffect, 150, getCreaturePosition(target), effect) doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(target), distance) return true end function movePlayer(position, target, cid) if isCreature(target) and isPlayer(cid) then local pos = getCreaturePosition(target) if getPlayerPosition(cid).x ~= position.x then pos = {x = getCreaturePosition(target).x+(getPlayerPosition(cid).x +(- 1 * position.x)), y = getCreaturePosition(target).y, z = getCreaturePosition(target).z} elseif getPlayerPosition(cid).y ~= position.y then pos = {x = getCreaturePosition(target).x, y = getCreaturePosition(target).y+(getPlayerPosition(cid).y +(- 1 * position.y)), z = getCreaturePosition(target).z} end if isWalkable(pos) then doTeleportThing(target, pos) end if (getPlayerStorageValue(cid, 5421) - os.time()) > 0 then addEvent(movePlayer, 100, getPlayerPosition(cid), target, cid) else doPlayerSendTextMessage(cid, 22, "Voce perdeu o controle.") doCreatureSetNoMove(target, false) end end end function isWalkable(pos, creature, pz, proj) -- nord 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
Postado Maio 13, 2018 7 anos Autor 3 horas atrás, Sttorm disse: function onCastSpell(cid, var) local tempo = 5 local target = getCreatureTarget(cid) local position = getPlayerPosition(cid) doCreatureSetNoMove(target, true) setPlayerStorageValue(cid, 5421, os.time()+tempo) movePlayer(position, target, cid) local distance = 4 local effect = 56 addEvent(doSendMagicEffect, 150, getCreaturePosition(target), effect) doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(target), distance) return true end function movePlayer(position, target, cid) if isCreature(target) and isPlayer(cid) then local pos = getCreaturePosition(target) if getPlayerPosition(cid).x ~= position.x then pos = {x = getCreaturePosition(target).x+(getPlayerPosition(cid).x +(- 1 * position.x)), y = getCreaturePosition(target).y, z = getCreaturePosition(target).z} elseif getPlayerPosition(cid).y ~= position.y then pos = {x = getCreaturePosition(target).x, y = getCreaturePosition(target).y+(getPlayerPosition(cid).y +(- 1 * position.y)), z = getCreaturePosition(target).z} end if isWalkable(pos) then doTeleportThing(target, pos) end if (getPlayerStorageValue(cid, 5421) - os.time()) > 0 then addEvent(movePlayer, 100, getPlayerPosition(cid), target, cid) else doPlayerSendTextMessage(cid, 22, "Voce perdeu o controle.") doCreatureSetNoMove(target, false) end end end function isWalkable(pos, creature, pz, proj) -- nord 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 Muito obrigado !
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.