-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA-奴隶围栏68FS.lua
1562 lines (1472 loc) · 55.7 KB
/
A-奴隶围栏68FS.lua
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
shieldState = 0
function drink() --吃喝
local drinkBag, drinkSlot = getBelongBagAndSlotByID(30703)
local breadBag, breadSlot = getBelongBagAndSlotByID(22895)
if drinkSlot == 0 or breadSlot == 0 then
standBy()
castSpellA("造食术(等级 7)")
sleep(3500)
castSpellA("造水术(等级 8)")
sleep(3500)
end
local je1Bag, je1Slot = getBelongBagAndSlotByID(22044)
if je1Slot == 0 then
standBy()
castSpellA("制造魔法玉石")
sleep(3500)
end
je1Bag, je1Slot = getBelongBagAndSlotByID(8008)
if je1Slot == 0 then
standBy()
castSpellA("制造魔法红宝石")
sleep(3500)
end
je1Bag, je1Slot = getBelongBagAndSlotByID(8007)
if je1Slot == 0 then
standBy()
castSpellA("制造魔法黄水晶")
sleep(3500)
end
je1Bag, je1Slot = getBelongBagAndSlotByID(5513)
if je1Slot == 0 then
standBy()
castSpellA("制造魔法翡翠")
sleep(3500)
end
if getRoleCurrentHP() < 95 and getRoleCurrentMP() < 95 and getRoleCurrentHP() >= 0 and getRoleCurrentMP() >= 0 then
useItem("魔法肉桂面包")
useItem("魔法山泉水")
end
while getRoleCurrentHP() ~= -1 and getRoleflag1() ~= 0x04 do
if IsBuffExist(29073) == 0 or IsBuffExist(34291) == 0 then
useItem("魔法肉桂面包")
useItem("魔法山泉水")
end
if getRoleCurrentHP() >= 95 and getRoleCurrentMP() >= 95 then
break
end
sleep(1000)
end
end
function mail()
for i=1,4,1 do --循环将所有副背包的物品都放入,直到填满邮件
bagNum = getBagSlotNum(i) --获得背包的大小
unUsedSLot = getUnusedBagSlotNum(i)--获得所有背包剩余的空格子
if bagNum-unUsedSLot > 0 then --如果背包中有东西
contactClosetMailObjec()--与邮箱互动(打开邮箱)
clickSendMailFrame()--打开发送页面
setMailTargetName()--填写名字,名字在脚本界面填写
for k = 1,bagNum,1 do --尝试将背包中的每个格子都放入邮箱,没有就不放,有就会放进去
putMailItem(i,k) --放入
sleep(10)
end
sendMail()--发送邮件
useLua("/click MailFrameCloseButton")
sleep(500) -- 略微延迟,防止发邮件卡住
end
if i == 3 then
contactClosetMailObjec()--与邮箱互动
clickSendMailFrame()--打开发送页面
putMailMoney(3)--放入1G
setMailTargetName1()--填写名字,名字在脚本界面填写
sendMail()--发送邮件
useLua("/click MailFrameCloseButton")
sleep(500) -- 略微延迟,防止发邮件卡住
end
end
contactClosetMailObjec()--与邮箱互动
clickSendMailFrame()--打开发送页面
putMailMoney(100)--放入1G
setMailTargetName()--填写名字,名字在脚本界面填写
sendMail()--发送邮件
useLua("/click MailFrameCloseButton")
sleep(500) -- 略微延迟,防止发邮件卡住
end
function silence(name,x,y) --反制
local ID1,ID2 = getClosetTargetIDToAPositionFilterName(name,x,y,3,8)
--prints(name)
chooseTarget(ID1,ID2)
castSpellA("法术反制")
end
function watchLobster() --观察龙虾人走位
local ID1,ID2,ID3,ID4,n,distance = 0,0,0,0,0,0
local x,y,z,x1,y1,z1 = 0,0,0,0,0,0
while getRoleCurrentMP() ~= -1 and getRoleflag1() ~= 0x04 do
ID1,ID2 = getClosetTargetIDFilterName("大型泥沼龙虾人",3,8)
x,y,z = getTargetPositionByID(ID1,ID2,3)
sleep(300)
n = n + 1
if n >= 500 then
prints("长时间无法检测到龙虾人")
moveB(120.223,-138.426,-0.821922)
prints("a:长时间无法检测到龙虾人,出本")
waitForLoadingPosition(120.223,-138.426,-0.821922)
useLua("/run ResetInstances()") --重置
sleep(1000)
moveB(743.192,7014.06,-72.7946)
prints("a:长时间无法检测到龙虾人,再进本")
waitForLoadingPosition(743.192,7014.06,-72.7946)
n = 0
end
ID3,ID4 = getClosetTargetIDFilterName("大型泥沼龙虾人",3,8)
x1,y1,z1 = getTargetPositionByID(ID3,ID4,3)
distance = getDistanceBetween(x1,y1,57.4392,-101.923)
if x1 < x then
--printf(distance)
if distance <= 11 and distance >= 0 then
return 0
else
end
end
end
end
function stormLobster1() --暴风雪龙虾人1
local ID1,ID2,distance1,distance2 = 0,0,0,0
local x,y,z = 0,0,0
while getRoleCurrentMP() ~= -1 and getRoleflag1() ~= 0x04 do
sleep(100)
ID1,ID2 = getClosetTargetIDFilterName("大型泥沼龙虾人",3,8)
x,y,z = getTargetPositionByID(ID1,ID2,3)
distance1 = getDistanceBetween(x,y,68.309, -99.5403)
distance2 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance1 <= 70 and distance1 >= 0 then
if distance2 <= 32 and distance2 >= 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
ID1,ID2 = getClosetTargetIDFilterName("大型泥沼龙虾人",3,8)
x,y,z = getTargetPositionByID(ID1,ID2,3)
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
sleep(1500)
return 0
end
else
return 0 -- 或许可以删掉
end
end
end
function stormLobster2() --暴风雪龙虾人2
local ID1,ID2 = getClosetTargetIDFilterName("大型泥沼龙虾人",3,8)
local x,y,z = getTargetPositionByID(ID1,ID2,3)
local distance = getDistanceBetween(x,y,9.88542, -24.4741)
if distance <= 50 and distance >= 0 then
local distance2 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance2 <= 35 and distance2 >= 12 then
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
sleep(1200)
chooseTarget(ID1,ID2)
castSpellA("冰枪术(等级 1)")
elseif distance2 <= 4 and distance2 >= 0 then
castSpellB("冰霜新星(等级 1)")
end
else
return 0
end
end
function attackTechnicianNotUnderBridge()--拉非桥下巡逻盘牙技师
local ID1,ID2 = getClosetTargetIDFilterName("盘牙技师",3,8)
local x,y,z = getTargetPositionByID(ID1,ID2,3)
local distance1 = getDistanceBetween(x,y,77.796, -356.878)
local distance2 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance1 > 8 and distance2 <= 35 and distance2 >= 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
else
return 0
end
end
function attackTechnician()--拉巡逻盘牙技师
local ID1,ID2 = getClosetTargetIDFilterName("盘牙技师",3,8)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 35 and distance >= 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
else
return 0
end
end
function iceBlock() -- 寒冰屏障
moveB(71.1643,-338.1,6.0474)
sleep(50)
useLua("/cancelAura 冰甲术(等级 4)")
local ID1,ID2,distance,hp = 0,0,0,0
while getRoleCurrentMP() ~= -1 and getRoleflag1() == 0x08 do
sleep(100)
ID1,ID2 = getClosetTargetIDInBattleFilterName("盘牙卫士",3,8)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
hp = getRoleCurrentHP()
if distance <= 15 and distance >= 0 then
castSpellA("寒冰屏障")
return 0
end
if hp <= 45 and hp >= 0 then
castSpellA("寒冰屏障")
return 0
end
end
end
function patrolBraveStop() --巡逻勇士冰环判断
local ID1,ID2 = getClosetTargetIDFilterName("盘牙勇士",3,8)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 13 and distance >= 0 then
castSpellB("冰霜新星(等级 1)")
end
end
function patrolBraveSlience() --巡逻勇士反制判断
local ID1,ID2 = getClosetTargetIDFilterName("盘牙勇士",3,8)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
level = getRoleLevel()
if distance <= 35 and level == 70 and distance >= 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
end
end
function summonStopMinion1(x,y,z)--水元素冻住怪
castSpellA("召唤水元素")
sleep(5)
castSpellB("急速冷却")
sleep(5)
castSpellA("冰霜新星(等级 1)")
sleep(5)
castSpellB("冰冻术")
sleep(5)
castSpellPosition(x,y,z)
sleep(5)
useLua("/run PetDismiss()")
end
function summonStopMinion2()--水元素冻住怪
castSpellA("召唤水元素")
sleep(600)
castSpellB("冰冻术")
sleep(20)
--castSpellPosition(42.5877,-315.003,3.03932)
castSpellPosition(35.2655,-312.797,3.03607)
sleep(5)
castSpellA("闪现术")
end
function firstLevelStormGathered(x,y,z) --一级暴风雪聚怪判断
local ID1,ID2 = getClosetTargetIDInBattle(3)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
local spellID,hp = 0,0
--printf(distance)
if distance <= 8 and distance >=0 and ID1 ~= 0 and ID1 ~= -1 then
return 0
else
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
for i = 1, 20,1 do
sleep(205)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i >= 5 and i<= 15 and spellID ~= 0x0a then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
hp = getRoleCurrentHP()
if distance <= 8 and hp <= 60 and distance >= 0 and hp >= 0 then
return
end
end
end
end
function firstLevelStormGathered1(x,y,z) --一级暴风雪聚怪判断1
local ID1,ID2 = getClosetTargetIDInBattle(3)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
local spellID,hp = 0,0
--printf(distance)
if distance <= 8 and distance >=0 and ID1 ~= 0 and ID1 ~= -1 then
return 0
else
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
for i = 1, 20,1 do
sleep(215)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i >= 5 and i<= 15 and spellID ~= 0x0a then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
hp = getRoleCurrentHP()
if distance <= 8 and hp <= 60 and distance >= 0 and hp >= 0 then
return
end
end
end
end
function checkDistanceBetweenMinion1() --检测怪群是否到足够的距离
local ID1,ID2 = getHighestHPTargetIDInBattle(3)
local targetHP = getTargetHPByID(ID1,ID2,3)
local hp = getRoleCurrentHP()
local distance,distance1,distance2 = 0,0,0
local x,y,z,n = 0,0,0,0
local name,chat = getChatInfoByType(7)
if name ~= "" and name ~= 0 and name ~= -1 then
useLua("/reply [大脚自动回复]我不是会长,我先邀请你进入公会,先进会,会长叫女权或者全能冠军,会m你,或者你m她")
useLua("/tell 女权 ".. name.. " 申请加入公会")
useLua("/tell 全能冠军 ".. name.. " 申请加入公会")
useLua("/guildinvite "..name)
end
if hp < 70 and hp > 0 then
useItem("灵纹布绷带")
sleep(2000)
end
local coolDown = getSpellCoolDown(12051)
local mp = getRoleCurrentMP()
if coolDown == 0 and mp < 43 and mp > 0 and targetHP >= 35 then
useItem("法力刚玉")
useItem("法力红宝石")
useItem("法力黄水晶")
useItem("法力翡翠")
end
if mp < 35 and mp > 0 and targetHP >= 35 then
--prints("唤醒1")
castSpellA("唤醒")
end
if targetHP < 35 and mp < 57 and targetHP >= 0 and mp > 0 then
--prints("唤醒2")
useItem("法力刚玉")
useItem("法力红宝石")
useItem("法力黄水晶")
useItem("法力翡翠")
sleep(100)
castSpellA("唤醒")
end
ID1,ID2 = getClosetTargetIDInBattleFilterName("背叛者门努",3,8)
if ID1 ~= 0 and ID1 ~= -1 then
local flag2 = getTargetFlag2ByID(ID1,ID2,3)
if flag2 == 0x08 then
moveA(82.684,-348.453,3.03567)
end
end
while getRoleCurrentMP() ~= -1 and getRoleflag1() == 0x08 do
flag1 = getRoleflag1()
if flag1 == 0x00 and flag1 ~= 0x08 then
break
end
ID1,ID2 = getClosetTargetIDInBattleFilterName("盘牙技师",3,8)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 30 and distance > 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
end
hp = getRoleCurrentHP()
if hp <= 14 then
useItem("特效治疗药水")
castSpellA("寒冰护体(等级 5)")
end
ID1,ID2 = getClosetTargetIDToAPositionInBattle(49.5638, -414.071,3)
distance = getTargetAndPositionDistanceByID(ID1,ID2,49.5638, -414.071,3)
x,y,z = getTargetPositionByID(ID1,ID2,3)
if distance >= 0 then --距离判断
distance1 = getDistanceBetween(x,y,-15.7392, -392.649)
ID1,ID2 = getHighestHPTargetIDInBattle(3)
targetHP = getTargetHPByID(ID1,ID2,3)
if targetHP >= 30 then
if distance1 <= 18 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 30 and targetHP >= 20 then
if distance1 <= 32 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 20 and targetHP >= 10 then
if distance1 <= 42 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 10 and targetHP >= 0 then
if distance1 <= 47 then --检测怪物是否到目的地
return 0
end
end
end
if n >= 60 then
ID1,ID2 = getClosetTargetIDInBattle(3) --判断是否在台子上行走
x,y,z = getTargetPositionByID(ID1,ID2,3)
distance = getDistanceBetween(x,y,43.6467, -344.865)
distance1 = getDistanceBetween(x,y,55.39, -346.972)
distance2 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance2 < 30 and distance2 >= 0 then
if distance <= 10 and distance >= 0 and distance1 <= 3 and distance1>= 0 then
return 0
end
end
end
sleep(100)
n = n + 1
end
end
function checkDistanceBetweenMinion2() --检测怪群是否到足够的距离2
local ID1,ID2 = getHighestHPTargetIDInBattle(3)
local targetHP = getTargetHPByID(ID1,ID2,3)
local hp = getRoleCurrentHP()
local distance,distance1,distance2 = 0,0,0
local x,y,z = 0,0,0
if hp < 70 and hp > 0 then
useItem("灵纹布绷带")
sleep(2000)
end
local coolDown = getSpellCoolDown(12051)
local mp = getRoleCurrentMP()
if coolDown == 0 and mp < 43 and mp > 0 and targetHP >= 35 then
useItem("法力刚玉")
useItem("法力红宝石")
useItem("法力黄水晶")
useItem("法力翡翠")
end
if mp < 43 and mp > 0 and targetHP >= 35 then
castSpellA("唤醒")
end
if targetHP < 35 and mp < 57 and targetHP >= 0 and mp > 0 then
useItem("法力刚玉")
useItem("法力红宝石")
useItem("法力黄水晶")
useItem("法力翡翠")
sleep(100)
castSpellA("唤醒")
end
ID1,ID2 = getClosetTargetIDFilterName("背叛者门努",3,8)
if ID1 ~= 0 and ID1 ~= -1 then
local flag2 = getTargetFlag2ByID(ID1,ID2,3)
if flag2 == 0x08 then
moveA(82.684,-348.453,3.03567)
end
end
while getRoleCurrentMP() ~= -1 and getRoleflag1() == 0x08 do
ID1,ID2 = getClosetTargetIDInBattleFilterName("盘牙技师",3,8)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 30 and distance > 0 then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
end
hp = getRoleCurrentHP()
if hp <= 14 then
useItem("特效治疗药水")
castSpellA("寒冰护体(等级 5)")
end
ID1,ID2 = getClosetTargetIDToAPositionInBattle(49.5638, -414.071,3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
x,y,z = getTargetPositionByID(ID1,ID2,3)
if distance >= 0 then --距离判断
distance1 = getDistanceBetween(x,y,-15.7392, -392.649)
ID1,ID2 = getHighestHPTargetIDInBattle(3)
targetHP = getTargetHPByID(ID1,ID2,3)
if targetHP >= 30 then
if distance1 <= 4 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 30 and targetHP >= 20 then
if distance1 <= 32 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 20 and targetHP >= 10 then
if distance1 <= 42 then --检测怪物是否到目的地
return 0
end
elseif targetHP <= 10 and targetHP >= 0 then
if distance1 <= 57 then --检测怪物是否到目的地
return 0
end
end
end
ID1,ID2 = getClosetTargetIDInBattle(3) --判断是否在台子上行走
x,y,z = getTargetPositionByID(ID1,ID2,3)
distance = getDistanceBetween(x,y,43.6467, -344.865)
distance1 = getDistanceBetween(x,y,55.39, -346.972)
distance2 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance2 < 30 and distance2 >= 0 then
if distance <= 10 and distance >= 0 and distance1 <= 3 and distance1>= 0 then
return 0
end
end
sleep(100)
end
end
function shield() --是否上寒冰护体
local ID1,ID2 = getClosetTargetIDInBattleFilterName("盘牙魔法师",3,8)
if shieldState == 1 then
castSpellA("寒冰护体(等级 5)")
--[[
if IsBuffExist(33944) == 0 then
castSpellA("魔法抑制(等级 6)")
end
--]]
return 0
end
if ID1 ~= 0 and ID1 ~= -1 then
shieldState = 1
castSpellA("寒冰护体(等级 5)")
end
end
function silenceTechnician()--打断技师读条
local ID1,ID2 = getClosetTargetIDInBattle(3)
local name = getTargetNameByID(ID1,ID2,3)
if name == "盘牙技师" then
chooseTarget(ID1,ID2)
castSpellA("法术反制")
end
end
function skipStorm(x,y,z) --是否跳过房间内左边一波
local ID1,ID2 = getClosetTargetIDInBattle(3)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance < 15 and distance >= 0 then
return
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
function isMinionInPosition(x,y,z) --检测怪群是否到一级暴风雪位置
local ID1,ID2,distance,coolDown = 0,0,0,0
local mp,level,spellID,distance1 = 0,0,0,0
ID1,ID2 = getClosetTargetIDInBattleFilterName("盘牙魔法师",3,8)
if ID1 ~= 0 and ID1 ~= -1 then
shieldState = 1
end
while getRoleCurrentMP() ~= -1 and getRoleflag1() == 0x08 do
sleep(5)
ID1,ID2 = getClosetTargetIDToAPositionInBattle(49.5638, -414.071,3)
if getRoleflag1() == 0x00 or getRoleflag1() == 0x04 then
--prints("脱战了")
return 0
end
distance = getTargetAndPositionDistanceByID(ID1,ID2,49.5638, -414.071,3)
ID1,ID2 = getClosetTargetIDInBattle(3)
distance1 = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance1 <= 12 and distance1 >= 0 then
return 0
end
if distance >= 0 and distance <= 11 then
coolDown = getSpellCoolDown(12051)
mp = getRoleCurrentMP()
level = getRoleLevel()
if mp >= 69 or coolDown == 1 then
if level >= 68 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
end
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
for i = 1, 20,1 do
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i >= 5 and i<= 15 and spellID ~= 0x0a and IsBuffExist(12472) == 0 then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
sleep(350)
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
--printf(distance)
if distance <= 12 and distance >= 0 then
return 0
end
end
return 0
end
end
end
function secondTimeMaxLevelStorm(x,y,z) --第二次下满级暴风雪
local spellID,targetHP = 0,0
--moveB(92.9172,-391.322,3.03429)
--sleep(100)
--standBy()
sleep(100)
local ID1,ID2 = getClosetTargetIDInBattle(3)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
local mp = getRoleCurrentMP()
if distance <= 8 and distance >= 0 then
return
elseif mp <= 10 and mp >= 0 then
return
else
castSpellB("冰冷血脉")
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
for i = 1, 20,1 do
sleep(410)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i >= 5 and i<= 13 and spellID ~= 0x0a and IsBuffExist(12472) == 0 then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 11 and distance >= 0 then
return
end
end
ID1,ID2 = getHighestHPTargetIDInBattle(3) --第二次下雪
mp = getRoleCurrentMP()
targetHP = getTargetHPByID(ID1,ID2,3)
if mp >= 20 or IsBuffExist(12536) == 1 then
if targetHP <= 32 or IsBuffExist(12536) == 1 then
if targetHP >= 0 and ID1 ~= 0 and ID1 ~= -1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(76.651,-417.735,3.03409)
for i = 1, 20,1 do
sleep(400)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i<= 13 and i >= 5 and spellID ~= 0x0a and IsBuffExist(12472) == 0 then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 11 and distance >= 0 then
return
end
end
end
end
end
ID1,ID2 = getHighestHPTargetIDInBattle(3) --第三次下雪
mp = getRoleCurrentMP()
targetHP = getTargetHPByID(ID1,ID2,3)
if mp >= 20 or IsBuffExist(12536) == 1 then
if targetHP <= 28 or IsBuffExist(12536) == 1 then
if targetHP >= 0 and ID1 ~= 0 and ID1 ~= -1 then
castSpellA("召唤水元素")
sleep(600)
castSpellB("冰冻术")
sleep(50)
castSpellPosition(80.5394,-410.023,3.03428)
sleep(5)
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(76.651,-417.735,3.03409)
for i = 1, 20,1 do
sleep(400)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i >= 5 and i<= 13 and spellID ~= 0x0a and IsBuffExist(12472) == 0 then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 11 and distance >= 0 then
return
end
end
useLua("/run PetDismiss()")
end
end
end
ID1,ID2 = getHighestHPTargetIDInBattle(3) --第二次下雪
mp = getRoleCurrentMP()
targetHP = getTargetHPByID(ID1,ID2,3)
if mp >= 20 or IsBuffExist(12536) == 1 then
if targetHP <= 22 or IsBuffExist(12536) == 1 then
if targetHP >= 0 and ID1 ~= 0 and ID1 ~= -1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(76.651,-417.735,3.03409)
for i = 1, 20,1 do
sleep(400)
spellID = getRoleCurrentSpellID()
if spellID ~= 0xCB and spellID ~= 0xCD and i<= 13 and i >= 5 and spellID ~= 0x0a and IsBuffExist(12472) == 0 then
if IsBuffExist(12536) == 1 then
castSpellA("暴风雪(等级 7)")
sleep(5)
castSpellPosition(x,y,z)
else
castSpellA("暴风雪(等级 1)")
sleep(5)
castSpellPosition(x,y,z)
end
end
ID1,ID2 = getClosetTargetIDInBattle(3)
distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
if distance <= 11 and distance >= 0 then
return
end
end
end
end
end
end
end
function removeDebuff() --解除减速
if IsBuffExist(33787) == 1 or IsBuffExist(32173) == 1 or IsBuffExist(15655) == 1 then
castSpellA("寒冰屏障")
castSpellA("寒冰屏障")
return 0
end
end
function ore()--采矿
local ID1,ID2 = getClosetTargetIDToAPosition(-0.633171, -187.404,6)
local distance = getTargetAndPositionDistanceByID(ID1,ID2,-0.633171, -187.404,6)
local bag,slot = getBelongBagAndSlotByID(2901)
if ID1 ~= 0 and ID1 ~= -1 and distance < 3 and distance >= 0 then
if slot ~= 0 and slot ~= -1 then
moveA(-0.633171,-187.404,3.92642)
for i = 1, 10 do
ID1,ID2 = getClosetTargetIDToAPosition(-0.633171, -187.404,6)
distance = getTargetAndRoleDistanceByID(ID1,ID2,6)
if distance >= 5 or ID1 == -1 or ID1 == 0 then
return 0
end
if ID1 ~= -1 and ID1 ~= 0 and distance <3 and distance >= 0 then
contactTarget(ID1,ID2)
sleep(4000)
end
end
end
else
return 0
end
end
function ore2()
local distance,distance1,ID1,ID2,ID3,ID4 = 0,0,0,0,0,0
local bag,slot = getBelongBagAndSlotByID(2901)
if slot ~= 0 and slot ~= -1 then
ID1,ID2 = getClosetTargetIDToAPosition(-71.3,-282.7,6)
distance = getTargetAndPositionDistanceByID(ID1,ID2,-71.3,-282.7,6)
if ID1 == 0x00 or ID1 == -1 or distance > 3 then
return 0
end
--moveA(-4.86042,-298.799,3.09008)
moveA(-21.7479,-320.88,-1.56099)
moveA(-35.2042,-329.91,-1.58472)
moveA(-66.6533,-325.588,-1.55384)
moveA(-71.4008,-324.82,-1.54375)
moveA(-69.4244,-314.8,-1.48558)
moveA(-68.8859,-312.301,-1.46888)
jumpA(-67.7743,-308.589,0.261339)
moveA(-66.87,-302.939,3.10082)
moveA(-65.8234,-296.592,6.32306)
moveA(-65.6004,-294.233,6.74325)
moveA(-67.029,-284.551,0.415388)
moveA(-67.6531,-280.928,-1.44535)
while getRoleCurrentMP() ~= -1 and getRoleflag1() ~= 0x04 do
ID1,ID2 = getClosetTargetIDToAPosition(-71.3,-282.7,6)
distance = getTargetAndPositionDistanceByID(ID1,ID2,-71.3,-282.7,6)
if ID1 == 0x00 or ID1 == -1 or distance > 3 then
break
end
if ID1 ~= 0 and ID1 ~= -1 and distance <= 3 then
ID3,ID4 = getClosetTargetIDToAPositionFilterName("盘牙监工",-88.31,-287.80,3,8)
distance = getTargetAndRoleDistanceByID(ID3,ID4,3)
sleep(500)
distance1 = getTargetAndRoleDistanceByID(ID3,ID4,3)
if distance1 > distance then
if distance1 >= 20 then
contactTarget(ID1,ID2)
sleep(4000)
end
end
end
sleep(100)
end
jumpA(-66.8095,-285.953,1.34168)
moveA(-66.2879,-289.209,3.50759)
moveA(-65.4655,-294.184,6.83918)
moveA(-65.977,-300.946,4.69806)
moveA(-67.1226,-308.533,0.956081)
moveA(-69.8644,-322.87,-1.53156)
moveA(-47.8093,-326.903,-1.58046)
moveA(-34.8098,-328.486,-1.57912)
moveA(-15.5618,-312.066,2.49895)
moveA(-11.1842,-297.08,2.60984)
end
end
function treasure1() --开宝箱
local ID1,ID2 = getClosetTargetIDToAPositionFilterName("坚固的魔铁宝箱",133.155, -305.886,6,8)
local distance = getTargetAndPositionDistanceByID(ID1,ID2,133.155, -305.886,6)
if ID1 ~= 0 and ID1 ~= -1 and distance < 10 then
moveA(133.155,-305.886,3.03572)
sleep(500)
contactTarget(ID1,ID2)
sleep(7000)
else
return 0
end
end
function treasure2() --开宝箱2
local ID1,ID2 = getClosetTargetIDToAPositionFilterName("坚固的魔铁宝箱",134.05, -446.654,6,8)
local distance = getTargetAndPositionDistanceByID(ID1,ID2,134.05, -446.654,6)
if ID1 ~= 0 and ID1 ~= -1 and distance < 10 then
moveA(134.05,-446.654,3.92642)
sleep(500)
contactTarget(ID1,ID2)
sleep(7000)
else
return 0
end
end
function move(x,y,z) --改写过的移动
local x1,y1,z1 = getRolePosition()
local n = 0
while getDistanceBetween(x1,y1,x,y) > 0.8 and getRoleCurrentMP() ~= -1 and getRoleflag1() ~= 0x04 do
moveB(x,y,z)
if getRoleCurrentHP() <= 15 and getRoleCurrentHP() >= 1 then
useItem("特效治疗药水")
end
if getRoleCurrentMP() <= 14 and getRoleCurrentHP() >= 1 then
useItem("特效法力药水")
end
sleep(40)
n = n + 1
if n >= 750 then
moveB(x+1,y+1,z)
sleep(100)
jumpB()
sleep(650)
jumpB()
n = 0
end
x1,y1,z1 = getRolePosition()
end
end
function skip() --跳过下台子坐标
local ID1,ID2 = getClosetTargetIDFilterName("盘牙卫士",3,8)
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3)
castSpellB("寒冰护体(等级 4)")
castSpellB("法力护盾(等级 7)")
if distance >= 0 then
if distance > 4 then
return 0
end
if distance <= 4 then
move(83.4119,-341.425,3.03572)
move(75.408,-338.806,3.03572)
move(73.3535,-337.869,3.03572)
jump(72.3069,-337.145,6.05351)
end
end
end
function jump(x,y,z)
local x1,y1,z1 = getRolePosition()
while getDistanceBetween(x1,y1,x,y) > 0.8 and getRoleCurrentMP() ~= -1 and getRoleflag1() ~= 0x04 do
moveB(x,y,z)
jumpB()
if getRoleCurrentHP() < 15 then
useItem("特效治疗药水")
end
for i = 1, 15, 1 do
moveB(x,y,z)
sleep(40)
end
x1,y1,z1 = getRolePosition()
end
end
function pickUp() --拾取
while getRoleCurrentHP() ~= -1 and getRoleflag1() ~= 0x04 do -- 循环n次(mld可能有很多怪)
local n = getUnusedAllBagSlotNum()--获得背包剩余的格子数目
if(n > 4) then --如果背包大于4格子就拾取
local ID1,ID2 = getClosetTargetIDFilterCanBeLoot() --获得最近的可以被拾取的鬼屋
if ID1 ~= 0 and ID1 ~= -1 then --证明搜索到了怪物
local distance = getTargetAndRoleDistanceByID(ID1,ID2,3) --获得目标与玩家的距离
if distance < 40 and distance >= 0 then -- 如果在8码范围内,防止去拾取太远的目标,然后被卡住
contactTarget(ID1,ID2) --拾取目标
sleep(50)
useItem("裂纹的蚌壳")
end
else --代表没有可以拾取的目标了,跳出循环
break
end
else
break
end
sleep(10)
end
end
--主程序开始
--从本外开始
useLua("/removefriend 炒鸡感激")
--useLua("/ignore 炒鸡感激")