Ir para conteúdo
  • Cadastre-se

Spell TFS 1.X Como fazer buff que troca effecto do um Spells?


Posts Recomendados

@Fabian Marzan depende de alguns fatores mas pode ser por verificações de storage por tempo na spell e mudar a storage ou aumentar o valor de uma mesma storage no buff sendo assim

Buff: a cada momento que troca o efeito/outfit ele aumenta o valor da storage para +1 ou troca para um outro valor de storage

Spell: verificação de storage a cada storage diferente ele manda um efeito diferente ao usar a spell

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites

Nao sei como e pra criar um storage, tenho aki um spell do buff que troca do outfit

local tempo = 2 -- tempo em segundos.
local ml = 5 -- quantos ira aumentar o skill de ML
local skillfist = 1 -- quantos ira aumentar o skill de Fist
local skillsword = 1 -- quantos ira aumentar o skill de Sword
local skillshield = 1 -- quantos ira aumentar o skill de Shield
local health = 275-- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)

 
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.0, -60000, -1.0, -75000)
          


local function onCastSpell1(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat1, parameters.var)
end




                  
function onCastSpell(cid, var)
local waittime = 2.0 -- Tempo de exhaustion
local storage = 1600 -- não mecha
if exhaustion.check(cid, storage) then
 doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos para usar Jutsu nuevamente.")
doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
end
if getPlayerStorageValue(cid, 1600) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    setPlayerStorageValue(cid, 1600,1) -- storage verifica transformado, quando = 1 player esta transformado.
    doCreatureSay(cid, "Hachimon Tonkou!", TALKTYPE_ORANGE_1)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Buff activado por "..tempo.." segundos!")
	exhaustion.set(cid, storage, waittime)	
	local parameters = { cid = cid, var = var}
	for k = 1, 1 do
        addEvent(function()
            if isCreature(cid) then
			 local outfit = {lookType = 55}
                 doSetCreatureOutfit(cid, outfit, 15000)		 
            end
        end, 1 + ((k-1) * 600))
    end
	for k = 1, 1 do
        addEvent(function()
            if isCreature(cid) then
			  local outfit = {lookType = 56}
                 doSetCreatureOutfit(cid, outfit, 6000)	
            end
        end, 15000 + ((k-1) * 600))
    end


	
else
    doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos para usar Jutsu nuevamente.")
end
end

 

 

 

AKI DO SPELL DO ATK

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 64)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.0, -36500, -1.0, -44600)



local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function BijuRasengan(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 289)
	end
end




function onCastSpell(cid, var)
local waittime = 1 -- Tempo de exhaustion
local storage = 3 -- não mecha
if exhaustion.check(cid, storage) then
   doPlayerSendCancel(cid, "Usted esta cansado.")
doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
end
local parameters = {cid = cid, var = var, combat1 = combat1 , combat2 = combat2}
for i = 1, 1 do
	addEvent(function()
		if isCreature(cid) then
		addEvent(onCastSpell1, 100, parameters)
			addEvent(BijuRasengan,100,cid)
		
		end
	end, 1 + ((i-1) * 650))
end
exhaustion.set(cid, storage, waittime)
return true
end

 

Link para o post
Compartilhar em outros sites
  • 2 months later...
Em 06/06/2020 em 22:16, Fabian Marzan disse:

Nao sei como e pra criar um storage, tenho aki um spell do buff que troca do outfit


local tempo = 2 -- tempo em segundos.
local ml = 5 -- quantos ira aumentar o skill de ML
local skillfist = 1 -- quantos ira aumentar o skill de Fist
local skillsword = 1 -- quantos ira aumentar o skill de Sword
local skillshield = 1 -- quantos ira aumentar o skill de Shield
local health = 275-- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)

 
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.0, -60000, -1.0, -75000)
          


local function onCastSpell1(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat1, parameters.var)
end




                  
function onCastSpell(cid, var)
local waittime = 2.0 -- Tempo de exhaustion
local storage = 1600 -- não mecha
if exhaustion.check(cid, storage) then
 doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos para usar Jutsu nuevamente.")
doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
end
if getPlayerStorageValue(cid, 1600) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    setPlayerStorageValue(cid, 1600,1) -- storage verifica transformado, quando = 1 player esta transformado.
    doCreatureSay(cid, "Hachimon Tonkou!", TALKTYPE_ORANGE_1)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Buff activado por "..tempo.." segundos!")
	exhaustion.set(cid, storage, waittime)	
	local parameters = { cid = cid, var = var}
	for k = 1, 1 do
        addEvent(function()
            if isCreature(cid) then
			 local outfit = {lookType = 55}
                 doSetCreatureOutfit(cid, outfit, 15000)		 
            end
        end, 1 + ((k-1) * 600))
    end
	for k = 1, 1 do
        addEvent(function()
            if isCreature(cid) then
			  local outfit = {lookType = 56}
                 doSetCreatureOutfit(cid, outfit, 6000)	
            end
        end, 15000 + ((k-1) * 600))
    end


	
else
    doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos para usar Jutsu nuevamente.")
end
end

 

 

 

AKI DO SPELL DO ATK


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 64)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.0, -36500, -1.0, -44600)



local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function BijuRasengan(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 289)
	end
end




function onCastSpell(cid, var)
local waittime = 1 -- Tempo de exhaustion
local storage = 3 -- não mecha
if exhaustion.check(cid, storage) then
   doPlayerSendCancel(cid, "Usted esta cansado.")
doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
end
local parameters = {cid = cid, var = var, combat1 = combat1 , combat2 = combat2}
for i = 1, 1 do
	addEvent(function()
		if isCreature(cid) then
		addEvent(onCastSpell1, 100, parameters)
			addEvent(BijuRasengan,100,cid)
		
		end
	end, 1 + ((i-1) * 650))
end
exhaustion.set(cid, storage, waittime)
return true
end

 

testa assim 
spell storage + attk

nao tenho certeza. vou consertar dps

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 64)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.0, -36500, -1.0, -44600)


local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function BijuRasengan(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 289)
	end
end

local storageLoadEffect = 3
function onCastSpell(creature, variant)
    if combat:execute(creature, variant) then
        local loadEffect = math.max(1, creature:getStorageValue(storageLoadEffect))
        Position(creature:getPosition() + Position(1, 0, 0)):sendMagicEffect(loadEffect)
        return true
    end
    return false
end        


function onCastSpell(cid, var)
local waittime = 1 -- Tempo de exhaustion
local storage = 3 -- não mecha
if exhaustion.check(cid, storage) then
   doPlayerSendCancel(cid, "Usted esta cansado.")
doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
end
local parameters = {cid = cid, var = var, combat1 = combat1 , combat2 = combat2}
for i = 1, 1 do
	addEvent(function()
		if isCreature(cid) then
		addEvent(onCastSpell1, 100, parameters)
			addEvent(BijuRasengan,100,cid)
		
		end
	end, 1 + ((i-1) * 650))
end
exhaustion.set(cid, storage, waittime)
return true
end

 

