forked from BrenoHenrike/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreAdvanced.cs
More file actions
876 lines (787 loc) · 33.3 KB
/
Copy pathCoreAdvanced.cs
File metadata and controls
876 lines (787 loc) · 33.3 KB
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
using RBot;
using RBot.Items;
using RBot.Shops;
using System.Globalization;
public class CoreAdvanced
{
public ScriptInterface Bot => ScriptInterface.Instance;
public CoreBots Core => CoreBots.Instance;
public CoreFarms Farm = new CoreFarms();
#region Enhancement
public void EnhanceEquipped(EnhancementType Type, WeaponSpecial Special = WeaponSpecial.None)
{
List<InventoryItem> EquippedItems = Bot.Inventory.Items.FindAll(i => i.Equipped == true && EnhanceableCatagories.Contains(i.Category));
List<InventoryItem> EquippedWeapon = EquippedItems.FindAll(i => WeaponCatagories.Contains(i.Category));
List<InventoryItem> EquippedOther = EquippedItems.FindAll(i => !WeaponCatagories.Contains(i.Category));
if (Special == WeaponSpecial.None)
_AutoEnhance(Core.EmptyList, EquippedItems, Type, Special);
else _AutoEnhance(EquippedWeapon, EquippedOther, Type, Special);
}
public void EnhanceItem(string ItemName, EnhancementType Type, WeaponSpecial Special = WeaponSpecial.None)
{
if (ItemName == "")
return;
List<InventoryItem> SelectedItem = Bot.Inventory.Items.Concat(Bot.Bank.BankItems).ToList().FindAll(i => i.Name == ItemName && EnhanceableCatagories.Contains(i.Category));
List<InventoryItem> SelectedWeapon = SelectedItem.FindAll(i => WeaponCatagories.Contains(i.Category));
List<InventoryItem> SelectedOther = SelectedItem.FindAll(i => !WeaponCatagories.Contains(i.Category));
if (SelectedItem.Count == 0)
{
if (!SelectedItem.Any(x => x.Name == ""))
Core.Logger($"You do not own \"{ItemName}\", enhancement failed");
return;
}
if (SelectedWeapon.Count != 0)
_AutoEnhance(SelectedWeapon, Core.EmptyList, Type, Special);
if (SelectedOther.Count != 0)
_AutoEnhance(Core.EmptyList, SelectedOther, Type, Special);
}
public void EnhanceItem(string?[] ItemNames, EnhancementType Type, WeaponSpecial Special = WeaponSpecial.None)
{
List<InventoryItem> SelectedItems = Bot.Inventory.Items.Concat(Bot.Bank.BankItems).ToList().FindAll(i => ItemNames.Contains(i.Name) && EnhanceableCatagories.Contains(i.Category));
List<InventoryItem> SelectedWeapons = SelectedItems.FindAll(i => WeaponCatagories.Contains(i.Category));
List<InventoryItem> SelectedOthers = SelectedItems.FindAll(i => !WeaponCatagories.Contains(i.Category));
if (SelectedItems.Count == 0)
{
if (!SelectedItems.Any(x => x.Name == ""))
Core.Logger($"You do not own \"{ItemNames[0]}\", enhancement failed");
return;
}
if (SelectedWeapons.Count != 0)
_AutoEnhance(SelectedWeapons, Core.EmptyList, Type, Special);
if (SelectedOthers.Count != 0)
_AutoEnhance(Core.EmptyList, SelectedOthers, Type, Special);
}
public EnhancementType CurrentClassEnh()
{
int EnhPatternID = Bot.GetGameObject<int>($"world.invTree.{Bot.Inventory.CurrentClass.ID}.EnhPatternID");
if (EnhPatternID == 1 || EnhPatternID == 23)
EnhPatternID = 9;
return (EnhancementType)EnhPatternID;
}
public WeaponSpecial CurrentWeaponSpecial()
{
InventoryItem EquippedWeapon = Bot.Inventory.Items.First(i => i.Equipped == true && WeaponCatagories.Contains(i.Category));
int ProcID = Bot.GetGameObject<int>($"world.invTree.{EquippedWeapon.ID}.ProcID");
return (WeaponSpecial)ProcID;
}
private static ItemCategory[] EnhanceableCatagories =
{
ItemCategory.Sword,
ItemCategory.Axe,
ItemCategory.Dagger,
ItemCategory.Gun,
ItemCategory.HandGun,
ItemCategory.Rifle,
ItemCategory.Bow,
ItemCategory.Mace,
ItemCategory.Gauntlet,
ItemCategory.Polearm,
ItemCategory.Staff,
ItemCategory.Wand,
ItemCategory.Whip,
ItemCategory.Class,
ItemCategory.Helm,
ItemCategory.Cape,
};
private ItemCategory[] WeaponCatagories = EnhanceableCatagories[..12];
private void _AutoEnhance(List<InventoryItem> WeaponList, List<InventoryItem> OtherList, EnhancementType Type, WeaponSpecial Special)
{
if (Special != WeaponSpecial.None && !Core.isCompletedBefore(2937))
{
Special = WeaponSpecial.None;
Core.Logger("Awe enhancements are not unlocked yet. Using a normal enhancement");
}
List<InventoryItem> FlexibleList = Special == WeaponSpecial.None ? WeaponList.Concat(OtherList).ToList() : OtherList;
int i = 0;
if (WeaponList.Count == 0 && OtherList.Count == 0)
{
Core.Logger("Please report what you were trying to enhance to Lord Exelot#9674, enchantment failed");
return;
}
//Gear
if (FlexibleList.Count != 0)
{
Core.Logger($"Best Enhancement of: {Type.ToString()}");
if (Type == EnhancementType.Fighter)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 768 : 141);
else if (Type == EnhancementType.Thief)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 767 : 142);
else if (Type == EnhancementType.Wizard)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 765 : 144);
else if (Type == EnhancementType.Healer)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 762 : 145);
else if (Type == EnhancementType.Hybrid)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 766 : 143);
else if (Type == EnhancementType.Lucky)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 763 : 147);
else if (Type == EnhancementType.SpellBreaker)
__AutoEnhance(FlexibleList, Bot.Player.Level >= 50 ? 764 : 146);
}
//Weapon Specials
if (WeaponList.Count != 0 && Special != WeaponSpecial.None)
{
if (Bot.Player.Level == WeaponList.First().EnhancementLevel && (int)Type == Bot.GetGameObject<int>($"world.invTree.{WeaponList.First().ID}.EnhPatternID") &&
(WeaponCatagories.Contains(WeaponList.First().Category) ? (int)Special == Bot.GetGameObject<int>($"world.invTree.{WeaponList.First().ID}.ProcID") : true))
i++;
else
{
Core.Logger($"Best Enhancement of: {Type.ToString()} + {Special.ToString().Replace('_', ' ')}");
if (Type == EnhancementType.Fighter)
__AutoEnhance(WeaponList, 635, "museum");
else if (Type == EnhancementType.Thief)
__AutoEnhance(WeaponList, 637, "museum");
else if (Type == EnhancementType.Wizard || Type == EnhancementType.SpellBreaker)
__AutoEnhance(WeaponList, 636, "museum");
else if (Type == EnhancementType.Healer)
__AutoEnhance(WeaponList, 638, "museum");
else if (Type == EnhancementType.Hybrid)
__AutoEnhance(WeaponList, 633, "museum");
else if (Type == EnhancementType.Lucky)
__AutoEnhance(WeaponList, 639, "museum");
}
}
if (i > 0)
Core.Logger($"Skipped enhancement for {i} item{(i > 1 ? 's' : null)}");
if (i != WeaponList.Count + OtherList.Count)
Core.Logger("Enhancements complete");
void __AutoEnhance(List<InventoryItem> Input, int ShopID, string Map = "")
{
if (Map != "")
Core.Join(Map);
Core.JumpWait();
Bot.Shops.Load(ShopID);
List<ShopItem> ShopItems = Bot.Shops.ShopItems;
foreach (InventoryItem Item in Input)
{
Core.CheckInventory(Item.Name);
if (Bot.Player.Level == Item.EnhancementLevel && (int)Type == Bot.GetGameObject<int>($"world.invTree.{Item.ID}.EnhPatternID") &&
(WeaponCatagories.Contains(Item.Category) ? (int)Special == Bot.GetGameObject<int>($"world.invTree.{Item.ID}.ProcID") : true))
{
i++;
continue;
}
Core.Logger($"Best Enhancement for: \"{Item.Name}\" [Searching]");
List<ShopItem> AvailableEnh = new List<ShopItem>();
foreach (ShopItem Enh in ShopItems)
{
//Filtering out Member if you're non Member
if ((Core.IsMember || (!Core.IsMember && !Enh.Upgrade)) &&
//Filtering out the ones you're not high enough level for
Enh.Level <= Bot.Player.Level &&
//If Input is just the weapon, and if the name of the Special is seen in the items
((Input.Count == 1 && isWeapon(Item) && Enh.Name.Contains(Special.ToString().Replace('_', ' '))) ||
//If Input is not just weapon, then
((Input.Count > 1 || !isWeapon(Item)) &&
//If the Enhancement is for Classes
(Enh.Name.Contains("Armor") && Item.Category == ItemCategory.Class) ||
//If the Enhancement is for Helmets
(Enh.Name.Contains("Helm") && Item.Category == ItemCategory.Helm) ||
//If the Enhancement is for Capes
(Enh.Name.Contains("Cape") && Item.Category == ItemCategory.Cape) ||
//If the Enhancement is for Weapons
(Enh.Name.Contains("Weapon") && isWeapon(Item)))))
//Add to the list of selectable Enhancements
AvailableEnh.Add(Enh);
}
List<ShopItem> ListMinToMax = AvailableEnh.OrderBy(x => x.Level).ToList();
List<ShopItem> BestTwo = ListMinToMax.Skip(ListMinToMax.Count - 2).ToList();
ShopItem SelectedEhn = new ShopItem();
Bot.Log($"{AvailableEnh.Count}");
if (BestTwo.First().Level == BestTwo.Last().Level)
if (Core.IsMember)
SelectedEhn = BestTwo.First(x => x.Upgrade);
else SelectedEhn = BestTwo.First(x => !x.Upgrade);
else SelectedEhn = BestTwo.OrderByDescending(x => x.Level).First();
if (Bot.GetGameObject<int>($"world.invTree.{Item.ID}.EnhID") == SelectedEhn.ID)
Core.Logger($"Best Enhancement for: \"{Item.Name}\" [Already applied]");
else
{
Bot.SendPacket($"%xt%zm%enhanceItemShop%{Bot.Map.RoomID}%{Item.ID}%{SelectedEhn.ID}%{ShopID}%");
Core.Logger($"Best Enhancement for: \"{Item.Name}\" [Applied]");
Bot.Sleep(Core.ActionDelay);
}
}
}
}
#endregion
#region Gear
public void rankUpClass(string ClassName)
{
Bot.Wait.ForPickup(ClassName);
if (!Core.CheckInventory(ClassName))
Core.Logger($"Cant level up \"{ClassName}\" because you do not own it.", messageBox: true, stopBot: true);
InventoryItem itemInv = Bot.Inventory.Items.First(i => i.Name.ToLower() == ClassName.ToLower() && i.Category == ItemCategory.Class);
GearStore();
if (itemInv == null)
{
Core.Logger($"\"{ClassName}\" is not a valid Class", messageBox: true, stopBot: true);
return;
}
if (itemInv.Quantity == 302500)
{
Core.Logger($"\"{itemInv.Name}\" is already Rank 10");
return;
}
SmartEnhance(ClassName);
string?[] CPBoost = BestGear(GearBoost.cp);
EnhanceItem(CPBoost, CurrentClassEnh(), CurrentWeaponSpecial());
Core.Equip(CPBoost);
Farm.IcestormArena(1, true);
Core.Logger($"\"{itemInv.Name}\" is now Rank 10");
GearStore(true);
}
/// <summary>
/// Equipts the best gear available in a player's inventory/bank by checking what item has the highest boost value of the given type. Also works with damage stacking for monsters with a Race
/// </summary>
/// <param name="BoostType">Type "GearBoost." and then the boost of your choice in order to determine and equip the best available boosting gear</param>
public string?[] BestGear(GearBoost BoostType, bool EquipItem = true)
{
if (BoostType == GearBoost.None)
BoostType = GearBoost.dmgAll;
if (LastBoostType == BoostType)
{
if (RaceBoosts.Contains(BoostType))
return new[] { LastBestItem, LastBestItemDMGall };
else return new[] { LastBestItem };
}
LastBoostType = BoostType;
if (RaceBoosts.Contains(BoostType))
Core.Logger("Searching for the best available gear against: " + BoostType.ToString());
else Core.Logger("Searching for the best available gear to boost: " + BoostType.ToString());
List<InventoryItem> InventoryData = Bot.Inventory.Items;
List<InventoryItem> BankData = Bot.Bank.BankItems;
List<InventoryItem> BankInvData = InventoryData.Concat(BankData).ToList();
Dictionary<string, float> BoostedGear = new Dictionary<string, float>();
ItemCategory BestItemCategory = ItemCategory.Unknown;
string BestItemDMGall = "";
float BestValueDMGall = 0F;
foreach (InventoryItem Item in BankInvData)
{
if (Item.Meta != null && Item.Meta.Contains(BoostType.ToString()))
{
string CorrectData = Item.Meta.Split(',').ToList().First(i => i.Contains(BoostType.ToString()));
float BoostFloat = float.Parse(CorrectData.Replace($"{BoostType.ToString()}:", ""), CultureInfo.InvariantCulture.NumberFormat);
if (!BoostedGear.Values.Contains(BoostFloat))
BoostedGear.Add(Item.Name, BoostFloat);
}
}
string BestItem = BoostedGear.FirstOrDefault(x => x.Value == BoostedGear.Values.Max()).Key;
float BestValue = BoostedGear.FirstOrDefault(x => x.Value == BoostedGear.Values.Max()).Value;
if ((BankInvData.Find(x => x.Name == BestItem) != null))
BestItemCategory = BankInvData.First(x => x.Name == BestItem).Category;
if (RaceBoosts.Contains(BoostType))
{
Dictionary<string, float> BoostedGearDMGall = new Dictionary<string, float>();
foreach (InventoryItem Item in BankInvData)
{
if (Item.Meta != null && Item.Meta.Contains("dmgAll") &&
(WeaponCatagories.Contains(BestItemCategory) ^ WeaponCatagories.Contains(Item.Category)) &&
Item.Category != BestItemCategory)
{
string CorrectData = Item.Meta.Split(',').ToList().First(i => i.Contains("dmgAll"));
float BoostFloat = float.Parse(CorrectData.Replace("dmgAll:", ""), CultureInfo.InvariantCulture.NumberFormat);
BoostedGearDMGall.Add(Item.Name, BoostFloat);
}
}
BestItemDMGall = BoostedGearDMGall.FirstOrDefault(x => x.Value == BoostedGearDMGall.Values.Max()).Key;
BestValueDMGall = BoostedGearDMGall.FirstOrDefault(x => x.Value == BoostedGearDMGall.Values.Max()).Value;
if (EquipItem)
Core.Equip(BestItemDMGall);
Bot.Sleep(Core.ActionDelay);
}
if (EquipItem)
Core.Equip(BestItem);
LastBestItem = BestItem;
if (RaceBoosts.Contains(BoostType))
{
if (BestItem == null && BestItemDMGall == null)
{
Core.Logger($"Best gear for [{BoostType.ToString()}] wasnt found!");
return new[] { "" };
}
else if (BestItem == null && BestItemDMGall != null)
{
Core.Logger($"Best gear against {BoostType.ToString()} found: {BestItemDMGall} ({(BestValueDMGall - 1).ToString("+0.##%")})");
LastBestItemDMGall = BestItemDMGall;
return new[] { BestItemDMGall };
}
else if (BestItem != null && BestItemDMGall == null)
{
Core.Logger($"Best gear against {BoostType.ToString()} found: {BestItem} ({(BestValue - 1).ToString("+0.##%")})");
return new[] { BestItem };
}
Core.Logger($"Best gear against {BoostType.ToString()} found: {BestItem} ({(BestValue - 1).ToString("+0.##%")}) & {BestItemDMGall} ({(BestValueDMGall - 1).ToString("+0.##%")})");
Core.Logger($"Combined they give a boost of " + (BestValue * BestValueDMGall - 1).ToString("+0.##%"));
LastBestItemDMGall = BestItemDMGall ?? "";
return new[] { BestItem, BestItemDMGall };
}
if (BestItem != null)
Core.Logger($"Best gear for [{BoostType.ToString()}] found: {BestItem} ({(BestValue - 1).ToString("+0.##%")})");
else Core.Logger($"Best gear for [{BoostType.ToString()}] wasnt found!");
return new[] { BestItem };
}
private GearBoost[] RaceBoosts =
{
GearBoost.Chaos,
GearBoost.Dragonkin,
GearBoost.Drakath,
GearBoost.Elemental,
GearBoost.Human,
GearBoost.Orc,
GearBoost.Undead
};
private GearBoost LastBoostType = GearBoost.None;
private string LastBestItemDMGall = "";
private string LastBestItem = "";
public void GearStore(bool Restore = false)
{
if (!Restore)
{
foreach (InventoryItem Item in Bot.Inventory.Items.FindAll(i => i.Equipped == true))
ReEquippedItems.Add(Item.Name);
ReEnhanceAfter = CurrentClassEnh();
ReWEnhanceAfter = CurrentWeaponSpecial();
}
else
{
Core.Equip(ReEquippedItems.ToArray());
EnhanceEquipped(ReEnhanceAfter, ReWEnhanceAfter);
}
}
private List<string> ReEquippedItems = new List<string>();
private EnhancementType ReEnhanceAfter = EnhancementType.Lucky;
private WeaponSpecial ReWEnhanceAfter = WeaponSpecial.None;
public bool isWeapon(ItemBase Item)
{
return Item.ItemGroup == "Weapon";
}
private void _RaceGear(string Monster)
{
GearStore();
string MonsterRace = "";
if (Monster != "*")
MonsterRace = Bot.Monsters.MapMonsters.First(x => x.Name.ToLower() == Monster.ToLower()).Race;
else MonsterRace = Bot.Monsters.CurrentMonsters.First().Race;
if (MonsterRace == null || MonsterRace == "")
return;
string?[] _BestGear = BestGear((GearBoost)Enum.Parse(typeof(GearBoost), MonsterRace));
if (_BestGear.Length == 0)
return;
EnhanceItem(_BestGear, CurrentClassEnh(), CurrentWeaponSpecial());
Core.Equip(_BestGear);
EnhanceEquipped(CurrentClassEnh(), CurrentWeaponSpecial());
}
private void _RaceGear(int MonsterID)
{
GearStore();
string MonsterRace = Bot.Monsters.MapMonsters.First(x => x.ID == MonsterID).Race;
if (MonsterRace == null || MonsterRace == "")
return;
string?[] _BestGear = BestGear((GearBoost)Enum.Parse(typeof(GearBoost), MonsterRace));
if (_BestGear.Length == 0)
return;
EnhanceItem(_BestGear, CurrentClassEnh(), CurrentWeaponSpecial());
Core.Equip(_BestGear);
EnhanceEquipped(CurrentClassEnh(), CurrentWeaponSpecial());
}
#endregion
#region Kill
public void BoostKillMonster(string map, string cell, string pad, string monster, string item = "", int quant = 1, bool isTemp = true, bool log = true, bool publicRoom = false)
{
if (item != "" && Core.CheckInventory(item, quant))
return;
Core.Join(map, cell, pad, publicRoom: publicRoom);
_RaceGear(monster);
Core.KillMonster(map, cell, pad, monster, item, quant, isTemp, log, publicRoom);
GearStore(true);
}
public void BoostKillMonster(string map, string cell, string pad, int monsterID, string item = "", int quant = 1, bool isTemp = true, bool log = true, bool publicRoom = false)
{
if (item != "" && Core.CheckInventory(item, quant))
return;
Core.Join(map, cell, pad, publicRoom: publicRoom);
_RaceGear(monsterID);
Core.KillMonster(map, cell, pad, monsterID, item, quant, isTemp, log, publicRoom);
GearStore(true);
}
public void BoostHuntMonster(string map, string monster, string item = "", int quant = 1, bool isTemp = true, bool log = true, bool publicRoom = false)
{
if (item != "" && Core.CheckInventory(item, quant))
return;
Core.Join(map, publicRoom: publicRoom);
_RaceGear(monster);
Core.HuntMonster(map, monster, item, quant, isTemp, log, publicRoom);
GearStore(true);
}
public void KillUltra(string map, string cell, string pad, string monster, string item = "", int quant = 1, bool isTemp = true, bool log = true, bool publicRoom = true)
{
if (item != "" && Core.CheckInventory(item, quant))
return;
if (!isTemp && item != "")
Core.AddDrop(item);
Core.Join(map, cell, pad, publicRoom: publicRoom);
_RaceGear(monster);
Core.Join(map, cell, pad, publicRoom: publicRoom);
Core.Jump(cell, pad);
Bot.Events.CounterAttack += _KillUltra;
if (item == "")
{
if (log)
Core.Logger($"Killing Ultra-Boss {monster}");
int i = 0;
Bot.Events.MonsterKilled += b => i++;
while (i < 1)
while (shouldAttack)
Bot.Player.Kill(monster);
Core.Rest();
}
else
{
if (log)
Core.Logger($"Killing Ultra-Boss {monster} for {item} ({quant}) [Temp = {isTemp}]");
while (!Bot.ShouldExit() && !Core.CheckInventory(item, quant))
{
while (shouldAttack)
Bot.Player.Kill(monster);
if (!isTemp && !Core.CheckInventory(item))
{
Bot.Sleep(Core.ActionDelay);
Bot.Player.RejectExcept(item);
}
if (!Bot.Player.InCombat)
Core.Rest();
}
}
Bot.Events.CounterAttack -= _KillUltra;
GearStore(true);
}
private bool shouldAttack = true;
private void _KillUltra(ScriptInterface bot, bool faded)
{
string Target = "";
if (!faded)
{
Target = Bot.Player.Target.Name;
shouldAttack = false;
Bot.Player.CancelAutoAttack();
Bot.Player.CancelTarget();
}
else
{
if (Target != "")
Bot.Player.Attack(Target);
shouldAttack = true;
}
}
#endregion
#region SmartEnhance
public void SmartEnhance(string Class)
{
InventoryItem SelectedClass = Bot.Inventory.Items.First(i => i.Name == Class && i.Category == ItemCategory.Class);
if (SelectedClass.EnhancementLevel == 0)
{
Core.Logger("Ignore the message about the Hybrid Enhancement");
EnhanceItem(Class, EnhancementType.Hybrid);
}
Core.Equip(Class);
switch (Class)
{
//Lucky - Spiral Carve
case "Abyssal Angel":
case "Abyssal Angel’s Shadow":
case "ArchPaladin":
case "Artifact Hunter":
case "Assassin":
case "BeastMaster":
case "Berserker":
case "Beta Berserker":
case "BladeMaster Assassin":
case "BladeMaster":
case "Blood Titan":
case "CardClasher":
case "Chaos Avenger Member Preview":
case "Chaos Champion Prime":
case "Chaos Slayer":
case "Chaos Slayer Berserker":
case "Chaos Slayer Cleric":
case "Chaos Slayer Mystic":
case "Chaos Slayer Thief":
case "Chrono Chaorruptor":
case "Chrono Commandant":
case "ChronoCommander":
case "ChronoCorrupter":
case "Chunin":
case "Classic Alpha Pirate":
case "Classic Barber":
case "Classic DoomKnight":
case "Classic Exalted Soul Cleaver":
case "Classic Guardian":
case "Classic Legion DoomKnight":
case "Classic Paladin":
case "Classic Pirate":
case "Classic Soul Cleaver":
case "Continuum Chronomancer":
case "Corrupted Chronomancer":
case "Dark Chaos Berserker":
case "Dark Harbinger":
case "DoomKnight":
case "Empyrean Chronomancer":
case "Eternal Chronomancer":
case "Eternal Inversionist":
case "Evolved ClawSuit":
case "Evolved Dark Caster":
case "Evolved Leprechaun":
case "Exalted Harbinger":
case "Exalted Soul Cleaver":
case "Glacial Warlord":
case "Great Thief":
case "Immortal Chronomancer":
case "Imperial Chunin":
case "Infinite Dark Caster":
case "Infinite Legion Dark Caster":
case "Infinity Titan":
case "Legion BladeMaster Assassin":
case "Legion DoomKnight":
case "Legion Evolved Dark Caster":
case "Legion SwordMaster Assassin":
case "Leprechaun":
case "Lycan":
case "Master Ranger":
case "MechaJouster":
case "Necromancer":
case "Ninja":
case "Ninja Warrior":
case "NOT A MOD":
case "Overworld Chronomancer":
case "Pinkomancer":
case "Prismatic ClawSuit":
case "Ranger":
case "Renegade":
case "Rogue":
case "Scarlet Sorceress":
case "ShadowScythe General":
case "SkyCharged Grenadier":
case "SkyGuard Grenadier":
case "Soul Cleaver":
case "StarLord":
case "StoneCrusher":
case "SwordMaster Assassin":
case "SwordMaster":
case "TimeKeeper":
case "TimeKiller":
case "Timeless Chronomancer":
case "Undead Goat":
case "Undead Leperchaun":
case "UndeadSlayer":
case "Underworld Chronomancer":
case "Unlucky Leperchaun":
case "Void Highlord":
EnhanceEquipped(EnhancementType.Lucky, WeaponSpecial.Spiral_Carve);
break;
//Lucky - Mana Vamp
case "Alpha DOOMmega":
case "Alpha Omega":
case "Alpha Pirate":
case "Beast Warrior":
case "Blood Ancient":
case "Chaos Avenger":
case "Chaos Shaper":
case "Classic Defender":
case "ClawSuit":
case "Cryomancer Mini Pet Coming Soon":
case "Dark Legendary Hero":
case "Dark Ultra OmniNight":
case "DoomKnight OverLord":
case "Dragonslayer General":
case "Drakel Warlord":
case "Glacial Berserker Test":
case "Heroic Naval Commander":
case "Legendary Elemental Warrior":
case "Horc Evader":
case "Legendary Hero":
case "Legendary Naval Commander":
case "Legion DoomKnight Tester":
case "Legion Revenant Member Test":
case "Naval Commander":
case "Paladin High Lord":
case "Paladin":
case "PaladinSlayer":
case "Pirate":
case "Pumpkin Lord":
case "ShadowFlame DragonLord":
case "ShadowStalker of Time":
case "ShadowWalker of Time":
case "ShadowWeaver of Time":
case "Silver Paladin":
case "Thief of Hours":
case "Ultra Elemental Warrior":
case "Ultra OmniKnight":
case "Void Highlord Tester":
case "Warlord":
case "Warrior":
case "WarriorScythe General":
EnhanceEquipped(EnhancementType.Lucky, WeaponSpecial.Mana_Vamp);
break;
//Lucky - Awe Blast
case "Arachnomancer":
case "Bard":
case "Chrono Assassin":
case "Chronomancer":
case "Chronomancer Prime":
case "Dark Metal Necro":
case "DeathKnight Lord":
case "Dragon Shinobi":
case "Dragonlord":
case "Evolved Pumpkin Lord":
case "DragonSoul Shinobi":
case "Glacial Berserker":
case "Grunge Rocker":
case "Guardian":
case "Heavy Metal Necro":
case "Heavy Metal Rockstar":
case "Hobo Highlord":
case "Lord of Order":
case "Nechronomancer":
case "Necrotic Chronomancer":
case "No Class":
case "Nu Metal Necro":
case "Obsidian No Class":
case "Oracle":
case "ProtoSartorium":
case "Shadow Dragon Shinobi":
case "Shadow Ripper":
case "Shadow Rocker":
case "Star Captain":
case "Troubador of Love":
case "Unchained Rocker":
case "Unchained Rockstar":
case "Yami no Ronin":
EnhanceEquipped(EnhancementType.Lucky, WeaponSpecial.Awe_Blast);
break;
//Lucky - Health Vamp
case "ArchFiend":
case "Barber":
case "Classic DragonLord":
case "Dragonslayer":
case "Enchanted Vampire Lord":
case "Enforcer":
case "Flame Dragon Warrior":
case "Royal Vampire Lord":
case "Rustbucket":
case "Sentinel":
case "Vampire":
case "Vampire Lord":
EnhanceEquipped(EnhancementType.Lucky, WeaponSpecial.Health_Vamp);
break;
//Wizard - Awe Blast
case "Acolyte":
case "Arcane Dark Caster":
case "BattleMage":
case "BattleMage of Love":
case "Blaze Binder":
case "Blood Sorceress":
case "Dark BattleMage":
case "Dark Master of Moglins":
case "Dragon Knight":
case "FireLord Summoner":
case "Grim Necromancer":
case "Healer":
case "HighSeas Commander":
case "Infinity Knight":
case "Interstellar Knight":
case "Master of Moglins":
case "Mystical Dark Caster":
case "Northlands Monk":
case "Royal BattleMage":
case "Timeless Dark Caster":
case "Witch":
EnhanceEquipped(EnhancementType.Wizard, WeaponSpecial.Awe_Blast);
break;
//Wizard - Spiral Carve
case "Chrono DataKnight":
case "Chrono DragonKnight":
case "Cryomancer":
case "Dark Caster":
case "Dark Cryomancer":
case "Dark Lord":
case "Darkblood StormKing":
case "Darkside":
case "Defender":
case "Frost SpiritReaver":
case "Immortal Dark Caster":
case "Legion Paladin":
case "Legion Revenant":
case "LightCaster":
case "Pink Romancer":
case "Psionic MindBreaker":
case "Pyromancer":
case "Sakura Cryomancer":
case "Troll Spellsmith":
EnhanceEquipped(EnhancementType.Wizard, WeaponSpecial.Spiral_Carve);
break;
//Wizard - Health Vamp
case "Daimon":
case "Evolved Shaman":
case "LightMage":
case "MindBreaker":
case "Shaman":
case "Vindicator of They":
case "Elemental Dracomancer":
case "LightCaster Test":
case "Love Caster":
case "Mage":
case "Sorcerer":
case "The Collector":
EnhanceEquipped(EnhancementType.Wizard, WeaponSpecial.Health_Vamp);
break;
//Fighter - Awe Blast
case "DeathKnight":
case "Frostval Barbarian":
EnhanceEquipped(EnhancementType.Fighter, WeaponSpecial.Awe_Blast);
break;
//Healer - Health Vamp
case "Dragon of Time":
EnhanceEquipped(EnhancementType.Healer, WeaponSpecial.Health_Vamp);
break;
default:
Core.Logger($"Class: \"{Class}\" is not found in the Smart Enhance Library, please report to Lord Exelot#9674", messageBox: true);
break;
}
}
#endregion
}
public enum EnhancementType
{
Fighter = 2,
Thief = 3,
Hybrid = 5,
Wizard = 6,
Healer = 7,
SpellBreaker = 8,
Lucky = 9,
}
public enum WeaponSpecial
{
None = 0,
Spiral_Carve = 2,
Awe_Blast = 3,
Health_Vamp = 4,
Mana_Vamp = 5,
Powerword_Die = 6
}
public enum GearBoost
{
None,
cp,
gold,
rep,
exp,
dmgAll,
Chaos,
Dragonkin,
Drakath,
Elemental,
Human,
Orc,
Undead
}