Virar Pro Alvo

Descrição

Fique de frente para o alvo que estiver atacando.

Autor:

                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
macro(1, 'virar target', function() if not g_game.isAttacking() then return end local tt = g_game.getAttackingCreature() local tx = tt:getPosition().x local ty = tt:getPosition().y local dir = player:getDirection() local tdx = math.abs(tx-pos().x) local tdy = math.abs(ty-pos().y) if (tdy >= 2 and tdx >= 2) or tdx > 7 or tdy > 7 then return end if tdy >= tdx then if ty > pos().y then if dir ~= 2 then return turn(2) end else if dir ~= 0 then return turn(0) end end else if tx > pos().x then if dir ~= 1 then return turn(1) end else if dir ~= 3 then return turn(3) end end end end)