Link para o post
Compartilhar em outros sites
  • 5 months later...

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 Anderson Sacani
      Bom dia!
      Estava de bobeira agora pela manhã e resolvi brincar um pouco.
      Criei um script de SD no qual se for noite, ela retornará um valor X de dano, e, se for dia, ela retornará um valor Y de dano.
      Estou compartilhando esse script para vocês terem como base e usarem até mesmo em outros:
       
      local config = { damageDay = { min = 0.70, max = 0.75 }, damageNight = { min = 0.95, max = 1 }, hourStartDay = 6, hourEndDay = 18 } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function onGetFormulaValues(player, level, maglevel) local min, max = ((level / 5) + (maglevel * 4.605)), ((level / 5) + (maglevel * 7.395)) local hour = tonumber(os.date("%H", os.time())) -- Obtém a hora atual -- Define o valor do dano com base na hora do dia if hour >= config.hourStartDay and hour < config.hourEndDay then -- Dia min = min * config.damageDay.min max = max * config.damageDay.max else -- Noite min = min * config.damageNight.min max = max * config.damageNight.max end return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local rune = Spell("rune") function rune.onCastSpell(creature, var, isHotkey) return combat:execute(creature, var) end rune:group("attack") rune:name("sudden death rune") rune:runeId(3155) rune:allowFarUse(true) rune:charges(3) rune:level(45) rune:magicLevel(15) rune:cooldown(2 * 1000) rune:groupCooldown(2 * 1000) rune:needTarget(true) rune:isBlocking(true) -- True = Solid / False = Creature rune:register()  
    • Por tvieira
      Boa tarde, usuários do TibiaKing. Migrei recentemente pra TFS versão 1.4.1, 1098. E como sou usuáruio das 0.3, estou tendo algumas dificuldades com transferir magias.
      Minha dúvida é em questão das addDamageCondition. Quero criar uma magia chamada "EXORI BLEED", que dá o dano normal, como um exori, mas cria a Condition de Bleeding, por 10 segundos, a cada segundo o inimigo que recebeu o dano fica por 10 segundos com ticks de 1500 (hemorragia).
      Essa é a spell no TFS 0.3.6.
       
      E agora minha tentativa (falha), na TFS atual, 1.4.1
       
       
      Se alguém puder me auxiliar nisso, agradeço muito!
    • Por DarkRed
      Alguem Poderia me ajuda com esse erro de spell do pokemon    [13/03/2022 13:26:44] [Error - Spell Interface] [13/03/2022 13:26:44] data/spells/scripts/ps/Healarea.lua:onCastSpell [13/03/2022 13:26:44] Description: [13/03/2022 13:26:44] (luaGetThingFromPos) Tile not found   [13/03/2022 13:34:08] [Error - Spell Interface] [13/03/2022 13:34:08] data/spells/scripts/ps/Hyper Beam.lua:onCastSpell [13/03/2022 13:34:08] Description: [13/03/2022 13:34:08] (luaGetThingFromPos) Tile not found [13/03/2022 13:26:44] [Error - Spell Interface] [13/03/2022 13:26:44] data/spells/scripts/ps/Healarea.lua:onCastSpell [13/03/2022 13:26:44] Description: [13/03/2022 13:26:44] (luaGetThingFromPos) Tile not found   [13/03/2022 16:10:31] [Error - Spell Interface] 
      [13/03/2022 16:10:31] data/spells/scripts/ps/Thunder.lua:onCastSpell
      [13/03/2022 16:10:31] Description: 
      [13/03/2022 16:10:31] (luaGetThingFromPos) Tile not found Healarea.lua Hyper_Beam.lua
      Thunder.lua
    • Por EddyHavoc
      Nome: Ice Wall
      Tipo: Spell
      Autor: Eddy Havoc
       
       
       
      Essa é a versão final da spell Ice Wall ou Block Wall criada por mim.
       
      Exibição in-game:
       
       
       
       
      Crie um arquivo chamado ice_wall.lua na pasta data/spells/scripts/conjuring e copie o conteúdo abaixo:
      --[[ Created by: Eddy Havoc name: Victor Amaral contact: [email protected] É proibido a venda ou a cópia sem os devidos créditos desse script. ]]-- local north = 0 local south = 2 local east = 1 local west = 3 local delay = 1 -- Tempo em segundos local itemh = 6728 local itemv = 6729 combat = createCombatObject() combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) function onCastSpell(creature, variant) local cDir = creature:getDirection() local cPos = creature:getPosition () local pos = (Position(0,0,0)) if cDir == north then if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemv) pos = Position(cPos + Position(0, -1)) meffect = pos:sendMagicEffect(44) end elseif cDir == east then if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemh) pos = Position(cPos + Position(1, 0)) meffect = pos:sendMagicEffect(44) end elseif cDir == south then if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemv) pos = Position(cPos + Position(0, 1)) meffect = pos:sendMagicEffect(44) end elseif cDir == west then if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemh) pos = Position(cPos + Position(-1, 0)) meffect = pos:sendMagicEffect(44) end end addEvent(function() local wall = {itemh, itemv} for i = 1, 2 do if getTileItemById(pos, wall[i]).uid > 0 then doRemoveItem(getTileItemById(pos, wall[i]).uid) return TRUE end end end,delay*1000) return doCombat(creature, combat, variant) end Adicione a seguinte tag no arquivo spells.xml localizadon a pasta data/spells:
       
      <instant group="support" spellid="94" name="Protection" words="Ice Wall" level="1" mana="1" casterTargetOrDirection="1" blocktype="all" prem="0" cooldown="1000" groupcooldown="500" needlearn="0" script="conjuring/ice_wall.lua"> <vocation name="Elder Druid"/> </instant>  
       
       
      Para configurar qual item a spell irá conjurar edite itemh/itemv. Itemh: item que irá aparecer horizontalmente (norte e sul). Itemv: item que irá aparecer verticalmente (leste e oeste).  
       
      Qualquer dúvida estou a disposição,
      Atenciosamente, Eddy Havoc.
       
       
       
    • Por icaraiii
      Bom dia a todos, eu criei uma spell para monstro que no momento que o spell é ativado, solta um efeito em área que não causa dano e 2 segundos depois, solta outro efeito e este efeito causa dano. Porém estou com um problema, se o monstro usa o spell (aparece o primeiro efeito) e o monstro anda, o segundo efeito sai em outro lugar. Gostaria de fazer o segundo efeito, sair no mesmo lugar do primeiro efeito independentemente do monstro andar ou não. (GIF no final do tópico)
       
      TFS 1.3
       
      Segue spell:
       
      Outro problema que estou tendo com a magia é o erro que aparece na distro:
       
       
      problema.mp4
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo