Ir para conteúdo

Featured Replies

Postado

Fala galera, beleza? Então seguinte, preciso de um script que tipo nao de para atacar spells de area em um certo local, igual tenho evento castle. Ai os players ficam com time parado perto do tp dando spell de area, e atrapalhando muito o desenvolver do evento, Precisava tipo de um script que eu coloque as spells de area e ninguem dentro daquela area do "evento" consiga usar de forma alguma as spells!! Obrigado!! 

  • Respostas 8
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
-- config do local q n pode usar

function onSay(cid, words, param, channel)
local from,to = {x=1001, y=705, z=7},{x=1031, y=737, z=7} -- começo e final do local
local from2,to2 = {x=1011, y=705, z=6},{x=1031, y=738, z=6} -- começo e final do local
local from3,to3 = {x=1012, y=706, z=5},{x=1032, y=739, z=5} -- começo e final do local
local from4,to4 = {x=985, y=598, z=7},{x=1044, y=652, z=7} -- começo e final do local
local from5,to5 = {x=986, y=615, z=6},{x=1039, y=647, z=7} -- começo e final do local
local from6,to6 = {x=990, y=616, z=5},{x=1040, y=647, z=5} -- começo e final do local

--- config da spell 


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 16)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -5.2, -0 , -4.2, -0)


arr1 = {
    {0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 1, 3, 1, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)
 
local function onCastSpell1(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat1, parameters.var)
end

--- 


function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) or isInRange(getCreaturePosition(cid), from3, to3) or isInRange(getCreaturePosition(cid), from4, to4) or isInRange(getCreaturePosition(cid), from5, to5) or isInRange(getCreaturePosition(cid), from6, to6) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!")

else
addEvent(onCastSpell1, 100, parameters)
return TRUE
end 
end
end

Teste.

giphy.gif

Postado
  • Autor
1 minuto atrás, PedroSTT disse:

-- config do local q n pode usar

function onSay(cid, words, param, channel)
local from,to = {x=1001, y=705, z=7},{x=1031, y=737, z=7} -- começo e final do local
local from2,to2 = {x=1011, y=705, z=6},{x=1031, y=738, z=6} -- começo e final do local
local from3,to3 = {x=1012, y=706, z=5},{x=1032, y=739, z=5} -- começo e final do local
local from4,to4 = {x=985, y=598, z=7},{x=1044, y=652, z=7} -- começo e final do local
local from5,to5 = {x=986, y=615, z=6},{x=1039, y=647, z=7} -- começo e final do local
local from6,to6 = {x=990, y=616, z=5},{x=1040, y=647, z=5} -- começo e final do local

--- config da spell 


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 16)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -5.2, -0 , -4.2, -0)


arr1 = {
    {0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 1, 3, 1, 0, 0},
	{0, 0, 1, 1, 1, 0, 0},
	{0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)
 
local function onCastSpell1(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat1, parameters.var)
end

--- 


function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) or isInRange(getCreaturePosition(cid), from3, to3) or isInRange(getCreaturePosition(cid), from4, to4) or isInRange(getCreaturePosition(cid), from5, to5) or isInRange(getCreaturePosition(cid), from6, to6) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!")

else
addEvent(onCastSpell1, 100, parameters)
return TRUE
end 
end
end

Teste.

Pedro isso é oque? Moviment? Pode me explicar? 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo