Ir para conteúdo

Featured Replies

Postado

To com essas script de levar para outro mundo porem eu queria que ao usar, o player e o target focem juntos para um mundo Random

no caso irei fazer lugares indenticos para nao acontecer de players que usarem a mesma magia se encontrarem!

Agradeço desde já Darei Rep ++

Ps: Tem duas magias ai com scripts diferente queria que ambas pode-se levar para lugares Random

 

1ª Magia

Citar

function onCastSpell(cid, var)



-- Local para onde nao pode ser usado


local from1,to1 = {x=1686, y=1411, z=7},{x=1714, y=1437, z=7} ---- Posição que nao da para usar
local from2,to2 = {x=1761, y=1324, z=7},{x=1791, y=1350, z=7} -- Posição que nao da para usar 
local from3,to3 = {x=276, y=64, z=8},{x=292, y=78, z=8} -- Posição que nao da para usar 
local from4,to4 = {x=663, y=1098, z=7},{x=685, y=1104, z=7} -- Posição que nao da para usar 
local from5,to5 = {x=965, y=1483, z=7},{x=979, y=1494, z=7} -- Posição que nao da para usar 
local from6,to6 = {x=1161, y=1177, z=7},{x=1167, y=1188, z=7} -- Posição que nao da para usar 

-- Local Para onde vai o player e o target
local Tile1 = {x = 1699, y = 1423, z = 7} -- pos onde o player sera teleportado
local Tile2 = {x = 1699, y = 1421, z = 7} -- pos onde o target sera teleportado

local target = getCreatureTarget(cid)
local TargetPos = getCreaturePosition(target)
local PlayerPos = getCreaturePosition(cid)

if isInRange(PlayerPos, from1, to1) then
doPlayerSendCancel(cid, "Você ja esta dentro da Dimension!")
return FALSE
end

if isInRange(PlayerPos, from2, to2) or isInRange(PlayerPos, from3, to3) or isInRange(PlayerPos, from4, to4) or isInRange(PlayerPos, from5, to5) or isInRange(PlayerPos, from6, to6) then
doPlayerSendCancel(cid, "Você nao pode usar o Dimension!")
return FALSE
end

if getTileInfo(getThingPos(cid)).pvp then
doPlayerSendCancel(cid, "Você nao pode usar o Dimension!")
return FALSE
end

if exhaustion.check(cid, 5570) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 5570) .. " segundos para usar novamente.")
return FALSE
end

if not isPlayer(target) then
doPlayerSendCancel(cid, "Use apenas em players.")
return FALSE
end

exhaustion.set(cid, 5570, 15)
exhaustion.set(target, 5570, 15)
doSendMagicEffect(PlayerPos, 196)
doSendMagicEffect(TargetPos, 196)
doSendMagicEffect(Tile1, 196)
doSendMagicEffect(Tile2, 196)
setPlayerStorageValue(cid, 5020, PlayerPos.x)
setPlayerStorageValue(cid, 5021, PlayerPos.y)
setPlayerStorageValue(cid, 5022, PlayerPos.z)
setPlayerStorageValue(target, 5020, TargetPos.x)
setPlayerStorageValue(target, 5021, TargetPos.y)
setPlayerStorageValue(target, 5022, TargetPos.z)
doTeleportThing(cid, Tile1)
doTeleportThing(target, Tile2)
return TRUE
end

 

 

2ª Magia

Citar

function onCastSpell(cid, var)

local pos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)
  --- Locais para ondem o player vai com target
local tsuku = {x = 1775, y = 1340, z = 7}
local alvo = {x = 1775, y = 1336, z = 7}
  
local from1,to1 = {x=1761, y=1324, z=7},{x=1791, y=1350, z=7} ----  Posiçoes que nao poderam usar a magia
local from2,to2 = {x=276, y=64, z=8},{x=292, y=78, z=8} --  Posiçoes que nao poderam usar a magia
local from3,to3 = {x=1686, y=1411, z=7},{x=1714, y=1437, z=7} --- Posiçoes que nao poderam usar a magia

if isInRange(pos, from1, to1) then
doPlayerSendCancel(cid, "Você ja esta dentro da Prisao")
return FALSE
end

if isInRange(pos, from2, to2) or isInRange(pos, from3, to3) then
doPlayerSendCancel(cid, "Você nao pode usar Prision aqui!")
return FALSE
end


if getTileInfo(getThingPos(cid)).pvp then
doPlayerSendCancel(cid, "Você nao pode usar aqui!")
return FALSE
end

if exhaustion.check(cid, 13132) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 13132) .. " segundos para usar novamente.")
return FALSE
end

local function Teleport_Player(cid)
doTeleportThing(cid, pos)
end

local function Teleport_Target(target)
doCreatureSetNoMove(target, 0)
doTeleportThing(target, targetpos)
end

local function Teleport_Player_Emergency()
for x = from1.x, to1.x do
for y = from1.y, to1.y do
local mob_player = getTopCreature({x=x, y=y, z=from1.z}).uid
if mob_player ~= 0 and isPlayer(mob_player) then
doTeleportThing(cid, pos)
end
end
end
end

local function Teleport_Target_Emergency()
for x = from1.x, to1.x do
for y = from1.y, to1.y do
local mob_target = getTopCreature({x=x, y=y, z=from1.z}).uid
if mob_target ~= 0 and isPlayer(mob_target) then
doCreatureSetNoMove(target, 0)
doTeleportThing(target, targetpos)
end
end
end
end

if isPlayer(target) then
exhaustion.set(cid, 13132, 20)
doCreatureSetNoMove(target, 1)
doTeleportThing(cid,tsuku)
doTeleportThing(target,alvo)
doSendMagicEffect(alvo, 182)
doCreatureSay(cid, "Prision!", TALKTYPE_MONSTER)
addEvent(Teleport_Player, 15000, cid)
addEvent(Teleport_Target, 15000, target)
addEvent(Teleport_Player_Emergency, 20000)
addEvent(Teleport_Target_Emergency, 20000)
else
doPlayerSendCancel(cid, "Use apenas em players.")
end
end

 

 

  • 4 weeks later...
Postado

@Black Fenix Salve, bruxo! Como eu não manjo nada de script, não vou poder te ajudar nesse teu problema...

Porém, a função que você quer é exatamente a mesma que esta faz, só mudar os nomes e ajustar da sua maneira.

Espero que te ajude, se ajudar já sabe ^^

Citar

 

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo