Ir para conteúdo
  • Cadastre-se

Spells de transformação e... Modificar magia exori


Posts Recomendados

Pedido 1 : Queria um buff (magia igual utito tempo) que aumentasse o skill de sword do personagem em 20 pontos, e o transformasse em um undead gladiator, além de regenerar 60 de hp a cada 5 segundos.

OBS : A magia vai durar 300 segundos
Pedido 2 (se possível) : Fazer com que a spell exori só pudesse ser usada se o player estivesse com o buff acima ativado.

EXORI :

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)


local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)


function onGetFormulaValues(cid, level, skill, attack, element, factor)
local levelTotal, formula = level / 5, 0.0496
local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal))
return normal/2, normal, -math.random(elemental/2, elemental)
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

 

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

Qual a relação do pedido com o título?

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Link para o post
Compartilhar em outros sites

bom não sei se vai funciona a 1. spell mas vou posta uma que tenho aki,só dei uma editada,se caso funciona vou tenta fazer a 2.
 

local tempo = 300 -- tempo em segundos


local exausted = 1 -- em minutos o exausted
 
local points = 20 -- quantos ira aumentar os skills
local outfit = {lookType = 608} -- outfit que ira dar
 
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_SKILL_SWORD, points)
setCombatCondition(combat, condition)
 
local condition = createConditionObject(CONDITION_OUTFIT)
 
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
 
addOutfitCondition(condition, outfit)
 
setCombatCondition(combat, condition)
 
 
function onCastSpell(cid, var)
 
if isPlayer(cid) and getPlayerAccess(cid) < 3 and getPlayerStorageValue(cid, 102053)-os.time() > 1 then
local seetime = getPlayerStorageValue(cid, 102053)-os.time()
local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..minutes.." minuto(s) e "..seconds.." segundo(s) para usar novamente!")
return false
end
 
setPlayerStorageValue(cid, 102053, exausted*60+os.time())
doCombat(cid, combat, var)
local tempo2 = 0
while (tempo2 <= (tempo*1000)) do
addEvent(Magica, tempo2, cid)
tempo2 = tempo2 + 300
end
return true
end

 

Projeto/Serviços que desenvolvi durante esse Tempo.

[SERVIDOR] - NTO By Madara Rinnegan - Criado em 2014

Link para o post
Compartilhar em outros sites

Ficou repetindo o mesmo erro no distro, até que fechar-lo.

[Error - Spell Interface]
data/spells/scripts/transform.lua:onCastSpell
Description:
(LuaInterface::luaAddEvent) Callback parameter should be a function

#UP

Link para o post
Compartilhar em outros sites

1* 

local outfit = 126 -- numero da outfit

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 300000)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 20)


local function healthTime(cid, time, percent, count, i, storage)
	if not isPlayer(cid) then
		return true
	end

	if getPlayerStorageValue(cid, storage) > os.time() then
		if count <= i then
			if isPlayer(cid) then
				doCreatureAddHealth(cid, percent)
				doSendMagicEffect(getThingPos(cid), 14)
				print(percent)
			end
		end
	else
		doRemoveCondition(cid, CONDITION_OUTFIT)
		return true
	end
	addEvent(healthTime, time*1000, cid, time, percent, count + 1, i, storage)
end


function onCastSpell(cid, var)

	if not isPlayer(cid) then
		return true
	end

	local config = {
		count = 1,
		i = 300,
		time = 5,
		percent = 60,
		storage = 2020,
	}

    if(getPlayerStorageValue(cid, config.storage) > os.time() and getPlayerStorageValue(cid, config.storage) < 400+os.time()) then
      return doPlayerSendTextMessage(cid, 24, "You are buffed.")
    end
		doSetCreatureOutfit(cid, {lookType = outfit}, -1)
		doAddCondition(cid, condition)
		setPlayerStorageValue(cid, config.storage, os.time() + config.i)
		healthTime(cid, config.time, config.percent, config.count, config.i, config.storage)

	return true
end

2*

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)


local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)


function onGetFormulaValues(cid, level, skill, attack, element, factor)
  local levelTotal, formula = level / 5, 0.0496
  local normal, elemental = -(skill * attack * formula + levelTotal), math.ceil((skill * element * formula + levelTotal))
  return normal/2, normal, -math.random(elemental/2, elemental)
