Ir para conteúdo

[Spell] Battery Power


Newtonnotwen

Posts Recomendados

Aew galerinha, essa aqui é uma spell que consiste no player "carregar" poder para depois soltar toda energia em um poderoso attack.

 

​(Vídeo demonstrativo logo a baixo)

 

Em data/spells/script crie um arquivo.lua nomeie para battery e adicione:

local combat1 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 36)

local combat2 = createCombatObject()

setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat2, COMBAT_PARAM_EFFECT, 36)

local combat3 = createCombatObject()

setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat3, COMBAT_PARAM_EFFECT, 36)

local combat4 = createCombatObject()

setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat4, COMBAT_PARAM_EFFECT, 36)

local combat5 = createCombatObject()

setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat5, COMBAT_PARAM_EFFECT, 36)

local combat6 = createCombatObject()

setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat6, COMBAT_PARAM_EFFECT, 36)

local combat7 = createCombatObject()

setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat7, COMBAT_PARAM_EFFECT, 36)

local combat8 = createCombatObject()

setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat8, COMBAT_PARAM_EFFECT, 36)

local combat9 = createCombatObject()

setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat9, COMBAT_PARAM_EFFECT, 6)

setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -999.3, -999.160, -999, -999)

local combat10 = createCombatObject()

setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat10, COMBAT_PARAM_EFFECT, 6)

setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -999.3, -999.160, -999, -999)

local combat11 = createCombatObject()

setCombatParam(combat11, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat11, COMBAT_PARAM_EFFECT, 6)

setCombatFormula(combat11, COMBAT_FORMULA_LEVELMAGIC, -999.3, -999.160, -999, -999)

local combat12 = createCombatObject()

setCombatParam(combat12, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat12, COMBAT_PARAM_EFFECT, 6)

setCombatFormula(combat12, COMBAT_FORMULA_LEVELMAGIC, -999.3, -999.160, -999, -999)

 

arr1 = {

{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, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 2, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0},

}

 

arr2 = {

{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, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}

 

arr11 = {

{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, 1, 1, 1, 1, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 1, 1, 1, 1, 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},

}

 

arr12 = {

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

local area4 = createCombatArea(arr4)

local area5 = createCombatArea(arr5)

local area6 = createCombatArea(arr6)

local area7 = createCombatArea(arr7)

local area8 = createCombatArea(arr8)

local area9 = createCombatArea(arr9)

local area10 = createCombatArea(arr10)

local area11 = createCombatArea(arr11)

local area12 = createCombatArea(arr12)

 

setCombatArea(combat1, area1)

setCombatArea(combat2, area2)

setCombatArea(combat3, area3)

setCombatArea(combat4, area4)

setCombatArea(combat5, area5)

setCombatArea(combat6, area6)

setCombatArea(combat7, area7)

setCombatArea(combat8, area8)

setCombatArea(combat9, area9)

setCombatArea(combat10, area10)

setCombatArea(combat11, area11)

setCombatArea(combat12, area12)

 

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, combat1, parameters.var)

end

local function onCastSpell2(parameters)

doCombat(parameters.cid, combat2, parameters.var)

end

local function onCastSpell3(parameters)

doCombat(parameters.cid, combat3, parameters.var)

end

local function onCastSpell4(parameters)

doCombat(parameters.cid, combat4, parameters.var)

end

local function onCastSpell5(parameters)

doCombat(parameters.cid, combat5, parameters.var)

end

local function onCastSpell6(parameters)

doCombat(parameters.cid, combat6, parameters.var)

end

local function onCastSpell7(parameters)

doCombat(parameters.cid, combat7, parameters.var)

end

local function onCastSpell8(parameters)

doCombat(parameters.cid, combat8, parameters.var)

end

local function onCastSpell9(parameters)

doCombat(parameters.cid, combat9, parameters.var)

end

local function onCastSpell10(parameters)

doCombat(parameters.cid, combat10, parameters.var)

end

local function onCastSpell11(parameters)

doCombat(parameters.cid, combat11, parameters.var)

end

local function onCastSpell12(parameters)

doCombat(parameters.cid, combat12, parameters.var)

end

 

function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 14850, parameters)

addEvent(onCastSpell2, 14825, parameters)

addEvent(onCastSpell3, 14800, parameters)

addEvent(onCastSpell4, 14775, parameters)

addEvent(onCastSpell5, 14750, parameters)

addEvent(onCastSpell6, 14725, parameters)

addEvent(onCastSpell7, 14700, parameters)

addEvent(onCastSpell8, 14675, parameters)

addEvent(onCastSpell1, 14650, parameters)

addEvent(onCastSpell2, 14625, parameters)

addEvent(onCastSpell3, 14600, parameters)

addEvent(onCastSpell4, 14575, parameters)

addEvent(onCastSpell5, 14550, parameters)

addEvent(onCastSpell6, 14525, parameters)

addEvent(onCastSpell7, 14500, parameters)

addEvent(onCastSpell8, 14475, parameters)

addEvent(onCastSpell1, 14450, parameters)

addEvent(onCastSpell2, 14400, parameters)

addEvent(onCastSpell3, 14350, parameters)

addEvent(onCastSpell4, 14300, parameters)

addEvent(onCastSpell5, 14250, parameters)

addEvent(onCastSpell6, 14200, parameters)

addEvent(onCastSpell7, 14150, parameters)

addEvent(onCastSpell8, 14100, parameters)

addEvent(onCastSpell1, 14050, parameters)

addEvent(onCastSpell2, 14000, parameters)

addEvent(onCastSpell3, 13950, parameters)

addEvent(onCastSpell4, 13900, parameters)

addEvent(onCastSpell5, 13850, parameters)

addEvent(onCastSpell6, 13750, parameters)

addEvent(onCastSpell7, 13700, parameters)

addEvent(onCastSpell8, 13650, parameters)

addEvent(onCastSpell1, 13600, parameters)

addEvent(onCastSpell2, 13500, parameters)

addEvent(onCastSpell3, 13400, parameters)

addEvent(onCastSpell4, 13300, parameters)

addEvent(onCastSpell5, 13200, parameters)

addEvent(onCastSpell6, 13100, parameters)

addEvent(onCastSpell7, 13000, parameters)

addEvent(onCastSpell8, 12900, parameters)

addEvent(onCastSpell1, 12800, parameters)

addEvent(onCastSpell2, 12700, parameters)

addEvent(onCastSpell3, 12600, parameters)

addEvent(onCastSpell4, 12500, parameters)

addEvent(onCastSpell5, 12400, parameters)

addEvent(onCastSpell6, 12300, parameters)

addEvent(onCastSpell7, 12200, parameters)

addEvent(onCastSpell8, 12100, parameters)

addEvent(onCastSpell1, 12000, parameters)

addEvent(onCastSpell2, 11750, parameters)

addEvent(onCastSpell3, 11500, parameters)

addEvent(onCastSpell4, 11250, parameters)

addEvent(onCastSpell5, 11000, parameters)

addEvent(onCastSpell6, 10750, parameters)

addEvent(onCastSpell7, 10500, parameters)

addEvent(onCastSpell8, 10250, parameters)

addEvent(onCastSpell1, 10000, parameters)

addEvent(onCastSpell2, 9750, parameters)

addEvent(onCastSpell3, 9500, parameters)

addEvent(onCastSpell4, 9250, parameters)

addEvent(onCastSpell5, 9000, parameters)

addEvent(onCastSpell6, 8750, parameters)

addEvent(onCastSpell7, 8500, parameters)

addEvent(onCastSpell8, 8250, parameters)

addEvent(onCastSpell1, 8000, parameters)

addEvent(onCastSpell2, 7500, parameters)

addEvent(onCastSpell3, 7000, parameters)

addEvent(onCastSpell4, 6500, parameters)

addEvent(onCastSpell5, 6000, parameters)

addEvent(onCastSpell6, 5500, parameters)

addEvent(onCastSpell7, 5000, parameters)

addEvent(onCastSpell8, 4500, parameters)

addEvent(onCastSpell1, 4000, parameters)

addEvent(onCastSpell2, 3500, parameters)

addEvent(onCastSpell3, 3000, parameters)

addEvent(onCastSpell4, 2500, parameters)

addEvent(onCastSpell5, 2000, parameters)

addEvent(onCastSpell6, 1500, parameters)

addEvent(onCastSpell7, 1000, parameters)

addEvent(onCastSpell8, 500, parameters)

addEvent(onCastSpell9, 14900, parameters)

addEvent(onCastSpell10, 15100, parameters)

addEvent(onCastSpell11, 15300, parameters)

addEvent(onCastSpell12, 15500, parameters)

return TRUE

end

Editando:

 

-Vermelho: Numero do efeito do poder "circular" (/z)

-Laranja: Natureza do attack (elementos), pode variar entre:

 

EARTH

HOLY

PHYSICAL

FIRE

ENERGY

ICE

 

-Verde: Numero do efeito da explosão (/z)

-Roxo: Formula de attack (qualquer duvida pergunte)

 

Obs: Para editar o tempo pergunte, pois se baseia em uma parte mais complexa.

 

Em spells.xml adicione:

 

<instant name="battery" words="recharge" lvl="100" mana="1600" prem="1" exhaustion="1000" selftarget="1" needlearn="0" script="battery.lua">

<vocation id="1"/>

<vocation id="2"/>

<vocation id="3"/>

<vocation id="4"/>

<vocation id="5"/>

<vocation id="6"/>

<vocation id="7"/>

<vocation id="8"/>

</instant>

Editando:

 

-Vermelho: Word, palavra magica para "soltar" a magia

-Verde: Level necessário para utilizar a magia

-Roxo: Mana necessária para utilizar a magia

-Marrom: Id das vocações que poderão usar a magia

 

Obs: Qualquer duvida pergunte.

 

Agora um vídeo demonstrativo:

 

Editado por Newtonnotwen
Link para o comentário
Compartilhar em outros sites

lol cara.

magia muito simples .. faz uma parecida que eu fiz .. com critical .. porcentagem de dar dano maior ..

 

que formula é essa

setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -999.3, -999.160, -999, -999)

 

eita caramba ..

Link para o comentário
Compartilhar em outros sites

Aprenda a usar tabelas e loops, assim diminuirá legal o tamanho do script. Lógico, o tamanho não influencia no resultado, mas fica mais bonito o código e mais fácil de editar.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...