61
61
function break_item (t )
62
62
local x = t [1 ] or t .x or exit_message {message = " x coordinate is not defined" }
63
63
local y = t [2 ] or t .y or exit_message {message = " y coordinate is not defined" }
64
-
64
+
65
+ local nx , ny = GetLocal ().posX , GetLocal ().posY
65
66
pkt = {}
66
67
pkt .px = x ;
67
68
pkt .py = y ;
68
- pkt .x = x * 32 ;
69
- pkt .y = ( y - 1 ) * 32 ;
69
+ pkt .x = nx ;
70
+ pkt .y = ny ;
70
71
pkt .type = 3 ;
71
72
pkt .value = 18 ;
72
73
SendPacketRaw (false , pkt );
@@ -78,12 +79,13 @@ function place_item(t)
78
79
local x = t [1 ] or t .x or exit_message {message = " x coordinate is not defined" }
79
80
local y = t [2 ] or t .y or exit_message {message = " y coordinate is not defined" }
80
81
local item_id = t [3 ] or t .item_id or exit_message {message = " item id is not defined" }
81
-
82
+
83
+ local nx , ny = GetLocal ().posX , GetLocal ().posY
82
84
pkt = {}
83
85
pkt .px = x ;
84
86
pkt .py = y ;
85
- pkt .x = x * 32 ;
86
- pkt .y = ( y - 1 ) * 32 ;
87
+ pkt .x = nx ;
88
+ pkt .y = ny ;
87
89
pkt .type = 3 ;
88
90
pkt .value = item_id ;
89
91
SendPacketRaw (false , pkt );
@@ -116,15 +118,15 @@ function clear_island()
116
118
local tile = GetTile (x , y )
117
119
if (tile .fg == 12988 ) or (tile .fg == 12986 ) or (tile .bg == 14 and tile .fg ~= 8 ) or (tile .fg == 1104 ) or (tile .bg == 1102 ) then
118
120
if (FindPath (tile .x , tile .y - 1 ) == false ) then
119
- break_item { x = tile .x , y = tile .y }
121
+ break_island { x = tile .x , y = tile .y }
120
122
break
121
123
end
122
124
end
123
125
else
124
126
local tile = GetTile (199 - x , y )
125
127
if (tile .fg == 12988 ) or (tile .fg == 12986 ) or (tile .bg == 14 and tile .fg ~= 8 ) or (tile .fg == 1104 ) or (tile .bg == 1102 ) then
126
128
if (FindPath (tile .x , tile .y - 1 ) == false ) then
127
- break_item {x = tile .x , y = tile .y }
129
+ break_island {x = tile .x , y = tile .y }
128
130
break
129
131
end
130
132
end
0 commit comments