Ir para conteúdo
  • Cadastre-se

Derivado [PEDIDO] adaptação de spells para tfs 0.3.6 ~0.4.0


Posts Recomendados

Fala Galera do TK

 

primeiramente se ja existir algum tópico igual a este vamor mostra link e apagar este,

 

gostaria de pedir para alguma alma boa uma coisa n sei talvez seja até fácil.

 

queria ver uma maneira de adaptar estas spells que funcionam em tfs 1.0 para que funcionem em tfs 0.3.6 ~0.4.0 (eu coloquei as duas versões pq alguns scripts q eu uso uns é 0.3.6 e outros 0.4.0 se caso for algo impossível n me perguntem como eu fiz pq nem eu sei kkkk )

 

obs: se caso precisarem para ter uma noção de como a spell funciona aqui tem o link com as gif das 4 spells

 

1 rep+ por cada spell:

 

1ª SPELL

 

Spoiler

AREA1 = {
    {0, 0, 0},
    {0, 3, 0},
    {0, 0, 0}
}

local function sendHealingEffect(cid, position, loopCount)
    local player = Player(cid)
    if not player then
        return
    end

    position:sendDistanceEffect(player:getPosition(), CONST_ANI_SMALLHOLY)
    player:addHealth(math.max(100, 150))
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    if loopCount == 0 then
        player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    end
end

function onCastSpell(creature, var)
    local playerPos = creature:getPosition()
    local loopCount = 12

    creature:say('Heal me my brothers!', TALKTYPE_MONSTER_SAY)
   
    for i = 1, loopCount do
        local position = Position(playerPos.x + math.random(-4, 3), playerPos.y + math.random(-3, 2), playerPos.z)
        addEvent(doAreaCombatHealth, i * 75, creature:getId(), COMBAT_PHYSICALDAMAGE, position, createCombatArea(AREA1), 0, 0, CONST_ME_ASSASSIN)
        addEvent(sendHealingEffect, i * 75, creature:getId(), position, loopCount - i)
    end
    return false
end

 

 

2ª SPELL

 

Spoiler

local function targetEffect(cid)
    local player = Player(cid)
    if not player then
        return
    end

    local effect =  CONST_ANI_REDSTAR
    local orig = player:getPosition()
    local d1, d2 = {z = orig.z}, {z = orig.z}

    d1.x = orig.x - 5
    d2.x = orig.x + 5
    for i = -2, 2 do
        d1.y = orig.y + i
        d2.y = d1.y
        orig:sendDistanceEffect(d1, effect)
        orig:sendDistanceEffect(d2, effect)
    end

    d1.y = orig.y - 3
    d2.y = orig.y + 3
    for i = -4, 4 do
        d1.x = orig.x + i
        d2.x = d1.x
        orig:sendDistanceEffect(d1, effect)
        orig:sendDistanceEffect(d2, effect)
    end
end

local function backOldPosition(cid, oldPosition)
    local player = Player(cid)
    if not player then
        return
    end
   
    player:teleportTo(oldPosition)
    player:setGhostMode(false)
end

local function jumpEffect(cid, target)
    local player = Player(cid)
    if not player then
        return
    end

    local target = Creature(target)
    if target then
        player:getPosition():sendDistanceEffect(target:getPosition(), CONST_ANI_EXPLOSION)
    end
end

local function jumpOnTarget(cid, target, targetCount, oldPosition)
    local player = Player(cid)
    if not player then
        return
    end

    local target = Creature(target)
    if target then
        addEvent(targetEffect, 100, cid)
        player:teleportTo(target:getPosition())
        player:setGhostMode(true)
        doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_ASSASSIN)
        if targetCount == 0 then
            addEvent(backOldPosition, 400, cid, oldPosition)
        end
    end
end