end


setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
  local config = {
    storage = 2020,
  }

  if getPlayerStorageValue(cid, config.storage) > os.time() then
    doCombat(cid, combat, var)
  else
    doPlayerSendCancel(cid, "You need activated buff.")
  end
return true
end
Editado por xBen (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

xBen deu entre aspas; quando você usa a transformação pela primeira vez dá certo, se você usar depois o personagem não transforma mais, o exori ta funcionando sem precisar da spells, se possível só conserte o primeiro pedido, só vou precisar dela. Obrigado

Link para o post
Compartilhar em outros sites

pedrizito é porque eu coloquei pra durar 300 segundos, durante os 300 segundos não pode usar de novo, e coloque no seu login.lua pra setar a storage pra 0 assim, qnd o player logar não dara problema

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 Kill of sumoners
      Boa noite, estou com um erro ao atacar um player em meu sv eu nao pego pk, nem sai magia, aparece a mensagem "voce so pode usar isso em criaturas"
      obs: magia em area acerta e pega pk, apenas as targets ou hits de arma nao vao 
    • Por Tofames
      Hi,
      Para devolver o que recebi aqui, colocarei para si um sistema de transformação a trabalhar na TFS 1.X.
      (Testei em 1.4.2) 
       
      MUDANÇA DE SOURCE NECESSÁRIA PARA O BOM FUNCIONAMENTO!
      Havia algo dentro do código TFS (e provavelmente outras distros) que não estava funcionando corretamente e depois que eu informei, eles se fundiram em tfs principais, então já está dentro do TFS 1.5, mas não está em versões mais antigas.
      Trata-se de refrescar a velocidade do jogador após a transformação, se você não tiver isso, então sua velocidade do vocations.xml baseSpeed não é refrescada.
      Você precisa adicionar isto às sources:
      https://github.com/otland/forgottenserver/pull/4215/files
      se você não tem acesso às sources, eu tenho um meio de contornar isso, mas não vou inundar este posto, então escreva em pv.
       
      Créditos: 
      Erexo (guião original)
      Itutorial (TFS 1.X),
      Tofame (alteração: talkaction --> spell; source mudanças; correções do scripts)
       

      transform system.mp4  
      no final do global.lua:
      --[[ voc = from vocation newVoc = to vocation looktype = new outfit revertLooktype = current outfit level = lvl needed to transform rage = soul needed to transform (you can disable it, just type 0) kiToTrans = mana to transform addHp = maxHp added when you transform addKi = maxMana added effectOn = magic effect when you use transform aura = magic effect when you have current transform (can be disabled, just type 0). type nil in this version constant = if transform is constant (when it is, player dont lose transform/outfit and maxHp/Mana, and cannot use revert) --]] exhaust_transform = {} -- [1-8] naruto, transform = { [1] = {voc = 1, newVoc = 2, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 50, addHealth = 450, addMana = 450, effect = 76, aura = nil, constant = false}, [2] = {voc = 2, newVoc = 3, from_looktype = 3, looktype = 4, level = 100, rage = 0, mana = 50, addHealth = 500, addMana = 500, effect = 76, aura = nil, constant = false}, [3] = {voc = 3, newVoc = 4, from_looktype = 4, looktype = 5, level = 150, rage = 0, mana = 50, addHealth = 650, addMana = 650, effect = 76, aura = nil, constant = false}, [4] = {voc = 4, newVoc = 5, from_looktype = 5, looktype = 6, level = 200, rage = 0, mana = 50, addHealth = 800, addMana = 800, effect = 76, aura = nil, constant = false}, [5] = {voc = 5, newVoc = 6, from_looktype = 6, looktype = 7, level = 250, rage = 0, mana = 50, addHealth = 900, addMana = 900, effect = 76, aura = nil, constant = false}, [6] = {voc = 6, newVoc = 7, from_looktype = 7, looktype = 8, level = 300, rage = 0, mana = 50, addHealth = 1000, addMana = 1000, effect = 76, aura = nil, constant = false}, [7] = {voc = 7, newVoc = 8, from_looktype = 8, looktype = 9, level = 400, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false}, [8] = {voc = 8, newVoc = 9, from_looktype = 9, looktype = 10, level = 500, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false} -- end naruto transforms } spells/scripts/revert.lua
      local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local pid = player:getId() local TRANS = transform[player:getVocation():getId() - 1] -- - [player:getVocation():getId() - 4] domyslnie, should be -1. if not TRANS then player:sendCancelMessage("You cannot revert.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.from_looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end exhaust_transform[pid] = 1 player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth) player:setMaxMana(player:getMaxMana() - TRANS.addMana) player:setVocation(TRANS.voc) player:save() return combat:execute(player, variant) end spells/scripts/transform.lua
      local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local effectPosition = Position(player:getPosition().x, player:getPosition().y, player:getPosition().z) local pid = player:getId() local TRANS = transform[player:getVocation():getId()] if not TRANS then player:sendCancelMessage("You cannot transform.") return false end if TRANS.effect == 76 then effectPosition = Position(player:getPosition().x + 2, player:getPosition().y, player:getPosition().z) end if player:getLevel() < TRANS.level then player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") return false end if player:getSoul() < TRANS.rage then player:sendCancelMessage("You need "..TRANS.rage.." to transform.") return false end if player:getMana() < TRANS.mana then player:sendCancelMessage("You need "..TRANS.mana.." to transform.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end player:addSoul(-TRANS.rage) player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth) player:setMaxMana(player:getMaxMana() + TRANS.addMana) effectPosition:sendMagicEffect(TRANS.effect) player:setVocation(TRANS.newVoc) player:save() return combat:execute(player, variant) end spells.xml:
      <instant group="support" spellid="175" name="Revert" words="revert" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="revert.lua" /> <instant group="support" spellid="175" name="Transform" words="transform" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="transform.lua" />  
       
      As coisas abaixo são opcionais, adicione-as se você quiser ter aura. Se você não estiver usando, deixe a aura = nil em global.lua
      Também observei que isso poderia causar atrasos/screen freeze, por isso não recomendo o uso de aura.
       
      globalevents.xml adicionar linha:
      <globalevent name="TransformEffects" interval="2000" script="TransformEffects.lua"/> TransformEffects.lua (data/globalevents/scripts/TransformEffects.lua):
      function onThink(interval) for _, player in pairs(Game.getPlayers()) do if player then TRANS = transform[player:getVocation():getId()] if TRANS then if TRANS.aura ~= nil then player:getPosition():sendMagicEffect(TRANS.aura) end end end end return true end  
      edit:
      só consigo falar um pouco de espanhol e muito bem em inglês, por isso uso DEEPL para falar portugês.
    • Por L3K0T
      SUMMON SPELLS
       
       
      Como o nome diz é uma spell que sumona até 4 monstros ou podendo adicionar mais, legal pra naruto etc... Então para não perder ou ficar em vão, irei deixar pra vocês e já com as correções.
       
       
      DEMONSTRAÇÃO

      2022-09-01 00-08-30.mp4  
       
      INSTALANDO
      1: primeiro vá em data/spells/scripts e crie um arquivo.lua e adicione isso abaixo dentro dele e em seguida salve.
      function onCastSpell(cid, var) local from,to = {x=962, y=885, z=7},{x=973, y=892, z=7} local from2,to2 = {x=979, y=901, z=7},{x=991, y=905, z=7} local dir = getPlayerLookDir(cid) local ppos = getPlayerPosition(cid) if(dir==1)then ppos.x = ppos.x + 1 elseif(dir==2)then ppos.y = ppos.y + 1 elseif(dir==3)then ppos.x = ppos.x - 1 elseif(dir==0)then ppos.y = ppos.y - 1 end local summon = getCreatureSummons(cid) local MaximoSummon = 0 if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) then doPlayerSendCancel(cid, "Você não pode usar Summons Aqui!") return false end if (table.maxn(summon) > MaximoSummon) then doPlayerSendTextMessage(cid, 22, "Voce ainda tem summons em batalha!") return false end local clone1 = doConvinceCreature(cid, doCreateMonster("Morgaroth", ppos)) local clone2 = doConvinceCreature(cid, doCreateMonster("Demon", ppos)) local clone3 = doConvinceCreature(cid, doCreateMonster("Terror Bird", ppos)) local clone4 = doConvinceCreature(cid, doCreateMonster("Giant Spider", ppos)) doPlayerSendTextMessage(cid, 22, "Voce summonou 4 criaturas!") end  
       
      2: agora vá em data/spells/ e abra o arquivo spells.xml e coloca isso dentro e salve
       
      <instant name="Sumonar" words="!help" lvl="0" mana="0" aggressive="0" params="1" exhaustion="1000" needlearn="0" event="script" value="arquivo.lua"> </instant>  

      2022-09-01 00-28-08.mp4 Pronto! agora é só usar a imaginação, pode adicionar monstro diferente ou do mesmo quantas vezes quiser.
       
      créditos fonte: @Lenilson e L3K0T
       
       
       
       
       
    • Por Thiago Virtuoso
      Preciso de ajuda com minha spell, quero que quando o player esteja com o addon do druid full ele use o combat e quando estiver com qualquer outro addon usar o combat2.
       
      Script:
       
      local combat = createCombatObject()

      local meteor = createCombatObject()
      setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      setCombatParam(combat, COMBAT_PARAM_EFFECT, 41)
      setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -10.3, -47, -10.2, 2)

      local stun = createConditionObject(CONDITION_PARALYZE)
      setConditionParam(stun, CONDITION_PARAM_TICKS, 5000)
      setConditionFormula(stun, -0.8, 0, -0.9, 0)
      setCombatCondition(meteor, stun)

      local combat2 = createCombatObject()

      local meteor2 = createCombatObject()
      setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43)
      setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -7.3, -47, -6.2, 2)






      local arr = {
      {0, 0, 0, 0, 0},
      {0, 0, 1, 0, 0},
      {0, 1, 3, 1, 0},
      {0, 0, 1, 0, 0},
      {0, 0, 0, 0, 0}
      }

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



      local area = createCombatArea(arr)
      local area2 = createCombatArea(arr2)

      setCombatArea(combat, area)
      setCombatArea(combat2, area2)

      local function meteorCast(p)
          doCombat(p.cid, p.combat, positionToVariant(p.pos))
      end
      local function meteorCast2(p)
          doCombat(p.cid, p.combat2, positionToVariant(p.pos))
      end
      local function stunEffect(cid)
          doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
      end


      function onTargetTile(cid, pos)
          if (math.random(0, 0) == 0) then
              local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
              if (isInArray(water, ground.itemid) == TRUE) then
                  local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
                  doSendDistanceShoot(newpos, pos, CONST_ANI_ICE)
                  addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
              else
                  local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
                  doSendDistanceShoot(newpos, pos, CONST_ANI_ICE)
                  addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
              end
          end
      end

      setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")


      function onTargetTile(cid, pos)
          if (math.random(0, 0) == 0) then
              local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0})
              if (isInArray(water, ground.itemid) == TRUE) then
                  local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
                  doSendDistanceShoot(newpos, pos, CONST_ANI_ICE)
                  addEvent(meteorCast2, 200, {cid = cid, pos = pos, combat2 = meteor_water2})
              else
                  local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
                  doSendDistanceShoot(newpos, pos, CONST_ANI_ICE)
                  addEvent(meteorCast2, 200, {cid = cid,pos = pos, combat2 = meteor2})
              end
          end
      end

      setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

      function onCastSpell(cid, var)
      local parameters = { cid = cid, var = var, combat = combat, combat2 = combat2 }


      local sex = getPlayerSex(cid)
      localOutfit = {lookType = 144, lookAddons = 3}
      localOufit2 = {lookType = 148, lookAddons = 3}




      if sex == 0 then
      if getCreatureOutfit == localOutfit2 then
      return doCombat(cid, combat, var)
      else
      return doCombat(cid, combat2, var)
      end
      end


      if sex == 1 then
      if getCreatureOutfit == localOutfit then
      return doCombat(cid, combat, var)
      else
      return doCombat(cid, combat2, var)
      end
      end
      end
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo