Adorius Black
Advanced OT User
- Joined
- Mar 31, 2020
- Messages
- 301
- Solutions
- 3
- Reaction score
- 180
Shamanic Ritual
(exevo gran mas sham)
(exevo gran mas sham)
XML:
<!-- 50 level-->
<instant group="attack" spellid="28" name="Shamanic Ritual" words="exevo gran mas sham" lvl="50" mana="430" prem="0" direction="1" exhaustion="12000" groupcooldown="2000" needlearn="0" script="custom/shamanic_ritual.lua">
<vocation name="Shaman" />
<vocation name="Raised Shaman" />
</instant>
Lua:
-- Delay between animations.
local animationDelay = 100
local combat = {}
-- Frames (1 = Area, 2 = Player, 3 = Player + Self Damaging)
local area = {
{{3}},
{{0,2},{1,0}},
{{2},{0},{1}},
{{2,0},{0,1}},
{{2,1}},
{{1},{2}},
{{1,2}},
{{0,0,2},{1,0,0}},
{{0,2},{0,0},{1,0}},
{{2},{0},{0},{1}},
{{2,0},{0,0},{0,1}},
{{2,0,0},{0,0,1}},
{{0,0,0,1,1,1,0,0,0},
{0,0,1,0,0,0,1,0,0},
{0,1,0,0,0,0,0,1,0},
{1,0,0,0,0,0,0,0,1},
{1,0,0,0,2,0,0,0,1},
{1,0,0,0,0,0,0,0,1},
{0,1,0,0,0,0,0,1,0},
{0,0,1,0,0,0,1,0,0},
{0,0,0,1,1,1,0,0,0}
},
}
for i = 1, #area do
combat[i] = Combat()
combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN)
combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
end
for x, _ in ipairs(area) do
combat[x]:setArea(createCombatArea(area[x]))
end
function executeCombat(p, i)
if not p.player then
return false
end
if not p.player:isPlayer() then
return false
end
p.combat[i]:execute(p.player, p.var)
end
function onCastSpell(player, var)
local p = {player = player, var = var, combat = combat}
-- Damage formula
local level = player:getLevel()
local maglevel = player:getMagicLevel()
local min = (level / 5) + (maglevel * 3) + 32
local max = (level / 5) + (maglevel * 9) + 40
for i = 1, #area do
combat[i]:setFormula(COMBAT_FORMULA_LEVELMAGIC, 0, -min, 0, -max)
if i == 1 then
combat[i]:execute(player, var)
else
addEvent(executeCombat, (animationDelay * i) - animationDelay, p, i)
end
end
return true
end
If you know how to make this code more easy, stable, correct or you are just bored and you have created nice modification of this code please post it here. OTLand users will be grateful.