local function extractRandomValuesFromTable(tbl) --By Printer(This will make sure not to select a value twice from the table)
    if #tbl == 0 then
        return false
    end
          return table.remove(tbl, math.random(#tbl))
end

function onCastSpell(creature, var)
    local targets = {}

    local playerPos = creature:getPosition()
    local spectators = Game.getSpectators(playerPos, false, false, 0, 10, 0, 10)
    for i = 1, #spectators do
        local specs = spectators[i]
        if specs ~= creature and not specs:isNpc() then
            targets[#targets+1] = specs
        end
    end

    if #targets == 0 then
        creature:sendCancelMessage('There is no targets in sight.')
        playerPos:sendMagicEffect(CONST_ME_POFF)
        return false
    end

    local targetCount = #targets
    for i = 1, #targets do
        local randTarget = extractRandomValuesFromTable(targets)
        addEvent(jumpOnTarget, i * 400, creature:getId(), randTarget:getId(), targetCount - i, playerPos)
        addEvent(jumpEffect, i * 300, creature:getId(), randTarget:getId())
    end
    return false
end

 

 

3ª SPELL

 

Spoiler

local function sendDistanceEffectDelay(cid, fromPos, toPos, effect)
    local player = Player(cid)
    if not player then
        return
    end

    fromPos:sendDistanceEffect(toPos, effect)
end

local function ninjaJumpDash(cid, target, oldPos, lastJump, back)
    local player = Player(cid)
    if not player then
        return
    end

    local target = Creature(target)
    if not target then
        player:setGhostMode(false)
        return
    end
   
    if lastJump then
        player:setGhostMode(false)
    end

    if back then
        player:teleportTo(oldPos)
    else
        player:teleportTo(target:getPosition())
    end
    doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_THUNDER)
end

function onCastSpell(creature, var)
    local cid = creature:getId()
    local playerPos = creature:getPosition()

    creature:setGhostMode(true)
    addEvent(ninjaJumpDash, 0, cid, target:getId(), playerPos, false, false)
    addEvent(sendDistanceEffectDelay, 100, cid, playerPos, target:getPosition(), CONST_ANI_ENERGY)
    addEvent(sendDistanceEffectDelay, 300, cid, target:getPosition(), playerPos, CONST_ANI_ENERGY)
    addEvent(ninjaJumpDash, 400, cid, target:getId(), playerPos, false, true)

    addEvent(ninjaJumpDash, 600, cid, target:getId(), playerPos, false, false)
    addEvent(sendDistanceEffectDelay, 700, cid, playerPos, target:getPosition(), CONST_ANI_ENERGY)
    addEvent(sendDistanceEffectDelay, 1000, cid, target:getPosition(), playerPos, CONST_ANI_ENERGY)
    addEvent(ninjaJumpDash, 1100, cid, target:getId(), playerPos, false, true)

    addEvent(ninjaJumpDash, 1300, cid, target:getId(), playerPos, false, false)
    addEvent(sendDistanceEffectDelay, 1400, cid, playerPos, target:getPosition(), CONST_ANI_ENERGY)
    addEvent(sendDistanceEffectDelay, 1700, cid, target:getPosition(), playerPos, CONST_ANI_ENERGY)
    addEvent(ninjaJumpDash, 1800, cid, target:getId(), playerPos, true, true)
    return false
end

 

 

4ª SPELL

 

Spoiler

function isWalkable(cid, pos)
    local tile = Tile(pos)
    if not tile then
        return false
    end

    if tile:queryAdd(cid) == 1 and not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
        return true
    end
    return false
end

local function jumpBehindTarget(cid, target)
    local player = Player(cid)
    local target = Creature(target)
    local targetPos = target:getPosition()
    local targetPositions = {
        north = Position(targetPos.x, targetPos.y-1, targetPos.z),
        east = Position(targetPos.x+1, targetPos.y, targetPos.z),
        west = Position(targetPos.x-1, targetPos.y, targetPos.z),
        south = Position(targetPos.x, targetPos.y+1, targetPos.z)
    }

    local targetDir = target:getDirection()
    if targetDir == NORTH then
        dir = targetPositions.south
    elseif targetDir == EAST then
        dir = targetPositions.west
    elseif targetDir == WEST then
        dir = targetPositions.east
    elseif targetDir == SOUTH then
        dir = targetPositions.north
    end
    return dir
end

local function oldPos(cid, oldPos)
    local player = Player(cid)
    if not player then
        return
    end

    player:teleportTo(oldPos)
end

local function checkHasTarget(cid, count, oldPos)
    local player = Player(cid)
    if not player then
        return
    end

    if count < 1 then
        player:setGhostMode(false)
        return
    end
   
    local target = player:getTarget()
    if target then
        local behindTarget = jumpBehindTarget(cid, target:getId())
        if isWalkable(cid, behindTarget) then
            player:teleportTo(behindTarget)
        else
            player:teleportTo(target:getPosition())
            addEvent(backOldPos, 100, cid, oldPos)
        end
        player:setDirection(target:getDirection())
        player:setGhostMode(false)
        doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -20, -100, CONST_ME_FIREATTACK)
        return true
    end
    addEvent(checkHasTarget, 1 * 100, cid, count - 1)
end

function onCastSpell(creature, var)
    local playerPos = creature:getPosition()

    creature:setGhostMode(true)
    playerPos:sendMagicEffect(CONST_ME_POFF)
    addEvent(checkHasTarget, 1 * 250, creature:getId(), 50, playerPos)
    return false
end

 

 

Obrigado a Todos!

Link para o post
Compartilhar em outros sites

já vi essas spells, se nao me engano em forum BR, também queria para 0.3.6, até pedi para o criador me ajuda mas ele disse que estava meio sem tempo

Scriptszinhos:

 

Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.

Link para o post
Compartilhar em outros sites

mais um UP ai pra galera, sou insistente não vou desistir alguém vai vir ajudar eu sei disso

 

#UPatémorrer

Link para o post
Compartilhar em outros sites

#UP #UP #UP #UP #UP #UP cde o lendário mestre dos scripts pra me salvar aqui ja disse sou brasileiro e n desisto nunca vou insistir com esse post até o lendário scripter (seja quem for rs) me ajudar

Link para o post
Compartilhar em outros sites

Não testei nenhuma delas.

1° Spell:

Spoiler

local area = createCombatArea({
	{0, 0, 0},
	{0, 3, 0},
	{0, 0, 0}
})

local function sendHealingEffect(cid, position, loopCount)
	if(not isPlayer(cid)) then
		return
	end
	
	local pos = getThingPos(cid)
	doSendDistanceShoot(position, pos, CONST_ANI_SMALLHOLY)
	doCreatureAddHealth(cid, math.max(100, 150))
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	if(loopCount == 0) then
		doSendMagicEffect(pos, CONST_ME_HOLYAREA)
	end
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	local loopCount = 12
	
	doCreatureSay(cid, 'Heal me my brothers!', TALKTYPE_MONSTER_SAY)
	
	for i = 1, loopCount do
		local pos = {x = (playerPos.x + math.random(-4, 3)), y = (playerPos.y + math.random(-3, 2)), z = playerPos.z}
		addEvent(doCombatAreaHealth, (i * 75), cid, COMBAT_PHYSICALDAMAGE, pos, area, 0, 0, CONST_ME_ASSASSIN)
		addEvent(sendHealingEffect, (i * 75), cid, pos, (loopCount - i))
	end
	return false
end

 

 

2° Spell:

Spoiler

local function targetEffect(cid)
	if(not isPlayer(cid)) then
		return
	end
	
	local effect = CONST_ANI_REDSTAR
	local orig = getThingPos(cid)
	local d1, d2 = {z = orig.z}, {z = orig.z}
	
	d1.x = orig.x - 5
	d2.x = orig.x + 5
	for i = -2, 2 do
		d1.y = orig.y + i
		d2.y = d1.y
		doSendDistanceShoot(orig, d1, effect)
		doSendDistanceShoot(orig, d2, effect)
	end
	
	d1.y = orig.y - 3
	d2.y = orig.y + 3
	for i = -4, 4 do
		d1.x = orig.x + i
		d2.x = d1.x
		doSendDistanceShoot(orig, d1, effect)
		doSendDistanceShoot(orig, d2, effect)
	end
end

local function backOldPosition(cid, oldPosition)
	if(not isPlayer(cid)) then
		return
	end
	
	doTeleportThing(cid, oldPosition)
	--player:setGhostMode(false) -- not exists in TFS 0.4
end

local function jumpEffect(cid, target)
	if(not isPlayer(cid)) then
		return
	end
	
	if(isCreature(target)) then
		doSendDistanceShoot(getThingPos(cid), getThingPos(target), CONST_ANI_EXPLOSION)
	end
end

local function jumpOnTarget(cid, target, targetCount, oldPosition)
	if(not isPlayer(cid)) then
		return
	end
	
	if(isCreature(target)) then
		addEvent(targetEffect, 100, cid)
		doTeleportThing(cid, getThingPos(target))
		--player:setGhostMode(true) -- not exists in TFS 0.4
		doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_ASSASSIN)
		if(targetCount == 0) then
			addEvent(backOldPosition, 400, cid, oldPosition)
		end
	end
