Postado Junho 22, 2015 10 anos Olá galera do tk, to querendo pedir aki que coloque nessas 2 scripts para que n consiga usar elas em pvp e em No logout. local config = { pos = {x = 1234, y = 728, z = 6}, -- posição da aegis dimension tempo = 30, -- tempo pra voltar effect1 = 196, -- efeito ao ser teleportado effect2 = 196, -- efeito ao voltar distance = 15, --- distancia que você vai ter que estar do centro do kamui pra poder usar a magia storagecool = 94283, -- storage do cooldown cooldown = 120 -- tempo entre um uso e outro } function onCastSpell(cid, var) if getDistanceBetween(getThingPos(cid), config.pos) <= config.distance then doPlayerSendCancel(cid, "You cant use kamui inside the kamui.") return false end if getPlayerStorageValue(cid, config.storagecool) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, config.storage))).." segundos para usar a spell novamente.") return false end if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) setPlayerStorageValue(cid, config.storagecool, os.time() + config.cooldown) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!") end for i = 1,config.tempo do addEvent(function() if isCreature(target) then doPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end else doPlayerSendCancel(cid, "You can only use this spell in players") end return true end local config = { pos = {x = 1234, y = 728, z = 6}, -- posição que será teleportado tempo = 30, -- tempo pra voltar effect1 = 196, -- efeito ao ser teleportado effect2 = 196, -- efeito ao voltar storage = 19329, -- storage que fica guardado o cooldown from = {x=35, y=228, z=7}, --- quina do kamui (pra impedir players de usarem o kamui dentro do kamui) to = {x=49, y=240, z=7}, --- quina do kamui (pra impedir players de usarem o kamui dentro do kamui) cooldown = 60, --- tempo entre um uso e outro (após usar a spell vc vai ficar X segundos sem poder usar ela novamente) msg = "KAMUI OUT!" -- mensagem ao sair do kamui } local exceptions = {'trainer', 'aegis', 'god anderson'} --- nome das criaturas que não poderão ser levadas pro kamui (sempre em minúsculo e entre aspas) function canEffect(pos, pz, proj) -- Night Wolf based on Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 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 onCastSpell(cid, var) local pos = getPlayerPosition(cid) if isInRange(pos, config.from, config.to) then doPlayerSendCancel(cid, "You cannot use Kamui spell inside the Kamui!") return false end if os.time() - getPlayerStorageValue(cid, config.storage) >= config.cooldown then doPlayerSetStorageValue(cid, config.storage, os.time()) if isCreature(getCreatureTarget(cid)) then target = getCreatureTarget(cid) for i = 1, #exceptions do if getCreatureName(target):lower() == exceptions then doPlayerSendCancel(cid, "You can't take ".. getCreatureName(target) .." to Kamui.") return false end end --------------- PLAYER----------- addEvent(doTeleportThing, 1000*config.tempo, cid, pos, true) addEvent(doCreatureSay, 1000*config.tempo, cid, config.msg, 20, false) addEvent(doSendMagicEffect, 1000*config.tempo, pos, config.effect2) doSendMagicEffect(pos, config.effect1) doTeleportThing(cid, config.pos) -------------------- OPONENTE ---------------- addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) ------------------------------------- if isPlayer(target) and isCreature(cid) then doPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!") end for i = 1,config.tempo do addEvent(function() if isPlayer(target) then doPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end if isPlayer(cid) then doPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end else ---------- levar quem tá em volta do player --------------- local teleportPosition = { {x = pos.x, y = pos.y, z = pos.z}, } local mobas = {} local checker = 0 for _, tPos in ipairs(teleportPosition) do doSendMagicEffect(tPos, config.effect2) local mob = getTopCreature(tPos).uid if canEffect (tPos) and mob ~= 0 and (isMonster(mob) or isPlayer(mob)) then for i = 1, #exceptions do if getCreatureName(mob):lower() == exceptions then checker = 1 break end end if checker ~= 1 then table.insert(mobas, mob) end end end if #mobas > 0 then for _, pid in ipairs(mobas) do addEvent(doTeleportThing, 1000*config.tempo, pid, getThingPos(pid), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(pid), config.effect2) doSendMagicEffect(getThingPos(pid), config.effect1) doTeleportThing(pid, config.pos) if isPlayer(pid) and isCreature(cid) then doPlayerSendTextMessage(pid, 27, "You were teleported by ".. getCreatureName(cid) ..".") end for i = 1,config.tempo do addEvent(function() if isPlayer(pid) then doPlayerSendTextMessage(pid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end end end ---------------------------- addEvent(doTeleportThing, 1000*config.tempo, cid, pos, true) addEvent(doCreatureSay, 1000*config.tempo, cid, config.msg, 20, false) addEvent(doSendMagicEffect, 1000*config.tempo, pos, config.effect2) doSendMagicEffect(pos, config.effect1) doTeleportThing(cid, config.pos) if isPlayer(cid) then doPlayerSendTextMessage(cid, 27, "You teleported yourself.") end for i = 1,config.tempo do addEvent(function() if isPlayer(cid) then doPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, config.storage))).." segundos para usar a spell novamente.") return false end return true end Rep ++
Postado Junho 22, 2015 10 anos Não sei se entendi bem, mas você disse PVP, seria batle ou protection zone? No segundo script adicione abaixo de: function onCastSpell(cid, var) if getCreatureCondition(cid, CONDITION_INFIGHT) or getTileInfo(getCreaturePosition(cid)).nologout then doPlayerSendCancel(cid, "You can't use spells in protection zone.")return falseend local config = { pos = {x = 1234, y = 728, z = 6}, -- posição da aegis dimension tempo = 30, -- tempo pra voltar effect1 = 196, -- efeito ao ser teleportado effect2 = 196, -- efeito ao voltar distance = 15, --- distancia que você vai ter que estar do centro do kamui pra poder usar a magia storagecool = 94283, -- storage do cooldown cooldown = 120 -- tempo entre um uso e outro } function onCastSpell(cid, var) if getTileInfo(getThingPos(cid)).protection or getTileInfo(getCreaturePosition(cid)).nologout then doPlayerSendCancel(cid, "You can't use spells in protection zone.") return false end if getDistanceBetween(getThingPos(cid), config.pos) <= config.distance then doPlayerSendCancel(cid, "You cant use kamui inside the kamui.") return false end if getPlayerStorageValue(cid, config.storagecool) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, config.storage))).." segundos para usar a spell novamente.") return false end if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) setPlayerStorageValue(cid, config.storagecool, os.time() + config.cooldown) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!") end for i = 1,config.tempo do addEvent(function() if isCreature(target) then doPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end else doPlayerSendCancel(cid, "You can only use this spell in players") end return true end Se for em batalha, infight local config = { pos = {x = 1234, y = 728, z = 6}, -- posição da aegis dimension tempo = 30, -- tempo pra voltar effect1 = 196, -- efeito ao ser teleportado effect2 = 196, -- efeito ao voltar distance = 15, --- distancia que você vai ter que estar do centro do kamui pra poder usar a magia storagecool = 94283, -- storage do cooldown cooldown = 120 -- tempo entre um uso e outro } function onCastSpell(cid, var) if getCreatureCondition(cid, CONDITION_INFIGHT) or getTileInfo(getCreaturePosition(cid)).nologout then doPlayerSendCancel(cid, "You can't use spells in protection zone.") return false end if getDistanceBetween(getThingPos(cid), config.pos) <= config.distance then doPlayerSendCancel(cid, "You cant use kamui inside the kamui.") return false end if getPlayerStorageValue(cid, config.storagecool) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, config.storage))).." segundos para usar a spell novamente.") return false end if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) setPlayerStorageValue(cid, config.storagecool, os.time() + config.cooldown) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!") end for i = 1,config.tempo do addEvent(function() if isCreature(target) then doPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end else doPlayerSendCancel(cid, "You can only use this spell in players") end return true end Editado Junho 22, 2015 10 anos por lorenzo2014 (veja o histórico de edições) Danera Global Server Versão: 10.77 - 10.79 Sem Items VIP Venha se divertir
Postado Junho 23, 2015 10 anos Autor Não eu kero que o player não consiga usar essas spells em área pvp ou em área No Logout
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.