This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathL2EasyFarm.l2s
128 lines (105 loc) · 2.8 KB
/
L2EasyFarm.l2s
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
INCLUDE "StdLib/NPC.l2c"
INCLUDE "StdLib/Inventory.l2c"
INCLUDE "StdLib/Player.l2c"
INCLUDE "WEB_SEND.l2s"
CALL_EXTERN "MovingSniffer.l2s" START_SNIFF_MOVEPACKETS VOID 0
CALL_EXTERN "L2Vision.l2s" L2V_init VOID 1 "#$127.0.0.1"
SET_EVENT "<&SCRIPTEVENT_SELFDIE&>" "<&SYSTEM_CURRENTFILE&>" SelfDie
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" TeleportToLocation 34
DEFINE_GLOBAL INT CAN_BOT 1
DEFINE_GLOBAL WEB_SEND WSEND 0
WSEND.URL = "#$http://localhost/l2Net.php?"
WSEND.ADD VOID 2 "#$action" "#$script_started"
WSEND.ADD VOID 2 "#$username" ENV_USERNAME
WSEND.ADD VOID 2 "#$script_name" "#$<&SYSTEM_CURRENTFILE&>"
WSEND.ADD VOID 2 "#$server" "#$L2EasyPvp"
WSEND.ADD VOID 2 "#$version" "#$1"
WSEND.SEND_DATA
//THREAD SEND_STATISTIC
DEFINE INT RANGE 200
DEFINE ARRAYLIST NPCS
DEFINE INT TDIST
DEFINE INT X "<&CHAR_X&>"
DEFINE INT Y "<&CHAR_Y&>"
DEFINE INT Z "<&CHAR_Z&>"
DEFINE INT NEAR_DIST 0
DEFINE INT TEMP_DIST 0
DEFINE INT T_ID 0
DO
IF CAN_BOT == TRUE
GET_NPCS NPCS
T_ID = 0
NEAR_DIST = 9999999999
FOR A 0 "<&NPCS.COUNT&>" 1
DISTANCE TDIST "<&NPCS.A.X&>" "<&NPCS.A.Y&>" 0 "<&X&>" "<&Y&>" 0
IF TDIST < RANGE
IF TARGET_NAME == CHAR_NAME
CANCEL_TARGET
ENDIF
IF ( ( NPCS.A.NAME != "#$" ) && ( NPCS.A.TITLE.TO_UPPER != "#$ANTI-BOT" ) && ( NPCS.A.NAME != "#$Dark Water Dragon" ) && ( NPCS.A.ATTACKABLE == TRUE ) && ( NPCS.A.LOOKS_DEAD == FALSE ) )
IF NPCS.A.TITLE.TO_UPPER != "#$LUCKY DROP"
T_ID = "<&NPCS.A.ID&>"
BREAK 4
ENDIF
NPCS.A.DIST TEMP_DIST 0
IF ( TEMP_DIST < NEAR_DIST )
T_ID = "<&NPCS.A.ID&>"
ENDIF
ENDIF
ENDIF
NEXT
ATTACK_TARGET_ID VOID 1 T_ID
ENDIF
SLEEP 250
LOOP ONE == ONE
END_SCRIPT
//"=Phrack=
FUNCTION ATTACK_TARGET_ID 1 TID
IF TID > 0
TARGET "<&TID&>"
SLEEP 600
IF TARGET_CUR_HP == 0
BREAK 2
ENDIF
USE_SKILL 501
WHILE TARGET_CUR_HP > 0
IF TARGET_NAME == CHAR_NAME
CANCEL_TARGET
TARGET "<&TID&>"
ENDIF
ATTACK_TARGET
SLEEP 1000
WEND
CANCEL_TARGET
SLEEP 800
ENDIF
RETURN VOID
FUNCTION SEND_STATISTIC
DEFINE STRING DATA
DEFINE ARRAYLIST ITEMS
DO
GET_INVENTORY ITEMS
FOREACH A INVENTORY ITEMS
DATA = DATA + "#$<&ITEMS.A.ID&>,<&ITEMS.A.ITEM_ID&>,<&ITEMS.A.COUNT&>,<&ITEMS.A.ENCHANT&>;"
NEXTEACH
WSEND.ADD VOID 2 "#$action" "#$inventory"
WSEND.ADD VOID 2 "#$data" DATA
WSEND.SEND_DATA
SLEEP 300000
LOOP ONE == ONE
RETURN VOID
FUNCTION SelfDie
CAN_BOT = FALSE
SLEEP 2131
TAP_TO TOWN
SLEEP 23311
INJECT "00"
RETURN VOID
FUNCTION TeleportToLocation
DEFINE INT OBJ_ID 0
PACKET.READ_BYTE NULL
PACKET.READ_INT32 OBJ_ID
IF OBJ_ID == CHAR_ID
CAN_BOT = FALSE
ENDIF
RETURN VOID