Ir para conteúdo

Featured Replies

Postado

Boa tarde a todos!

Procurei por todos os fóruns e não encontrei esse "sript", antão resolvi pedir para os mais experiêntes aqui tibiaking.

Estou procurando um script, ou algo assim, que adicione no personagem, uma aura (ao redor, usando os effects) que acione automaticamente quando o player alcançar um certo level, e mantenha essa aura ligada sempre que o player tiver level igual ou maior do que foi selecionado.

Ex.: Player alcançou o level 100, a aura liga automaticamente e fica o tempo todo ligada. Se o player morrer e cair pro lvl 99, a aura desliga (algo parecido com o que tem no jogo Ragnarok Online).

Obs.: Encontrei algo parecido com o que eu quero nesse tópico aqui, porém no tópido do link, o script liga a aura ao enviar um comando, e preciso que seja ao atingir um certo level.

Acredito que esse script vai ser de interesse para outras pessoas também.
Agradeço desde já pela ajuda.

Postado
9 horas atrás, EtoxWudion disse:

porém no tópido do link, o script liga a aura ao enviar um comando,

só mudar pra onLogin E advanceSkill

 

sua source é TFS1.x?

 

tenta assim:

 

local config_aurea = {
    effect = 4; -- efeito que vai ficar girando no player
    effect_health = 162; -- efeito qnd curar o player
    level_use = { -- level que vai ser usado (min/max)
        min = 100,
        max = 600,
    } ;
    health = 10; -- tanto que vai curar por time configurado
    pos_aurea = { -- não mexa
        [1] = {x = 0, y = -1};
        [2] = {x = 1, y = -1};
        [3] = {x = 1, y = 0};
        [4] = {x = 1, y = 1};
        [5] = {x = 0, y = 1};
        [6] = {x = -1, y = 1};
        [7] = {x = -1, y = 0};
        [8] = {x = -1, y = -1};
    };
    storage_pos = 1547637649; -- não mexa e nem repita esse valor em outro script!!
    storage = 165477963; -- não mexa e nem repita esse valor em outro script!!
    tempo_aurea = 100; -- tempo da aurea para passar em cada posição
}

local function calculePosAurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage_pos) >= 8)then
        player:setStorageValue(config_aurea.storage_pos, 0)
    end

    player:setStorageValue(config_aurea.storage_pos, player:getStorageValue(config_aurea.storage_pos) + 1)
    return(player:getStorageValue(config_aurea.storage_pos))
end

local function posAurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    local pos_x = player:getPosition().x
    local pos_y = player:getPosition().y
    local pos_z = player:getPosition().z

    local aa = calculePosAurea(player_uid)

    local pos = Position(pos_x + config_aurea.pos_aurea[aa].x, pos_y + config_aurea.pos_aurea[aa].y, pos_z)
    if(not(pos))then
        return(nil)
    end
   return(pos)
end

local function aurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    player:addHealth(config_aurea.health)
    player:getPosition():sendMagicEffect(config_aurea.effect_health)

    local position = posAurea(player_uid)
    position:sendMagicEffect(config_aurea.effect)
    addEvent(aurea, config_aurea.tempo_aurea, player_uid)
end

function onLogin(player)
  	if(player:getLevel() >= config_aurea.level_use.min) then
   		 player:setStorageValue(config_aurea.storage, 1)
   		 player:setStorageValue(config_aurea.storage_pos, 0)
   		 aurea(player.uid)
    end
  return(true)
end

function onAdvance(player, skill, oldLevel, newLevel)
	if(skill == SKILL__EXPERIENCE) then
		return true
	end

	if(skill == SKILL__LEVEL) then
    	if player:getLevel() >= 100 then
      		player:setStorageValue(config_aurea.storage, 1)
   			player:setStorageValue(config_aurea.storage_pos, 0)
   			aurea(player.uid)
      	end
    end
  	
  	return true
end

 

  • 3 weeks later...
Postado
  • Autor
Em 03/09/2022 em 01:00, FeeTads disse:

só mudar pra onLogin E advanceSkill

 

sua source é TFS1.x?

 

tenta assim:

 


local config_aurea = {
    effect = 4; -- efeito que vai ficar girando no player
    effect_health = 162; -- efeito qnd curar o player
    level_use = { -- level que vai ser usado (min/max)
        min = 100,
        max = 600,
    } ;
    health = 10; -- tanto que vai curar por time configurado
    pos_aurea = { -- não mexa
        [1] = {x = 0, y = -1};
        [2] = {x = 1, y = -1};
        [3] = {x = 1, y = 0};
        [4] = {x = 1, y = 1};
        [5] = {x = 0, y = 1};
        [6] = {x = -1, y = 1};
        [7] = {x = -1, y = 0};
        [8] = {x = -1, y = -1};
    };
    storage_pos = 1547637649; -- não mexa e nem repita esse valor em outro script!!
    storage = 165477963; -- não mexa e nem repita esse valor em outro script!!
    tempo_aurea = 100; -- tempo da aurea para passar em cada posição
}

local function calculePosAurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage_pos) >= 8)then
        player:setStorageValue(config_aurea.storage_pos, 0)
    end

    player:setStorageValue(config_aurea.storage_pos, player:getStorageValue(config_aurea.storage_pos) + 1)
    return(player:getStorageValue(config_aurea.storage_pos))
end

local function posAurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    local pos_x = player:getPosition().x
    local pos_y = player:getPosition().y
    local pos_z = player:getPosition().z

    local aa = calculePosAurea(player_uid)

    local pos = Position(pos_x + config_aurea.pos_aurea[aa].x, pos_y + config_aurea.pos_aurea[aa].y, pos_z)
    if(not(pos))then
        return(nil)
    end
   return(pos)
end

local function aurea(player_uid)
    local player = Player(player_uid)
    if(not(player))then
        return(nil)
    end

    if(player:getStorageValue(config_aurea.storage) <= 0)then
        return(nil)
    end

    player:addHealth(config_aurea.health)
    player:getPosition():sendMagicEffect(config_aurea.effect_health)

    local position = posAurea(player_uid)
    position:sendMagicEffect(config_aurea.effect)
    addEvent(aurea, config_aurea.tempo_aurea, player_uid)
end

function onLogin(player)
  	if(player:getLevel() >= config_aurea.level_use.min) then
   		 player:setStorageValue(config_aurea.storage, 1)
   		 player:setStorageValue(config_aurea.storage_pos, 0)
   		 aurea(player.uid)
    end
  return(true)
end

function onAdvance(player, skill, oldLevel, newLevel)
	if(skill == SKILL__EXPERIENCE) then
		return true
	end

	if(skill == SKILL__LEVEL) then
    	if player:getLevel() >= 100 then
      		player:setStorageValue(config_aurea.storage, 1)
   			player:setStorageValue(config_aurea.storage_pos, 0)
   			aurea(player.uid)
      	end
    end
  	
  	return true
end

 

Opa, tud certo?

Vou testar aqui, e depois volto para dar um feedback se deu certo...

Obrigado 

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

Informação Importante

Confirmação de Termo