Rhythm Echo.lua

main 96 lines · 3.7 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local combat = createCombatObject()
2-- Define o tipo de dano azul (energia) e os efeitos visuais
3setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
4setCombatParam(combat, COMBAT_PARAM_EFFECT, 100)
5setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 0)
6
7
8
9setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -100, 0, -100)
10
11
12local area = createCombatArea({
13 {1, 1, 1, 1, 1},
14 {1, 1, 1, 1, 1},
15 {1, 1, 2, 1, 1},
16 {1, 1, 1, 1, 1},
17 {1, 1, 1, 1, 1}
18})
19setCombatArea(combat, area)
20
21
22local function persistEffect(pos, effectId, interval, stopFlag)
23 if not stopFlag.value then
24 doSendMagicEffect(pos, effectId)
25 addEvent(persistEffect, interval, pos, effectId, interval, stopFlag)
26 end
27end
28
29function onCastSpell(creature, var)
30 local casterPos = getCreaturePosition(creature)
31
32
33 doCreatureChangeOutfit(creature, {lookType = 43})
34
35
36 local areaPos = {x = casterPos.x + 4, y = casterPos.y + 4, z = casterPos.z}
37
38 local variant = Variant(casterPos, area)
39
40
41 local slowCondition = createConditionObject(CONDITION_HASTE)
42 setConditionParam(slowCondition, CONDITION_PARAM_SPEEDPERCENT, -60)
43
44 setConditionParam(slowCondition, CONDITION_PARAM_TICKS, 3000)
45
46
47 for dx = -2, 2 do
48 for dy = -2, 2 do
49 local pos = {x = areaPos.x + dx, y = areaPos.y + dy, z = areaPos.z}
50 local target = getTopCreature(pos)
51 if target and target.uid ~= creature.uid then
52 doAddCondition(target, slowCondition)
53 doSendMagicEffect(getCreaturePosition(target), 85)
54 end
55 end
56 end
57
58 local stopFlag = {value = false}
59
60
61 persistEffect(areaPos, 102, 600, stopFlag)
62
63
64 addEvent(function()
65 stopFlag.value = true -- Para o loop do efeito 102
66
67
68 local damageEffects = {97, 98, 103, 99} -- efeitos a serem exibidos com cada dano
69 local effectOffsets = {
70 {x = -3, y = -3}, -- desloca o effect 97
71 {x = -3, y = -3}, -- desloca o effect 98
72 {x = -3, y = -3}, -- desloca o effect 103
73 {x = -3, y = -3} -- desloca o effect 99
74 }
75
76 for i, delay in ipairs(damageIntervals) do
77 addEvent(function()
78 local effectPos = {
79 x = areaPos.x + effectOffsets[i].x,
80 y = areaPos.y + effectOffsets[i].y,
81 z = areaPos.z
82 }
83 doSendMagicEffect(effectPos, damageEffects[i])
84 doCombat(creature, combat, variant)
85 end, delay)
86 end
87
88
89 addEvent(function()
90 doCreatureChangeOutfit(creature, {lookType = 45})
91 end, 1500)
92 end, 1000)
93
94 return true
95end
96
Top