Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Fala galera do TK, hoje vim trazer pra vocês um conjuntinho de spells que eu criei com base em uma spell que achei aqui no fórum mesmo :D
Os créditos da spell base que eu utilizei são do OneShot :D

São duas spells bem simples, uma puxa o oponente pra perto e a outra arremessa ele longe.
Idéia original tirada dos servidores de Avatar que possuem esse tipo de magia pra nação do Ar haha.

Aqui vão os scripts:

empurrararea.lua

local function doPushCreature(target, cid)
    if target > 0 then
   if not isNpc(target) then
   local position = getThingPosition(cid)
   local fromPosition = getThingPosition(target)
   local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
   local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
   local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
   if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
   doTeleportThing(target, toPosition, true)
   end
   end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{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, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 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},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4, 0, -4.7, 0)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
   addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end



puxararea.lua

local function doPushCreature(target, cid)
    if target > 0 then
   if not isNpc(target) then
   local position = getThingPosition(cid)
   local fromPosition = getThingPosition(target)
   local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
   local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
   local toPosition = {x = fromPosition.x - x, y = fromPosition.y - y, z = fromPosition.z}
   if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
   doTeleportThing(target, toPosition, true)
   end
   end
    end
end
local spell = {}
spell.config = {
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{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, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 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},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4, 0, -4.7, 0)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
   addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end



no spells.xml:

​<instant name="Get off here (AREA)" words="exani mas grav" lvl="160"  mana="500" prem="1" exhaustion="2000" needlearn="0" event="script" value="especiais/empurrararea.lua">
<vocation id="6"/>
<vocation id="7"/>
<vocation id="5"/>
</instant>
<instant name="Get over here (AREA)" words="exina mas grav" lvl="160"  mana="500" prem="1" exhaustion="2000" needlearn="0" event="script" value="especiais/puxararea.lua">
<vocation id="6"/>
<vocation id="7"/>
<vocation id="5"/>
</instant>

Agora algumas imagens (não deu pra captar muito bem oque a spell faz porque ela é composta por diferentes movimentos, sugiro que vcs instalem e testem)

Puxar:

rJy5cGy.jpg

 



Empurrar 


hsPW0sC.jpg

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)

  • Respostas 59
  • Visualizações 9.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado

Caraca xWhiteWolf so sabia do de empurrar kk boa Manin, vo testa aqui agora

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Postado
  • Autor

créditos adicionados ;] 

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)

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

Informação Importante

Confirmação de Termo