Ir para conteúdo

Featured Replies

Postado
Versão do Servidor: TFS - 0.4
Tipo de Script: spell
local combat1 = createCombatObject()
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.1, 1, -4.8, 1)

arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)

local function onCastSpell2(parameters)
    if isPlayer(parameters.cid) then
    doCombat(parameters.cid, parameters.combat2, parameters.var)
end
end

local times = 3       --Quantos SQMs o jogador irá se mover.
 
function isWalkable(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    if getTopCreature(pos).uid > 0 and creature then return true end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 2 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 playerPos = getThingPos(cid)
	for i = 1, times do
		playerPos = getPosByDir(playerPos, getCreatureLookDirection(cid))    
		if not isWalkable(playerPos, i == times, i == times, i == times) then
			doPlayerSendCancel(cid, "Sorry, destination not possible.")
			return false
		end
    end
local direction = getCreatureLookDirection(cid)
local size = 3

local toPosition = getPositionByDirection(getThingPosition(cid), direction, size)
if isWalkable(toPosition, cid) then
	doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
        addEvent(doTeleportThing,600,cid, toPosition)
	doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
else
	doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 }
addEvent(onCastSpell2, 200, parameters)
doCombat(cid, combat1, var)
return true
end

 

Boa noite, galera! Alguém poderia me ajudar. Bom, essa Spell funciona assim, eu a uso e sou teleportado a 3 Sqm a frente da onde estou olhando. Queria colocar para atravesar obstáculos específicos, tipo: Árvores. Como está ai, ela não atravessa nada, só Monstros e Players. Agradeço desde já.

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.8k

Informação Importante

Confirmação de Termo