Ir para conteúdo
  • Cadastre-se

(Resolvido)[Pedido] Script Dimensão


Ir para solução Resolvido por Yugami,

Posts Recomendados

@Kevin Araujo 
so then, I can't test because I'm on mobile
 

  Quote

local exausted = 25 -- exhausted em segundos
local storage = 32598 -- storage do exausted

local time = 15 -- tempo em segundos para voltar
local points = 70 -- o tanto de skills ele ficara mais forte

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, time*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, points)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, points)

function onCastSpell(cid, var)

local config = {pos = {x=1765, y=578, z=7},tempo = 30,effect1 = 10,effect2 = 10}
local areas ={ -- areas bloqueadas
{from = {x=97, y=1773, z=7},to = {x=109, y=1785, z=7}}, -- Evento
{from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}}
}
function onCastSpell(cid, var)
for _, var in ipairs(areas) do
    if isInRange(getCreaturePosition(cid), var.from, var.to) then
       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce nao pode usar essa magia nesse local") return true
    end
end

if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
    return false
    end
    exhaustion.set(cid, storage, exausted)
    
local waittime = 60 -- Tempo de exhaustion
local storage = 15291

if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Voce precisa esperar 60 segundos apos utilizar a spell.")
return false
end

exhaustion.set(cid, storage, waittime)
local pos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)

local Tile1 = {x=1509, y=1261, z=7} -- position onde o player sera teleportado
local Tile2 = {x=1509, y=1255, z=7} -- position onde o target sera teleportado
local from1,to1 = {x = 1483, y = 1110, z = 7},{x = 1648, y = 1275, z = 7} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from2,to2 = {x = 1054, y = 910, z = 7},{x = 1069, y = 925, z = 7} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from3,to3 = {x = 1424, y = 1949, z = 7},{x = 1508, y = 2034, z = 7} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from4,to4 = {x = 1424, y = 1949, z = 6},{x = 1508, y = 2034, z = 6} -- ponto 1 ao ponto 2 da area
local from5,to5 = {x = 1424, y = 1949, z = 5},{x = 1508, y = 2034, z = 5} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from6,to6 = {x = 1424, y = 1949, z = 4},{x = 1508, y = 2034, z = 4} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from7,to7 = {x = 784, y = 2252, z = 7},{x = 805, y = 2264, z = 7} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from8,to8 = {x = 1090, y = 2601, z = 7},{x = 1097, y = 2608, z = 7} -- ponto 1 ao ponto 2 da area em que ele sera teleportado

local from9,to9 = {x=1133, y=1039, z=12},{x=972, y=873, z=12} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from10,to10 = {x=1133, y=1039, z=11},{x=972, y=873, z=11} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
local from11,to11 = {x=1133, y=1039, z=10},{x=972, y=873, z=10} -- ponto 1 ao ponto 2 da area em que ele sera teleportado
-- worlds --
local from12,to12 = {x=1082, y=751, z=15},{x=1110, y=773, z=15} -- Kaguya World
local from13,to13 = {x=1530, y=1460, z=7},{x=1540, y=1466, z=7} -- Chino World 
local from14,to14 = {x=1502, y=1252, z=7},{x=1517, y=1264, z=7} -- Itachi World
local from15,to15 = {x=1520, y=1144, z=7},{x=1559, y=1171, z=7} -- Kakashi World
local from16,to16 = {x=1543, y=1213, z=7},{x=1640, y=1269,z = 7} -- Aleatory 3 World

if isInRange(pos, from1, to1) or isInRange(pos, from2, to2) or isInRange(pos, from3, to3) or isInRange(pos, from4, to4) or isInRange(pos, from5, to5) or isInRange(pos, from6, to6) or isInRange(pos, from7, to7) or isInRange(pos, from8, to8) or isInRange(pos, from9, to9) or isInRange(pos, from10, to10) or isInRange(pos, from11, to11)or isInRange(pos, from12, to12)or isInRange(pos, from13, to13)or isInRange(pos, from14, to14)or isInRange(pos, from15, to15)or isInRange(pos, from16, to16) then
doPlayerSendCancel(cid, "Você nao pode usar o Tsukuyomi World aqui!")
return FALSE
end

if not isPlayer(target) then
doPlayerSendCancel(cid, "Você so pode usar essa magia em players!")
return FALSE
end

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

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


doTeleportThing(cid,Tile1)
doTeleportThing(target,Tile2)
doSendMagicEffect(targetpos, 182)
addEvent(Teleport_Player, time*1000, cid)
addEvent(Teleport_Target, time*1000, target)
return TRUE
end

Expand   Mostrar mais  

 

Link para o post
Compartilhar em outros sites
  • Respostas 20
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

local c = {     cooldown = 25, -- tempo em segundos para usar novamente     effect = 200, -- efeito que vai sair quando for utilizado a spell     storage = 32598, -- storage do cooldown     pos_user = { x = 1509, y = 1261, z = 7},     pos_target = { x = 1509, y = 1255, z = 7},     time_back = 15, -- tempo em segundos para retornar     points = 70, -- pontos de skills que o usuario terar a mais     spell_room = {from = {x = 1, y = 1, z = 1}, to = {x = 1, y = 1, z = 1}},     restricted_zones = {  

Posted Images

caso o do nosso amigo acima não funcione, e queira tentar oque eu tentei resumi do dele, fiz pelo bloco de notas qualquer erro só postar.
 

local c = {
	cooldown = 25, -- tempo em segundos para usar novamente
	effect = 200, -- efeito que vai sair quando for utilizado a spell
	storage = 32598, -- storage do cooldown
	pos_user = { x = 1509, y = 1261, z = 7},
	pos_target = { x = 1509, y = 1255, z = 7},
	time_back = 15, -- tempo em segundos para retornar
	points = 70, -- pontos de skills que o usuario terar a mais
	spell_room = {from = {x = 1, y = 1, z = 1}, to = {x = 1, y = 1, z = 1}},
	restricted_zones = {
		[1] = {from = {x = 1483, y = 1110, z = 7}, to = {x = 1648, y = 1275, z = 7}},
		[2] = {from = {x = 1054, y = 910, z = 7}, to = {x = 1069, y = 925, z = 7}}
	}
}


local function teleportPlayer(cid, pos, time, posBack)
addEvent(doTeleportThing, time, cid, posBack)
doTeleportThing(cid, pos)
end

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, c.time_back*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, c.points)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, c.points)


function onCastSpell(cid, var)
	local spellRoom = c.spell_room
	local restrictZones = c.restricted_zones
	local target = getCreatureTarget(cid)

	if (isInRange(getCreaturePosition(cid), spellRoom.from, spellRoom.to)) then
		doPlayerSendTextMessage(cid, 25, "You are already within the dimension of this spell.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return false
	end

	for _, zone in ipairs(restrictZones) do
		if (isInRange(getCreaturePosition(cid), zone.from, zone.to)) then
			doPlayerSendTextMessage(cid, 25, "It is impossible to use this spell here.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return false
		end
	end

	if (isPlayer(cid)) and  (exhaustion.check(cid, c.storage)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. exhaustion.get(cid, c.storage) .. " seconds")
	return false
	end
	
	if (not isPlayer(target)) then
		doPlayerSendCancel(cid, "This spell can only be used in Player.")
	return false
	end
	
	
teleportPlayer(cid, c.pos_target, c.time_back*1000, getCreaturePosition(target))
teleportPlayer(cid, c.pos_user, c.time_back*1000, getCreaturePosition(cid))
doSendMagicEffect(getCreaturePosition(target), c.effect)

return TRUE
end

 

Editado por Onepiece (veja o histórico de edições)

 

Projeto/Serviços que desenvolvi durante esse Tempo.

[SERVIDOR] - NTO By Madara Rinnegan - Criado em 2014

Link para o post
Compartilhar em outros sites

Atah, ambos os erro foi por que esqueci de add o to na position, tenta agora, fiz uma edição no script .

 

Projeto/Serviços que desenvolvi durante esse Tempo.

[SERVIDOR] - NTO By Madara Rinnegan - Criado em 2014

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96847
    Tópicos
    519609
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo