Denki Tenohira.lua

main 66 lines · 2 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local function sendDistanceEffectDelay(cid, fromPos, toPos)
2 local player = Player(cid)
3 if not player then
4 return
5 end
6
7 fromPos:sendDistanceEffect(toPos, 236) -- Efeito 236 (elétrico azul)
8end
9
10local function ninjaJumpDash(cid, targetId, oldPos, lastJump, back)
11 local player = Player(cid)
12 if not player then
13 return
14 end
15
16 local target = Creature(targetId)
17 if not target then
18 player:setGhostMode(false)
19 return
20 end
21
22 -- Aplica o efeito 236 no caster antes do ataque
23 player:getPosition():sendMagicEffect(236)
24
25 if lastJump then
26 player:setGhostMode(false)
27 end
28
29 if back then
30 player:teleportTo(oldPos)
31 else
32 player:teleportTo(target:getPosition())
33 end
34
35 -- Aplica dano e efeito 236 no alvo
36 doTargetCombatHealth(cid, target, COMBAT_ENERGYDAMAGE, -50, -150, 236) -- Dano de energia
37 target:getPosition():sendMagicEffect(236) -- Efeito elétrico azul no alvo
38end
39
40function onCastSpell(creature, var)
41 local cid = creature:getId()
42 local playerPos = creature:getPosition()
43 local target = creature:getTarget()
44
45 if not target then
46 creature:sendCancelMessage("Você precisa de um alvo para usar esta habilidade.")
47 return false
48 end
49
50 creature:setGhostMode(true)
51
52 -- **1º ATAQUE**
53 addEvent(ninjaJumpDash, 0, cid, target:getId(), playerPos, false, false)
54 addEvent(sendDistanceEffectDelay, 100, cid, playerPos, target:getPosition())
55 addEvent(sendDistanceEffectDelay, 300, cid, target:getPosition(), playerPos)
56 addEvent(ninjaJumpDash, 400, cid, target:getId(), playerPos, false, true)
57
58 -- **2º ATAQUE**
59 addEvent(ninjaJumpDash, 600, cid, target:getId(), playerPos, false, false)
60 addEvent(sendDistanceEffectDelay, 700, cid, playerPos, target:getPosition())
61 addEvent(sendDistanceEffectDelay, 1000, cid, target:getPosition(), playerPos)
62 addEvent(ninjaJumpDash, 1100, cid, target:getId(), playerPos, true, true)
63 playSound(creature, "energy.ogg")
64 return false
65end
66
Top