end

local function extractRandomValuesFromTable(tbl) --By Printer(This will make sure not to select a value twice from the table)
	if(#tbl == 0) then
		return false
	end
	return table.remove(tbl, math.random(#tbl))
end

function onCastSpell(cid, var)
	local targets = {}
	
	local playerPos = getThingPos(cid)
	local spectators = getSpectators(playerPos, 10, 10)
	for i = 1, #spectators do
		local specs = spectators[i]
		if(specs ~= cid and not isNpc(specs)) then
			targets[#targets+1] = specs
		end
	end
	
	if(#targets == 0) then
		doPlayerSendCancel(cid, 'There is no targets in sight.')
		doSendMagicEffect(playerPos, CONST_ME_POFF)
		return false
	end
	
	local targetCount = #targets
	for i = 1, #targets do
		local randTarget = extractRandomValuesFromTable(targets)
		addEvent(jumpOnTarget, (i * 400), cid, randTarget, (targetCount - i), playerPos)
		addEvent(jumpEffect, (i * 300), cid, randTarget)
	end
	return false
end

 

 

 

3° Spell:

Spoiler

local function sendDistanceEffectDelay(cid, fromPos, toPos, effect)
	if(not isPlayer(cid)) then
		return
	end
	
	doSendDistanceShoot(fromPos, toPos, effect)
end

local function ninjaJumpDash(cid, target, oldPos, lastJump, back)
	if(not isPlayer(cid)) then
		return
	end
	
	if(not isCreature(target)) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
		return
	end
	
	if(lastJump) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
	end
	
	if(back) then
		doTeleportThing(cid, oldPos)
	else
		doTeleportThing(cid, getThingPos(target))
	end
	doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_ENERGYAREA) -- CONST_ME_THUNDER not exists in TFS 0.4
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	local target = variantToNumber(var)
	
	--creature:setGhostMode(true) -- not exists in TFS 0.4
	addEvent(ninjaJumpDash, 0, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 100, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 300, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 400, cid, target, playerPos, false, true)
	
	addEvent(ninjaJumpDash, 600, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 700, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 1000, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 1100, cid, target, playerPos, false, true)
	
	addEvent(ninjaJumpDash, 1300, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 1400, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 1700, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 1800, cid, target, playerPos, true, true)
	return false
end

 

 

4° Spell:

Spoiler

function isWalkable(cid, pos)
	pos.stackpos = 0
	local tile = getTileThingByPos(pos)
	if(tile.itemid == 0) then
		return false
	end
	
	if(doTileQueryAdd(cid, pos) == 1 and not getTilePzInfo(pos)) then
		return true
	end
	return false
end

local function jumpBehindTarget(cid, target)
	local targetPos = getThingPos(target)
	local targetPositions = {
		north = {x = targetPos.x, y = (targetPos.y - 1), targetPos.z},
		east = {x = (targetPos.x + 1), y = targetPos.y, z = targetPos.z},
		west = {x = (targetPos.x - 1), y = targetPos.y, z = targetPos.z},
		south = {x = targetPos.x, y = (targetPos.y + 1), z = targetPos.z}
	}
	
	local targetDir = getCreatureLookDirection(target)
	if(targetDir == NORTH) then
		dir = targetPositions.south
	elseif(targetDir == EAST) then
		dir = targetPositions.west
	elseif(targetDir == WEST) then
		dir = targetPositions.east
	elseif(targetDir == SOUTH) then
		dir = targetPositions.north
	end
	return dir
end

local function backOldPos(cid, oldPos)
	if(not isPlayer(cid)) then
		return
	end
	
	doTeleportThing(cid, oldPos)
end

local function checkHasTarget(cid, count, oldPos)
	if(not isPlayer(cid)) then
		return
	end
	
	if(count < 1) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
		return
	end
	
	local target = getCreatureTarget(cid)
	if(isCreature(target)) then
		local behindTarget = jumpBehindTarget(cid, target)
		if(isWalkable(cid, behindTarget)) then
			doTeleportThing(cid, behindTarget)
		else
			doTeleportThing(cid, getThingPos(target))
			addEvent(backOldPos, 100, cid, oldPos)
		end
		doCreatureSetLookDirection(cid, getCreatureLookDirection(target))
		--player:setGhostMode(false) -- not exists in TFS 0.4
		doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -20, -100, CONST_ME_FIREATTACK)
		return true
	end
	addEvent(checkHasTarget, (1 * 100), cid, (count - 1))
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	
	--creature:setGhostMode(true) -- not exists in TFS 0.4
	doSendMagicEffect(playerPos, CONST_ME_POFF)
	addEvent(checkHasTarget, (1 * 250), cid, 50, playerPos)
	return false
end

 

 

Editado por MaTTch (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
1 hora atrás, MaTTch disse:

Não testei nenhuma delas.

1° Spell:

  Mostrar conteúdo oculto


local area = {
	{0, 0, 0},
	{0, 3, 0},
	{0, 0, 0}
}

local function sendHealingEffect(cid, position, loopCount)
	if(not isPlayer(cid)) then
		return
	end
	
	local pos = getThingPos(cid)
	doSendDistanceShoot(position, pos, CONST_ANI_SMALLHOLY)
	doCreatureAddHealth(cid, math.max(100, 150))
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	if(loopCount == 0) then
		doSendMagicEffect(pos, CONST_ME_HOLYAREA)
	end
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	local loopCount = 12
	
	doCreatureSay(cid, 'Heal me my brothers!', TALKTYPE_MONSTER_SAY)
	
	for i = 1, loopCount do
		local pos = Position(playerPos.x + math.random(-4, 3), playerPos.y + math.random(-3, 2), playerPos.z)
		addEvent(doCombatAreaHealth, (i * 75), cid, COMBAT_PHYSICALDAMAGE, pos, createCombatArea(area), 0, 0, CONST_ME_ASSASSIN)
		addEvent(sendHealingEffect, (i * 75), cid, pos, (loopCount - i))
	end
	return false
end

 

 

2° Spell:

  Mostrar conteúdo oculto


local function targetEffect(cid)
	if(not isPlayer(cid)) then
		return
	end
	
	local effect = CONST_ANI_REDSTAR
	local orig = getThingPos(cid)
	local d1, d2 = {z = orig.z}, {z = orig.z}
	
	d1.x = orig.x - 5
	d2.x = orig.x + 5
	for i = -2, 2 do
		d1.y = orig.y + i
		d2.y = d1.y
		doSendDistanceShoot(orig, d1, effect)
		doSendDistanceShoot(orig, d2, effect)
	end
	
	d1.y = orig.y - 3
	d2.y = orig.y + 3
	for i = -4, 4 do
		d1.x = orig.x + i
		d2.x = d1.x
		doSendDistanceShoot(orig, d1, effect)
		doSendDistanceShoot(orig, d2, effect)
	end
end

local function backOldPosition(cid, oldPosition)
	if(not isPlayer(cid)) then
		return
	end
	
	doTeleportThing(cid, oldPosition)
	--player:setGhostMode(false) -- not exists in TFS 0.4
end

local function jumpEffect(cid, target)
	if(not isPlayer(cid)) then
		return
	end
	
	if(isCreature(target)) then
		doSendDistanceShoot(getThingPos(cid), getThingPos(target), CONST_ANI_EXPLOSION)
	end
end

local function jumpOnTarget(cid, target, targetCount, oldPosition)
	if(not isPlayer(cid)) then
		return
	end
	
	if(isCreature(target)) then
		addEvent(targetEffect, 100, cid)
		doTeleportThing(cid, getThingPos(target))
		--player:setGhostMode(true) -- not exists in TFS 0.4
		doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_ASSASSIN)
		if(targetCount == 0) then
			addEvent(backOldPosition, 400, cid, oldPosition)
		end
	end
end

local function extractRandomValuesFromTable(tbl) --By Printer(This will make sure not to select a value twice from the table)
	if(#tbl == 0) then
		return false
	end
	return table.remove(tbl, math.random(#tbl))
end

function onCastSpell(cid, var)
	local targets = {}
	
	local playerPos = getThingPos(cid)
	local spectators = getSpectators(playerPos, 10, 10)
	for i = 1, #spectators do
		local specs = spectators[i]
		if(specs ~= cid and not isNpc(specs)) then
			targets[#targets+1] = specs
		end
	end
	
	if(#targets == 0) then
		doPlayerSendCancel(cid, 'There is no targets in sight.')
		doSendMagicEffect(playerPos, CONST_ME_POFF)
		return false
	end
	
	local targetCount = #targets
	for i = 1, #targets do
		local randTarget = extractRandomValuesFromTable(targets)
		addEvent(jumpOnTarget, (i * 400), cid, randTarget, (targetCount - i), playerPos)
		addEvent(jumpEffect, (i * 300), cid, randTarget)
	end
	return false
end

 

 

 

3° Spell:

  Mostrar conteúdo oculto


local function sendDistanceEffectDelay(cid, fromPos, toPos, effect)
	if(not isPlayer(cid)) then
		return
	end
	
	doSendDistanceShoot(fromPos, toPos, effect)
end

local function ninjaJumpDash(cid, target, oldPos, lastJump, back)
	if(not isPlayer(cid)) then
		return
	end
	
	if(not isCreature(target)) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
		return
	end
	
	if(lastJump) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
	end
	
	if(back) then
		doTeleportThing(cid, oldPos)
	else
		doTeleportThing(cid, getThingPos(target))
	end
	doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -1, -100, CONST_ME_ENERGYAREA) -- CONST_ME_THUNDER not exists in TFS 0.4
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	local target = variantToNumber(var)
	
	--creature:setGhostMode(true) -- not exists in TFS 0.4
	addEvent(ninjaJumpDash, 0, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 100, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 300, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 400, cid, target, playerPos, false, true)
	
	addEvent(ninjaJumpDash, 600, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 700, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 1000, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 1100, cid, target, playerPos, false, true)
	
	addEvent(ninjaJumpDash, 1300, cid, target, playerPos, false, false)
	addEvent(sendDistanceEffectDelay, 1400, cid, playerPos, getThingPos(target), CONST_ANI_ENERGY)
	addEvent(sendDistanceEffectDelay, 1700, cid, getThingPos(target), playerPos, CONST_ANI_ENERGY)
	addEvent(ninjaJumpDash, 1800, cid, target, playerPos, true, true)
	return false
end

 

 

4° Spell:

  Mostrar conteúdo oculto


function isWalkable(cid, pos)
	pos.stackpos = 0
	local tile = getTileThingByPos(pos)
	if(tile.itemid == 0) then
		return false
	end
	
	if(doTileQueryAdd(cid, pos) == 1 and not getTilePzInfo(pos)) then
		return true
	end
	return false
end

local function jumpBehindTarget(cid, target)
	local targetPos = getThingPos(target)
	local targetPositions = {
		north = Position(targetPos.x, targetPos.y-1, targetPos.z),
		east = Position(targetPos.x+1, targetPos.y, targetPos.z),
		west = Position(targetPos.x-1, targetPos.y, targetPos.z),
		south = Position(targetPos.x, targetPos.y+1, targetPos.z)
	}
	
	local targetDir = getCreatureLookDirection(target)
	if(targetDir == NORTH) then
		dir = targetPositions.south
	elseif(targetDir == EAST) then
		dir = targetPositions.west
	elseif(targetDir == WEST) then
		dir = targetPositions.east
	elseif(targetDir == SOUTH) then
		dir = targetPositions.north
	end
	return dir
end

local function oldPos(cid, oldPos)
	if(not isPlayer(cid)) then
		return
	end
	
	doTeleportThing(cid, oldPos)
end

local function checkHasTarget(cid, count, oldPos)
	if(not isPlayer(cid)) then
		return
	end
	
	if(count < 1) then
		--player:setGhostMode(false) -- not exists in TFS 0.4
		return
	end
	
	local target = getCreatureTarget(cid)
	if(isCreature(target)) then
		local behindTarget = jumpBehindTarget(cid, target)
		if(isWalkable(cid, behindTarget)) then
			doTeleportThing(cid, behindTarget)
		else
			doTeleportThing(cid, getThingPos(target))
			addEvent(backOldPos, 100, cid, oldPos)
		end
		doCreatureSetLookDirection(cid, getCreatureLookDirection(target))
		--player:setGhostMode(false) -- not exists in TFS 0.4
		doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -20, -100, CONST_ME_FIREATTACK)
		return true
	end
	addEvent(checkHasTarget, (1 * 100), cid, (count - 1))
end

function onCastSpell(cid, var)
	local playerPos = getThingPos(cid)
	
	--creature:setGhostMode(true) -- not exists in TFS 0.4
	doSendMagicEffect(playerPos, CONST_ME_POFF)
	addEvent(checkHasTarget, (1 * 250), cid, 50, playerPos)
	return false
end

 

 

 

manoooooooooooooo se não existe sério, se é o chuck norris dos scripts PARABENSNEI, só um probleminha a  primeira spell e a quarta spell de acordo com a ordem das spell que vc posto esta dando esse erro na distro;

 

Spoiler

PRIMEIRA SPELL

[15/04/2016 21:04:13] [Error - Spell Interface] 
[15/04/2016 21:04:13] data/spells/scripts/especiais/healbrothers.lua:onCastSpell
[15/04/2016 21:04:13] Description: 
[15/04/2016 21:04:13] data/spells/scripts/especiais/healbrothers.lua:28: attempt to call global 'Position' (a nil value)
[15/04/2016 21:04:13] stack traceback:
[15/04/2016 21:04:13] 	data/spells/scripts/especiais/healbrothers.lua:28: in function <data/spells/scripts/especiais/healbrothers.lua:21>
  
  
QUARTA SPELL
  
[15/04/2016 21:06:14] [Error - Spell Interface] 
[15/04/2016 21:06:14] In a timer event called from: 
[15/04/2016 21:06:14] data/spells/scripts/especiais/silenceattack.lua:onCastSpell
[15/04/2016 21:06:14] Description: 
[15/04/2016 21:06:14] data/spells/scripts/especiais/silenceattack.lua:17: attempt to call global 'Position' (a nil value)
[15/04/2016 21:06:14] stack traceback:
[15/04/2016 21:06:14] 	data/spells/scripts/especiais/silenceattack.lua:17: in function 'jumpBehindTarget'
[15/04/2016 21:06:14] 	data/spells/scripts/especiais/silenceattack.lua:56: in function <data/spells/scripts/especiais/silenceattack.lua:44>

 

se puder ajudar ficarei eternamente agradecido com sua pessoa ja vou dar uns rep aqui pelas spells que estão funfando.

Editado por rheynkhen (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
35 minutos atrás, MaTTch disse:

Eu editei o meu post lá em cima, só pegar novamente as spells.

vou testar aqui mas ja vou dar outro rep 2/4 até completar as 4 vc merece depois de uns 12 up o unico que quis ajudar

 

 

 

mano pelo que eu comparei acho que deu o mesmo erro na distro olha só

 

Spoiler

PRIMEIRA SPELL

[15/04/2016 21:45:02] [Error - Spell Interface] 
[15/04/2016 21:45:02] data/spells/scripts/especiais/healbrothers.lua:onCastSpell
[15/04/2016 21:45:02] Description: 
[15/04/2016 21:45:02] data/spells/scripts/especiais/healbrothers.lua:28: attempt to call global 'Position' (a nil value)
[15/04/2016 21:45:03] stack traceback:
[15/04/2016 21:45:03] 	data/spells/scripts/especiais/healbrothers.lua:28: in function <data/spells/scripts/especiais/healbrothers.lua:21>

  
  QUARTA SPELL
[15/04/2016 21:45:24] [Error - Spell Interface] 
[15/04/2016 21:45:25] In a timer event called from: 
[15/04/2016 21:45:25] data/spells/scripts/especiais/silenceattack.lua:onCastSpell
[15/04/2016 21:45:25] Description: 
[15/04/2016 21:45:25] data/spells/scripts/especiais/silenceattack.lua:17: attempt to call global 'Position' (a nil value)
[15/04/2016 21:45:25] stack traceback:
[15/04/2016 21:45:25] 	data/spells/scripts/especiais/silenceattack.lua:17: in function 'jumpBehindTarget'
[15/04/2016 21:45:25] 	data/spells/scripts/especiais/silenceattack.lua:56: in function <data/spells/scripts/especiais/silenceattack.lua:44>
 
 
Editado 14 minutos atrás por rheynkhen

 

 

Editado por rheynkhen (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Spoiler

 

7 minutos atrás, MaTTch disse:

Você tem certeza de que pegou as spells que eu acabei de editar?

 

ow vdd man vlw desculpa ai, mas tipo agora ta funcionando normal mas fica aparecendo isso na distro

 

 

mais um rep pra vc 3/4

 

Spoiler

primeira spell

[15/04/2016 22:13:46] [Error - Spell Interface] 
[15/04/2016 22:13:46] data/spells/scripts/especiais/healbrothers.lua:onCastSpell
[15/04/2016 22:13:46] Description: 
[15/04/2016 22:13:46] (luaCreateCombatArea) This function can only be used while loading the script.

quarta spell

[15/04/2016 22:14:00] [Error - Spell Interface] 
[15/04/2016 22:14:00] In a timer event called from: 
[15/04/2016 22:14:00] data/spells/scripts/especiais/silenceattack.lua:onCastSpell
[15/04/2016 22:14:00] Description: 
[15/04/2016 22:14:00] (luaAddEvent) Callback parameter should be a function.

isso afetará quando digamos muitos players forem usar?

 

Editado por rheynkhen (veja o histórico de edições)
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.


  • Conteúdo Similar

    • Por hekan19
      Olá pessoal,
       
      Estou com um problema no sistema de autoloot.
      Ao abrir um Pokémon, itens aparecem no chão. Recebo "0" no console do TFS.
       
      Obrigado pela ajuda
    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por wallaceg15
      Sempre que mato o poke, cai um corpinho e o pokemon continua vivo, e aparece esse erro na distro... Alguém poderia me ajudar? 
       
      [Error - CreatureScript Interface]
      data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
      Description:
      data/lib/towerSystem.lua:931: attempt to index global 'magmaTP2' (a nil value)
      stack traceback:
              data/lib/towerSystem.lua:931: in function 'doKillBossTower'
              data/lib/Death System.lua:599: in function 'doKillWildPoke'
              data/creaturescripts/scripts/player/statsChange.lua:1461: in function <data/creaturescripts/scripts/player/statsChange.lua:6>
      statsChange.lua towerSystem.lua Death System.lua
    • Por Alladdin
      ESTÁ A PROCURA DE UM DESIGNER?
       
      A Identidade Visual de um OT é o ponto chave para o seu sucesso!
      Um OTServer com sua identidade visual formada consegue gerar:
      - Mais atenção para as belezas visuais do servidor.
      - Um ponto de vista positivo para novos jogadores.
      - A identidade de seu servidor.
      - Boas impressões à primeira vista.
      - Permite seu OTServer ser reconhecido e lembrado.
      - Um melhor posicionamento artístico.
      - Rentabilidade, lhe poupando dinheiro de designs futuros.
      - Apresentação, um ponto chave para um bom início na carreira de otservers.
      --------------------------------------------------------------------------
      Peça agora mesmo sua logo personalizada ou compre um template pré-definido!
      Não trabalhamos apenas com logos, temos experiências em criação de capas, posts.
      templates de sites, e muito mais!
      Trabalhamos com qualquer tipo de OTServer, como: Narutibia, Wodbo, Poketibia, Bleachtibia,
      Tibia Global ou Baiak e muitos outros servidores derivados!
      NÃO PERCA TEMPO, ME MANDE MENSAGEM AGORA MESMO!
      --------------------------------------------------------------------------
      Entre em contato agora:
      > Discord: vinny#9460
      > Facebook: https://www.facebook.com/VinnyArtz
      > Contatos opcionais: Me chame no messenger.
       
       
      UM POUCO DO MEU PORTFÓLIO ABAIXO \/









       

      “Se o seu ódio fosse transformado em eletricidade, ele seria capaz de acender todo o planeta” - Nikola Tesla.
       
      PS: NÃO CONSEGUI MOVER MEU TÓPICO PARA A ÁREA DE DESIGNS, PEÇO PARA QUE ALGUM MODERADOR O FAÇA, OBRIGADO.
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo